diff --git a/.env b/.env index eef8c324b6b7195f3e52d4d30f0038f53fa668da..a76b17d4291f90393c86a7bd9d120c1445479776 100644 --- a/.env +++ b/.env @@ -1,14 +1,13 @@ # Infrastructure Related BASE_REGISTRY_URL="ssa-containers.aoc.nrao.edu:5000/ssa-docker/workspaces" # the url for the project's docker registry BASE_IMAGE_TAG=local # TODO: remove once cache image removed -CACHE_IMAGE_TAG=local # TODO: remove once cache image removed DEPLOY_ENV=local # the default environment to build for (one of: dev, test, local, prod) ENV=local # the default environment to build for (one of: dev, test, local, prod) TAG=local # the tag name to pull images from when building ENV_HOST="localhost" DL_HOST="https://dl-dsoc.nrao.edu" -NG_APP_WS_VERSION=${ENV} -WS_VERSION=unknown-version +WS_VERSION="0.0.0+local" +NG_APP_WS_VERSION=${WS_VERSION} LOCAL_OR_SERVER_PEX=local-pex # determines if pexes are built from scratch or pulled from the registry (one of: local-pex, server-pex) API_TOKEN= diff --git a/Makefile b/Makefile index a187adf3006f6517e09a08936264a91d97a977bd..82a112f2ffffdd2e394677edb0b30d3515c82e63 100644 --- a/Makefile +++ b/Makefile @@ -82,7 +82,7 @@ clean: # Clean things up in a very nasty and destructive way that is sure to derail the rest of your afternoon reallyclean: clean docker system prune --volumes -f - docker volume prune -f + docker volume prune --filter all=1 -f # Make the documentation .PHONY: docs godocs diff --git a/apps/web/Dockerfile b/apps/web/Dockerfile index 81c2fe04177ab2734e47eb746685f71739661da5..e74b93616f01730184346f4b74623807063d8d02 100644 --- a/apps/web/Dockerfile +++ b/apps/web/Dockerfile @@ -1,6 +1,6 @@ -ARG WS_VERSION=dev FROM node:14.16-alpine3.12 as base - +ARG WS_VERSION=unknown-version +ENV WS_VERSION=${WS_VERSION} RUN apk update && apk add --virtual build-dependencies \ git \ python2 \ @@ -23,6 +23,10 @@ COPY ./apps/web ./ # Disable Angular Analytics prompt ENV NG_CLI_ANALYTICS=false +# Requires build-arg WS_VERSION +# Build arg that sets Workspaces Version; defaults if no build arg is given +ENV NG_APP_WS_VERSION=${WS_VERSION} + # install node_modules RUN npm install @@ -34,14 +38,14 @@ FROM base as base-build # Requires build-arg $env # Build arg that sets environment; sets to "dev" if no build arg is given -ARG env=dev -ENV ENV=${env} +ARG DEPLOY_ENV=dev +ENV DEPLOY_ENV=${DEPLOY_ENV} ARG ENV_HOST ENV ENV_HOST=${ENV_HOST} # Requires build-arg WS_VERSION -# Build arg that sets Workspaces Version; defaults to "dev" if no build arg is given +# Build arg that sets Workspaces Version; defaults to "unknown-version" if no build arg is given ENV NG_APP_WS_VERSION=${WS_VERSION} # Switch to vlapipe @@ -81,7 +85,7 @@ USER vlapipe COPY --chown=vlapipe:vlapipe ./apps/web ./ # Build the angular app -RUN ./node_modules/.bin/ng build --configuration=${ENV} --output-path=dist +RUN ./node_modules/.bin/ng build --configuration=${DEPLOY_ENV} --output-path=dist # ## NGINX section of multi-stage image diff --git a/docker-compose.local.yml b/docker-compose.local.yml index 917e8b1744cd928929426b0c833819a2ef8c773d..abe8e5775d61b24ffad8fe30c0af1909ab001046 100644 --- a/docker-compose.local.yml +++ b/docker-compose.local.yml @@ -140,7 +140,7 @@ services: dockerfile: ./services/workflow/Dockerfile target: dev args: - - CACHE_IMAGE_TAG=${TAG} + - WS_VERSION=${WS_VERSION} - LOCAL_OR_SERVER_PEX=${LOCAL_OR_SERVER_PEX} - DEPLOY_ENV=${DEPLOY_ENV} ports: @@ -179,7 +179,8 @@ services: dockerfile: ./services/capability/Dockerfile target: dev args: - - CACHE_IMAGE_TAG=${TAG} + - WS_VERSION=${WS_VERSION} + - ENV_HOST=${ENV_HOST} ports: - "3457:3457" depends_on: @@ -211,8 +212,9 @@ services: dockerfile: ./services/notification/Dockerfile target: dev args: - - CACHE_IMAGE_TAG=${TAG} + - WS_VERSION=${WS_VERSION} - DEPLOY_ENV=${DEPLOY_ENV} + - ENV_HOST=${ENV_HOST} ports: - "3458:3458" depends_on: @@ -239,8 +241,8 @@ services: context: . dockerfile: ./apps/web/Dockerfile target: dev - environment: - NG_APP_WS_VERSION: "local" + args: + - WS_VERSION=${WS_VERSION} init: true ports: - "4200:4200" diff --git a/docker-compose.yml b/docker-compose.yml index 9c8a8ac227a7bea66fc64944f07c8935efbd05ac..49ba7bd50fe45652a2d57864e58aef11834e0ad1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,11 +15,6 @@ services: - LOCAL_OR_SERVER_PEX="server-pex" - DEPLOY_ENV=${ENV} - API_TOKEN=${API_TOKEN} -# ports: -# - target: 3456 -# published: 3456 -# protocol: tcp -# mode: host environment: CAPO_PATH: /home/casa/capo CAPO_PROFILE: dsoc-${ENV} @@ -61,7 +56,6 @@ services: - BASE_REGISTRY_URL=${BASE_REGISTRY_URL} - WS_VERSION=${WS_VERSION} - DEPLOY_ENV=${ENV} - - ENV_HOST=${ENV_HOST} ports: - target: 3457 published: 3457 @@ -70,8 +64,8 @@ services: environment: CAPO_PATH: /home/casa/capo CAPO_PROFILE: dsoc-${ENV} - ENV_HOST: ${ENV_HOST} DL_HOST: ${DL_HOST} + ENV_HOST: ${ENV_HOST} volumes: - /home/casa/capo:/home/casa/capo deploy: @@ -103,11 +97,6 @@ services: - BASE_REGISTRY_URL=${BASE_REGISTRY_URL} - WS_VERSION=${WS_VERSION} - DEPLOY_ENV=${ENV} -# ports: -# - target: 3458 -# published: 3458 -# protocol: tcp -# mode: host environment: CAPO_PATH: /home/casa/capo CAPO_PROFILE: dsoc-${ENV} @@ -141,6 +130,7 @@ services: args: - BASE_REGISTRY_URL=${BASE_REGISTRY_URL} - WS_VERSION=${WS_VERSION} + - DEPLOY_ENV=${ENV} - ENV_HOST=${ENV_HOST} ports: - target: 80 diff --git a/services/notification/Dockerfile b/services/notification/Dockerfile index 6481ce4efeade3353a646c7a81568609218aca9d..5509e01777abbb7143ab8c78019373280ecce178 100644 --- a/services/notification/Dockerfile +++ b/services/notification/Dockerfile @@ -1,8 +1,10 @@ # This is nrao:notification FROM python:3.10-slim-buster as base -ARG DEPLOY_ENV ARG WS_VERSION=unknown-version + +ARG DEPLOY_ENV ENV DEPLOY_ENV=${DEPLOY_ENV} + ARG ENV_HOST ENV ENV_HOST=${ENV_HOST}