Loading .gitlab-ci.yml +24 −9 Original line number Diff line number Diff line Loading @@ -64,11 +64,22 @@ build:base: variables: CONTEXT_DIR: $CI_PROJECT_DIR/images/base build:conda: build:python2: extends: .docker-build stage: build-2 variables: CONTEXT_DIR: $CI_PROJECT_DIR/images/conda CONTEXT_DIR: $CI_PROJECT_DIR/images/python IMAGE_NAME: python2 BUILD_ARG_PYTHON_MAJOR_VERSION: "2" needs: ["build:base"] build:python3: extends: .docker-build stage: build-2 variables: CONTEXT_DIR: $CI_PROJECT_DIR/images/python IMAGE_NAME: python3 BUILD_ARG_PYTHON_MAJOR_VERSION: "3" needs: ["build:base"] build:postgres: Loading @@ -92,19 +103,23 @@ build:tomcat-runtime: CONTEXT_DIR: $CI_PROJECT_DIR/images/tomcat-runtime needs: ["build:base"] build:conda-builder: build:django2: extends: .docker-build stage: build-3 variables: CONTEXT_DIR: $CI_PROJECT_DIR/images/conda-builder needs: ["build:conda"] CONTEXT_DIR: $CI_PROJECT_DIR/images/django IMAGE_NAME: django2 BUILD_ARG_PYTHON_MAJOR_VERSION: "2" needs: ["build:python2"] build:django: build:django3: extends: .docker-build stage: build-3 variables: CONTEXT_DIR: $CI_PROJECT_DIR/images/django needs: ["build:conda"] IMAGE_NAME: django3 BUILD_ARG_PYTHON_MAJOR_VERSION: "3" needs: ["build:python3"] build:idp: extends: .docker-build Loading @@ -118,7 +133,7 @@ build:schema-migrate: stage: build-3 variables: CONTEXT_DIR: $CI_PROJECT_DIR/images/schema-migrate needs: ["build:conda"] needs: ["build:python2"] build:orp: extends: .docker-build Loading @@ -139,4 +154,4 @@ build:slcs: stage: build-4 variables: CONTEXT_DIR: $CI_PROJECT_DIR/images/slcs needs: ["build:conda-builder", "build:django"] needs: ["build:django3"] images/cog/Dockerfile +50 −0 Original line number Diff line number Diff line ##### ## Docker image for the ESGF SLCS Django application ##### ARG ESGF_REPOSITORY_BASE=esgfhub ARG ESGF_IMAGES_VERSION=latest FROM ${ESGF_REPOSITORY_BASE}/python2:${ESGF_IMAGES_VERSION} as builder USER root RUN yum makecache && \ yum install -y git gcc postgresql-devel sqlite-devel openssl-devel && \ yum clean all # Clone the code into /application and build wheels of the dependencies in /build/wheelhouse ARG ESGF_COG_REPO=https://github.com/EarthSystemCoG/COG.git ARG ESGF_COG_VERSION=v3.15.3 RUN git clone $ESGF_COG_REPO /application && \ pushd /application && \ git checkout $ESGF_COG_VERSION && \ rm -rf .git && \ popd && \ pip wheel --requirement /application/requirements.txt --wheel-dir /build/wheelhouse && \ pip wheel --no-deps git+https://github.com/EarthSystemCoG/django-openid-auth.git --wheel-dir /build/wheelhouse # && \ # git clone https://github.com/globusonline/transfer-api-client-python.git /globus-client && \ # pip wheel --wheel-dir /pip-wheels /globus-client && \ # make -C /globus-client/mkproxy FROM ${ESGF_REPOSITORY_BASE}/django2:${ESGF_IMAGES_VERSION} USER root ENV COG_INSTALL_DIR /application ENV COG_CONFIG_DIR $ESGF_HOME/cog RUN mkdir -p $COG_CONFIG_DIR && \ chown $ESGF_USER:$ESGF_GROUP $COG_CONFIG_DIR # Install additional packages not in the requirements # COPY --from=builder /globus-client/mkproxy/mkproxy /opt/conda/lib/python2.7/site-packages/globusonline/transfer/api_client/x509_proxy/ RUN pip install --no-cache-dir --no-index --find-links /build/wheelhouse django-openid-auth && \ pip install --no-cache-dir --no-index --find-links /build/wheelhouse --requirement /application/requirements.txt RUN yum install -y git RUN BUST=2; pip install --force git+https://github.com/cedadev/django-flexi-settings.git@python2#egg=django_flexi_settings # COPY init.d/* $ESGF_INIT_DIR/ USER $ESGF_UID images/cog/init.d/05-setup-cog.sh 0 → 100755 +6 −0 Original line number Diff line number Diff line #!/usr/bin/bash set -eo pipefail echo "[info] Running CoG setup" python "$COG_INSTALL_DIR/setup.py" setup_cog --esgf=true images/conda-builder/Dockerfiledeleted 100644 → 0 +0 −17 Original line number Diff line number Diff line ##### ## Base image for building Python wheels using conda ## ## It is designed to provide wheels to wheels to a runtime image, which avoids ## having build dependencies, e.g. compilers, git, in the final image ##### ARG ESGF_REPOSITORY_BASE=esgfhub ARG ESGF_IMAGES_VERSION=latest FROM ${ESGF_REPOSITORY_BASE}/conda:${ESGF_IMAGES_VERSION} USER root # Install common dependencies, e.g. git RUN yum makecache && yum install -y git && yum clean all USER $ESGF_UID images/django/Dockerfile +13 −4 Original line number Diff line number Diff line Loading @@ -6,20 +6,29 @@ ## ## This allows the final Django images to be free of build dependencies like ## git, compilers, devel packages, etc. ## ## This Dockerfile is used to build two images with python2 and python3 as the ## base image respectively ##### ARG ESGF_REPOSITORY_BASE=esgfhub ARG ESGF_IMAGES_VERSION=latest FROM ${ESGF_REPOSITORY_BASE}/conda:${ESGF_IMAGES_VERSION} ARG PYTHON_MAJOR_VERSION=3 FROM ${ESGF_REPOSITORY_BASE}/python${PYTHON_MAJOR_VERSION}:${ESGF_IMAGES_VERSION} USER root # Install gunicorn as WSGI server, whitenoise for serving static files and # django-flexi-settings for smart handling of settings RUN pip install --no-cache-dir \ # We have to use a different version of gunicorn and whitenoise depending on whether # we are running Python 2 or 3 ARG PYTHON_MAJOR_VERSION=3 RUN GUNICORN_VERSION="$([ "$PYTHON_MAJOR_VERSION" -eq 2 ] && echo "19.10.0" || echo "20.0.4")" && \ WHITENOISE_VERSION="$([ "$PYTHON_MAJOR_VERSION" -eq 2 ] && echo "4.1.4" || echo "5.0.1")" && \ pip install --no-cache-dir \ 'django-flexi-settings==0.1.1' \ 'gunicorn==20.0.4' \ 'whitenoise==5.0.1' "gunicorn==$GUNICORN_VERSION" \ "whitenoise==$WHITENOISE_VERSION" # Confiure Gunicorn and Django ENV DJANGO_SETTINGS_MODULE flexi_settings.settings Loading Loading
.gitlab-ci.yml +24 −9 Original line number Diff line number Diff line Loading @@ -64,11 +64,22 @@ build:base: variables: CONTEXT_DIR: $CI_PROJECT_DIR/images/base build:conda: build:python2: extends: .docker-build stage: build-2 variables: CONTEXT_DIR: $CI_PROJECT_DIR/images/conda CONTEXT_DIR: $CI_PROJECT_DIR/images/python IMAGE_NAME: python2 BUILD_ARG_PYTHON_MAJOR_VERSION: "2" needs: ["build:base"] build:python3: extends: .docker-build stage: build-2 variables: CONTEXT_DIR: $CI_PROJECT_DIR/images/python IMAGE_NAME: python3 BUILD_ARG_PYTHON_MAJOR_VERSION: "3" needs: ["build:base"] build:postgres: Loading @@ -92,19 +103,23 @@ build:tomcat-runtime: CONTEXT_DIR: $CI_PROJECT_DIR/images/tomcat-runtime needs: ["build:base"] build:conda-builder: build:django2: extends: .docker-build stage: build-3 variables: CONTEXT_DIR: $CI_PROJECT_DIR/images/conda-builder needs: ["build:conda"] CONTEXT_DIR: $CI_PROJECT_DIR/images/django IMAGE_NAME: django2 BUILD_ARG_PYTHON_MAJOR_VERSION: "2" needs: ["build:python2"] build:django: build:django3: extends: .docker-build stage: build-3 variables: CONTEXT_DIR: $CI_PROJECT_DIR/images/django needs: ["build:conda"] IMAGE_NAME: django3 BUILD_ARG_PYTHON_MAJOR_VERSION: "3" needs: ["build:python3"] build:idp: extends: .docker-build Loading @@ -118,7 +133,7 @@ build:schema-migrate: stage: build-3 variables: CONTEXT_DIR: $CI_PROJECT_DIR/images/schema-migrate needs: ["build:conda"] needs: ["build:python2"] build:orp: extends: .docker-build Loading @@ -139,4 +154,4 @@ build:slcs: stage: build-4 variables: CONTEXT_DIR: $CI_PROJECT_DIR/images/slcs needs: ["build:conda-builder", "build:django"] needs: ["build:django3"]
images/cog/Dockerfile +50 −0 Original line number Diff line number Diff line ##### ## Docker image for the ESGF SLCS Django application ##### ARG ESGF_REPOSITORY_BASE=esgfhub ARG ESGF_IMAGES_VERSION=latest FROM ${ESGF_REPOSITORY_BASE}/python2:${ESGF_IMAGES_VERSION} as builder USER root RUN yum makecache && \ yum install -y git gcc postgresql-devel sqlite-devel openssl-devel && \ yum clean all # Clone the code into /application and build wheels of the dependencies in /build/wheelhouse ARG ESGF_COG_REPO=https://github.com/EarthSystemCoG/COG.git ARG ESGF_COG_VERSION=v3.15.3 RUN git clone $ESGF_COG_REPO /application && \ pushd /application && \ git checkout $ESGF_COG_VERSION && \ rm -rf .git && \ popd && \ pip wheel --requirement /application/requirements.txt --wheel-dir /build/wheelhouse && \ pip wheel --no-deps git+https://github.com/EarthSystemCoG/django-openid-auth.git --wheel-dir /build/wheelhouse # && \ # git clone https://github.com/globusonline/transfer-api-client-python.git /globus-client && \ # pip wheel --wheel-dir /pip-wheels /globus-client && \ # make -C /globus-client/mkproxy FROM ${ESGF_REPOSITORY_BASE}/django2:${ESGF_IMAGES_VERSION} USER root ENV COG_INSTALL_DIR /application ENV COG_CONFIG_DIR $ESGF_HOME/cog RUN mkdir -p $COG_CONFIG_DIR && \ chown $ESGF_USER:$ESGF_GROUP $COG_CONFIG_DIR # Install additional packages not in the requirements # COPY --from=builder /globus-client/mkproxy/mkproxy /opt/conda/lib/python2.7/site-packages/globusonline/transfer/api_client/x509_proxy/ RUN pip install --no-cache-dir --no-index --find-links /build/wheelhouse django-openid-auth && \ pip install --no-cache-dir --no-index --find-links /build/wheelhouse --requirement /application/requirements.txt RUN yum install -y git RUN BUST=2; pip install --force git+https://github.com/cedadev/django-flexi-settings.git@python2#egg=django_flexi_settings # COPY init.d/* $ESGF_INIT_DIR/ USER $ESGF_UID
images/cog/init.d/05-setup-cog.sh 0 → 100755 +6 −0 Original line number Diff line number Diff line #!/usr/bin/bash set -eo pipefail echo "[info] Running CoG setup" python "$COG_INSTALL_DIR/setup.py" setup_cog --esgf=true
images/conda-builder/Dockerfiledeleted 100644 → 0 +0 −17 Original line number Diff line number Diff line ##### ## Base image for building Python wheels using conda ## ## It is designed to provide wheels to wheels to a runtime image, which avoids ## having build dependencies, e.g. compilers, git, in the final image ##### ARG ESGF_REPOSITORY_BASE=esgfhub ARG ESGF_IMAGES_VERSION=latest FROM ${ESGF_REPOSITORY_BASE}/conda:${ESGF_IMAGES_VERSION} USER root # Install common dependencies, e.g. git RUN yum makecache && yum install -y git && yum clean all USER $ESGF_UID
images/django/Dockerfile +13 −4 Original line number Diff line number Diff line Loading @@ -6,20 +6,29 @@ ## ## This allows the final Django images to be free of build dependencies like ## git, compilers, devel packages, etc. ## ## This Dockerfile is used to build two images with python2 and python3 as the ## base image respectively ##### ARG ESGF_REPOSITORY_BASE=esgfhub ARG ESGF_IMAGES_VERSION=latest FROM ${ESGF_REPOSITORY_BASE}/conda:${ESGF_IMAGES_VERSION} ARG PYTHON_MAJOR_VERSION=3 FROM ${ESGF_REPOSITORY_BASE}/python${PYTHON_MAJOR_VERSION}:${ESGF_IMAGES_VERSION} USER root # Install gunicorn as WSGI server, whitenoise for serving static files and # django-flexi-settings for smart handling of settings RUN pip install --no-cache-dir \ # We have to use a different version of gunicorn and whitenoise depending on whether # we are running Python 2 or 3 ARG PYTHON_MAJOR_VERSION=3 RUN GUNICORN_VERSION="$([ "$PYTHON_MAJOR_VERSION" -eq 2 ] && echo "19.10.0" || echo "20.0.4")" && \ WHITENOISE_VERSION="$([ "$PYTHON_MAJOR_VERSION" -eq 2 ] && echo "4.1.4" || echo "5.0.1")" && \ pip install --no-cache-dir \ 'django-flexi-settings==0.1.1' \ 'gunicorn==20.0.4' \ 'whitenoise==5.0.1' "gunicorn==$GUNICORN_VERSION" \ "whitenoise==$WHITENOISE_VERSION" # Confiure Gunicorn and Django ENV DJANGO_SETTINGS_MODULE flexi_settings.settings Loading