Create a Python3.9 based Dockerfile for cara to run on openshift.
This commit is contained in:
parent
234ca99d28
commit
3103663978
7 changed files with 99 additions and 55 deletions
|
|
@ -2,4 +2,5 @@ venv
|
|||
env*
|
||||
prototypes
|
||||
support
|
||||
Dockerfile
|
||||
Dockerfile
|
||||
_*
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ include:
|
|||
|
||||
variables:
|
||||
project_name: cara
|
||||
PY_VERSION: "3.6" # This is what we have running in OpenShift currently.
|
||||
PY_VERSION: "3.9" # This is what we have running in OpenShift currently.
|
||||
|
||||
|
||||
# A full installation of CARA, tested with pytest.
|
||||
|
|
@ -84,7 +84,7 @@ test_dev-39:
|
|||
DOCKER_TOKEN: "${OPENSHIFT_DOCKER_TOKEN_PROD}"
|
||||
script:
|
||||
- echo "{\"auths\":{\"$DOCKER_REGISTRY\":{\"auth\":\"$DOCKER_TOKEN\"}}}" > /kaniko/.docker/config.json
|
||||
- /kaniko/executor --context $CI_PROJECT_DIR/$DOCKERFILE_DIRECTORY --dockerfile $CI_PROJECT_DIR/$DOCKERFILE_DIRECTORY/Dockerfile --destination $DOCKER_REGISTRY/$IMAGE_NAME:latest
|
||||
- /kaniko/executor --context $CI_PROJECT_DIR/$DOCKER_CONTEXT_DIRECTORY --dockerfile $CI_PROJECT_DIR/$DOCKERFILE_DIRECTORY/Dockerfile --destination $DOCKER_REGISTRY/$IMAGE_NAME:latest
|
||||
|
||||
|
||||
auth-service-image_builder:
|
||||
|
|
@ -93,6 +93,16 @@ auth-service-image_builder:
|
|||
variables:
|
||||
IMAGE_NAME: auth-service
|
||||
DOCKERFILE_DIRECTORY: app-config/auth-service
|
||||
DOCKER_CONTEXT_DIRECTORY: app-config/auth-service
|
||||
|
||||
|
||||
cara-webservice-image_builder:
|
||||
extends:
|
||||
- .image_builder
|
||||
variables:
|
||||
IMAGE_NAME: cara-webservice
|
||||
DOCKERFILE_DIRECTORY: app-config/cara-webservice
|
||||
DOCKER_CONTEXT_DIRECTORY: ""
|
||||
|
||||
|
||||
trigger_build_on_openshift:
|
||||
|
|
@ -101,7 +111,6 @@ trigger_build_on_openshift:
|
|||
- if: '$OPENSHIFT_BUILD_WEBHOOK_SECRET'
|
||||
script:
|
||||
- curl -X POST -k https://openshift.cern.ch:443/apis/build.openshift.io/v1/namespaces/cara/buildconfigs/cara-router/webhooks/${OPENSHIFT_BUILD_WEBHOOK_SECRET}/generic
|
||||
- curl -X POST -k https://openshift.cern.ch:443/apis/build.openshift.io/v1/namespaces/cara/buildconfigs/cara-webservice/webhooks/${OPENSHIFT_BUILD_WEBHOOK_SECRET}/generic
|
||||
|
||||
|
||||
deploy_to_test:
|
||||
|
|
@ -110,7 +119,6 @@ deploy_to_test:
|
|||
- if: '$CI_COMMIT_BRANCH == "live/test-cara" && $OPENSHIFT_TEST_BUILD_WEBHOOK_SECRET'
|
||||
script:
|
||||
- curl -X POST -k https://openshift-dev.cern.ch:443/apis/build.openshift.io/v1/namespaces/test-cara/buildconfigs/cara-router/webhooks/${OPENSHIFT_TEST_BUILD_WEBHOOK_SECRET}/generic
|
||||
- curl -X POST -k https://openshift-dev.cern.ch:443/apis/build.openshift.io/v1/namespaces/test-cara/buildconfigs/cara-webservice/webhooks/${OPENSHIFT_TEST_BUILD_WEBHOOK_SECRET}/generic
|
||||
|
||||
|
||||
oci_calculator:
|
||||
|
|
|
|||
27
app-config/cara-webservice/Dockerfile
Normal file
27
app-config/cara-webservice/Dockerfile
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
FROM condaforge/mambaforge as conda
|
||||
|
||||
RUN mamba create --yes -p /opt/app python=3.9
|
||||
COPY . /opt/app-source
|
||||
RUN cd /opt/app-source && conda run -p /opt/app python -m pip install -r ./requirements.txt .[app]
|
||||
COPY app-config/cara-webservice/app.sh /opt/app/bin/cara-app.sh
|
||||
RUN cd /opt/app \
|
||||
&& find -name '*.a' -delete \
|
||||
&& rm -rf /opt/app/conda-meta \
|
||||
&& rm -rf /opt/app/include \
|
||||
&& find -name '__pycache__' -type d -exec rm -rf '{}' '+' \
|
||||
&& rm -rf /opt/app/lib/python*/site-packages/pip /opt/app/lib/python*/idlelib /opt/app/lib/python*/ensurepip \
|
||||
/opt/app/bin/x86_64-conda-linux-gnu-ld \
|
||||
/opt/app/bin/sqlite3 \
|
||||
/opt/app/bin/openssl \
|
||||
/opt/app/share/terminfo \
|
||||
&& find /opt/app/lib/ -name 'tests' -type d -exec rm -rf '{}' '+' \
|
||||
&& find /opt/app/lib -name '*.pyx' -delete \
|
||||
;
|
||||
|
||||
FROM debian
|
||||
|
||||
COPY --from=conda /opt/app /opt/app
|
||||
ENV PATH=/opt/app/bin/:$PATH
|
||||
CMD [ \
|
||||
"cara-app.sh" \
|
||||
]
|
||||
|
|
@ -19,5 +19,8 @@ if [[ "$APP_NAME" == "cara-webservice" ]]; then
|
|||
elif [[ "$APP_NAME" == "cara-voila" ]]; then
|
||||
echo "Starting the voila service"
|
||||
voila app/ --port=8080 --no-browser --base_url=/voila-server/ --Voila.tornado_settings="{'allow_origin': '*'}"
|
||||
else
|
||||
echo "No APP_NAME specified"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
@ -201,7 +201,7 @@
|
|||
- name: CARA_CALCULATOR_PREFIX
|
||||
value: /calculator-cern
|
||||
- name: CARA_THEME
|
||||
value: cara/apps/calculator/themes/cern
|
||||
value: /opt/app/lib/python3.9/site-packages/cara/apps/calculator/themes/cern
|
||||
image: '${PROJECT_NAME}/cara-webservice'
|
||||
ports:
|
||||
- containerPort: 8080
|
||||
|
|
|
|||
101
requirements.txt
101
requirements.txt
|
|
@ -1,80 +1,85 @@
|
|||
# Created by installing the cara[app] extra and running:
|
||||
# echo '.[app]' > requirements.txt
|
||||
# pip freeze | grep -v cara >> requirements.txt
|
||||
# echo '.[app]' > requirements.txt
|
||||
# pip list --format freeze | grep -vi cara | grep -v pip | grep -v setuptools >> requirements.txt
|
||||
|
||||
.[app]
|
||||
anyio==2.1.0
|
||||
appnope==0.1.2
|
||||
anyio==3.3.0
|
||||
argon2-cffi==20.1.0
|
||||
async-generator==1.10
|
||||
attrs==20.3.0
|
||||
attrs==21.2.0
|
||||
backcall==0.2.0
|
||||
bleach==3.3.0
|
||||
certifi==2020.12.5
|
||||
cffi==1.14.5
|
||||
contextvars==2.4
|
||||
bleach==3.3.1
|
||||
certifi==2021.5.30
|
||||
cffi==1.14.6
|
||||
charset-normalizer==2.0.3
|
||||
cloudpickle==1.6.0
|
||||
cycler==0.10.0
|
||||
dataclasses==0.8
|
||||
decorator==4.4.2
|
||||
defusedxml==0.6.0
|
||||
debugpy==1.4.1
|
||||
decorator==5.0.9
|
||||
defusedxml==0.7.1
|
||||
entrypoints==0.3
|
||||
idna==3.1
|
||||
immutables==0.15
|
||||
importlib-metadata==3.5.0
|
||||
ipykernel==5.5.0
|
||||
ipympl==0.6.3
|
||||
ipython==7.16.1
|
||||
idna==3.2
|
||||
ipykernel==6.0.3
|
||||
ipympl==0.7.0
|
||||
ipython==7.25.0
|
||||
ipython-genutils==0.2.0
|
||||
ipywidgets==7.6.3
|
||||
jedi==0.18.0
|
||||
Jinja2==2.11.3
|
||||
Jinja2==3.0.1
|
||||
joblib==1.0.1
|
||||
jsonschema==3.2.0
|
||||
jupyter-client==6.1.11
|
||||
jupyter-client==6.1.12
|
||||
jupyter-core==4.7.1
|
||||
jupyter-server==1.4.1
|
||||
jupyter-server==1.10.1
|
||||
jupyterlab-pygments==0.1.2
|
||||
jupyterlab-widgets==1.0.0
|
||||
kiwisolver==1.3.1
|
||||
loky==2.9.0
|
||||
MarkupSafe==1.1.1
|
||||
matplotlib==3.3.4
|
||||
MarkupSafe==2.0.1
|
||||
matplotlib==3.4.2
|
||||
matplotlib-inline==0.1.2
|
||||
memoization==0.3.2
|
||||
mistune==0.8.4
|
||||
nbclient==0.5.2
|
||||
nbconvert==6.0.7
|
||||
nbformat==5.1.2
|
||||
nbclient==0.5.3
|
||||
nbconvert==6.1.0
|
||||
nbformat==5.1.3
|
||||
nest-asyncio==1.5.1
|
||||
notebook==6.2.0
|
||||
numpy==1.19.5
|
||||
packaging==20.9
|
||||
notebook==6.4.0
|
||||
numpy==1.21.1
|
||||
packaging==21.0
|
||||
pandocfilters==1.4.3
|
||||
parso==0.8.1
|
||||
parso==0.8.2
|
||||
pexpect==4.8.0
|
||||
pickleshare==0.7.5
|
||||
Pillow==8.1.0
|
||||
prometheus-client==0.9.0
|
||||
prompt-toolkit==3.0.16
|
||||
Pillow==8.3.1
|
||||
prometheus-client==0.11.0
|
||||
prompt-toolkit==3.0.19
|
||||
psutil==5.8.0
|
||||
ptyprocess==0.7.0
|
||||
pycparser==2.20
|
||||
Pygments==2.8.0
|
||||
Pygments==2.9.0
|
||||
pyparsing==2.4.7
|
||||
pyrsistent==0.17.3
|
||||
python-dateutil==2.8.1
|
||||
pyzmq==22.0.3
|
||||
qrcode==6.1
|
||||
scipy==1.5.4
|
||||
scikit_learn==0.23.1
|
||||
Send2Trash==1.5.0
|
||||
six==1.15.0
|
||||
pyrsistent==0.18.0
|
||||
python-dateutil==2.8.2
|
||||
pyzmq==22.1.0
|
||||
qrcode==7.2
|
||||
requests==2.26.0
|
||||
requests-unixsocket==0.2.0
|
||||
scikit-learn==0.24.2
|
||||
scipy==1.7.0
|
||||
Send2Trash==1.7.1
|
||||
six==1.16.0
|
||||
sklearn==0.0
|
||||
sniffio==1.2.0
|
||||
terminado==0.9.2
|
||||
testpath==0.4.4
|
||||
terminado==0.10.1
|
||||
testpath==0.5.0
|
||||
threadpoolctl==2.2.0
|
||||
tornado==6.1
|
||||
traitlets==4.3.3
|
||||
typing-extensions==3.7.4.3
|
||||
voila==0.2.7
|
||||
traitlets==5.0.5
|
||||
urllib3==1.26.6
|
||||
voila==0.2.10
|
||||
wcwidth==0.2.5
|
||||
webencodings==0.5.1
|
||||
websocket-client==1.1.0
|
||||
wheel==0.36.2
|
||||
widgetsnbextension==3.5.1
|
||||
zipp==3.4.0
|
||||
|
|
|
|||
2
setup.py
2
setup.py
|
|
@ -61,7 +61,7 @@ setup(
|
|||
url='cern.ch/cara',
|
||||
|
||||
packages=find_packages(),
|
||||
python_requires='~=3.6',
|
||||
python_requires='~=3.9',
|
||||
classifiers=[
|
||||
"Programming Language :: Python :: 3",
|
||||
"Operating System :: OS Independent",
|
||||
|
|
|
|||
Loading…
Reference in a new issue