diff --git a/Dockerfile b/Dockerfile index 10c112b41..fd3b89c57 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,15 @@ # syntax=docker/dockerfile:experimental -FROM node:16 as builder - +# Use node:17 to docker build on M1 +FROM --platform=${BUILDPLATFORM} node:16 as builder LABEL org.opencontainers.image.source https://github.com/flyteorg/flyteconsole +ARG TARGETARCH +ENV npm_config_target_arch "${TARGETARCH}" +ENV npm_config_target_platform linux +ENV npm_config_target_libc glibc + WORKDIR /my-project/ COPY . /my-project/ - RUN : \ --mount=type=cache,target=/root/.yarn \ # install production dependencies @@ -15,15 +19,17 @@ RUN : \ && rm -rf node_modules/@flyteorg \ && cp -R node_modules /app -WORKDIR /my-project/ RUN : \ --mount=type=cache,target=/root/.yarn \ # install all dependencies so we can build && yarn workspaces focus --all --production \ - && yarn build:pack \ + && yarn build:types \ && BASE_URL=/console yarn run build:prod \ && cp -R ./website/dist/* /app +RUN rm -rf /app/node_modules +RUN rm -f /app/client-stats.json + FROM gcr.io/distroless/nodejs LABEL org.opencontainers.image.source https://github.com/flyteorg/flyteconsole diff --git a/package.json b/package.json index 961bdfe5f..7925dbb22 100644 --- a/package.json +++ b/package.json @@ -17,6 +17,7 @@ "scripts": { "postinstall": "husky install", "build:pack": "yarn workspaces foreach -vit --include '{@flyteorg/flyteidl-types,@flyteorg/flyte-api,@flyteorg/ui-atoms,@flyteorg/common,@flyteorg/locale,@flyteorg/flyte-api,@flyteorg/components,@flyteorg/console}' run build", + "build:types": "yarn workspaces foreach -vit --include '{@flyteorg/flyteidl-types,@flyteorg/flyte-api,@flyteorg/ui-atoms,@flyteorg/common,@flyteorg/locale,@flyteorg/flyte-api,@flyteorg/components,@flyteorg/console}' run build:types", "clean": "git clean -fxd --exclude script", "gen:ssl": "make generate_ssl", "start": "yarn workspace @flyteconsole/client-app start", diff --git a/packages/common/package.json b/packages/common/package.json index 3c2abd4cc..24b427853 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -30,6 +30,7 @@ "build": "yarn clean && yarn build:esm && yarn build:cjs", "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", + "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "test": "NODE_ENV=test jest" } } diff --git a/packages/components/package.json b/packages/components/package.json index 8bbb3141b..4efc1313f 100644 --- a/packages/components/package.json +++ b/packages/components/package.json @@ -36,6 +36,7 @@ "build": "yarn clean && yarn build:esm && yarn build:cjs", "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", + "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "test": "NODE_ENV=test jest" }, "dependencies": { diff --git a/packages/console/package.json b/packages/console/package.json index 34fe369b5..6583c2605 100644 --- a/packages/console/package.json +++ b/packages/console/package.json @@ -1,6 +1,6 @@ { "name": "@flyteorg/console", - "version": "0.0.11", + "version": "0.0.10", "description": "Flyteconsole main app module", "main": "./dist/index.js", "module": "./lib/index.js", @@ -33,8 +33,9 @@ "clean": "rm -rf dist && rm -rf lib && rm -rf **.tsbuildinfo || true", "build:watch": "run -T tsc-watch --noClear -p ./tsconfig.es.build.json --onSuccess \"yarn build\"", "build": "yarn clean && yarn build:esm && yarn build:cjs", - "build:esm": "mkdir lib && cp -R src/assets ./lib && run -T tsc --module esnext --outDir ./lib --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", + "build:esm": "mkdir lib && cp -R src/assets ./lib && run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "mkdir dist && cp -R src/assets ./dist && run -T wait-on ./dist/assets && run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", + "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "test": "NODE_ENV=test jest" }, "installConfig": { diff --git a/packages/flyte-api/package.json b/packages/flyte-api/package.json index 173983dd4..d51134565 100644 --- a/packages/flyte-api/package.json +++ b/packages/flyte-api/package.json @@ -36,6 +36,7 @@ "build": "yarn clean && yarn build:esm && yarn build:cjs", "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", + "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "push:update": "yarn clean && yarn build && yarn publish", "test": "NODE_ENV=test jest" }, diff --git a/packages/flyteidl-types/package.json b/packages/flyteidl-types/package.json index 844c0b834..f9931cda3 100644 --- a/packages/flyteidl-types/package.json +++ b/packages/flyteidl-types/package.json @@ -36,6 +36,7 @@ "build": "yarn clean && yarn build:esm && yarn build:cjs", "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", + "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "test": "NODE_ENV=test jest" }, "peerDependencies": { diff --git a/packages/locale/package.json b/packages/locale/package.json index 0247ce006..13efbee62 100644 --- a/packages/locale/package.json +++ b/packages/locale/package.json @@ -36,6 +36,7 @@ "build": "yarn clean && yarn build:esm && yarn build:cjs", "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", + "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "test": "NODE_ENV=test jest" }, "devDependencies": { diff --git a/packages/ui-atoms/package.json b/packages/ui-atoms/package.json index 6e784bc72..de1597275 100644 --- a/packages/ui-atoms/package.json +++ b/packages/ui-atoms/package.json @@ -27,6 +27,7 @@ "build": "yarn clean && yarn build:esm && yarn build:cjs", "build:esm": "run -T tsc --module esnext --project ./tsconfig.build.es.json && run -T tsc-alias -p ./tsconfig.build.es.json", "build:cjs": "run -T tsc --project ./tsconfig.build.json && run -T tsc-alias -p ./tsconfig.build.json", + "build:types": "run -T tsc --module esnext --project ./tsconfig.build.es.json --emitDeclarationOnly && run -T tsc-alias -p ./tsconfig.build.es.json", "test": "NODE_ENV=test jest" }, "installConfig": { diff --git a/website/package.json b/website/package.json index 50f4ad92b..7fac358a1 100644 --- a/website/package.json +++ b/website/package.json @@ -37,7 +37,7 @@ }, "dependencies": { "@flyteorg/common": "^0.0.3", - "@flyteorg/console": "^0.0.7", + "@flyteorg/console": "^0.0.10", "long": "^4.0.0", "protobufjs": "~6.11.3", "react-ga4": "^1.4.1", diff --git a/yarn.lock b/yarn.lock index a3249fc07..2790aa96b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1995,7 +1995,7 @@ __metadata: resolution: "@flyteconsole/client-app@workspace:website" dependencies: "@flyteorg/common": ^0.0.3 - "@flyteorg/console": ^0.0.7 + "@flyteorg/console": ^0.0.10 "@types/long": ^3.0.32 long: ^4.0.0 protobufjs: ~6.11.3 @@ -2034,77 +2034,7 @@ __metadata: languageName: unknown linkType: soft -"@flyteorg/console@npm:^0.0.7": - version: 0.0.7 - resolution: "@flyteorg/console@npm:0.0.7" - dependencies: - "@date-io/moment": 1.3.9 - "@emotion/core": 10.1.1 - "@flyteorg/common": ^0.0.3 - "@flyteorg/components": ^0.0.3 - "@flyteorg/flyte-api": ^0.0.2 - "@flyteorg/flyteidl-types": ^0.0.3 - "@flyteorg/locale": ^0.0.2 - "@flyteorg/ui-atoms": ^0.0.3 - "@material-ui/core": ^4.12.4 - "@material-ui/icons": ^4.11.3 - "@material-ui/pickers": ^3.2.2 - "@rjsf/core": 3.2.1 - "@rjsf/material-ui": 3.2.1 - "@rjsf/utils": ^5.0.0-beta.12 - "@rjsf/validator-ajv6": ^5.0.0-beta.12 - "@types/d3-shape": ^1.2.6 - "@xstate/react": ^1.0.0 - axios: ^0.27.2 - chart.js: 3.6.2 - chartjs-plugin-datalabels: 2.0.0 - classnames: ^2.3.1 - copy-to-clipboard: ^3.0.8 - cronstrue: ^1.31.0 - d3-dag: ^0.3.4 - d3-shape: ^1.2.2 - dagre: 0.8.5 - dagre-d3: ^0.6.4 - debug: 2.6.9 - dom-helpers: ^3.4.0 - fuzzysort: ^1.1.1 - intersection-observer: ^0.7.0 - js-yaml: ^3.13.1 - linkify-it: ^2.2.0 - lodash: ^4.17.21 - lossless-json: ^1.0.3 - memoize-one: ^5.0.0 - moment: ^2.29.4 - moment-timezone: ^0.5.28 - notistack: ^1.0.10 - object-hash: ^1.3.1 - prop-types: 15.6.0 - query-string: ^6.5.0 - react-chartjs-2: ^4.3.1 - react-flow-renderer: 10.3.8 - react-ga4: ^1.4.1 - react-intersection-observer: ^8.25.1 - react-json-view: ^1.21.3 - react-loading-skeleton: ^1.1.2 - react-query: 3.3.0 - react-query-devtools: 3.0.0-beta.1 - react-virtualized: ^9.21.1 - shallowequal: ^1.1.0 - url-search-params: ^0.10.0 - xstate: 4.33.6 - peerDependencies: - long: ^4.0.0 - protobufjs: ~6.11.3 - react: ^16.14.0 - react-dom: ^16.14.0 - react-router: ^5.3.4 - react-router-dom: ^5.3.4 - use-react-router: ^1.0.7 - checksum: 998c925f806d61cd549687fb36d24c765f42daacd1892dea8c2fc1f334ce8e1d0146bf1687f7e1328a4df29fd620d78f5ecc17ca7e4547d595420c876e963fd8 - languageName: node - linkType: hard - -"@flyteorg/console@workspace:packages/console": +"@flyteorg/console@^0.0.10, @flyteorg/console@workspace:packages/console": version: 0.0.0-use.local resolution: "@flyteorg/console@workspace:packages/console" dependencies: @@ -3347,25 +3277,6 @@ __metadata: languageName: node linkType: hard -"@rjsf/core@npm:3.2.1": - version: 3.2.1 - resolution: "@rjsf/core@npm:3.2.1" - dependencies: - "@types/json-schema": ^7.0.7 - ajv: ^6.7.0 - core-js-pure: ^3.6.5 - json-schema-merge-allof: ^0.6.0 - jsonpointer: ^5.0.0 - lodash: ^4.17.15 - nanoid: ^3.1.23 - prop-types: ^15.7.2 - react-is: ^16.9.0 - peerDependencies: - react: ">=16" - checksum: 2142d4a31229ea242b79aca4ed93e2fe89e75f15ce93111457c3017d3ab295cae8f53e4dd870c619afa571959d00f46b3c19085c6a336f522c891fc07ecc46f1 - languageName: node - linkType: hard - "@rjsf/core@npm:^5.1.0": version: 5.1.0 resolution: "@rjsf/core@npm:5.1.0" @@ -3381,18 +3292,6 @@ __metadata: languageName: node linkType: hard -"@rjsf/material-ui@npm:3.2.1": - version: 3.2.1 - resolution: "@rjsf/material-ui@npm:3.2.1" - peerDependencies: - "@material-ui/core": ^4.2.0 - "@material-ui/icons": ^4.2.1 - "@rjsf/core": ^3.0.0 - react: ">=16" - checksum: bd25cd9f2e2d568c653755e7268fe3e53279e1ae675e39bccd85f65557623d2052b706763e017a949f897751e25a16d0f2c8b995508bb56907be6786b09e2b1e - languageName: node - linkType: hard - "@rjsf/material-ui@npm:^5.1.0": version: 5.1.0 resolution: "@rjsf/material-ui@npm:5.1.0" @@ -3406,21 +3305,6 @@ __metadata: languageName: node linkType: hard -"@rjsf/utils@npm:^5.0.0-beta.12": - version: 5.0.0-beta.14 - resolution: "@rjsf/utils@npm:5.0.0-beta.14" - dependencies: - json-schema-merge-allof: ^0.8.1 - jsonpointer: ^5.0.1 - lodash: ^4.17.15 - lodash-es: ^4.17.15 - react-is: ^18.2.0 - peerDependencies: - react: ^16.14.0 || >=17 - checksum: 66d29377c98f6e778ec0b167734a949528b0ca2bfb4776dea74fd70add1fb339e14ec878b9162a152e83804bc8094c3ebcd9ebf8b1b68a63c6ee2bf4548938c8 - languageName: node - linkType: hard - "@rjsf/utils@npm:^5.1.0": version: 5.1.0 resolution: "@rjsf/utils@npm:5.1.0" @@ -3436,19 +3320,6 @@ __metadata: languageName: node linkType: hard -"@rjsf/validator-ajv6@npm:^5.0.0-beta.12": - version: 5.0.0-beta.14 - resolution: "@rjsf/validator-ajv6@npm:5.0.0-beta.14" - dependencies: - ajv: ^6.7.0 - lodash: ^4.17.15 - lodash-es: ^4.17.15 - peerDependencies: - "@rjsf/utils": ^5.0.0-beta.1 - checksum: 57b5c6968475a66762f644f2832aad077f8dde0ca9e71c8b0b27c06174855b7e6330f44fa6078fc0f347b728a4a5fd62399378fad26ada3cde32da89bddf6f9f - languageName: node - linkType: hard - "@rjsf/validator-ajv8@npm:^5.1.0": version: 5.1.0 resolution: "@rjsf/validator-ajv8@npm:5.1.0" @@ -5333,7 +5204,7 @@ __metadata: languageName: node linkType: hard -"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.4, @types/json-schema@npm:^7.0.5, @types/json-schema@npm:^7.0.7, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": +"@types/json-schema@npm:*, @types/json-schema@npm:^7.0.4, @types/json-schema@npm:^7.0.5, @types/json-schema@npm:^7.0.8, @types/json-schema@npm:^7.0.9": version: 7.0.11 resolution: "@types/json-schema@npm:7.0.11" checksum: 527bddfe62db9012fccd7627794bd4c71beb77601861055d87e3ee464f2217c85fca7a4b56ae677478367bbd248dbde13553312b7d4dbc702a2f2bbf60c4018d @@ -6558,7 +6429,7 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^6.1.0, ajv@npm:^6.10.0, ajv@npm:^6.10.2, ajv@npm:^6.12.2, ajv@npm:^6.12.4, ajv@npm:^6.12.5, ajv@npm:^6.7.0": +"ajv@npm:^6.1.0, ajv@npm:^6.10.0, ajv@npm:^6.10.2, ajv@npm:^6.12.2, ajv@npm:^6.12.4, ajv@npm:^6.12.5": version: 6.12.6 resolution: "ajv@npm:6.12.6" dependencies: @@ -8714,7 +8585,7 @@ __metadata: languageName: node linkType: hard -"compute-lcm@npm:^1.1.0, compute-lcm@npm:^1.1.2": +"compute-lcm@npm:^1.1.2": version: 1.1.2 resolution: "compute-lcm@npm:1.1.2" dependencies: @@ -8963,7 +8834,7 @@ __metadata: languageName: node linkType: hard -"core-js-pure@npm:^3.23.3, core-js-pure@npm:^3.25.1, core-js-pure@npm:^3.6.5": +"core-js-pure@npm:^3.23.3, core-js-pure@npm:^3.25.1": version: 3.26.1 resolution: "core-js-pure@npm:3.26.1" checksum: d88c40e5e29e413c11d1ef991a8d5b6a63f00bd94707af0f649d3fc18b3524108b202f4ae75ce77620a1557d1ba340bc3362b4f25d590eccc37cf80fc75f7cd4 @@ -14743,17 +14614,6 @@ __metadata: languageName: node linkType: hard -"json-schema-merge-allof@npm:^0.6.0": - version: 0.6.0 - resolution: "json-schema-merge-allof@npm:0.6.0" - dependencies: - compute-lcm: ^1.1.0 - json-schema-compare: ^0.2.2 - lodash: ^4.17.4 - checksum: 2008aede3f5d05d7870e7d5e554e5c6a5b451cfff1357d34d3d8b34e2ba57468a97c76aa5b967bdb411d91b98c734f19f350de578d25b2a0a27cd4e1ca92bd1d - languageName: node - linkType: hard - "json-schema-merge-allof@npm:^0.8.1": version: 0.8.1 resolution: "json-schema-merge-allof@npm:0.8.1" @@ -14840,7 +14700,7 @@ __metadata: languageName: node linkType: hard -"jsonpointer@npm:^5.0.0, jsonpointer@npm:^5.0.1": +"jsonpointer@npm:^5.0.1": version: 5.0.1 resolution: "jsonpointer@npm:5.0.1" checksum: 0b40f712900ad0c846681ea2db23b6684b9d5eedf55807b4708c656f5894b63507d0e28ae10aa1bddbea551241035afe62b6df0800fc94c2e2806a7f3adecd7c @@ -16391,7 +16251,7 @@ __metadata: languageName: node linkType: hard -"nanoid@npm:^3.1.23, nanoid@npm:^3.3.1, nanoid@npm:^3.3.4": +"nanoid@npm:^3.3.1, nanoid@npm:^3.3.4": version: 3.3.4 resolution: "nanoid@npm:3.3.4" bin: @@ -18704,7 +18564,7 @@ __metadata: languageName: node linkType: hard -"react-is@npm:^16.13.1, react-is@npm:^16.6.0, react-is@npm:^16.7.0, react-is@npm:^16.9.0": +"react-is@npm:^16.13.1, react-is@npm:^16.6.0, react-is@npm:^16.7.0": version: 16.13.1 resolution: "react-is@npm:16.13.1" checksum: f7a19ac3496de32ca9ae12aa030f00f14a3d45374f1ceca0af707c831b2a6098ef0d6bdae51bd437b0a306d7f01d4677fcc8de7c0d331eb47ad0f46130e53c5f