Skip to content

Commit

Permalink
control-service: publish job-builder image (#85)
Browse files Browse the repository at this point in the history
Job Builder Image is used by Control Service to build the data job image
when a new data job is being deployed. It's started in kubernetes job -
this way the operation can be done asyncrounously and also enables
certain level of extensibility as the job-builder image can be
configured.

We need to publish the image to dockerhub on each change . This is
enabling the publish step and setting correct variables to use.

Testing Done executed locally ./publish-vdk-job-builder.sh , tested in
CI by starting step in PR (temporarily)
  • Loading branch information
antoniivanov authored Aug 16, 2021
1 parent 5b345cc commit ee281e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions projects/control-service/cicd/.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ build_control_service_image:
changes:
- projects/control-service/projects/helm_charts/pipelines-control-service/version.txt

.publish_vdk_job_builder_image:
publish_vdk_job_builder_image:
image: docker:19.03.8
services:
- docker:19.03.8-dind
Expand All @@ -97,7 +97,7 @@ build_control_service_image:
stage: publish_artifacts
script:
- apk add --no-cache bash
- docker login --username "${HARBOR_REGISTRY_ROBOT_PIPELINES_USER}" --password "${HARBOR_REGISTRY_ROBOT_PIPELINES_TOKEN}" "${PIPELINES_DOCKER_REGISTRY}"
- docker login --username "${VDK_DOCKER_REGISTRY_USERNAME}" --password "${VDK_DOCKER_REGISTRY_PASSWORD}" "${VDK_DOCKER_REGISTRY_URL}"
- cd projects/control-service/projects/vdk_job_builder
- bash -ex ./publish-vdk-job-builder.sh
retry: !reference [.control_service_retry, retry_options]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
VERSION_TAG=$(cat "$SCRIPT_DIR/version.txt")
PIPELINES_DOCKER_REGISTRY=${PIPELINES_DOCKER_REGISTRY:-"hub.docker.com/versatiledatakit"}
VDK_DOCKER_REGISTRY_URL=${VDK_DOCKER_REGISTRY_URL:-"registry.hub.docker.com/versatiledatakit"}

function build_and_push_image() {
name="$1"
docker_file="$2"
arguments="$3"

image_repo="$PIPELINES_DOCKER_REGISTRY/$name"
image_repo="$VDK_DOCKER_REGISTRY_URL/$name"
image_tag="$image_repo:$VERSION_TAG"

docker build -t $image_tag -t $image_repo:latest -f "$SCRIPT_DIR/k8s_vdk_job_builder/$docker_file" $arguments "$SCRIPT_DIR"
Expand Down

0 comments on commit ee281e7

Please sign in to comment.