diff --git a/.github/workflows/build-coreos-debug.yml b/.github/workflows/build-coreos-debug.yml index f04643b3a..6c7b859d5 100644 --- a/.github/workflows/build-coreos-debug.yml +++ b/.github/workflows/build-coreos-debug.yml @@ -82,7 +82,7 @@ jobs: - name: "Build and Upload" run: > - make -j$(nproc) CONTAINER_ENGINE=docker NETRC=/tmp/.netrc GCP_IMAGE_NAME="${{ env.IMAGE_TIMESTAMP }}" AZURE_IMAGE_NAME="${{ env.IMAGE_TIMESTAMP }}" + make -j$(nproc) CONTAINER_ENGINE=docker NETRC=/tmp/.netrc GCP_IMAGE_NAME="${{ env.IMAGE_TIMESTAMP }}" GCP_IMAGE_FAMILY="constellation-debug" AZURE_IMAGE_NAME="${{ env.IMAGE_TIMESTAMP }}" AZURE_IMAGE_DEFINITION="constellation-coreos-debugd" AZURE_IMAGE_VERSION="${{env.IMAGE_VERSION }}" DOWNLOAD_COORDINATOR=n COORDINATOR_BINARY="${{ github.workspace }}/debugd/debugd/cmd/debugd/constellation-debugd" image-gcp image-azure upload-gcp upload-azure working-directory: ${{ env.working-directory }} diff --git a/cli/gcp/client/instances.go b/cli/gcp/client/instances.go index 09546a81c..40a6a489f 100644 --- a/cli/gcp/client/instances.go +++ b/cli/gcp/client/instances.go @@ -322,7 +322,7 @@ func (i insertInstanceTemplateInput) insertInstanceTemplateRequest() *computepb. { InitializeParams: &computepb.AttachedDiskInitializeParams{ DiskSizeGb: proto.Int64(10), - SourceImage: proto.String("projects/" + i.Project + "/global/images/" + i.ImageId), + SourceImage: proto.String(i.ImageId), }, AutoDelete: proto.Bool(true), Boot: proto.Bool(true), diff --git a/image/Makefile b/image/Makefile index 7d5a81f48..df76551f9 100644 --- a/image/Makefile +++ b/image/Makefile @@ -27,7 +27,9 @@ COSA_INIT_REPO ?= "https://github.com/edgelesssys/constellatio COSA_INIT_BRANCH ?= "constellation" COSA_LOCKFILE ?= $(BASE_PATH)/cosa.lock NETRC ?= ~/.netrc +GCP_PROJECT ?= constellation-images GCP_BUCKET ?= constellation-images +GCP_IMAGE_FAMILY ?= constellation GCP_IMAGE_NAME ?= constellation-coreos GCP_IMAGE_FILENAME ?= $(GCP_IMAGE_NAME)_gcp.tar.gz GCP_IMAGE_PATH ?= $(IMAGES_PATH)/$(GCP_IMAGE_FILENAME) @@ -107,7 +109,12 @@ upload-gcp: $(GCP_IMAGE_PATH) -gsutil mb -l $(GCP_REGION) gs://$(GCP_BUCKET) gsutil pap set enforced gs://$(GCP_BUCKET) gsutil cp $(GCP_IMAGE_PATH) gs://$(GCP_BUCKET) - gcloud compute images create $(GCP_IMAGE_NAME) --source-uri=gs://$(GCP_BUCKET)/$(GCP_IMAGE_FILENAME) --guest-os-features=GVNIC,SEV_CAPABLE,VIRTIO_SCSI_MULTIQUEUE,UEFI_COMPATIBLE --labels=coordinator-sha1=$$(shasum $(COORDINATOR_OVERRIDE_PATH) | cut -d " " -f 1),coordinator-sha512=$$(sha512sum $(COORDINATOR_OVERRIDE_PATH) | cut -d " " -f 1 | cut -c-63) + gcloud compute images create $(GCP_IMAGE_NAME) \ + --family $(GCP_IMAGE_FAMILY) + --source-uri=gs://$(GCP_BUCKET)/$(GCP_IMAGE_FILENAME) \ + --guest-os-features=GVNIC,SEV_CAPABLE,VIRTIO_SCSI_MULTIQUEUE,UEFI_COMPATIBLE \ + --labels=coordinator-sha1=$$(shasum $(COORDINATOR_OVERRIDE_PATH) | cut -d " " -f 1),coordinator-sha512=$$(sha512sum $(COORDINATOR_OVERRIDE_PATH) | cut -d " " -f 1 | cut -c-63) \ + --project $(GCP_PROJECT) gsutil rm gs://$(GCP_BUCKET)/$(GCP_IMAGE_FILENAME) image-azure: $(AZURE_IMAGE_PATH) diff --git a/internal/config/config.go b/internal/config/config.go index 9b03a9f62..87767e272 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -155,7 +155,7 @@ func Default() *Config { Project: proto.String("constellation-331613"), Region: proto.String("europe-west3"), Zone: proto.String("europe-west3-b"), - Image: proto.String("constellation-coreos-1651150807"), + Image: proto.String("projects/constellation-images/global/images/constellation-coreos-1651150807"), FirewallInput: &gcpClient.FirewallInput{ Ingress: cloudtypes.Firewall{ {