From 942e20aadaaf74a6aef8d935ad4c99fe65508560 Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Wed, 6 Nov 2024 17:00:23 -0500 Subject: [PATCH 1/6] fix: use BuildKit to build the Hermetic Build images --- .../cloudbuild-library-generation-push-prod.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.cloudbuild/library_generation/cloudbuild-library-generation-push-prod.yaml b/.cloudbuild/library_generation/cloudbuild-library-generation-push-prod.yaml index b3d6783087..1499c9053b 100644 --- a/.cloudbuild/library_generation/cloudbuild-library-generation-push-prod.yaml +++ b/.cloudbuild/library_generation/cloudbuild-library-generation-push-prod.yaml @@ -30,6 +30,8 @@ steps: "--file", ".cloudbuild/library_generation/library_generation.Dockerfile", "."] id: library-generation-build waitFor: ["-"] + env: + - 'DOCKER_BUILDKIT=1' options: logging: CLOUD_LOGGING_ONLY From 1da540eda82b0cf3d17c32f60d87db6ccb886998 Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Wed, 6 Nov 2024 17:01:11 -0500 Subject: [PATCH 2/6] Update cloudbuild-library-generation-push.yaml --- .../library_generation/cloudbuild-library-generation-push.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml b/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml index 012cd26817..359c021f69 100644 --- a/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml +++ b/.cloudbuild/library_generation/cloudbuild-library-generation-push.yaml @@ -30,6 +30,8 @@ steps: "--file", ".cloudbuild/library_generation/library_generation.Dockerfile", "."] id: library-generation-build waitFor: ["-"] + env: + - 'DOCKER_BUILDKIT=1' options: logging: CLOUD_LOGGING_ONLY From a4be75029b5ef9cf7a8a6a1033511549af4794a2 Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Wed, 6 Nov 2024 18:05:33 -0500 Subject: [PATCH 3/6] Update DEVELOPMENT.md --- hermetic_build/DEVELOPMENT.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/hermetic_build/DEVELOPMENT.md b/hermetic_build/DEVELOPMENT.md index e54c57e9ec..4ba3d4b9af 100644 --- a/hermetic_build/DEVELOPMENT.md +++ b/hermetic_build/DEVELOPMENT.md @@ -167,9 +167,6 @@ python hermetic_build/library_generation/cli/entry_point.py generate \ ``` Please note that the build only works when using the new [Docker BuildKit](https://docs.docker.com/build/buildkit/) (enabled through the `DOCKER_BUILDKIT` variable). - This is meant for local development only (in CloudTops) - GH Actions' Ubuntu-22.04 \ - [comes with the latest Docker version](https://github.com/actions/runner-images/blob/e74605cd6d5407469cf224802f25057bafc23d70/images/ubuntu/Ubuntu2204-Readme.md?plain=1#L81-L83) - and is able to handle the build properly using the (updated) legacy builder. 3. Set the version of gapic-generator-java From c6596670543ae6ed7a94b87e48abce9f6d188381 Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Wed, 6 Nov 2024 18:06:22 -0500 Subject: [PATCH 4/6] Update integration_tests.py --- hermetic_build/library_generation/tests/integration_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hermetic_build/library_generation/tests/integration_tests.py b/hermetic_build/library_generation/tests/integration_tests.py index 5a1d5f7e53..b0ce2ded51 100644 --- a/hermetic_build/library_generation/tests/integration_tests.py +++ b/hermetic_build/library_generation/tests/integration_tests.py @@ -200,7 +200,7 @@ def __build_image(cls, docker_file: str, cwd: str): # we build the docker image without removing intermediate containers, so # we can re-test more quickly subprocess.check_call( - ["docker", "build", "-f", docker_file, "-t", image_tag, "."], + ["DOCKER_BUILDKIT=1", "docker", "build", "-f", docker_file, "-t", image_tag, "."], cwd=cwd, ) From d569f3f0d1e24f627307c4730c671dcdbb755832 Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Thu, 7 Nov 2024 13:08:07 -0500 Subject: [PATCH 5/6] Update integration_tests.py --- hermetic_build/library_generation/tests/integration_tests.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hermetic_build/library_generation/tests/integration_tests.py b/hermetic_build/library_generation/tests/integration_tests.py index b0ce2ded51..e5803ffda1 100644 --- a/hermetic_build/library_generation/tests/integration_tests.py +++ b/hermetic_build/library_generation/tests/integration_tests.py @@ -200,8 +200,9 @@ def __build_image(cls, docker_file: str, cwd: str): # we build the docker image without removing intermediate containers, so # we can re-test more quickly subprocess.check_call( - ["DOCKER_BUILDKIT=1", "docker", "build", "-f", docker_file, "-t", image_tag, "."], + ["docker", "build", "-f", docker_file, "-t", image_tag, "."], cwd=cwd, + env=dict(os.environ, DOCKER_BUILDKIT="1") ) @classmethod From f29a00797acb57ea87ff23eb9fa2531e735fd61f Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Fri, 8 Nov 2024 01:40:24 +0000 Subject: [PATCH 6/6] lint --- hermetic_build/library_generation/tests/integration_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hermetic_build/library_generation/tests/integration_tests.py b/hermetic_build/library_generation/tests/integration_tests.py index e5803ffda1..a940069baa 100644 --- a/hermetic_build/library_generation/tests/integration_tests.py +++ b/hermetic_build/library_generation/tests/integration_tests.py @@ -202,7 +202,7 @@ def __build_image(cls, docker_file: str, cwd: str): subprocess.check_call( ["docker", "build", "-f", docker_file, "-t", image_tag, "."], cwd=cwd, - env=dict(os.environ, DOCKER_BUILDKIT="1") + env=dict(os.environ, DOCKER_BUILDKIT="1"), ) @classmethod