From patchwork Thu Mar 30 10:11:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 668595 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d08:0:0:0:0:0 with SMTP id z8csp846029wrt; Thu, 30 Mar 2023 03:12:55 -0700 (PDT) X-Google-Smtp-Source: AK7set/VgOByHiV2Cs7cayBHh+cq8c7IwgiH6dN1ZcYN0oqBk7zJjeAifULc47FRCxKU9bQUhwZb X-Received: by 2002:a05:622a:343:b0:3e3:9175:f71b with SMTP id r3-20020a05622a034300b003e39175f71bmr37735966qtw.39.1680171175566; Thu, 30 Mar 2023 03:12:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680171175; cv=none; d=google.com; s=arc-20160816; b=lMjd//O6UcK13CgVOKeWbhCg2fkNFlauIYreKK9mhkHJ+evp6FOSSecwHKwT78/Y53 BVxkFePKO1URsl1/zsmMpETkZlYDZjXiDitBlL3JBsu7vlYJd+YT/Wl1e+AT7YbxGTJa tU/c37KfWQWpua33tK+S9jMKMbqCXBxZhb9ltlryDrGJKta6nDI63CNpaaBMl4TO5qnw Li4ZOYZV3cBpkTbB+EQIZTcPjljtEZEb6VvtvmJz0CZfiIooFD14oTwp6ZNURueSWfvw 1z15ZS9Xmu1tAMqqBcJ9ZoK1msAojusZRW4q1rlmEVoL+eJsDkNDuWqwTKyClQK+XBXs nTnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=G9GbMYvAaWW0oOBX4NN/Uf9OJgdDvvjHPBRD08CBk9g=; b=pC7v2G4RMTHZHUuM2RGlsbwYNoSUf1zhzWAhCY0oNwnqlKTx4ydM7w8e0TsTPthMZ8 lWdXVj9v1q0NeGwGq59GBScCt3UJW3io5w03+eZAWHmOZM4eLa71607xTDh6RdlbLn5T 4azg/0HwiDXnDGReAg2D+D3Olqky/cCTYyR8IA+dyTdeXok7ExV1UkIs6F8n7xBys22P NCmsJOHX7GtNl0LBt9UM8f5uMGuL7qB4Nz3hCWbdKdv8Lwk3D4oDmjNA8Yhq061obtid WXIiHLG/IasTbSoMfh/h9CCzN2XwOztWvAsYEW+W/7wge/ssnZhYXJjdFjDU3R9B2ysx C72A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r8Tl2Xr9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d2-20020a05622a15c200b003e388b3400fsi1477684qty.176.2023.03.30.03.12.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 30 Mar 2023 03:12:55 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r8Tl2Xr9; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1phpGB-0007bb-0x; Thu, 30 Mar 2023 06:11:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1phpG6-0007WY-OV for qemu-devel@nongnu.org; Thu, 30 Mar 2023 06:11:54 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1phpG1-0000Il-8a for qemu-devel@nongnu.org; Thu, 30 Mar 2023 06:11:53 -0400 Received: by mail-wm1-x32b.google.com with SMTP id n10-20020a05600c4f8a00b003ee93d2c914so12771640wmq.2 for ; Thu, 30 Mar 2023 03:11:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1680171107; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=G9GbMYvAaWW0oOBX4NN/Uf9OJgdDvvjHPBRD08CBk9g=; b=r8Tl2Xr9YELbpFcA6fCKKZQzbDwA6NAThE/yqJ7HVsERf8swaDPtXtWhu6w9gO0qjD SRrO1DCNI9XRS5qzZi1fS/L5wbjqKZhAyXgUMawY3rbhQCRnEZIaz8KHwK4QmUf7/AqC BuYLiuaA6fHgbXDERRg1daKEOugBEERn+owVxxbL09VOfdE2XVpo0fOa2Y15Citrl7yZ EVWmY2z46sKktdHuv7iy8bZESN03SDjflLXfAJDE8rEdqe4FeU3VrqVGGYi2yek1dcgp w5m4SKUDxbwDadgvZAQkzouZc8c3OuYg9HHFZuToIv/6+QI5YR5utXiFdUhSAtpyYhwD HQ/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680171107; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G9GbMYvAaWW0oOBX4NN/Uf9OJgdDvvjHPBRD08CBk9g=; b=OAl4V6YjjhVSeBvNy2luzSdQmVVLTRdskdGR4ZLOrUDmGhYrGzLT4OL+OqQz2+J+vd s9UUPnKyUavKBRyQhfAjoPmQ+ocwY1rAZbUQs5O1vowl5+5wqsPge3UdUoK9zMLN+hE7 WNjwBgcCLNfMcohY6fxzVNYaKznUB7FwLYcAaPj7qkLHG/+LU+kFgADrYKDqWM8LpmXa XESp7VfZMp8Inj+3XmY5FHyZfPmwddaa6H7npiHdWIutgPuWMiJ5UtMrkJLGUg/Sbtz9 Z8OGzvGYwmVBhA/haTjsHM3jTqkmUjeb/WY3Cc+uhIBOa+a1g82fyYUQouXgNVdXOWkI 7hBg== X-Gm-Message-State: AAQBX9e6yqGNlhA91eKWo3vURkriUVJymvs+puner9RcXQpBNfXCrHL8 gzMoW8BNXph/Sx/YIeqwFR8IzA== X-Received: by 2002:a05:600c:2198:b0:3ef:61f6:d7be with SMTP id e24-20020a05600c219800b003ef61f6d7bemr13838630wme.35.1680171107586; Thu, 30 Mar 2023 03:11:47 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id w20-20020a05600c475400b003f034c76e85sm2315703wmo.38.2023.03.30.03.11.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 03:11:47 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2ECA91FFC1; Thu, 30 Mar 2023 11:11:43 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Alex_Benn=C3=A9e?= , Warner Losh , Ryo ONODERA , Kevin Wolf , Beraldo Leal , Wainer dos Santos Moschetta , Hanna Reitz , qemu-block@nongnu.org, =?utf-8?q?Philippe_?= =?utf-8?q?Mathieu-Daud=C3=A9?= , Kyle Evans , Reinoud Zandijk Subject: [PATCH 11/11] tests/gitlab: use kaniko to build images Date: Thu, 30 Mar 2023 11:11:41 +0100 Message-Id: <20230330101141.30199-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230330101141.30199-1-alex.bennee@linaro.org> References: <20230330101141.30199-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Apparently the docker-in-docker approach has some flaws including needing privileged mode to run and being quite slow. An alternative approach is to use Google's kaniko tool. It also works across different gitlab executors. Following the gitlab example code we drop all the direct docker calls and usage of the script and make a direct call to kaniko and hope the images are cacheable by others. Signed-off-by: Alex Bennée Message-Id: <20230224180857.1050220-8-alex.bennee@linaro.org> Acked-by: Thomas Huth Signed-off-by: Alex Bennée --- v2 - add danpb's --cache suggestions --- .gitlab-ci.d/container-template.yml | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/.gitlab-ci.d/container-template.yml b/.gitlab-ci.d/container-template.yml index 519b8a9482..cd8e0a1ff6 100644 --- a/.gitlab-ci.d/container-template.yml +++ b/.gitlab-ci.d/container-template.yml @@ -1,21 +1,19 @@ .container_job_template: extends: .base_job_template - image: docker:stable + image: + name: gcr.io/kaniko-project/executor:v1.9.0-debug + entrypoint: [""] stage: containers - services: - - docker:dind before_script: - export TAG="$CI_REGISTRY_IMAGE/qemu/$NAME:latest" - export COMMON_TAG="$CI_REGISTRY/qemu-project/qemu/qemu/$NAME:latest" - - apk add python3 - - docker info - - docker login $CI_REGISTRY -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" 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 "tests/docker/dockerfiles/$NAME.docker" "." - - docker push "$TAG" - after_script: - - docker logout + - /kaniko/executor + --reproducible + --context "${CI_PROJECT_DIR}" + --cache=true + --cache-repo "${COMMON_TAG}" + --dockerfile "${CI_PROJECT_DIR}/tests/docker/dockerfiles/$NAME.docker" + --destination "${TAG}"