From e097f544811b96484b55e546ef3c9ce1b3a8134c Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Wed, 1 Jul 2020 04:24:37 +0530 Subject: [PATCH] fix: bench image use specific version(s) of nodejs [skip travis] --- build/bench/Dockerfile | 7 +--- tests/pwd.yml | 94 ++++++++++++++++++++++++++++-------------- 2 files changed, 64 insertions(+), 37 deletions(-) diff --git a/build/bench/Dockerfile b/build/bench/Dockerfile index e237ae3c..920f9cc2 100644 --- a/build/bench/Dockerfile +++ b/build/bench/Dockerfile @@ -85,8 +85,8 @@ RUN bash -c "bench --version" # https://nodejs.org/download/release/latest-v10.x/ # https://nodejs.org/download/release/latest-v12.x/ # https://nodejs.org/download/release/latest-v13.x/ -ENV NODE_VERSION=12 -ENV NODE_VERSION_FRAPPEV11=10 +ENV NODE_VERSION=12.18.2 +ENV NODE_VERSION_FRAPPEV11=10.21.0 # Install nvm with node RUN wget https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh @@ -103,9 +103,6 @@ RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION} && npm install -g yarn RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION} ENV PATH="/home/frappe/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}" -# Install yarn -RUN npm install -g yarn - # Print version and verify bashrc is properly sourced so that everything works in the Dockerfile RUN node --version \ && npm --version \ diff --git a/tests/pwd.yml b/tests/pwd.yml index 4197b680..328d44f2 100644 --- a/tests/pwd.yml +++ b/tests/pwd.yml @@ -3,16 +3,21 @@ version: "3" services: traefik: image: "traefik:v2.2" - command: - - "--log.level=DEBUG" - - "--providers.docker=true" - - "--providers.docker.exposedbydefault=false" - - "--entrypoints.web.address=:80" - labels: - # enable traefik - - "traefik.enable=true" ports: - "80:80" + deploy: + restart_policy: + condition: on-failure + labels: + - "traefik.enable=true" + command: + - "--log.level=DEBUG" + - "--providers.docker" + - "--providers.docker.exposedbydefault=false" + - "--entrypoints.web.address=:80" + - "--providers.docker.swarmmode" + - "--accesslog" + - "--log" volumes: - /var/run/docker.sock:/var/run/docker.sock:ro @@ -24,20 +29,25 @@ services: - FRAPPE_PY_PORT=8000 - FRAPPE_SOCKETIO=frappe-socketio - SOCKETIO_PORT=9000 - labels: - - "traefik.enable=true" - - "traefik.http.routers.erpnext-nginx.rule=HostRegexp(`{catchall:.*}`)" - - "traefik.http.middlewares.erpnext-nginx.headers.customrequestheaders.Host=mysite.localhost" - - "traefik.http.routers.erpnext-nginx.middlewares=erpnext-nginx" - - "traefik.http.routers.erpnext-nginx.entrypoints=web" - - "traefik.http.services.erpnext-nginx.loadbalancer.server.port=80" + deploy: + restart_policy: + condition: on-failure + labels: + - "traefik.enable=true" + - "traefik.http.routers.erpnext-nginx.rule=HostRegexp(`{catchall:.*}`)" + - "traefik.http.middlewares.erpnext-nginx.headers.customrequestheaders.Host=mysite.localhost" + - "traefik.http.routers.erpnext-nginx.middlewares=erpnext-nginx" + - "traefik.http.routers.erpnext-nginx.entrypoints=web" + - "traefik.http.services.erpnext-nginx.loadbalancer.server.port=80" volumes: - sites-vol:/var/www/html/sites:rw - assets-vol:/assets:rw erpnext-python: image: frappe/erpnext-worker:edge - restart: on-failure + deploy: + restart_policy: + condition: on-failure environment: - MARIADB_HOST=mariadb - REDIS_CACHE=redis-cache:6379 @@ -51,15 +61,17 @@ services: frappe-socketio: image: frappe/frappe-socketio:edge - restart: on-failure - depends_on: - - redis-socketio + deploy: + restart_policy: + condition: on-failure volumes: - sites-vol:/home/frappe/frappe-bench/sites:rw erpnext-worker-default: image: frappe/erpnext-worker:edge - restart: on-failure + deploy: + restart_policy: + condition: on-failure command: worker depends_on: - redis-queue @@ -69,7 +81,9 @@ services: erpnext-worker-short: image: frappe/erpnext-worker:edge - restart: on-failure + deploy: + restart_policy: + condition: on-failure command: worker environment: - WORKER_TYPE=short @@ -81,7 +95,9 @@ services: erpnext-worker-long: image: frappe/erpnext-worker:edge - restart: on-failure + deploy: + restart_policy: + condition: on-failure command: worker environment: - WORKER_TYPE=long @@ -93,7 +109,9 @@ services: erpnext-schedule: image: frappe/erpnext-worker:edge - restart: on-failure + deploy: + restart_policy: + condition: on-failure command: schedule depends_on: - redis-queue @@ -103,30 +121,42 @@ services: redis-cache: image: redis:latest - restart: on-failure + deploy: + restart_policy: + condition: on-failure volumes: - redis-cache-vol:/data redis-queue: image: redis:latest - restart: on-failure + deploy: + restart_policy: + condition: on-failure volumes: - redis-queue-vol:/data redis-socketio: image: redis:latest - restart: on-failure + deploy: + restart_policy: + condition: on-failure volumes: - redis-socketio-vol:/data site-configurator: image: frappe/erpnext-worker:edge + deploy: + restart_policy: + condition: none command: ["bash", "-c", "echo mysite.localhost > /sites/currentsite.txt"] volumes: - sites-vol:/sites:rw mariadb-configurator: image: mariadb:10.3 + deploy: + restart_policy: + condition: none command: - "bash" - "-c" @@ -147,9 +177,9 @@ services: mariadb: image: mariadb:10.3 - restart: on-failure - depends_on: - - mariadb-configurator + deploy: + restart_policy: + condition: on-failure environment: - MYSQL_ROOT_PASSWORD=admin volumes: @@ -158,10 +188,10 @@ services: site-creator: image: frappe/erpnext-worker:edge - restart: "no" + deploy: + restart_policy: + condition: none command: new - depends_on: - - erpnext-python environment: - SITE_NAME=mysite.localhost - DB_ROOT_USER=root