kubeflow二次开发--centraldashboard本地代码启动前端服务

一、环境介绍

系统版本:Centos7
Kubeflow版本:0.7.0
Pipeline版本:0.1.31
官方指导
https://github.com/kubeflow/kubeflow/tree/master/components/centraldashboard

二、安装nodejs

下载安装包

从https://nodejs.org/en/download/找到合适包的url
下载,比如

[root@localhost centraldashboard]#wget https://nodejs.org/dist/v9.3.0/node-v9.3.0-linux-x64.tar.xz
安装bzip
[root@localhost centraldashboard]#yum -y install bzip2
解压安装文件
[root@localhost centraldashboard]#tar -xvf node-v9.3.0-linux-x64.tar.xz
创建软连接
[root@localhost centraldashboard]#ln -s /ssd/tools/node-v9.3.0-linux-x64/bin/node /usr/bin/node
[root@localhost centraldashboard]#ln -s /ssd/tools/node-v9.3.0-linux-x64/bin/npm /usr/bin/npm
检查安装
[root@localhost centraldashboard]#node -v
[root@localhost centraldashboard]#npm -v
npm升级版本
[root@localhost centraldashboard]#npm install -g npm

三、安装make

Centraldashboard根目录执行

[root@localhost centraldashboard]#make build-local

五、安装依赖

前端界面是react编写的,有很多依赖关系。依赖包说明都package.json里面。
进入package.json同级目录执行下面的命令,安装依赖

[root@localhost centraldashboard]# npm install --unsafe-perm=true --allow-root

如果安装依赖很慢的话 可以使用淘宝镜像或者安装cnpm

[root@localhost centraldashboard]#npm config set registry https://registry.npm.taobao.org
[root@localhost centraldashboard]#npm install -g cnpm --registry=https://registry.npm.taobao.org

安装完cnpm 然后执行

[root@localhost centraldashboard]#cnpm install

六、启动本地服务

进入package.json同级目录启动本地服务器,执行

[root@localhost centraldashboard]#npm run dev

在这里插入图片描述
因为只是本地启动前端服务,没有启动api,所以有很多报错,但是前端可以访问
http://localhost:8080/
在这里插入图片描述
启动日志如下

[root@localhost centraldashboard]# npm run dev

> kubeflow-centraldashboard@0.0.2 dev /sz-dev/kubeflow/components/centraldashboard
> concurrently -k -p "[{name}]" -n "Webpack,TypeScript,Express" -c "green.bold,yellow.bold,cyan.bold" "webpack-dev-server" "npm run watch-ts" "npm run watch-node"

[TypeScript]
[TypeScript] > kubeflow-centraldashboard@0.0.2 watch-ts /sz-dev/kubeflow/components/centraldashboard
[TypeScript] > tsc -w
[TypeScript]
[Express]
[Express] > kubeflow-centraldashboard@0.0.2 watch-node /sz-dev/kubeflow/components/centraldashboard
[Express] > nodemon dist/server.js
[Express]
[TypeScript]
7:37:38 PM - Starting compilation in watch mode...
[TypeScript]
[Express] [nodemon] 1.19.3
[Express] [nodemon] to restart at any time, enter `rs`
[Express] [nodemon] watching dir(s): *.*
[Express] [nodemon] watching extensions: js,mjs,json
[Express] [nodemon] starting `node dist/server.js`
[Express] Initializing Kubernetes configuration
[Express] Unable to fetch Nodes Error: connect ECONNREFUSED 127.0.0.1:8080
[Express]     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16) {
[Express]   errno: 'ECONNREFUSED',
[Express]   code: 'ECONNREFUSED',
[Express]   syscall: 'connect',
[Express]   address: '127.0.0.1',
[Express]   port: 8080
[Express] }
[Express] Unable to fetch Application information: Error: connect ECONNREFUSED 127.0.0.1:8080
[Express]     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16) {
[Express]   errno: 'ECONNREFUSED',
[Express]   code: 'ECONNREFUSED',
[Express]   syscall: 'connect',
[Express]   address: '127.0.0.1',
[Express]   port: 8080
[Express] }
[Express] Unable to fetch Nodes Error: connect ECONNREFUSED 127.0.0.1:8080
[Express]     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16) {
[Express]   errno: 'ECONNREFUSED',
[Express]   code: 'ECONNREFUSED',
[Express]   syscall: 'connect',
[Express]   address: '127.0.0.1',
[Express]   port: 8080
[Express] }
[Express] "other" is not a supported platform for Metrics
[Express] Using Profiles service at http://localhost:8081/kfam
[Express] Server listening on port http://localhost:8082 (in development mode)
[Webpack] fatal: Not a git repository (or any of the parent directories): .git
[Webpack] clean-webpack-plugin: /sz-dev/kubeflow/components/centraldashboard/dist/public has been removed.
[Webpack] ℹ 「wds」: Project is running at http://localhost:8080/
[Webpack] ℹ 「wds」: webpack output is served from /
[Webpack] ℹ 「wds」: Content not from webpack is served from /sz-dev/kubeflow/components/centraldashboard
[Webpack] ℹ 「wds」: 404s will fallback to /index.html
[Express] [nodemon] restarting due to changes...
[Express] [nodemon] restarting due to changes...
[Express] [nodemon] restarting due to changes...
[Express] [nodemon] restarting due to changes...
[TypeScript]
[TypeScript] 7:37:48 PM - Found 0 errors. Watching for file changes.
[Express] [nodemon] restarting due to changes...
[Express] [nodemon] restarting due to changes...
[Express] [nodemon] restarting due to changes...
[Express] [nodemon] starting `node dist/server.js`
[Express] [nodemon] restarting due to changes...
[Express] [nodemon] restarting due to changes...
[Express] [nodemon] starting `node dist/server.js`
[Express] Initializing Kubernetes configuration
[Webpack] ℹ 「wdm」: wait until bundle finished: /api/v1/nodes
[Webpack] ℹ 「wdm」: wait until bundle finished: /apis/app.k8s.io/v1beta1/namespaces/kubeflow/applications
[Webpack] ℹ 「wdm」: wait until bundle finished: /api/v1/nodes
[Webpack] ℹ 「wdm」: Hash: 6e6fe789afc1955db7ba
[Webpack] Version: webpack 4.41.0
[Webpack] Time: 8971ms
[Webpack] Built at: 03/04/2020 7:37:51 PM
[Webpack]                                                 Asset       Size         Chunks                   Chunk Names
[Webpack]                                         app.bundle.js    226 KiB            app  [emitted]        app
[Webpack]                                     app.bundle.js.map    170 KiB            app  [emitted] [dev]  app
[Webpack]                                               app.css   30.6 KiB            app  [emitted]        app
[Webpack]                                           app.css.map     36 KiB            app  [emitted] [dev]  app
[Webpack]                                  assets/anon-user.png  271 bytes                 [emitted]
[Webpack]                            assets/favicon-128x128.png   9.18 KiB                 [emitted]
[Webpack]                            assets/favicon-152x152.png   11.5 KiB                 [emitted]
[Webpack]                              assets/favicon-16x16.png  585 bytes                 [emitted]
[Webpack]                            assets/favicon-180x180.png   14.7 KiB                 [emitted]
[Webpack]                            assets/favicon-192x192.png   16.6 KiB                 [emitted]
[Webpack]                              assets/favicon-32x32.png   1.34 KiB                 [emitted]
[Webpack]                              assets/favicon-57x57.png   2.85 KiB                 [emitted]
[Webpack]                              assets/favicon-76x76.png   4.31 KiB                 [emitted]
[Webpack]                              assets/favicon-96x96.png   5.95 KiB                 [emitted]
[Webpack]                                    assets/favicon.png  585 bytes                 [emitted]
[Webpack]                                   assets/gcp-logo.png   4.07 KiB                 [emitted]
[Webpack]                               dashboard_lib.bundle.js   12.2 KiB  dashboard_lib  [emitted]        dashboard_lib
[Webpack]                           dashboard_lib.bundle.js.map   10.4 KiB  dashboard_lib  [emitted] [dev]  dashboard_lib
[Webpack]                                            index.html   1.76 KiB                 [emitted]
[Webpack]                                  kubeflow-palette.css  168 bytes                 [emitted]
[Webpack]                                      vendor.bundle.js   3.29 MiB         vendor  [emitted]        vendor
[Webpack]                                  vendor.bundle.js.map   3.53 MiB         vendor  [emitted] [dev]  vendor
[Webpack]           webcomponentsjs/bundles/webcomponents-ce.js   19.7 KiB                 [emitted]
[Webpack]       webcomponentsjs/bundles/webcomponents-ce.js.map    129 KiB                 [emitted]
[Webpack]     webcomponentsjs/bundles/webcomponents-sd-ce-pf.js    112 KiB                 [emitted]
[Webpack] webcomponentsjs/bundles/webcomponents-sd-ce-pf.js.map    666 KiB                 [emitted]
[Webpack]        webcomponentsjs/bundles/webcomponents-sd-ce.js   83.9 KiB                 [emitted]
[Webpack]    webcomponentsjs/bundles/webcomponents-sd-ce.js.map    539 KiB                 [emitted]
[Webpack]           webcomponentsjs/bundles/webcomponents-sd.js   65.2 KiB                 [emitted]
[Webpack]       webcomponentsjs/bundles/webcomponents-sd.js.map    410 KiB                 [emitted]
[Webpack]        webcomponentsjs/custom-elements-es5-adapter.js  950 bytes                 [emitted]
[Webpack]               webcomponentsjs/webcomponents-bundle.js    113 KiB                 [emitted]
[Webpack]           webcomponentsjs/webcomponents-bundle.js.map    669 KiB                 [emitted]
[Webpack]               webcomponentsjs/webcomponents-loader.js   6.13 KiB                 [emitted]
[Webpack] Entrypoint app = vendor.bundle.js vendor.bundle.js.map app.css app.bundle.js app.css.map app.bundle.js.map
[Webpack] Entrypoint dashboard_lib = vendor.bundle.js vendor.bundle.js.map dashboard_lib.bundle.js dashboard_lib.bundle.js.map
[Webpack] [0] multi (webpack)-dev-server/client?http://localhost:8080 ./public/index.js 40 bytes {app} [built]
[Webpack] [2] multi (webpack)-dev-server/client?http://localhost:8080 ./public/library.js 40 bytes {dashboard_lib} [built]
[Webpack] [./node_modules/core-js/modules/es6.regexp.constructor.js] 1.57 KiB {vendor} [built]
[Webpack] [./node_modules/core-js/modules/es6.regexp.flags.js] 201 bytes {vendor} [built]
[Webpack] [./node_modules/core-js/modules/es6.regexp.match.js] 1.36 KiB {vendor} [built]
[Webpack] [./node_modules/core-js/modules/es6.regexp.replace.js] 4.55 KiB {vendor} [built]
[Webpack] [./node_modules/core-js/modules/es6.regexp.search.js] 1.16 KiB {vendor} [built]
[Webpack] [./node_modules/core-js/modules/es6.regexp.split.js] 5.1 KiB {vendor} [built]
[Webpack] [./node_modules/core-js/modules/es6.regexp.to-string.js] 826 bytes {vendor} [built]
[Webpack] [./node_modules/core-js/modules/es6.symbol.js] 9.07 KiB {vendor} [built]
[Webpack] [./node_modules/core-js/modules/es7.array.flat-map.js] 740 bytes {vendor} [built]
[Webpack] [./node_modules/core-js/modules/es7.object.lookup-getter.js] 624 bytes {vendor} [built]
[Webpack] [./node_modules/webpack-dev-server/client/index.js?http://localhost:8080] (webpack)-dev-server/client?http://localhost:8080 4.29 KiB {vendor} [built]
[Webpack] [./public/index.js] 965 bytes {app} [built]
[Webpack] [./public/library.js] 2.89 KiB {app} {dashboard_lib} [built]
[Webpack]     + 512 hidden modules
[Webpack] Child html-webpack-plugin for "index.html":
[Webpack]      1 asset
[Webpack]     Entrypoint undefined = index.html
[Webpack]     [./node_modules/html-webpack-plugin/lib/loader.js!./public/index.html] 1.75 KiB {0} [built]
[Webpack]     [./node_modules/lodash/lodash.js] 528 KiB {0} [built]
[Webpack]     [./node_modules/webpack/buildin/global.js] (webpack)/buildin/global.js 472 bytes {0} [built]
[Webpack]     [./node_modules/webpack/buildin/module.js] (webpack)/buildin/module.js 497 bytes {0} [built]
[Webpack] Child mini-css-extract-plugin node_modules/css-loader/dist/cjs.js!public/styles.css:
[Webpack]     Entrypoint mini-css-extract-plugin = *
[Webpack]     [./node_modules/css-loader/dist/cjs.js!./public/styles.css] 31.6 KiB {mini-css-extract-plugin} [built]
[Webpack]     [./node_modules/css-loader/dist/runtime/api.js] 2.35 KiB {mini-css-extract-plugin} [built]
[Webpack] ℹ 「wdm」: Compiled successfully.
[Webpack] [HPM] Error occurred while trying to proxy request /api/v1/nodes from localhost:8080 to http://localhost:8082 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
[Webpack] [HPM] Error occurred while trying to proxy request /apis/app.k8s.io/v1beta1/namespaces/kubeflow/applications from localhost:8080 to http://localhost:8082 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
[Webpack] [HPM] Error occurred while trying to proxy request /api/v1/nodes from localhost:8080 to http://localhost:8082 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
[Express] Unable to fetch Nodes Error occured while trying to proxy to: localhost:8080/api/v1/nodes
[Express] Unable to fetch Application information: Error occured while trying to proxy to: localhost:8080/apis/app.k8s.io/v1beta1/namespaces/kubeflow/applications
[Express] Unable to fetch Nodes Error occured while trying to proxy to: localhost:8080/api/v1/nodes
[Express] "other" is not a supported platform for Metrics
[Express] Using Profiles service at http://localhost:8081/kfam
[Express] Server listening on port http://localhost:8082 (in development mode)
[Webpack] [HPM] Error occurred while trying to proxy request /apis/v1beta1/pipelines?page_size=5&sort_by=created_at%20desc from localhost:8080 to http://localhost:8083/api/v1/namespaces/kubeflow/services/ml-pipeline-ui:80/proxy (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
[Webpack] [HPM] Error occurred while trying to proxy request /apis/v1beta1/runs?page_size=5&sort_by=created_at%20desc from localhost:8080 to http://localhost:8083/api/v1/namespaces/kubeflow/services/ml-pipeline-ui:80/proxy (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)
[Express] Unable to contact Profile Controller
  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值