updated app-config configuration and naming

This commit is contained in:
Luis Aleixo 2023-03-23 14:39:53 +01:00
parent 8a72d27fb1
commit 43a37bfac1
6 changed files with 32 additions and 32 deletions

View file

@ -124,12 +124,12 @@ auth-service-image_builder:
DOCKER_CONTEXT_DIRECTORY: app-config/auth-service DOCKER_CONTEXT_DIRECTORY: app-config/auth-service
caimira-webservice-image_builder: calculator-app-image_builder:
extends: extends:
- .image_builder - .image_builder
variables: variables:
IMAGE_NAME: caimira-webservice IMAGE_NAME: calculator-app
DOCKERFILE_DIRECTORY: app-config/caimira-webservice DOCKERFILE_DIRECTORY: app-config/calculator-app
DOCKER_CONTEXT_DIRECTORY: "" DOCKER_CONTEXT_DIRECTORY: ""
@ -159,11 +159,11 @@ link_auth-service_with_gitlab_registry:
variables: variables:
IMAGE_NAME: auth-service IMAGE_NAME: auth-service
link_caimira-webservice_with_gitlab_registry: link_calculator-app_with_gitlab_registry:
extends: extends:
- .link_docker_images_with_gitlab_registry - .link_docker_images_with_gitlab_registry
variables: variables:
IMAGE_NAME: caimira-webservice IMAGE_NAME: calculator-app
link_calculator_with_gitlab_registry: link_calculator_with_gitlab_registry:
extends: extends:

View file

@ -153,7 +153,7 @@ pytest ./caimira
``` ```
s2i build file://$(pwd) --copy --keep-symlinks --context-dir ./app-config/nginx/ centos/nginx-112-centos7 caimira-nginx-app s2i build file://$(pwd) --copy --keep-symlinks --context-dir ./app-config/nginx/ centos/nginx-112-centos7 caimira-nginx-app
docker build . -f ./app-config/caimira-webservice/Dockerfile -t caimira-webservice docker build . -f ./app-config/calculator-app/Dockerfile -t calculator-app
docker build ./app-config/auth-service -t auth-service docker build ./app-config/auth-service -t auth-service
``` ```

View file

@ -3,7 +3,7 @@ FROM registry.cern.ch/docker.io/condaforge/mambaforge as conda
RUN mamba create --yes -p /opt/app python=3.9 RUN mamba create --yes -p /opt/app python=3.9
COPY . /opt/app-source COPY . /opt/app-source
RUN cd /opt/app-source && conda run -p /opt/app python -m pip install -r ./requirements.txt .[app] RUN cd /opt/app-source && conda run -p /opt/app python -m pip install -r ./requirements.txt .[app]
COPY app-config/caimira-webservice/app.sh /opt/app/bin/caimira-app.sh COPY app-config/calculator-app/app.sh /opt/app/bin/calculator-app.sh
RUN cd /opt/app \ RUN cd /opt/app \
&& find -name '*.a' -delete \ && find -name '*.a' -delete \
&& rm -rf /opt/app/conda-meta \ && rm -rf /opt/app/conda-meta \
@ -32,5 +32,5 @@ WORKDIR /scratch
RUN CAIMIRA_INIT_FILE=$(/opt/app/bin/python -c "import caimira; print(caimira.__file__)") \ RUN CAIMIRA_INIT_FILE=$(/opt/app/bin/python -c "import caimira; print(caimira.__file__)") \
&& ln -s $(dirname ${CAIMIRA_INIT_FILE}) /scratch/caimira && ln -s $(dirname ${CAIMIRA_INIT_FILE}) /scratch/caimira
CMD [ \ CMD [ \
"caimira-app.sh" \ "calculator-app.sh" \
] ]

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
if [[ "$APP_NAME" == "caimira-webservice" ]]; then if [[ "$APP_NAME" == "calculator-app" ]]; then
args=("$@") args=("$@")
if [ "$DEBUG" != "true" ] && [[ ! "${args[@]}" =~ "--no-debug" ]]; then if [ "$DEBUG" != "true" ] && [[ ! "${args[@]}" =~ "--no-debug" ]]; then
args+=("--no-debug") args+=("--no-debug")

View file

@ -1,32 +1,32 @@
version: "3.8" version: "3.8"
services: services:
caimira-app: expert-app:
image: caimira-webservice image: calculator-app
environment: environment:
- APP_NAME=caimira-voila - APP_NAME=caimira-voila
user: ${CURRENT_UID:?"Please run as follows 'CURRENT_UID=$(id -u):$(id -g) docker-compose up'"} user: ${CURRENT_UID:?"Please run as follows 'CURRENT_UID=$(id -u):$(id -g) docker-compose up'"}
caimira-co2-app: expert-co2-app:
image: caimira-webservice image: calculator-app
environment: environment:
- APP_NAME=caimira-co2-voila - APP_NAME=caimira-co2-voila
user: ${CURRENT_UID:?"Please run as follows 'CURRENT_UID=$(id -u):$(id -g) docker-compose up'"} user: ${CURRENT_UID:?"Please run as follows 'CURRENT_UID=$(id -u):$(id -g) docker-compose up'"}
caimira-webservice: calculator-app:
image: caimira-webservice image: calculator-app
environment: environment:
- COOKIE_SECRET - COOKIE_SECRET
- APP_NAME=caimira-webservice - APP_NAME=calculator-app
- APPLICATION_ROOT=/ - APPLICATION_ROOT=/
- CAIMIRA_CALCULATOR_PREFIX=/calculator-cern - CAIMIRA_CALCULATOR_PREFIX=/calculator-cern
- CAIMIRA_THEME=caimira/apps/templates/cern - CAIMIRA_THEME=caimira/apps/templates/cern
user: ${CURRENT_UID} user: ${CURRENT_UID}
caimira-calculator-open: calculator-open-app:
image: caimira-webservice image: calculator-app
environment: environment:
- COOKIE_SECRET - COOKIE_SECRET
- APP_NAME=caimira-webservice - APP_NAME=calculator-app
- APPLICATION_ROOT=/ - APPLICATION_ROOT=/
- CAIMIRA_CALCULATOR_PREFIX=/calculator-open - CAIMIRA_CALCULATOR_PREFIX=/calculator-open
user: ${CURRENT_UID} user: ${CURRENT_UID}
@ -46,13 +46,13 @@ services:
ports: ports:
- "8080:8080" - "8080:8080"
depends_on: depends_on:
caimira-webservice: calculator-app:
condition: service_started condition: service_started
caimira-calculator-open: calculator-open-app:
condition: service_started condition: service_started
caimira-app: expert-app:
condition: service_started condition: service_started
caimira-co2-app: expert-co2-app:
condition: service_started condition: service_started
auth-service: auth-service:
condition: service_started condition: service_started

View file

@ -70,7 +70,7 @@ http {
# Pass the request on to the webservice. Most likely the URI won't # Pass the request on to the webservice. Most likely the URI won't
# exist so we get a 404 from that service instead (good as the 404 # exist so we get a 404 from that service instead (good as the 404
# pages are consistent). # pages are consistent).
proxy_pass http://caimira-webservice:8080/$request_uri; proxy_pass http://calculator-app:8080/$request_uri;
} }
location /voila-server/ { location /voila-server/ {
@ -81,9 +81,9 @@ http {
error_page 401 = @error401; error_page 401 = @error401;
error_page 404 = @proxy_404_error_handler; error_page 404 = @proxy_404_error_handler;
# caimira-app is the name of the voila server in each of docker-compose, # expert-app is the name of the voila server in each of docker-compose,
# caimira-test.web.cern.ch and caimira.web.cern.ch. # caimira-test.web.cern.ch and caimira.web.cern.ch.
proxy_pass http://caimira-app:8080/voila-server/; proxy_pass http://expert-app:8080/voila-server/;
} }
rewrite ^/expert-app$ /voila-server/voila/render/caimira.ipynb last; rewrite ^/expert-app$ /voila-server/voila/render/caimira.ipynb last;
rewrite ^/(files/static)/(.*)$ /voila-server/voila/$1/$2 last; rewrite ^/(files/static)/(.*)$ /voila-server/voila/$1/$2 last;
@ -101,9 +101,9 @@ http {
error_page 401 = @error401; error_page 401 = @error401;
error_page 404 = @proxy_404_error_handler; error_page 404 = @proxy_404_error_handler;
# caimira-co2-app is the name of the voila server in each of docker-compose, # expert-co2-app is the name of the voila server in each of docker-compose,
# caimira-test.web.cern.ch and caimira.web.cern.ch. # caimira-test.web.cern.ch and caimira.web.cern.ch.
proxy_pass http://caimira-co2-app:8080/co2-voila-server/; proxy_pass http://expert-co2-app:8080/co2-voila-server/;
} }
rewrite ^/co2-app$ /co2-voila-server/voila/render/caimira.ipynb last; rewrite ^/co2-app$ /co2-voila-server/voila/render/caimira.ipynb last;
rewrite ^/(files/static)/(.*)$ /co2-voila-server/voila/$1/$2 last; rewrite ^/(files/static)/(.*)$ /co2-voila-server/voila/$1/$2 last;
@ -114,7 +114,7 @@ http {
location / { location / {
# By default we have no authentication. # By default we have no authentication.
proxy_pass http://caimira-webservice:8080; proxy_pass http://calculator-app:8080;
} }
location /calculator { location /calculator {
@ -126,14 +126,14 @@ http {
auth_request /auth/probe; auth_request /auth/probe;
error_page 401 = @error401; error_page 401 = @error401;
# caimira-webservice is the name of the tornado server (for the calculator) # calculator-app is the name of the tornado server (for the calculator)
# in each of docker-compose, caimira-test.web.cern.ch and caimira.web.cern.ch. # in each of docker-compose, caimira-test.web.cern.ch and caimira.web.cern.ch.
proxy_pass http://caimira-webservice:8080/calculator-cern; proxy_pass http://calculator-app:8080/calculator-cern;
} }
location /calculator-open { location /calculator-open {
# Public open calculator # Public open calculator
proxy_pass http://caimira-calculator-open:8080/calculator-open; proxy_pass http://calculator-open-app:8080/calculator-open;
} }
} }
} }