Commit 983efbba authored by David Mendez's avatar David Mendez
Browse files

Merge branch 'staging' into 'master'

Print to console when generating default job config

See merge request !77
parents a315e7dc 6a290279
......@@ -42,7 +42,7 @@ stages:
# ----------------------------------------------------------------------------------------------------------------------
build_docker_image_server:
image:
name: docker/compose:1.24.1
name: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/docker/compose:1.24.1
entrypoint: ["/bin/sh", "-c"]
stage: build
variables:
......@@ -53,14 +53,20 @@ build_docker_image_server:
- docker:dind
tags:
- dind
before_script:
- apk add curl jq
- echo $DOCKERHUB_REGISTRY_PASSWORD | docker login -u $DOCKERHUB_REGISTRY_USER --password-stdin $DOCKERHUB_REGISTRY
- |
TOKEN=$(curl --user "${DOCKERHUB_REGISTRY_USER}:${DOCKERHUB_REGISTRY_PASSWORD}" "https://auth.docker.io/token?service=registry.docker.io&scope=repository:ratelimitpreview/test:pull" | jq --raw-output .token) && curl --head --header "Authorization: Bearer $TOKEN" "https://registry-1.docker.io/v2/ratelimitpreview/test/manifests/latest" 2>&1
script:
- set -x
# Check rate limit
- docker version # verify docker cli is there. Also prints server info
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
- echo $DOCKERHUB_REGISTRY_PASSWORD | docker login -u $DOCKERHUB_REGISTRY_USER --password-stdin $DOCKERHUB_REGISTRY
- echo ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}
- echo building $SERVER_IMAGE_TAG
- docker-compose build delayed-jobs-server-prod
- echo Deploying $SERVER_IMAGE_TAG
- echo $CI_REGISTRY_PASSWORD | docker login -u $CI_REGISTRY_USER --password-stdin $CI_REGISTRY
- docker push $SERVER_IMAGE_TAG
# ----------------------------------------------------------------------------------------------------------------------
......@@ -84,7 +90,7 @@ pylint:
prepare_config_tests:
stage: prepare_config_tests
image:
name: alpine/git
name: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/alpine/git
entrypoint: ["/bin/sh", "-c"]
except:
- schedules
......@@ -114,7 +120,7 @@ unit_tests:
prepare_config_staging:
stage: prepare_config_staging
image:
name: alpine/git
name: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/alpine/git
entrypoint: ["/bin/sh", "-c"]
only:
- staging
......@@ -135,7 +141,7 @@ prepare_config_staging:
deploy_to_staging:
stage: deploy_to_staging
image:
name: lachlanevenson/k8s-kubectl:latest
name: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/lachlanevenson/k8s-kubectl:latest
entrypoint: ["/bin/sh", "-c"]
only:
- staging
......@@ -204,7 +210,7 @@ functional_tests_staging:
prepare_config_prod_hx:
stage: prepare_config_hx_hh
image:
name: alpine/git
name: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/alpine/git
entrypoint: ["/bin/sh", "-c"]
only:
- master
......@@ -224,7 +230,7 @@ prepare_config_prod_hx:
deploy_to_prod_hx:
stage: deploy_to_prod_hx_hh
image:
name: lachlanevenson/k8s-kubectl:latest
name: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/lachlanevenson/k8s-kubectl:latest
entrypoint: ["/bin/sh", "-c"]
only:
- master
......@@ -285,7 +291,7 @@ functional_tests_prod_hx:
prepare_config_prod_hh:
stage: prepare_config_hx_hh
image:
name: alpine/git
name: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/alpine/git
entrypoint: ["/bin/sh", "-c"]
only:
- master
......@@ -305,7 +311,7 @@ prepare_config_prod_hh:
deploy_to_prod_hh:
stage: deploy_to_prod_hx_hh
image:
name: lachlanevenson/k8s-kubectl:latest
name: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/lachlanevenson/k8s-kubectl:latest
entrypoint: ["/bin/sh", "-c"]
only:
- master
......@@ -381,7 +387,7 @@ functional_tests_prod_public:
# ----------------------------------------------------------------------------------------------------------------------
delete_expired_jobs:
stage: schedules
image: 'python:3.7'
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/python:3.7
only:
- schedules
script:
......
# ==================================== BASE ====================================
ARG INSTALL_PYTHON_VERSION=${INSTALL_PYTHON_VERSION:-3.7}
FROM python:${INSTALL_PYTHON_VERSION}-slim-buster AS base
ARG CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX=${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX:-'gitlab.ebi.ac.uk/chembl/dependency_proxy/containers'}
FROM ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/python:${INSTALL_PYTHON_VERSION}-slim-buster AS base
ENV CONFIG_FILE_PATH=${CONFIG_FILE_PATH:-'/etc/run_config/RUN_CONFIG.yml'}
ENV GUNICORN_CONFIG_FILE_PATH=${GUNICORN_CONFIG_FILE_PATH:-'/etc/gunicorn_config/GUNICORN_CONFIG.py'}
......
......@@ -57,7 +57,9 @@ def create_app():
generate_default_config = RUN_CONFIG.get('generate_default_config', False)
if generate_default_config:
print('GENERATING DEFAULT JOB CONFIG')
delayed_job_models.generate_default_job_configs()
print('DEFAULT JOB CONFIG GENERATED!')
flask_app.register_blueprint(SWAGGER_BLUEPRINT, url_prefix=f'{base_path}/swagger')
flask_app.register_blueprint(SUBMISSION_BLUEPRINT, url_prefix=f'{base_path}/submit')
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment