From af09ab9b7749d79ec42b540763235b519df2a081 Mon Sep 17 00:00:00 2001 From: Corey Larson Date: Mon, 22 Jan 2024 17:35:16 -0700 Subject: [PATCH 01/12] Fix Cloudbuild $HOME override, update Earthfile to 0.7 --- Earthfile | 2 ++ cloudbuild.yaml | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Earthfile b/Earthfile index 9869d96..644f53f 100644 --- a/Earthfile +++ b/Earthfile @@ -1,3 +1,5 @@ +VERSION 0.7 + FROM golang:1.16-alpine3.13 WORKDIR /go-example diff --git a/cloudbuild.yaml b/cloudbuild.yaml index a1c7d9e..fdff8e8 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -1,12 +1,16 @@ steps: - id: 'build' - name: 'earthly/earthly:v0.5.24' + name: 'earthly/earthly:v0.7.23' + env: + - "HOME=/root" args: - --allow-privileged - +docker - id: 'gcp-test' - name: 'earthly/earthly:v0.5.24' + name: 'earthly/earthly:v0.7.23' + env: + - "HOME=/root" args: - +gcp-cloudbuild secretEnv: From ad4ded977b4e6b1822d46f967940d5c32538a19a Mon Sep 17 00:00:00 2001 From: Corey Larson Date: Mon, 22 Jan 2024 17:45:23 -0700 Subject: [PATCH 02/12] Update earthly project --- cloudbuild.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/cloudbuild.yaml b/cloudbuild.yaml index fdff8e8..1666439 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -11,6 +11,7 @@ steps: name: 'earthly/earthly:v0.7.23' env: - "HOME=/root" + - "EARTHLY_PROJECT=cloud" args: - +gcp-cloudbuild secretEnv: From 18d22f8597085367110cd82a185d62b3795dbaa9 Mon Sep 17 00:00:00 2001 From: Corey Larson Date: Mon, 22 Jan 2024 17:49:14 -0700 Subject: [PATCH 03/12] Update to 0.8 --- Earthfile | 2 +- cloudbuild.yaml | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Earthfile b/Earthfile index 644f53f..41869bb 100644 --- a/Earthfile +++ b/Earthfile @@ -1,4 +1,4 @@ -VERSION 0.7 +VERSION 0.8 FROM golang:1.16-alpine3.13 WORKDIR /go-example diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 1666439..90dfda2 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -1,14 +1,16 @@ steps: - id: 'build' - name: 'earthly/earthly:v0.7.23' + name: 'earthly/earthly:v0.8.0' env: - "HOME=/root" args: - --allow-privileged + - --ci + - --push - +docker - id: 'gcp-test' - name: 'earthly/earthly:v0.7.23' + name: 'earthly/earthly:v0.8.0' env: - "HOME=/root" - "EARTHLY_PROJECT=cloud" From 2e0d9d659756a7971be1fa08a914cb708fc6c15e Mon Sep 17 00:00:00 2001 From: Corey Larson Date: Mon, 22 Jan 2024 17:56:23 -0700 Subject: [PATCH 04/12] Ugh --- cloudbuild.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 90dfda2..d46c07b 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -6,9 +6,15 @@ steps: args: - --allow-privileged - --ci - - --push + # - --push # Uncomment to allow GCP to push images to your choice of repository. Secrets for your repository must be configured. - +docker + - id: 'secrets' + name: 'earthly/earthly:v0.8.0' + entrypoint: earthly secrets ls + secretEnv: + - 'EARTHLY_TOKEN' + - id: 'gcp-test' name: 'earthly/earthly:v0.8.0' env: From 6b5f13e1722344f2f4465bf2d531d1ceec26a6a3 Mon Sep 17 00:00:00 2001 From: Corey Larson Date: Fri, 19 Apr 2024 16:35:12 -0600 Subject: [PATCH 05/12] Try to finish fix --- cloudbuild.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cloudbuild.yaml b/cloudbuild.yaml index d46c07b..0678ada 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -11,6 +11,8 @@ steps: - id: 'secrets' name: 'earthly/earthly:v0.8.0' + env: + - "HOME=/root" entrypoint: earthly secrets ls secretEnv: - 'EARTHLY_TOKEN' From 03448aa067eea72f87184127a7c0d2ed1a124ea9 Mon Sep 17 00:00:00 2001 From: Corey Larson Date: Fri, 19 Apr 2024 16:38:32 -0600 Subject: [PATCH 06/12] test --- cloudbuild.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 0678ada..437b5e8 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -13,7 +13,9 @@ steps: name: 'earthly/earthly:v0.8.0' env: - "HOME=/root" - entrypoint: earthly secrets ls + args: + - secrets + - ls secretEnv: - 'EARTHLY_TOKEN' From 6ffeedf883acdeda7826cfaad06867acd88a526f Mon Sep 17 00:00:00 2001 From: Corey Larson Date: Fri, 19 Apr 2024 16:53:12 -0600 Subject: [PATCH 07/12] Use new value --- cloudbuild.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 437b5e8..55b15ed 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -31,5 +31,5 @@ steps: availableSecrets: secretManager: - - versionName: projects/earthly-jupyterlab/secrets/EARTHLY_TOKEN/versions/2 + - versionName: projects/earthly-jupyterlab/secrets/EARTHLY_TOKEN/versions/4 env: 'EARTHLY_TOKEN' From d7bc1046490cc951cf4e024ef90727830801cbdd Mon Sep 17 00:00:00 2001 From: Corey Larson Date: Fri, 19 Apr 2024 16:58:53 -0600 Subject: [PATCH 08/12] Continuted iteration to get it lined up and updated --- Earthfile | 2 +- cloudbuild.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Earthfile b/Earthfile index 41869bb..9395397 100644 --- a/Earthfile +++ b/Earthfile @@ -27,4 +27,4 @@ docker: # Demo for Google Cloud Build, showing use of a dedicated service account gcp-cloudbuild: FROM gcr.io/cloud-builders/gsutil - RUN --mount type=secret,id=+secrets/earthly-technologies/google/cloudbuild-service-key,target=/root/key.json gcloud auth activate-service-account --key-file=/root/key.json && gsutil ls -p earthly-jupyterlab + RUN --mount type=secret,id=google/cloudbuild-service-key,target=/root/key.json gcloud auth activate-service-account --key-file=/root/key.json && gsutil ls -p earthly-jupyterlab diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 55b15ed..fa6298e 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -13,6 +13,7 @@ steps: name: 'earthly/earthly:v0.8.0' env: - "HOME=/root" + - "EARTHLY_PROJECT=cloud" args: - secrets - ls From d1a9c94062ad46754c3b5eeb79092d08b3a2d35e Mon Sep 17 00:00:00 2001 From: Corey Larson Date: Fri, 19 Apr 2024 17:04:20 -0600 Subject: [PATCH 09/12] Update to 0.8.7 --- cloudbuild.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cloudbuild.yaml b/cloudbuild.yaml index fa6298e..d3ab63a 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -1,6 +1,6 @@ steps: - id: 'build' - name: 'earthly/earthly:v0.8.0' + name: 'earthly/earthly:v0.8.7' env: - "HOME=/root" args: @@ -10,7 +10,7 @@ steps: - +docker - id: 'secrets' - name: 'earthly/earthly:v0.8.0' + name: 'earthly/earthly:v0.8.7' env: - "HOME=/root" - "EARTHLY_PROJECT=cloud" @@ -21,7 +21,7 @@ steps: - 'EARTHLY_TOKEN' - id: 'gcp-test' - name: 'earthly/earthly:v0.8.0' + name: 'earthly/earthly:v0.8.7' env: - "HOME=/root" - "EARTHLY_PROJECT=cloud" From 05aa1c09e2dd9704d0cd4b620b7ed13f4ebfb61d Mon Sep 17 00:00:00 2001 From: Corey Larson Date: Mon, 22 Apr 2024 11:10:27 -0600 Subject: [PATCH 10/12] Try setting org in cloudbuild --- cloudbuild.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/cloudbuild.yaml b/cloudbuild.yaml index d3ab63a..048698a 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -24,6 +24,7 @@ steps: name: 'earthly/earthly:v0.8.7' env: - "HOME=/root" + - "EARTHLY_ORG=earthly-technologies" - "EARTHLY_PROJECT=cloud" args: - +gcp-cloudbuild From abe4d7d76018edef96e1fe1d8f2310011c2142e4 Mon Sep 17 00:00:00 2001 From: Corey Larson Date: Mon, 22 Apr 2024 11:27:22 -0600 Subject: [PATCH 11/12] Test in-file project --- Earthfile | 5 +++++ cloudbuild.yaml | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Earthfile b/Earthfile index 9395397..13c8225 100644 --- a/Earthfile +++ b/Earthfile @@ -1,5 +1,7 @@ VERSION 0.8 +PROJECT earthly-technologies/cloud + FROM golang:1.16-alpine3.13 WORKDIR /go-example @@ -28,3 +30,6 @@ docker: gcp-cloudbuild: FROM gcr.io/cloud-builders/gsutil RUN --mount type=secret,id=google/cloudbuild-service-key,target=/root/key.json gcloud auth activate-service-account --key-file=/root/key.json && gsutil ls -p earthly-jupyterlab + +test: + RUN --mount type=secret,id=google/cloudbuild-service-key,target=/root/key.json ls -la /root \ No newline at end of file diff --git a/cloudbuild.yaml b/cloudbuild.yaml index 048698a..a48e54f 100644 --- a/cloudbuild.yaml +++ b/cloudbuild.yaml @@ -24,8 +24,6 @@ steps: name: 'earthly/earthly:v0.8.7' env: - "HOME=/root" - - "EARTHLY_ORG=earthly-technologies" - - "EARTHLY_PROJECT=cloud" args: - +gcp-cloudbuild secretEnv: From 9fd246ccec2b6a6275a6a99eeb9047f464e78230 Mon Sep 17 00:00:00 2001 From: Corey Larson Date: Mon, 22 Apr 2024 11:30:13 -0600 Subject: [PATCH 12/12] Newline, remove test target --- Earthfile | 3 --- 1 file changed, 3 deletions(-) diff --git a/Earthfile b/Earthfile index 13c8225..744bd1b 100644 --- a/Earthfile +++ b/Earthfile @@ -30,6 +30,3 @@ docker: gcp-cloudbuild: FROM gcr.io/cloud-builders/gsutil RUN --mount type=secret,id=google/cloudbuild-service-key,target=/root/key.json gcloud auth activate-service-account --key-file=/root/key.json && gsutil ls -p earthly-jupyterlab - -test: - RUN --mount type=secret,id=google/cloudbuild-service-key,target=/root/key.json ls -la /root \ No newline at end of file