From b61481b85aefee47c523f2f46c28be23916d0f6c Mon Sep 17 00:00:00 2001 From: alfonsomthd Date: Wed, 27 May 2020 17:02:36 +0200 Subject: [PATCH] Improvements in frontend build. --- docker/ceph/build-dashboard-frontend.sh | 2 +- docker/ceph/e2e/e2e-run.sh | 4 +++- docker/ceph/entrypoint.sh | 1 + docker/ceph/start-ceph.sh | 9 ++------- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/docker/ceph/build-dashboard-frontend.sh b/docker/ceph/build-dashboard-frontend.sh index 94272711a5272..9970fd1abc571 100755 --- a/docker/ceph/build-dashboard-frontend.sh +++ b/docker/ceph/build-dashboard-frontend.sh @@ -7,7 +7,7 @@ cd /ceph/src/pybind/mgr/dashboard/frontend rm -rf dist npm cache clean --force -npm install --no-shrinkwrap +npm ci cd /ceph/build diff --git a/docker/ceph/e2e/e2e-run.sh b/docker/ceph/e2e/e2e-run.sh index cc48efdbb6b1e..0bac63675ccab 100755 --- a/docker/ceph/e2e/e2e-run.sh +++ b/docker/ceph/e2e/e2e-run.sh @@ -4,7 +4,9 @@ set -eo pipefail cd /ceph/src/pybind/mgr/dashboard/frontend -npm install --no-shrinkwrap +export NODE_OPTIONS=--max_old_space_size=4096 +npm ci + npx webdriver-manager update --versions.chrome=$(google-chrome --version | awk '{ print $3 }') ARGS="--dev-server-target --webdriverUpdate=false" diff --git a/docker/ceph/entrypoint.sh b/docker/ceph/entrypoint.sh index 690674b06091f..8bf383930887a 100755 --- a/docker/ceph/entrypoint.sh +++ b/docker/ceph/entrypoint.sh @@ -65,5 +65,6 @@ fi [[ "$CEPH_VERSION" == 'De' ]] && export_var CEPH_VERSION=1000000 [[ -z "$CEPH_PATCH_VERSION" ]] && export_var CEPH_PATCH_VERSION=$("$CEPH_BIN"/ceph -v | sed -r 's/.*\.([0-9]*)\-.*/\1/') [[ $(rpm -qi ceph-mgr-dashboard | grep 'Red Hat' | wc -l) > 0 ]] && export_var IS_UPSTREAM=0 || export_var IS_UPSTREAM=1 +export_var NODE_OPTIONS=--max_old_space_size=4096 exec "$@" diff --git a/docker/ceph/start-ceph.sh b/docker/ceph/start-ceph.sh index 7bee2000bd49e..b878e8c564457 100755 --- a/docker/ceph/start-ceph.sh +++ b/docker/ceph/start-ceph.sh @@ -18,16 +18,11 @@ if [[ "$FRONTEND_BUILD_REQUIRED" == 1 ]]; then npm update @angular/cli fi - npm_clean_install() { - rm -rf node_modules - npm install --no-shrinkwrap - } - - npm install --no-shrinkwrap || npm_clean_install + npm ci if [[ -z "$REMOTE_DASHBOARD_URL" ]]; then # Required to run dashboard python module. - npm run build || { npm_clean_install && npm run build ; } + npm run build fi # Start dev server