Skip to content
Snippets Groups Projects
Commit f1845aa9 authored by Nathan Hertz's avatar Nathan Hertz
Browse files

WS-541: Production HTCondor submit host configuration file and updated production `Dockerfile`s

parent 1c37e596
No related branches found
No related tags found
1 merge request!375WS-541: Production HTCondor submit host configuration file
Pipeline #2324 passed
......@@ -180,7 +180,7 @@ e2e:
variables:
ENV_HOST: workflow
before_script:
- docker build -t base-build:ci --target base-build -f apps/web/Dockerfile.dev .
- docker build -t base-build:ci --target base-build -f apps/web/Dockerfile --build-arg env=dev .
- docker build -t e2e:${CI_COMMIT_SHORT_SHA} -f apps/web/Dockerfile.ci .
script:
# setting env variables with .env https://docs.docker.com/compose/environment-variables/
......
......@@ -7,7 +7,7 @@ all: dev check-build
# Check if local code will pass CI build
check-build: docker-base docker-dev-images-locally test-dev
# Run tests on Dockerfile.dev images
# Run tests on Dockerfile images
test-dev:
docker run nrao:workflow ./bin/run-tests.sh
docker run nrao:capability ./bin/run-tests.sh
......@@ -32,7 +32,7 @@ alembic-update:
cd schema; \
env CAPO_PROFILE=local alembic upgrade head
# Build images from Dockerfile.dev
# Build images from Dockerfile
docker-dev-images-locally:
docker build -t nrao:workflow -f services/workflow/Dockerfile.local . --build-arg capo_env=docker
docker build -t nrao:capability -f services/capability/Dockerfile.local . --build-arg capo_env=docker
......
FROM ssa-containers.aoc.nrao.edu/ops/base:nodejs-14 as base-build
# Requies build-arg $env
# Build arg that sets environment; sets to "dev" if no build arg is given
ARG env=dev
ENV ENV=${env}
# Switch to vlapipe
USER vlapipe
......@@ -37,7 +42,7 @@ USER vlapipe
COPY --chown=vlapipe:vlapipe ./apps/web ./
# Build the angular app
RUN ./node_modules/.bin/ng build --configuration=dev --output-path=dist
RUN ./node_modules/.bin/ng build --configuration=${ENV} --output-path=dist
#
## NGINX section of multi-stage image
......
# base-build:ci references the first stage in app/web/Dockerfile.dev
# base-build:ci references the first stage in app/web/Dockerfile
# in which npm install has already been ran and app/web/ has been
# copied to /app in the image
# For e2e testing, we want to use this first stage as the base for our
# e2e container when we run e2e tests in the CI. We'll copy /app/ from
# e2e container when we run e2e tests in the CI. We'll copy /app/ from
# base-build:ci and copy it to /app of the trion/ng-cli-karma:11.2.7 image.
# Then we are able to run `ng e2e` with our Angular environment already setup.
# https://hub.docker.com/r/trion/ng-cli-karma/
......@@ -17,4 +17,3 @@ WORKDIR /app
COPY --from=web-base /home/vlapipe/app/ ./
CMD ./node_modules/protractor/bin/webdriver-manager update --versions.chrome 89.0.4389.114 && ng e2e --configuration=ci --webdriver-update=false
......@@ -36,7 +36,7 @@
"scripts": []
},
"configurations": {
"production": {
"prod": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
......@@ -183,6 +183,9 @@
},
"test": {
"baseUrl": "https://ws-test.nrao.edu"
},
"prod": {
"baseUrl": "https://ws.nrao.edu"
}
}
},
......
export const environment = {
production: true,
// archive search services
apiUrl: 'https://webtest.aoc.nrao.edu/archive-service/',
apiUrl: "https://data.nrao.edu/archive-service/",
// workspace services
workspacesUrl: 'http://localhost:3457/'
workspacesUrl: "http://ws.nrao.edu/",
};
# CI Build Template
.build:
variables:
CAPO_BUILD_ARG: "docker"
script:
- echo "Building branch or tag -- ${IMAGE_TAG}"
- NAME="${REGISTRY_URL}/${PROJECT_NAME}/${SERVICE_NAME}"
- docker build -t ${NAME}:${CI_COMMIT_SHORT_SHA} -f ${PATH_PREFIX}${SERVICE_NAME}/Dockerfile.dev . --build-arg capo_env=${CAPO_BUILD_ARG} --build-arg TAGNAME=${CI_COMMIT_SHORT_SHA}
- docker build -t ${NAME}:${CI_COMMIT_SHORT_SHA} -f ${PATH_PREFIX}${SERVICE_NAME}/Dockerfile . --build-arg env=${DEPLOY_ENV} --build-arg TAGNAME=${CI_COMMIT_SHORT_SHA}
- docker tag ${NAME}:${CI_COMMIT_SHORT_SHA} ${NAME}:${IMAGE_TAG}
- echo "TAG=${IMAGE_TAG}" >> build.env
artifacts:
......@@ -15,9 +13,12 @@
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
variables:
IMAGE_TAG: $CI_COMMIT_BRANCH
DEPLOY_ENV: "dev"
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
variables:
IMAGE_TAG: $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME
DEPLOY_ENV: "dev"
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_TAG =~ /^end-of-sprint-[0-9]+/'
variables:
IMAGE_TAG: $CI_COMMIT_TAG
......@@ -27,4 +28,4 @@
variables:
IMAGE_TAG: $CI_COMMIT_TAG
# override DEPLOY_ENV
DEPLOY_ENV: "prod"
\ No newline at end of file
DEPLOY_ENV: "prod"
CONDOR_HOST = nmpost-cm.aoc.nrao.edu
use ROLE : Submit
ALLOW_WRITE = *.aoc.nrao.edu
ALLOW_DAEMON = $(ALLOW_WRITE)
# one or more submit hosts has an external IP
PRIVATE_NETWORK_NAME = nrao.edu
# while not in production yet
CONDOR_ADMIN = krowe@nrao.edu
# send email if job errors
JOB_DEFAULT_NOTIFICATION = ERROR
# Differentiate from other pools if needed
PoolName = "nmpost"
# Set UID domain
UID_DOMAIN = aoc.nrao.edu
......@@ -20,8 +20,8 @@ ENV PATH "${PATH}:/home/vlapipe/.local/bin"
RUN python setup.py develop --user
# Set Capo
ARG capo_env=dsoc-dev
ENV CAPO_PROFILE $capo_env
# Set Capo for build stage
# Gets reset to proper environment's profile in the deploy stage
ENV CAPO_PROFILE docker
CMD ["pserve", "--reload", "development.ini"]
......@@ -20,8 +20,8 @@ ENV PATH "${PATH}:/home/vlapipe/.local/bin"
RUN python setup.py develop --user
# Set Capo
ARG capo_env=dsoc-dev
ENV CAPO_PROFILE $capo_env
# Set Capo for build stage
# Gets reset to proper environment's profile in the deploy stage
ENV CAPO_PROFILE docker
CMD ["pserve", "--reload", "development.ini"]
......@@ -2,6 +2,10 @@
ARG TAGNAME="tmp"
FROM cache:${TAGNAME}
# Build arg that sets environment; sets to "dev" if no build arg is given
ARG env=dev
ENV ENV=${env}
USER root
# HTCondor install
......@@ -14,7 +18,7 @@ RUN sudo apt install -y htcondor
# HTCondor setup
# Copy over HTCondor submit node config
COPY ./config/htcondor/submit/99-workspaces-submit.dev.conf /etc/condor/config.d/99-workspaces-submit.dev.conf
COPY ./config/htcondor/submit/99-workspaces-submit.${ENV}.conf /etc/condor/config.d/99-workspaces-submit.${ENV}.conf
# Change working directory to /code
WORKDIR /code
......@@ -34,10 +38,9 @@ ENV PATH "${PATH}:/home/vlapipe/.local/bin"
RUN python setup.py develop --user
# Set Capo
ARG capo_env=dsoc-dev
ENV CAPO_PROFILE $capo_env
ENV PATH $PATH:/lustre/aoc/pipeline/$CAPO_PROFILE/workflow
# Set Capo for build stage
# Gets reset to proper environment's profile in the deploy stage
ENV CAPO_PROFILE docker
USER root
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment