Skip to content
Snippets Groups Projects
Commit 1919b5ed authored by Hannes Feldt's avatar Hannes Feldt
Browse files

Resolve L2SS-1432 "Improve pipeline execution"

parent f3b3453e
Branches
Tags
1 merge request!669Resolve L2SS-1432 "Improve pipeline execution"
Showing
with 51 additions and 118 deletions
...@@ -66,14 +66,6 @@ trigger_prepare: ...@@ -66,14 +66,6 @@ trigger_prepare:
## Allow docker image script to execute ## Allow docker image script to execute
# - chmod u+x $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh # - chmod u+x $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh
# Template for docker images NOT on tagged or master builds
.base_docker_images_except:
extends: .base_docker_images
except:
refs:
- tags
- master
# Template to download all remote images and store them on our image registry # Template to download all remote images and store them on our image registry
# (call tag_and_push without arguments) # (call tag_and_push without arguments)
.base_docker_store_images: .base_docker_store_images:
...@@ -103,102 +95,33 @@ docker_store_images_changes: ...@@ -103,102 +95,33 @@ docker_store_images_changes:
changes: changes:
- docker-compose/.env - docker-compose/.env
# Build and push all our custom images on tagged or master builds # Build and push custom images on merge request if relevant files changed
docker_build_image_all: docker_build_image:
extends: .base_docker_images extends: .base_docker_images
parallel:
matrix:
- IMAGE:
- lofar-device-base
- ec-sim
- http-json-schemas
- prometheus
- tango-prometheus-exporter
- itango
- grafana
- loki
- logstash
- jupyter-lab
rules: rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
changes:
- docker-compose/$IMAGE.yml
- docker-compose/$IMAGE/*
- docker-compose/.env
- if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH) || $CI_COMMIT_TAG - if: ($CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH) || $CI_COMMIT_TAG
script: script:
# Do not remove 'bash' or statement will be ignored by primitive docker shell # Do not remove 'bash' or statement will be ignored by primitive docker shell
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh lofar-device-base latest - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh $IMAGE $tag
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh prometheus latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh itango latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh grafana latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh loki latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh logstash latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh jupyter-lab latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh grafana latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh prometheus latest
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh tango-prometheus-exporter latest
# Build and push custom images on merge request if relevant files changed
docker_build_image_lofar_device_base:
extends: .base_docker_images_except
only:
refs:
- merge_requests
changes:
- docker-compose/lofar-device-base.yml
- docker-compose/lofar-device-base/*
script:
# Do not remove 'bash' or statement will be ignored by primitive docker shell
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh lofar-device-base $tag
docker_build_image_prometheus:
extends: .base_docker_images_except
only:
refs:
- merge_requests
changes:
- docker-compose/prometheus.yml
- docker-compose/prometheus/*
script:
# Do not remove 'bash' or statement will be ignored by primitive docker shell
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh prometheus $tag
docker_build_image_itango:
extends: .base_docker_images_except
only:
refs:
- merge_requests
changes:
- docker-compose/itango.yml
- docker-compose/itango/*
script:
# Do not remove 'bash' or statement will be ignored by primitive docker shell
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh itango $tag
docker_build_image_grafana:
extends: .base_docker_images_except
only:
refs:
- merge_requests
changes:
- docker-compose/grafana.yml
- docker-compose/grafana/*
script:
# Do not remove 'bash' or statement will be ignored by primitive docker shell
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh grafana $tag
docker_build_image_loki:
extends: .base_docker_images_except
only:
refs:
- merge_requests
changes:
- docker-compose/loki.yml
- docker-compose/loki/*
script:
# Do not remove 'bash' or statement will be ignored by primitive docker shell
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh loki $tag
docker_build_image_logstash:
extends: .base_docker_images_except
only:
refs:
- merge_requests
changes:
- docker-compose/logstash.yml
- docker-compose/logstash/*
script:
# Do not remove 'bash' or statement will be ignored by primitive docker shell
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh logstash $tag
docker_build_image_jupyter:
extends: .base_docker_images_except
only:
refs:
- merge_requests
changes:
- docker-compose/jupyter-lab.yml
- docker-compose/jupyterlab/*
script:
# Do not remove 'bash' or statement will be ignored by primitive docker shell
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh jupyter-lab $tag
newline_at_eof: newline_at_eof:
stage: linting stage: linting
before_script: before_script:
...@@ -335,7 +258,8 @@ integration_test_docker: ...@@ -335,7 +258,8 @@ integration_test_docker:
# Do not remove 'bash' or statement will be ignored by primitive docker shell # Do not remove 'bash' or statement will be ignored by primitive docker shell
- bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh pull $tag - bash $CI_PROJECT_DIR/sbin/tag_and_push_docker_image.sh pull $tag
# Do not remove 'bash' or statement will be ignored by primitive docker shell # Do not remove 'bash' or statement will be ignored by primitive docker shell
- bash -e $CI_PROJECT_DIR/sbin/run_integration_test.sh - export TAG="$tag"
- bash -e $CI_PROJECT_DIR/sbin/run_integration_test.sh --no-build
after_script: after_script:
# Collect output of all containers # Collect output of all containers
- | - |
......
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
MAKEPATH := $(abspath $(lastword $(MAKEFILE_LIST))) MAKEPATH := $(abspath $(lastword $(MAKEFILE_LIST)))
BASEDIR := $(notdir $(patsubst %/,%,$(dir $(MAKEPATH)))) BASEDIR := $(notdir $(patsubst %/,%,$(dir $(MAKEPATH))))
TAG ?= latest
DOCKER_COMPOSE ?= docker compose DOCKER_COMPOSE ?= docker compose
DOCKER_COMPOSE_ENV_FILE := $(abspath .env) DOCKER_COMPOSE_ENV_FILE := $(abspath .env)
...@@ -23,6 +25,9 @@ TIMEOUT ?= 300 ...@@ -23,6 +25,9 @@ TIMEOUT ?= 300
SCRATCH ?= /tmp SCRATCH ?= /tmp
# Disables building of the lofar-base-device, primarily used for integration tests in CI/CD
NO_BASE ?= 0
# Host name through which others can reach our control interfaces. # Host name through which others can reach our control interfaces.
# Needs to be resolvable from the containers and clients. # Needs to be resolvable from the containers and clients.
ifneq (,$(wildcard /run/WSL)) ifneq (,$(wildcard /run/WSL))
...@@ -146,6 +151,7 @@ else ...@@ -146,6 +151,7 @@ else
endif endif
endif endif
DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) \ DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) \
XAUTHORITY=$(XAUTHORITY) \ XAUTHORITY=$(XAUTHORITY) \
TANGO_HOST=$(TANGO_HOST) \ TANGO_HOST=$(TANGO_HOST) \
...@@ -159,7 +165,8 @@ DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) \ ...@@ -159,7 +165,8 @@ DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) \
COMPOSE_HTTP_TIMEOUT=180 \ COMPOSE_HTTP_TIMEOUT=180 \
CONTAINER_EXECUTION_UID=$(shell id -u) \ CONTAINER_EXECUTION_UID=$(shell id -u) \
DOCKER_GID=$(DOCKER_GID) \ DOCKER_GID=$(DOCKER_GID) \
TEST_MODULE=$(INTEGRATION_MODULE) TEST_MODULE=$(INTEGRATION_MODULE) \
TAG=$(TAG)
.PHONY: up base base-nocache down minimal context run integration start stop restart build build-nocache status clean pull help await .PHONY: up base base-nocache down minimal context run integration start stop restart build build-nocache status clean pull help await
...@@ -169,7 +176,9 @@ pull: ## pull the images from the Docker hub ...@@ -169,7 +176,9 @@ pull: ## pull the images from the Docker hub
$(DOCKER_COMPOSE_ARGS) $(DOCKER_COMPOSE) $(COMPOSE_FILE_ARGS) pull --ignore-pull-failures $(DOCKER_COMPOSE_ARGS) $(DOCKER_COMPOSE) $(COMPOSE_FILE_ARGS) pull --ignore-pull-failures
base: context ## Build base lofar device image base: context ## Build base lofar device image
ifneq ($(NO_BASE),1)
$(DOCKER_COMPOSE_ARGS) $(DOCKER_COMPOSE) $(COMPOSE_FILE_ARGS) build --progress=plain lofar-device-base $(DOCKER_COMPOSE_ARGS) $(DOCKER_COMPOSE) $(COMPOSE_FILE_ARGS) build --progress=plain lofar-device-base
endif
base-nocache: context ## Rebuild base lofar device image base-nocache: context ## Rebuild base lofar device image
$(DOCKER_COMPOSE_ARGS) $(DOCKER_COMPOSE) $(COMPOSE_FILE_ARGS) build --no-cache --progress=plain lofar-device-base $(DOCKER_COMPOSE_ARGS) $(DOCKER_COMPOSE) $(COMPOSE_FILE_ARGS) build --no-cache --progress=plain lofar-device-base
......
...@@ -17,7 +17,7 @@ version: '2.1' ...@@ -17,7 +17,7 @@ version: '2.1'
services: services:
device-antennafield: device-antennafield:
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base:${TAG}
hostname: device-antennafield hostname: device-antennafield
container_name: device-antennafield container_name: device-antennafield
logging: logging:
......
...@@ -8,7 +8,7 @@ version: '2.1' ...@@ -8,7 +8,7 @@ version: '2.1'
services: services:
device-aps: device-aps:
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base:${TAG}
container_name: device-aps container_name: device-aps
hostname: device-aps hostname: device-aps
logging: logging:
......
...@@ -16,7 +16,7 @@ version: '2.1' ...@@ -16,7 +16,7 @@ version: '2.1'
services: services:
device-apsct: device-apsct:
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base:${TAG}
hostname: device-apsct hostname: device-apsct
container_name: device-apsct container_name: device-apsct
logging: logging:
......
...@@ -16,7 +16,7 @@ version: '2.1' ...@@ -16,7 +16,7 @@ version: '2.1'
services: services:
device-apspu: device-apspu:
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base:${TAG}
hostname: device-apspu hostname: device-apspu
container_name: device-apspu container_name: device-apspu
logging: logging:
......
...@@ -16,7 +16,7 @@ version: '2.1' ...@@ -16,7 +16,7 @@ version: '2.1'
services: services:
device-beamlet: device-beamlet:
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base:${TAG}
hostname: device-beamlet hostname: device-beamlet
container_name: device-beamlet container_name: device-beamlet
logging: logging:
......
...@@ -15,7 +15,7 @@ version: '2.1' ...@@ -15,7 +15,7 @@ version: '2.1'
services: services:
device-boot: device-boot:
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base:${TAG}
hostname: device-boot hostname: device-boot
container_name: device-boot container_name: device-boot
logging: logging:
......
...@@ -16,7 +16,7 @@ version: '2.1' ...@@ -16,7 +16,7 @@ version: '2.1'
services: services:
device-bst: device-bst:
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base:${TAG}
hostname: device-bst hostname: device-bst
container_name: device-bst container_name: device-bst
logging: logging:
......
...@@ -16,7 +16,7 @@ version: '2.1' ...@@ -16,7 +16,7 @@ version: '2.1'
services: services:
device-calibration: device-calibration:
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base:${TAG}
hostname: device-calibration hostname: device-calibration
container_name: device-calibration container_name: device-calibration
logging: logging:
......
...@@ -16,7 +16,7 @@ version: '2.1' ...@@ -16,7 +16,7 @@ version: '2.1'
services: services:
device-ccd: device-ccd:
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base:${TAG}
hostname: device-ccd hostname: device-ccd
container_name: device-ccd container_name: device-ccd
logging: logging:
......
...@@ -16,7 +16,7 @@ version: '2.1' ...@@ -16,7 +16,7 @@ version: '2.1'
services: services:
device-configuration: device-configuration:
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base:${TAG}
hostname: device-configuration hostname: device-configuration
container_name: device-configuration container_name: device-configuration
logging: logging:
......
...@@ -16,7 +16,7 @@ version: '2.1' ...@@ -16,7 +16,7 @@ version: '2.1'
services: services:
device-digitalbeam: device-digitalbeam:
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base:${TAG}
hostname: device-digitalbeam hostname: device-digitalbeam
container_name: device-digitalbeam container_name: device-digitalbeam
logging: logging:
......
...@@ -16,7 +16,7 @@ version: '2.1' ...@@ -16,7 +16,7 @@ version: '2.1'
services: services:
device-docker: device-docker:
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base:${TAG}
hostname: device-docker hostname: device-docker
container_name: device-docker container_name: device-docker
logging: logging:
......
...@@ -11,7 +11,7 @@ volumes: ...@@ -11,7 +11,7 @@ volumes:
services: services:
device-ec: device-ec:
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base:${TAG}
hostname: device-ec hostname: device-ec
container_name: device-ec container_name: device-ec
logging: logging:
......
...@@ -15,7 +15,7 @@ version: '2.1' ...@@ -15,7 +15,7 @@ version: '2.1'
services: services:
device-observation-control: device-observation-control:
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base:${TAG}
hostname: device-observation-control hostname: device-observation-control
container_name: device-observation-control container_name: device-observation-control
logging: logging:
......
...@@ -14,7 +14,7 @@ version: '2.1' ...@@ -14,7 +14,7 @@ version: '2.1'
services: services:
device-observation: device-observation:
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base:${TAG}
hostname: device-observation hostname: device-observation
container_name: device-observation container_name: device-observation
logging: logging:
......
...@@ -11,7 +11,7 @@ volumes: ...@@ -11,7 +11,7 @@ volumes:
services: services:
device-pcon: device-pcon:
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base:${TAG}
hostname: device-pcon hostname: device-pcon
container_name: device-pcon container_name: device-pcon
logging: logging:
......
...@@ -11,7 +11,7 @@ volumes: ...@@ -11,7 +11,7 @@ volumes:
services: services:
device-psoc: device-psoc:
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base:${TAG}
hostname: device-psoc hostname: device-psoc
container_name: device-psoc container_name: device-psoc
logging: logging:
......
...@@ -8,7 +8,7 @@ version: '2.1' ...@@ -8,7 +8,7 @@ version: '2.1'
services: services:
device-recvh: device-recvh:
image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base image: ${LOCAL_DOCKER_REGISTRY_HOST}/${LOCAL_DOCKER_REGISTRY_USER}/lofar-device-base:${TAG}
hostname: device-recvh hostname: device-recvh
container_name: device-recvh container_name: device-recvh
logging: logging:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment