Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push images to gce #3213

Merged
merged 4 commits into from
Mar 4, 2025
Merged

Push images to gce #3213

merged 4 commits into from
Mar 4, 2025

Conversation

jimmykarily
Copy link
Contributor

@jimmykarily jimmykarily commented Feb 21, 2025

Fixes #3147

What this PR does / why we need it:

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

@jimmykarily jimmykarily force-pushed the 3147-push-to-gce branch 18 times, most recently from ab836ca to e9a83f9 Compare February 27, 2025 15:43
@jimmykarily jimmykarily changed the title [WIP] Add job to configure google credentials Push images to gce Feb 28, 2025
@jimmykarily jimmykarily marked this pull request as ready for review February 28, 2025 09:47
@jimmykarily jimmykarily requested a review from a team February 28, 2025 09:47
Copy link
Member

@Itxaka Itxaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@Itxaka
Copy link
Member

Itxaka commented Feb 28, 2025

So what I get from this is that there is no regions on GCE then? Uploading an image makes it available everywhere?

@jimmykarily
Copy link
Contributor Author

user-data also works:

instance-20250228-095741:/home/kairos # cat /etc/kairos-release 
KAIROS_ARCH="amd64"
KAIROS_BUG_REPORT_URL="https://github.com/kairos-io/kairos/issues"
KAIROS_FAMILY="suse"
KAIROS_FLAVOR="opensuse"
KAIROS_FLAVOR_RELEASE="leap-15.6"
KAIROS_FRAMEWORK_VERSION="v2.16.1"
KAIROS_HOME_URL="https://github.com/kairos-io/kairos"
KAIROS_ID="kairos"
KAIROS_ID_LIKE="kairos-core-opensuse-leap-15.6"
KAIROS_IMAGE_LABEL="leap-15.6-core-amd64-generic-3.3.1-71-gad983b4"
KAIROS_MODEL="generic"
KAIROS_NAME="kairos-core-opensuse-leap-15.6"
KAIROS_REGISTRY_AND_ORG="quay.io/kairos"
KAIROS_RELEASE="3.3.1-71-gad983b4"
KAIROS_TARGETARCH="amd64"
KAIROS_VARIANT="core"
KAIROS_VERSION="3.3.1-71-gad983b4"
instance-20250228-095741:/home/kairos # 

It's set as metadata when creating the VM:

image

(docs pending)

@jimmykarily
Copy link
Contributor Author

So what I get from this is that there is no regions on GCE then? Uploading an image makes it available everywhere?

there are "locations" but images are a global resource: https://cloud.google.com/sdk/gcloud/reference/compute/images/list (no mention of location anywhere)

@jimmykarily
Copy link
Contributor Author

Caution: Publicly shared images do not appear in the images list for users. Users must know the image name explicitly. Users cannot rely on getting the information by making an images.list request.

https://cloud.google.com/compute/docs/images/managing-access-custom-images

@jimmykarily
Copy link
Contributor Author

I can't find a way to search for images in the UI. The only thing that works (which matches the limitation mentioned in the above comment) is to manually point to the image in the command line:

gcloud --project  <myproject> compute instances create kairos-vm-test --image=projects/palette-kairos/global/images/kairos-ubuntu-24-04-core-amd64-generic-v3-2-1 --image-project=palette-kairos

This requires the user to know the full image "path". If we can't find any better way, we should just make sure our documentation always points to the current public image. 🤷 Strange UX from google.

@jimmykarily
Copy link
Contributor Author

image

It may need something more to make the image available to more "zones". I'll look into it.

@jimmykarily
Copy link
Contributor Author

--storage-location=STORAGE_LOCATION
    Specifies a Cloud Storage location, either regional or multi-regional, where image content is to be stored. If not specified, the multi-region location closest to the source is chosen automatically. 

https://cloud.google.com/sdk/gcloud/reference/compute/images/import

We should try "global" or "asia,eu,us" according to chatgpt. Let's see.

Signed-off-by: Dimitris Karakasilis <[email protected]>
Signed-off-by: Dimitris Karakasilis <[email protected]>
to avoid latency when using the images (and egress charges when it has
to be used from other locations).

https://cloud.google.com/sdk/gcloud/reference/compute/images/import

Signed-off-by: Dimitris Karakasilis <[email protected]>
"storage-location" is an argument of the "gcloud compute images import" command not "gcloud compute images import

This reverts commit cb28e41.
@jimmykarily
Copy link
Contributor Author

--storage-location=STORAGE_LOCATION
    Specifies a Cloud Storage location, either regional or multi-regional, where image content is to be stored. If not specified, the multi-region location closest to the source is chosen automatically. 

https://cloud.google.com/sdk/gcloud/reference/compute/images/import

We should try "global" or "asia,eu,us" according to chatgpt. Let's see.

"storage-location" is an argument of the "gcloud compute images import" command not "gcloud migration vms image-imports create" . Images are a global resource anyway and only latency and costs are different by adding more regions/zones/locations/whatever.

@jimmykarily jimmykarily merged commit 7abf82e into master Mar 4, 2025
52 of 54 checks passed
@jimmykarily jimmykarily deleted the 3147-push-to-gce branch March 4, 2025 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Push images to Google cloud
3 participants