From 7b73aa0c849497e8b925b24b81ee0a119757048e Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Wed, 16 Nov 2022 19:08:28 -0400 Subject: [PATCH] ci: use Container-Optimized OS public image on the VM (#5617) * ci(compute): use debian public image on the VM, not the container Previous behavior: We were pulling the debian image the wrong way, as this was being used as a container but it was meant to be the VM image The image being pulled to create the internal container has been causing crashes as this images do not exists on Google's container repositories Expected behavior: Use a public image as debian-11 to get multiple benefits from it, as being able to use machine-images (#5615) and automatic disk resizing (which is now possible as we're using COS images, but those are more restrictive) Solution Add `--image-project=debian-cloud` and `--image-family=debian-11` as stated in the official documentation: https://cloud.google.com/sdk/gcloud/reference/compute/instances/create-with-container#--image-project More info: https://cloud.google.com/compute/docs/images/os-details#import * fix: use a public image with docker on the host * fix(logs): missing sudo before docker command Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> --- .github/workflows/continous-delivery.yml | 4 ++++ .github/workflows/deploy-gcp-tests.yml | 10 ++++++---- .github/workflows/zcashd-manual-deploy.yml | 2 ++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/continous-delivery.yml b/.github/workflows/continous-delivery.yml index 744f934f..3f1bb775 100644 --- a/.github/workflows/continous-delivery.yml +++ b/.github/workflows/continous-delivery.yml @@ -120,6 +120,8 @@ jobs: run: | gcloud compute instance-templates create-with-container zebrad-${{ needs.versioning.outputs.major_version || env.GITHUB_REF_SLUG_URL }}-${{ env.GITHUB_SHA_SHORT }} \ --boot-disk-type=pd-ssd \ + --image-project=cos-cloud \ + --image-family=cos-stable \ --container-image ${{ env.GAR_BASE }}/zebrad@${{ needs.build.outputs.image_digest }} \ --create-disk name=zebrad-cache-${{ env.GITHUB_SHA_SHORT }},auto-delete=yes,size=300GB,type=pd-ssd \ --container-mount-disk mount-path="/zebrad-cache",name=zebrad-cache-${{ env.GITHUB_SHA_SHORT }} \ @@ -196,6 +198,8 @@ jobs: gcloud compute instances create-with-container "zebrad-${{ env.GITHUB_REF_SLUG_URL }}-${{ env.GITHUB_SHA_SHORT }}" \ --boot-disk-size 300GB \ --boot-disk-type=pd-ssd \ + --image-project=cos-cloud \ + --image-family=cos-stable \ --container-stdin \ --container-tty \ --container-image ${{ env.GAR_BASE }}/zebrad@${{ needs.build.outputs.image_digest }} \ diff --git a/.github/workflows/deploy-gcp-tests.yml b/.github/workflows/deploy-gcp-tests.yml index ecd9f10f..f0274ac9 100644 --- a/.github/workflows/deploy-gcp-tests.yml +++ b/.github/workflows/deploy-gcp-tests.yml @@ -144,9 +144,10 @@ jobs: gcloud compute instances create-with-container "${{ inputs.test_id }}-${{ env.GITHUB_REF_SLUG_URL }}-${{ env.GITHUB_SHA_SHORT }}" \ --boot-disk-size 300GB \ --boot-disk-type pd-ssd \ + --image-project=cos-cloud \ + --image-family=cos-stable \ --create-disk name="${{ inputs.test_id }}-${{ env.GITHUB_SHA_SHORT }}",device-name="${{ inputs.test_id }}-${{ env.GITHUB_SHA_SHORT }}",size=300GB,type=pd-ssd \ - --container-image gcr.io/google-containers/busybox \ - --container-restart-policy=never \ + --container-image=gcr.io/google-containers/busybox \ --machine-type ${{ env.MACHINE_TYPE }} \ --scopes cloud-platform \ --metadata=google-monitoring-enabled=TRUE,google-logging-enabled=TRUE,enable-oslogin=TRUE \ @@ -363,9 +364,10 @@ jobs: gcloud compute instances create-with-container "${{ inputs.test_id }}-${{ env.GITHUB_REF_SLUG_URL }}-${{ env.GITHUB_SHA_SHORT }}" \ --boot-disk-size 300GB \ --boot-disk-type pd-ssd \ + --image-project=cos-cloud \ + --image-family=cos-stable \ --create-disk image=${{ env.CACHED_DISK_NAME }},name="${{ inputs.test_id }}-${{ env.GITHUB_SHA_SHORT }}",device-name="${{ inputs.test_id }}-${{ env.GITHUB_SHA_SHORT }}",size=300GB,type=pd-ssd \ - --container-image gcr.io/google-containers/busybox \ - --container-restart-policy=never \ + --container-image=gcr.io/google-containers/busybox \ --machine-type ${{ env.MACHINE_TYPE }} \ --scopes cloud-platform \ --metadata=google-monitoring-enabled=TRUE,google-logging-enabled=TRUE,enable-oslogin=TRUE \ diff --git a/.github/workflows/zcashd-manual-deploy.yml b/.github/workflows/zcashd-manual-deploy.yml index c7482935..8ab7eb49 100644 --- a/.github/workflows/zcashd-manual-deploy.yml +++ b/.github/workflows/zcashd-manual-deploy.yml @@ -55,6 +55,8 @@ jobs: gcloud compute instance-templates create-with-container zcashd-${{ env.GITHUB_REF_SLUG_URL }}-${{ env.GITHUB_SHA_SHORT }} \ --boot-disk-size 10GB \ --boot-disk-type=pd-ssd \ + --image-project=cos-cloud \ + --image-family=cos-stable \ --container-stdin \ --container-tty \ --container-image electriccoinco/zcashd \