removed deployment related configuration on expert apps

This commit is contained in:
lrdossan 2024-06-24 17:23:58 +02:00
parent 4bed754f21
commit 16a417a817
10 changed files with 1 additions and 247 deletions

View file

@ -14,8 +14,6 @@ COPY ./app-config/caimira-public-docker-image/run_caimira.sh /opt/caimira/start.
# To ensure that we have installed the full requirements, re-run the pip install.
# In the best case this will be a no-op.
RUN cd /opt/caimira/src/ && /opt/caimira/app/bin/pip install -r /opt/caimira/src/requirements.txt
RUN /opt/caimira/app/bin/jupyter trust /opt/caimira/src/caimira/apps/expert/*.ipynb
RUN /opt/caimira/app/bin/jupyter trust /opt/caimira/src/caimira/apps/expert_co2/*.ipynb
COPY ./app-config/caimira-public-docker-image/nginx.conf /opt/caimira/nginx.conf
EXPOSE 8080

View file

@ -44,18 +44,6 @@ http {
large_client_header_buffers 4 16k;
location /voila-server/ {
proxy_pass http://localhost:8082/voila-server/;
}
rewrite ^/expert-app$ /voila-server/ last;
rewrite ^/(files/static)/(.*)$ /voila-server/voila/$1/$2 last;
location /co2-voila-server/ {
proxy_pass http://localhost:8083/co2-voila-server/;
}
rewrite ^/co2-app$ /voila-server/ last;
rewrite ^/(files/static)/(.*)$ /voila-server/voila/$1/$2 last;
location / {
proxy_pass http://localhost:8081;
}

View file

@ -5,17 +5,5 @@ echo 'Please see https://gitlab.cern.ch/caimira/caimira for terms of use.'
# Run a proxy for the apps (listening on 8080).
nginx -c /opt/caimira/nginx.conf
# Run the expert app in the background.
cd /opt/caimira/src/caimira
/opt/caimira/app/bin/python -m voila /opt/caimira/src/caimira/apps/expert/caimira.ipynb \
--port=8082 --no-browser --base_url=/voila-server/ \
--Voila.tornado_settings 'allow_origin=*' \
>> /var/log/expert-app.log 2>&1 &
/opt/caimira/app/bin/python -m voila /opt/caimira/src/caimira/apps/expert_co2/caimira.ipynb \
--port=8083 --no-browser --base_url=/co2-voila-server/ \
--Voila.tornado_settings 'allow_origin=*' \
>> /var/log/co2-app.log 2>&1 &
# Run the calculator in the foreground.
/opt/caimira/app/bin/python -m caimira.apps.calculator --port 8081 --no-debug

View file

@ -28,12 +28,7 @@ if [[ "$APP_NAME" == "calculator-app" ]]; then
echo "Starting the caimira webservice with: python -m caimira.apps.calculator ${args[@]}"
python -m caimira.apps.calculator "${args[@]}"
elif [[ "$APP_NAME" == "caimira-voila" ]]; then
echo "Starting the voila service"
voila caimira/apps/expert/ --port=8080 --no-browser --base_url=/voila-server/ --tornado_settings 'allow_origin=*'
elif [[ "$APP_NAME" == "caimira-co2-voila" ]]; then
echo "Starting the CO2 voila service"
voila caimira/apps/expert_co2/ --port=8080 --no-browser --base_url=/co2-voila-server/ --tornado_settings 'allow_origin=*'
else
echo "No APP_NAME specified"
exit 1

View file

@ -1,16 +1,5 @@
version: "3.8"
services:
expert-app:
image: calculator-app
environment:
- APP_NAME=caimira-voila
user: ${CURRENT_UID:?"Please run as follows 'CURRENT_UID=$(id -u):$(id -g) docker-compose up'"}
expert-co2-app:
image: calculator-app
environment:
- APP_NAME=caimira-co2-voila
user: ${CURRENT_UID:?"Please run as follows 'CURRENT_UID=$(id -u):$(id -g) docker-compose up'"}
calculator-app:
image: calculator-app
@ -54,10 +43,6 @@ services:
condition: service_started
calculator-open-app:
condition: service_started
expert-app:
condition: service_started
expert-co2-app:
condition: service_started
auth-service:
condition: service_started
user: ${CURRENT_UID}

View file

@ -73,45 +73,6 @@ http {
proxy_pass http://calculator-app:8080/$request_uri;
}
location /voila-server/ {
proxy_intercept_errors on;
# Anything under voila-server or expert-app is authenticated.
auth_request /auth/probe;
error_page 401 = @error401;
error_page 404 = @proxy_404_error_handler;
# expert-app is the name of the voila server in each of docker-compose,
# caimira-test.web.cern.ch and caimira.web.cern.ch.
proxy_pass http://expert-app:8080/voila-server/;
}
rewrite ^/expert-app$ /voila-server/voila/render/caimira.ipynb last;
rewrite ^/(files/static)/(.*)$ /voila-server/voila/$1/$2 last;
# Before implementing the nginx router we could access /voila/render/caimira.ipynb.
# Redirect this (and all other) URLs to the new scheme.
absolute_redirect off;
rewrite ^/voila/(.*)$ /voila-server/voila/$1 redirect;
location /co2-voila-server/ {
proxy_intercept_errors on;
# Anything under voila-server or co2-app is authenticated.
auth_request /auth/probe;
error_page 401 = @error401;
error_page 404 = @proxy_404_error_handler;
# 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.
proxy_pass http://expert-co2-app:8080/co2-voila-server/;
}
rewrite ^/co2-app$ /co2-voila-server/voila/render/caimira.ipynb last;
rewrite ^/(files/static)/(.*)$ /co2-voila-server/voila/$1/$2 last;
# Before implementing the nginx router we could access /voila/render/caimira.ipynb.
# Redirect this (and all other) URLs to the new scheme.
rewrite ^/voila/(.*)$ /co2-voila-server/voila/$1 redirect;
location / {
# By default we have no authentication.
proxy_pass http://calculator-app:8080;

View file

@ -68,120 +68,6 @@
kind: ImageStreamTag
name: 'auth-service:latest'
namespace: ${PROJECT_NAME}
-
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
name: expert-app
labels: {app: expert-app}
spec:
replicas: 1
template:
metadata:
labels:
app: expert-app
spec:
containers:
- name: calculator-app
env:
- name: APP_NAME
value: caimira-voila
image: '${PROJECT_NAME}/calculator-app'
ports:
- containerPort: 8080
protocol: TCP
imagePullPolicy: Always
resources:
limits: { cpu: '1', memory: 1Gi }
requests: { cpu: 1m, memory: 512Mi }
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: { }
terminationGracePeriodSeconds: 30
strategy:
activeDeadlineSeconds: 21600
resources: { }
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
test: false
selector:
app: expert-app
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- calculator-app
from:
kind: ImageStreamTag
name: 'calculator-app:latest'
namespace: ${PROJECT_NAME}
-
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
name: expert-co2-app
labels: {app: expert-co2-app}
spec:
replicas: 1
template:
metadata:
labels:
app: expert-co2-app
spec:
containers:
- name: calculator-app
env:
- name: APP_NAME
value: caimira-co2-voila
image: '${PROJECT_NAME}/calculator-app'
ports:
- containerPort: 8080
protocol: TCP
imagePullPolicy: Always
resources:
limits: { cpu: '1', memory: 1Gi }
requests: { cpu: 1m, memory: 512Mi }
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: { }
terminationGracePeriodSeconds: 30
strategy:
activeDeadlineSeconds: 21600
resources: { }
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
test: false
selector:
app: expert-co2-app
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- calculator-app
from:
kind: ImageStreamTag
name: 'calculator-app:latest'
namespace: ${PROJECT_NAME}
-
apiVersion: apps.openshift.io/v1
kind: DeploymentConfig

View file

@ -27,40 +27,6 @@
deploymentconfig: auth-service
sessionAffinity: 'None'
type: 'ClusterIP'
-
apiVersion: v1
kind: Service
metadata:
labels:
app: expert-app
name: expert-app
spec:
ports:
- name: 8080-tcp
port: 8080
protocol: TCP
targetPort: 8080
selector:
deploymentconfig: expert-app
sessionAffinity: 'None'
type: 'ClusterIP'
-
apiVersion: v1
kind: Service
metadata:
labels:
app: expert-co2-app
name: expert-co2-app
spec:
ports:
- name: 8080-tcp
port: 8080
protocol: TCP
targetPort: 8080
selector:
deploymentconfig: expert-co2-app
sessionAffinity: 'None'
type: 'ClusterIP'
-
apiVersion: v1
kind: Service

View file

@ -49,16 +49,6 @@ json5==0.9.14
jsonpointer==2.4
jsonschema==4.21.1
jsonschema-specifications==2023.12.1
jupyter_client==8.6.0
jupyter_core==5.7.1
jupyter-events==0.9.0
jupyter-lsp==2.2.2
jupyter_server==2.12.5
jupyter_server_terminals==0.5.2
jupyterlab==4.1.1
jupyterlab_pygments==0.3.0
jupyterlab_server==2.25.3
jupyterlab-widgets==1.1.7
kiwisolver==1.4.5
loky==3.4.1
MarkupSafe==2.1.5
@ -124,7 +114,6 @@ typing_extensions==4.9.0
tzdata==2024.1
uri-template==1.3.0
urllib3==2.2.0
voila==0.5.5
wcwidth==0.2.13
webcolors==1.13
webencodings==0.5.1

View file

@ -40,7 +40,6 @@ REQUIREMENTS: dict = {
'timezonefinder',
'tornado',
'types-retry',
'voila',
],
'app': [],
'test': [
@ -54,7 +53,6 @@ REQUIREMENTS: dict = {
'types-requests',
],
'dev': [
'jupyterlab',
],
'doc': [
'sphinx',