Skip to content
Snippets Groups Projects
Commit b90f5f33 authored by Виталий Шунков's avatar Виталий Шунков
Browse files

ci: move image builds and patch tests to schedule

Use gitlab schedule to run these jobs every night to reduce
time it takes to complete main pipeline
parent 0c99200b
No related branches found
No related tags found
1 merge request!1492ci: build images on schedule
Pipeline #57770 failed
......@@ -14,7 +14,8 @@ stages:
- test
- pack
- docker
- stress-test
- build-stress-image
- stress-test
- deploy
workflow:
......@@ -26,6 +27,7 @@ workflow:
when: never
- if: $CI_PIPELINE_SOURCE == "push"
- if: $CI_PIPELINE_SOURCE == "web"
- if: $CI_PIPELINE_SOURCE == "schedule"
variables:
REGISTRY: docker-public.binary.picodata.io
......@@ -70,14 +72,14 @@ variables:
#
.rules:
- &if-build-base-changes-on-master-branch
if: $CI_COMMIT_BRANCH == $MAIN_BRANCH
if: ($CI_COMMIT_BRANCH == $MAIN_BRANCH) && ($CI_PIPELINE_SOURCE != "schedule")
changes:
paths: &build-base-changes-paths
- docker-build-base/**
- .gitlab-ci.yml
- &if-build-base-changes-on-dev-branch
if: $CI_COMMIT_BRANCH != $MAIN_BRANCH
if: ($CI_COMMIT_BRANCH != $MAIN_BRANCH) && ($CI_PIPELINE_SOURCE != "schedule")
changes:
paths:
- docker-build-base/**
......@@ -228,7 +230,6 @@ test-linux:
grep_rust_version Cargo.toml;
grep_toolchain Makefile;
grep_toolchain docker-build-base/Dockerfile;
grep_toolchain helm/picodata.Dockerfile;
} \
| tee /dev/fd/3 \
| cut -d: -f2- | sort | uniq | wc -l
......@@ -295,31 +296,8 @@ lint:
.test-patch-rules: &test-patch-rules
rules:
- <<: *if-build-base-changes-on-master-branch
variables:
BASE_IMAGE_TAG: ${BASE_IMAGE_TAG}
# build base didnt chage but we still want the job to run
- if: $CI_COMMIT_BRANCH == $MAIN_BRANCH
variables:
BASE_IMAGE_TAG: ${BASE_IMAGE_TAG}
- <<: *if-build-base-changes-on-dev-branch
when: manual
allow_failure: true
variables:
BASE_IMAGE_TAG: ${CI_COMMIT_SHA}
# build base didnt change but we still want the job to run
# in case certification_patches has changed
- if: $CI_COMMIT_BRANCH != $MAIN_BRANCH
changes:
paths:
- certification_patches/**/*
compare_to: *main-branch
allow_failure: true
variables:
BASE_IMAGE_TAG: ${BASE_IMAGE_LATEST}
# manual in other cases
- if: $CI_COMMIT_BRANCH != $MAIN_BRANCH
when: manual
- if: ($CI_COMMIT_BRANCH == $MAIN_BRANCH) && ($CI_PIPELINE_SOURCE == "schedule")
- when: manual
allow_failure: true
variables:
BASE_IMAGE_TAG: ${BASE_IMAGE_LATEST}
......@@ -393,17 +371,18 @@ test-mac-m1:
.helm:
interruptible: true
stage: test
needs: []
rules:
- if: $CI_COMMIT_BRANCH != $MAIN_BRANCH
changes:
compare_to: *main-branch
paths:
- helm/picodata.Dockerfile
- helm/picodata.distroless
- helm/picodata-distroless.Dockerfile
- helm/docker-compose.yml
variables:
PUSH_DOCKER: "--no-push"
- if: $CI_COMMIT_BRANCH == $MAIN_BRANCH
- if: ($CI_COMMIT_BRANCH == $MAIN_BRANCH) && ($CI_PIPELINE_SOURCE == "schedule")
when: on_success
variables:
PUSH_DOCKER: ""
......@@ -415,12 +394,12 @@ helm-image:
variables:
KUBERNETES_CPU_REQUEST: 8
KUBERNETES_MEMORY_REQUEST: "8Gi"
MULTIARCH: "true"
MULTIARCH: "true"
parallel:
matrix:
- DOCKERFILE: helm/picodata.Dockerfile
DESTINATION: ${REGISTRY}/picodata:master
- DOCKERFILE: helm/picodata.distroless
- DOCKERFILE: helm/picodata-distroless.Dockerfile
DESTINATION: ${REGISTRY}/picodata:master-distroless
trigger:
project: picodata/devops/picodata-in-docker
......@@ -535,7 +514,7 @@ deploy-docker:
matrix:
- DOCKERFILE: helm/picodata.Dockerfile
DESTINATION: ${REGISTRY}/picodata:${CI_COMMIT_TAG}
- DOCKERFILE: helm/picodata.distroless
- DOCKERFILE: helm/picodata-distroless.Dockerfile
DESTINATION: ${REGISTRY}/picodata:${CI_COMMIT_TAG}-distroless
- DOCKERFILE: docker-build-base/sbroad.Dockerfile
DESTINATION: ${BASE_IMAGE_NAME}:${CI_COMMIT_TAG}
......@@ -667,6 +646,10 @@ publish-picodata-plugin:
name: docker-public.binary.picodata.io/kaniko-project/executor:v1.23.1-debug
entrypoint: ['']
pull_policy: [if-not-present]
rules:
- if: $CI_PIPELINE_SOURCE != "schedule"
- when: manual
allow_failure: true
tags:
- docker-k8s
before_script:
......@@ -674,7 +657,7 @@ publish-picodata-plugin:
- echo "$DOCKER_AUTH_CONFIG" > /kaniko/.docker/config.json
build-stress-image:
stage: build-base-image
stage: build-stress-image
<<: *kaniko_image
needs: []
variables:
......@@ -693,6 +676,8 @@ build-stress-image:
stage: test
tags:
- docker-k8s
rules:
- if: $CI_PIPELINE_SOURCE != "schedule"
image:
name: $BASE_IMAGE_NAME:$BASE_IMAGE_TAG
pull_policy: [always]
......@@ -737,6 +722,8 @@ stress_tests:
- insert
tags:
- docker-k8s
rules:
- if: $CI_PIPELINE_SOURCE != "schedule"
variables:
TNT_HOST: tarantool
STRESS_TEST: insert
......
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment