Skip to content

Commit 9dc860f

Browse files
Alexander MatyushentsevAlexander Matyushentsev
Alexander Matyushentsev
authored and
Alexander Matyushentsev
committed
Prepare docker file
1 parent 62676c7 commit 9dc860f

File tree

9 files changed

+201
-88
lines changed

9 files changed

+201
-88
lines changed

.dockerignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.git
3+
Dockerfile

Dockerfile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM node:9.4.0 as build
2+
3+
WORKDIR /src
4+
ADD ["package.json", "yarn.lock", "./"]
5+
6+
RUN yarn install
7+
8+
ADD [".", "."]
9+
10+
RUN yarn build && yarn cache clean && yarn install --production
11+
12+
FROM node:6.9.5-alpine
13+
14+
COPY --from=build ./src/dist /app
15+
COPY --from=build ./src/node_modules /app/node_modules
16+
WORKDIR /app
17+
18+
EXPOSE 8001
19+
CMD ["sh", "-c", "node api/api/main.js --uiDist /app/app --inCluster ${IN_CLUSTER} --namespace ${ARGO_NAMESPACE} --enableWebConsole ${ENABLE_WEB_CONSOLE} --uiBaseHref ${BASE_HREF}"]

Procfile

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ui: yarn dev:ui
2+
api: yarn dev:api

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Argo UI
2+
3+
![Argo Image](argo.png)
4+
5+
Web-based UI for Argo workflow engine. Web UI allows to view Argo workflows running in the cluster, view container logs etc.
6+
7+
## Build, run, release
8+
9+
* Install [NodeJS](https://nodejs.org/en/download/) and [Yarn](https://yarnpkg.com)
10+
* Run: `yarn dev` - starts API server and webpack dev UI server. API server uses current `kubectl` context to access workflow CRDs.
11+
* Build: `yarn build` - builds static resources into `./dist` directory.
12+
* Release: `IMAGE_NAMESPACE=argoproj IMAGE_TAG=latest DOCKER_PUSH=true yarn docker` - builds docker image and optionally push to docker registry.

argo.png

27.3 KB
Loading

package.json

+86-81
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,88 @@
11
{
2-
"name": "argo-ui",
3-
"version": "1.0.0",
4-
"main": "index.js",
5-
"author": "Alexander Matyushentsev <[email protected]>",
6-
"license": "MIT",
7-
"scripts": {
8-
"build:ui": "webpack --config ./src/app/webpack.config.js",
9-
"dev:ui": "webpack-dev-server --config ./src/app/webpack.config.js",
10-
"dev:ui:hot": "yarn dev:ui -- --hot",
11-
"dev:api": "TS_NODE_PROJECT=./src/api/tsconfig.json nodemon --nolazy --inspect -r ts-node/register ./src/api/main.ts",
12-
"lint": "yarn lint:ui && yarn lint:api",
13-
"lint:ui": "tslint -p ./src/app",
14-
"lint:api": "tslint -p ./src/api",
15-
"utils:icons": "rm -f src/assets/fonts/* && node ./scripts/icons/generator.js",
16-
"test": "mocha --require ts-node/register ./src/app/**/*.spec.ts"
17-
},
18-
"dependencies": {
19-
"@types/aws-sdk": "^2.7.0",
20-
"@types/classnames": "^2.2.3",
21-
"@types/dagre": "^0.7.39",
22-
"@types/deep-equal": "^1.0.1",
23-
"@types/history": "^4.6.2",
24-
"@types/prop-types": "^15.5.2",
25-
"@types/react": "^16.0.34",
26-
"@types/react-dom": "^16.0.3",
27-
"@types/react-redux": "^5.0.14",
28-
"@types/react-router-dom": "^4.2.3",
29-
"@types/react-router-redux": "^5.0.11",
30-
"@types/redux": "^3.6.0",
31-
"@types/superagent": "^3.5.7",
32-
"@types/ws": "^4.0.0",
33-
"aws-sdk": "^2.188.0",
34-
"classnames": "^2.2.5",
35-
"dagre": "^0.8.2",
36-
"deep-equal": "^1.0.1",
37-
"express-history-api-fallback": "^2.2.1",
38-
"font-awesome": "^4.7.0",
39-
"foundation-sites": "^6.4.3",
40-
"history": "^4.7.2",
41-
"install": "^0.10.4",
42-
"json-stream": "^1.0.0",
43-
"kubernetes-client": "3.17.1",
44-
"moment": "^2.20.1",
45-
"prop-types": "^15.6.0",
46-
"react": "^16.2.0",
47-
"react-dom": "^16.2.0",
48-
"react-redux": "^5.0.6",
49-
"react-router-dom": "^4.2.2",
50-
"react-router-redux": "^5.0.0-alpha.9",
51-
"redux": "3.6.0",
52-
"rxjs": "^5.5.6",
53-
"superagent": "^3.8.2",
54-
"superagent-promise": "^1.1.0",
55-
"ws": "^4.0.0",
56-
"xterm": "2.4.0"
57-
},
58-
"devDependencies": {
59-
"@types/chai": "^4.1.2",
60-
"@types/mocha": "^2.2.48",
61-
"awesome-typescript-loader": "^3.4.1",
62-
"chai": "^4.1.2",
63-
"copy-webpack-plugin": "^4.3.1",
64-
"glob": "^7.1.2",
65-
"html-webpack-plugin": "^2.30.1",
66-
"jscs": "^3.0.7",
67-
"mocha": "^5.0.0",
68-
"node-sass": "^4.7.2",
69-
"nodemon": "^1.14.11",
70-
"raw-loader": "^0.5.1",
71-
"react-hot-loader": "^3.1.3",
72-
"sass-loader": "^6.0.6",
73-
"source-map-loader": "^0.2.3",
74-
"style-loader": "^0.20.1",
75-
"ts-node": "^4.1.0",
76-
"tslint": "^5.9.1",
77-
"tslint-react": "^3.4.0",
78-
"typescript": "^2.6.2",
79-
"webfonts-generator": "^0.4.0",
80-
"webpack": "^3.10.0",
81-
"webpack-dev-server": "^2.11.1"
82-
}
2+
"name": "argo-ui",
3+
"version": "2.1.0",
4+
"main": "./dist/api/api/main.js",
5+
"license": "MIT",
6+
"scripts": {
7+
"docker": "docker build -t ${IMAGE_PREFIX:-`whoami`}/argoui:${IMAGE_TAG:-'latest'} . && [[ $DOCKER_PUSH == true ]] && echo docker push ${IMAGE_PREFIX:-`whoami`}/argoui:${IMAGE_TAG:-'latest'}",
8+
"build": "yarn build:ui && yarn build:api",
9+
"build:ui": "webpack --config ./src/app/webpack.config.js",
10+
"build:api": "tsc -p ./src/api/tsconfig.json",
11+
"dev": "nf start",
12+
"dev:ui": "webpack-dev-server --config ./src/app/webpack.config.js",
13+
"dev:api": "TS_NODE_PROJECT=./src/api/tsconfig.json nodemon --nolazy --inspect -r ts-node/register ./src/api/main.ts",
14+
"lint": "yarn lint:ui && yarn lint:api",
15+
"lint:ui": "tslint -p ./src/app",
16+
"lint:api": "tslint -p ./src/api",
17+
"utils:icons": "rm -f src/assets/fonts/* && node ./scripts/icons/generator.js",
18+
"test": "mocha --require ts-node/register ./src/app/**/*.spec.ts"
19+
},
20+
"dependencies": {
21+
"aws-sdk": "^2.188.0",
22+
"body-parser": "^1.18.2",
23+
"express": "^4.16.2",
24+
"express-history-api-fallback": "^2.2.1",
25+
"json-stream": "^1.0.0",
26+
"kubernetes-client": "3.17.1",
27+
"moment": "^2.20.1",
28+
"rxjs": "^5.5.6",
29+
"ws": "^4.0.0",
30+
"yargs": "^11.0.0"
31+
},
32+
"devDependencies": {
33+
"@types/aws-sdk": "^2.7.0",
34+
"@types/chai": "^4.1.2",
35+
"@types/classnames": "^2.2.3",
36+
"@types/dagre": "^0.7.39",
37+
"@types/deep-equal": "^1.0.1",
38+
"@types/history": "^4.6.2",
39+
"@types/mocha": "^2.2.48",
40+
"@types/prop-types": "^15.5.2",
41+
"@types/react": "^16.0.34",
42+
"@types/react-dom": "^16.0.3",
43+
"@types/react-redux": "^5.0.14",
44+
"@types/react-router-dom": "^4.2.3",
45+
"@types/react-router-redux": "^5.0.11",
46+
"@types/redux": "^3.6.0",
47+
"@types/superagent": "^3.5.7",
48+
"@types/ws": "^4.0.0",
49+
"awesome-typescript-loader": "^3.4.1",
50+
"chai": "^4.1.2",
51+
"classnames": "^2.2.5",
52+
"copy-webpack-plugin": "^4.3.1",
53+
"dagre": "^0.8.2",
54+
"deep-equal": "^1.0.1",
55+
"font-awesome": "^4.7.0",
56+
"foreman": "^2.0.0",
57+
"foundation-sites": "^6.4.3",
58+
"glob": "^7.1.2",
59+
"history": "^4.7.2",
60+
"html-webpack-plugin": "^2.30.1",
61+
"jscs": "^3.0.7",
62+
"mocha": "^5.0.0",
63+
"node-sass": "^4.7.2",
64+
"nodemon": "^1.14.11",
65+
"prop-types": "^15.6.0",
66+
"raw-loader": "^0.5.1",
67+
"react": "^16.2.0",
68+
"react-dom": "^16.2.0",
69+
"react-hot-loader": "^3.1.3",
70+
"react-redux": "^5.0.6",
71+
"react-router-dom": "^4.2.2",
72+
"react-router-redux": "^5.0.0-alpha.9",
73+
"redux": "3.6.0",
74+
"sass-loader": "^6.0.6",
75+
"source-map-loader": "^0.2.3",
76+
"style-loader": "^0.20.1",
77+
"superagent": "^3.8.2",
78+
"superagent-promise": "^1.1.0",
79+
"ts-node": "^4.1.0",
80+
"tslint": "^5.9.1",
81+
"tslint-react": "^3.4.0",
82+
"typescript": "^2.6.2",
83+
"webfonts-generator": "^0.4.0",
84+
"webpack": "^3.10.0",
85+
"webpack-dev-server": "^2.11.1",
86+
"xterm": "2.4.0"
87+
}
8388
}

src/api/main.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as app from './app';
77
const argv = yargs.argv;
88

99
app.create(
10-
argv.uiDist || path.join(__dirname, '..', 'dist'),
10+
argv.uiDist || path.join(__dirname, '..', '..', 'app'),
1111
argv.inCluster === 'true',
1212
argv.namespace || 'default',
1313
argv.crdVersion || 'v1alpha1',

src/api/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compileOnSave": false,
33
"compilerOptions": {
4-
"outDir": "../api-dist",
4+
"outDir": "../../dist/api",
55
"sourceMap": true,
66
"declaration": false,
77
"moduleResolution": "node",

yarn.lock

+77-5
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,10 @@ arr-union@^3.1.0:
254254
version "3.1.0"
255255
resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4"
256256

257+
array-filter@~0.0.0:
258+
version "0.0.1"
259+
resolved "https://registry.yarnpkg.com/array-filter/-/array-filter-0.0.1.tgz#7da8cf2e26628ed732803581fd21f67cacd2eeec"
260+
257261
array-find-index@^1.0.1:
258262
version "1.0.2"
259263
resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1"
@@ -273,6 +277,14 @@ array-includes@^3.0.3:
273277
define-properties "^1.1.2"
274278
es-abstract "^1.7.0"
275279

280+
array-map@~0.0.0:
281+
version "0.0.0"
282+
resolved "https://registry.yarnpkg.com/array-map/-/array-map-0.0.0.tgz#88a2bab73d1cf7bcd5c1b118a003f66f665fa662"
283+
284+
array-reduce@~0.0.0:
285+
version "0.0.0"
286+
resolved "https://registry.yarnpkg.com/array-reduce/-/array-reduce-0.0.0.tgz#173899d3ffd1c7d9383e4479525dbe278cab5f2b"
287+
276288
array-union@^1.0.1:
277289
version "1.0.2"
278290
resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39"
@@ -493,7 +505,7 @@ bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0:
493505
version "4.11.8"
494506
resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.8.tgz#2cde09eb5ee341f484746bb0309b3253b1b1442f"
495507

496-
508+
[email protected], body-parser@^1.18.2:
497509
version "1.18.2"
498510
resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.18.2.tgz#87678a19d84b47d859b83199bd59bce222b10454"
499511
dependencies:
@@ -888,6 +900,14 @@ cliui@^3.2.0:
888900
strip-ansi "^3.0.1"
889901
wrap-ansi "^2.0.0"
890902

903+
cliui@^4.0.0:
904+
version "4.0.0"
905+
resolved "https://registry.yarnpkg.com/cliui/-/cliui-4.0.0.tgz#743d4650e05f36d1ed2575b59638d87322bfbbcc"
906+
dependencies:
907+
string-width "^2.1.1"
908+
strip-ansi "^4.0.0"
909+
wrap-ansi "^2.0.0"
910+
891911
clone-deep@^0.3.0:
892912
version "0.3.0"
893913
resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-0.3.0.tgz#348c61ae9cdbe0edfe053d91ff4cc521d790ede8"
@@ -1941,6 +1961,15 @@ foreach@^2.0.5:
19411961
version "2.0.5"
19421962
resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99"
19431963

1964+
foreman@^2.0.0:
1965+
version "2.0.0"
1966+
resolved "https://registry.yarnpkg.com/foreman/-/foreman-2.0.0.tgz#00acd20f9dbbe2f79d04697bcca2a77ee00ee031"
1967+
dependencies:
1968+
commander "~2.9.0"
1969+
http-proxy "~1.11.1"
1970+
mustache "^2.2.1"
1971+
shell-quote "~1.4.2"
1972+
19441973
forever-agent@~0.6.1:
19451974
version "0.6.1"
19461975
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
@@ -2487,6 +2516,13 @@ http-proxy@^1.16.2:
24872516
eventemitter3 "1.x.x"
24882517
requires-port "1.x.x"
24892518

2519+
http-proxy@~1.11.1:
2520+
version "1.11.3"
2521+
resolved "https://registry.yarnpkg.com/http-proxy/-/http-proxy-1.11.3.tgz#1915dc888751e2a6bf3c2abfcb1808fa86c72353"
2522+
dependencies:
2523+
eventemitter3 "1.x.x"
2524+
requires-port "0.x.x"
2525+
24902526
http-signature@~1.1.0:
24912527
version "1.1.1"
24922528
resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.1.1.tgz#df72e267066cd0ac67fb76adf8e134a8fbcf91bf"
@@ -2583,10 +2619,6 @@ ini@^1.3.4, ini@~1.3.0:
25832619
version "1.3.5"
25842620
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
25852621

2586-
install@^0.10.4:
2587-
version "0.10.4"
2588-
resolved "https://registry.yarnpkg.com/install/-/install-0.10.4.tgz#9cb09115768b93a582d1450a6ba3f275975b49aa"
2589-
25902622
25912623
version "1.2.0"
25922624
resolved "https://registry.yarnpkg.com/internal-ip/-/internal-ip-1.2.0.tgz#ae9fbf93b984878785d50a8de1b356956058cf5c"
@@ -3470,6 +3502,10 @@ multicast-dns@^6.0.1:
34703502
dns-packet "^1.0.1"
34713503
thunky "^0.1.0"
34723504

3505+
mustache@^2.2.1:
3506+
version "2.3.0"
3507+
resolved "https://registry.yarnpkg.com/mustache/-/mustache-2.3.0.tgz#4028f7778b17708a489930a6e52ac3bca0da41d0"
3508+
34733509
mute-stream@~0.0.4:
34743510
version "0.0.7"
34753511
resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab"
@@ -4613,6 +4649,10 @@ require-main-filename@^1.0.1:
46134649
version "1.0.1"
46144650
resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1"
46154651

4652+
4653+
version "0.0.1"
4654+
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-0.0.1.tgz#4b4414411d9df7c855995dd899a8c78a2951c16d"
4655+
46164656
[email protected], [email protected], requires-port@~1.0.0:
46174657
version "1.0.0"
46184658
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
@@ -4862,6 +4902,15 @@ shebang-regex@^1.0.0:
48624902
version "1.0.0"
48634903
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
48644904

4905+
shell-quote@~1.4.2:
4906+
version "1.4.3"
4907+
resolved "https://registry.yarnpkg.com/shell-quote/-/shell-quote-1.4.3.tgz#952c44e0b1ed9013ef53958179cc643e8777466b"
4908+
dependencies:
4909+
array-filter "~0.0.0"
4910+
array-map "~0.0.0"
4911+
array-reduce "~0.0.0"
4912+
jsonify "~0.0.0"
4913+
48654914
signal-exit@^3.0.0, signal-exit@^3.0.2:
48664915
version "3.0.2"
48674916
resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d"
@@ -6080,6 +6129,12 @@ yargs-parser@^7.0.0:
60806129
dependencies:
60816130
camelcase "^4.1.0"
60826131

6132+
yargs-parser@^9.0.2:
6133+
version "9.0.2"
6134+
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-9.0.2.tgz#9ccf6a43460fe4ed40a9bb68f48d43b8a68cc077"
6135+
dependencies:
6136+
camelcase "^4.1.0"
6137+
60836138
60846139
version "6.6.0"
60856140
resolved "https://registry.yarnpkg.com/yargs/-/yargs-6.6.0.tgz#782ec21ef403345f830a808ca3d513af56065208"
@@ -6098,6 +6153,23 @@ [email protected]:
60986153
y18n "^3.2.1"
60996154
yargs-parser "^4.2.0"
61006155

6156+
yargs@^11.0.0:
6157+
version "11.0.0"
6158+
resolved "https://registry.yarnpkg.com/yargs/-/yargs-11.0.0.tgz#c052931006c5eee74610e5fc0354bedfd08a201b"
6159+
dependencies:
6160+
cliui "^4.0.0"
6161+
decamelize "^1.1.1"
6162+
find-up "^2.1.0"
6163+
get-caller-file "^1.0.1"
6164+
os-locale "^2.0.0"
6165+
require-directory "^2.1.1"
6166+
require-main-filename "^1.0.1"
6167+
set-blocking "^2.0.0"
6168+
string-width "^2.0.0"
6169+
which-module "^2.0.0"
6170+
y18n "^3.2.1"
6171+
yargs-parser "^9.0.2"
6172+
61016173
yargs@^7.0.0:
61026174
version "7.1.0"
61036175
resolved "https://registry.yarnpkg.com/yargs/-/yargs-7.1.0.tgz#6ba318eb16961727f5d284f8ea003e8d6154d0c8"

0 commit comments

Comments
 (0)