From: Camilla Conte <cconte@redhat.com>
To: qemu-devel@nongnu.org
Cc: berrange@redhat.com, richard.henderson@linaro.org,
alex.bennee@linaro.org, Camilla Conte <cconte@redhat.com>
Subject: [PATCH 5/5] gitlab-ci: Replace Docker with Kaniko
Date: Wed, 31 May 2023 16:08:24 +0100 [thread overview]
Message-ID: <20230531150824.32349-6-cconte@redhat.com> (raw)
In-Reply-To: <20230531150824.32349-1-cconte@redhat.com>
Previous attempt by Alex Bennée, for the records:
https://lore.kernel.org/qemu-devel/20230330101141.30199-12-alex.bennee@linaro.org/
Does not enable caching, as suggested in a previous review:
https://lore.kernel.org/qemu-devel/ZCVpMDLPJcdnkAJz@redhat.com/
Does not specify a context since no Dockerfile is using COPY or ADD instructions.
Does not enable reproducible builds as
that results in builds failing with an out of memory error.
See issue "Using --reproducible loads entire image into memory":
https://github.com/GoogleContainerTools/kaniko/issues/862
Signed-off-by: Camilla Conte <cconte@redhat.com>
---
.gitlab-ci.d/container-template.yml | 25 +++++--------------
.gitlab-ci.d/opensbi.yml | 1 -
.../ci/gitlab-kubernetes-runners/values.yaml | 12 ---------
3 files changed, 6 insertions(+), 32 deletions(-)
diff --git a/.gitlab-ci.d/container-template.yml b/.gitlab-ci.d/container-template.yml
index d146d1d197..0e93f5f13e 100644
--- a/.gitlab-ci.d/container-template.yml
+++ b/.gitlab-ci.d/container-template.yml
@@ -1,27 +1,14 @@
.container_job_template:
extends: .base_job_template
stage: containers
- image: docker:stable
- services:
- - docker:stable-dind
+ image:
+ name: gcr.io/kaniko-project/executor:debug
+ entrypoint: [""]
variables:
TAG: "$CI_REGISTRY_IMAGE/qemu/$NAME:latest"
- COMMON_TAG: "$CI_REGISTRY/qemu-project/qemu/qemu/$NAME:latest"
DOCKERFILE: "$CI_PROJECT_DIR/tests/docker/dockerfiles/$NAME.docker"
- BUILD_CONTEXT: "$CI_PROJECT_DIR"
- before_script:
- - docker login $CI_REGISTRY -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD"
- - until docker info; do sleep 1; done
script:
- echo "TAG:$TAG"
- - echo "COMMON_TAG:$COMMON_TAG"
- - >
- docker build
- --tag "$TAG"
- --cache-from "$TAG"
- --cache-from "$COMMON_TAG"
- --build-arg BUILDKIT_INLINE_CACHE=1
- -f "$DOCKERFILE" "$BUILD_CONTEXT"
- - docker push "$TAG"
- after_script:
- - docker logout
+ - /kaniko/executor
+ --dockerfile "$DOCKERFILE"
+ --destination "$TAG"
diff --git a/.gitlab-ci.d/opensbi.yml b/.gitlab-ci.d/opensbi.yml
index bb90c56bcf..e531ce2728 100644
--- a/.gitlab-ci.d/opensbi.yml
+++ b/.gitlab-ci.d/opensbi.yml
@@ -50,7 +50,6 @@ docker-opensbi:
GIT_DEPTH: 3
NAME: opensbi-cross-build
DOCKERFILE: "$CI_PROJECT_DIR/.gitlab-ci.d/opensbi/Dockerfile"
- BUILD_CONTEXT: "$CI_PROJECT_DIR/.gitlab-ci.d/opensbi"
build-opensbi:
rules:
diff --git a/scripts/ci/gitlab-kubernetes-runners/values.yaml b/scripts/ci/gitlab-kubernetes-runners/values.yaml
index 204a96a842..ed6c5894bc 100644
--- a/scripts/ci/gitlab-kubernetes-runners/values.yaml
+++ b/scripts/ci/gitlab-kubernetes-runners/values.yaml
@@ -4,27 +4,15 @@ rbac:
create: true
concurrent: 200
runners:
- privileged: true
config: |
[[runners]]
limit = 100
- environment = [
- "DOCKER_HOST=tcp://docker:2376",
- "DOCKER_TLS_CERTDIR=/certs",
- "DOCKER_TLS_VERIFY=1",
- "DOCKER_CERT_PATH=/certs/client"
- ]
[runners.kubernetes]
poll_timeout = 1200
- image = "ubuntu:20.04"
cpu_request = "0.5"
service_cpu_request = "0.5"
helper_cpu_request = "0.25"
cpu_request_overwrite_max_allowed = "7"
memory_request_overwrite_max_allowed = "30Gi"
- [[runners.kubernetes.volumes.empty_dir]]
- name = "docker-certs"
- mount_path = "/certs/client"
- medium = "Memory"
[runners.kubernetes.node_selector]
agentpool = "jobs"
--
2.40.1
next prev parent reply other threads:[~2023-05-31 15:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-31 15:08 Improvements to Gitlab CI container builds Camilla Conte
2023-05-31 15:08 ` [PATCH 1/5] gitlab-ci: Remove unused Python package Camilla Conte
2023-05-31 15:09 ` Daniel P. Berrangé
2023-05-31 15:08 ` [PATCH 2/5] gitlab-ci: Reference rules instead of extends Camilla Conte
2023-05-31 15:14 ` Daniel P. Berrangé
2023-05-31 15:08 ` [PATCH 3/5] gitlab-ci: Move variables outside script Camilla Conte
2023-05-31 15:12 ` Daniel P. Berrangé
2023-05-31 15:08 ` [PATCH 4/5] gitlab-ci: Use container template for opensbi Camilla Conte
2023-05-31 15:14 ` Daniel P. Berrangé
2023-05-31 15:08 ` Camilla Conte [this message]
2023-05-31 15:19 ` [PATCH 5/5] gitlab-ci: Replace Docker with Kaniko Daniel P. Berrangé
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230531150824.32349-6-cconte@redhat.com \
--to=cconte@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).