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

Add documentation about Google Cloud #366

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

jimmykarily
Copy link
Contributor

@jimmykarily jimmykarily commented Feb 28, 2025

@jimmykarily jimmykarily self-assigned this Feb 28, 2025
Copy link

netlify bot commented Feb 28, 2025

Deploy Preview for kairos-io ready!

Name Link
🔨 Latest commit 758f4e6
🔍 Latest deploy log https://app.netlify.com/sites/kairos-io/deploys/67c84255da58a200094a3b92
😎 Deploy Preview https://deploy-preview-366--kairos-io.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Signed-off-by: Dimitris Karakasilis <[email protected]>
@jimmykarily jimmykarily force-pushed the 3147-google-cloud-images branch from 255cecd to 7e4cbc7 Compare March 5, 2025 06:26
Signed-off-by: Dimitris Karakasilis <[email protected]>
@jimmykarily jimmykarily force-pushed the 3147-google-cloud-images branch from ce14a41 to 096d6b4 Compare March 5, 2025 06:32
@@ -105,6 +105,7 @@ provider_version = "v2.9.2"
# renovate: datasource=github-releases depName=k3s-io/k3s
k3s_version = "v1.32.1+k3s1"
kairos_version = "master"
google_cloud_image_version = "v3-2-1"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't think of a better way to set this without making it too complex. Google cloud doesn't allow dots . in the name of the image and it doesn't allow users to search for our images (only certain public images are searchable, not all publicly accessible images). So we need to keep this up to date but we don't keep all versions around so we can't base this on the kairos_version above (e.g. we don't push master and we clean up older versions).

Copy link
Member

Choose a reason for hiding this comment

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

Isn't there a way of maybe making renovate pull the latest Kairos tag and transform it into the gcloud valid version?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm a noob renovate user. This is some serious black belt stuff you are discussing here :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

chatgpt suggests something like this:

{
  "regexManagers": [
    {
      "fileMatch": ["your-file\\.ext"],  // Replace with your actual file (e.g., "config.yaml")
      "matchStrings": ["your-dependency: 'v(?<version>\\d+\\.\\d+\\.\\d+)'"],
      "replaceString": "your-dependency: 'v${version//./-}'",
      "datasourceTemplate": "npm"
    }
  ]
}

looking at the docs, it may be possible. But that's what I had in mind when I said without making it too complex :D . I can give it a try but we won't know if it works until we have a new release. That's a slow feedback loop.

Copy link
Member

Choose a reason for hiding this comment

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

You can have it nice or you can have it easy, not both 🤣

When I test this renovate stuff I just put an older version in place and then run renovate locally with dry run to see if it would have update it and to which version.

Also @mauromorales is the renovate master maybe he can tell us if that would work?

Copy link
Member

Choose a reason for hiding this comment

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

I feel like chatgpt is BSing there, I don't see any replaceString in the docs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was hoping this would help: https://docs.renovatebot.com/configuration-options/#autoreplacestringtemplate

but I don't understand how it works and there are no example provided 🤷

Signed-off-by: Dimitris Karakasilis <[email protected]>
Signed-off-by: Dimitris Karakasilis <[email protected]>
@jimmykarily jimmykarily force-pushed the 3147-google-cloud-images branch 2 times, most recently from 2be2d6b to 2831997 Compare March 5, 2025 07:52
Signed-off-by: Dimitris Karakasilis <[email protected]>
@jimmykarily jimmykarily force-pushed the 3147-google-cloud-images branch from 2831997 to 748bc2b Compare March 5, 2025 07:56
@jimmykarily jimmykarily marked this pull request as ready for review March 5, 2025 08:06
@jimmykarily jimmykarily requested a review from a team March 5, 2025 08:06
@@ -0,0 +1 @@
{{- $.Page.Site.Params.softwareVersions.google_cloud_image_version -}}
Copy link
Member

@mauromorales mauromorales Mar 5, 2025

Choose a reason for hiding this comment

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

I think what you want is just take the kairos_version and transform it to your liking here with hugo templating instead of having your own variable

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
{{- $.Page.Site.Params.softwareVersions.google_cloud_image_version -}}
{{- $.Page.Site.Params.softwareVersions.kairos_version | replace "." "-" -}}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this will use master when user is browsing the dev branch no? We don't push master images to google cloud :(

Copy link
Member

Choose a reason for hiding this comment

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

@jimmykarily indeed but imo that is ok because at the end of the day, no one should be viewing dev branch unless they know what they are doing in which sense they'd know we don't publish those

Copy link
Member

Choose a reason for hiding this comment

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

I guess I coudl also add some functionality so we add an automatic alert on top of those sources that we don't publish on master. I'll create a ticket

Copy link
Member

Choose a reason for hiding this comment

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

1. Create a VM using the latest Kairos image:


```
Copy link
Member

Choose a reason for hiding this comment

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

If this only works with Ubuntu 24.04 then you can add the only-flavors here ... if it's with multiple flavors then I guess there should also be a shortcode for that?

Suggested change
```
```bash {class="only-flavors=Ubuntu+24.04"}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We only push ubuntu 24.04, hardcoded: https://github.com/kairos-io/kairos/blob/48d5c2bc8fc5555263f799db8a3388d7d46cd559/.github/workflows/upload-cloud-images.yaml#L65

It doesn't matter because people are supposed to reset to whatever image they want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I commited the suggestion but I'm not sure it's right. We don't want to appear as if only ubuntu is supported on public cloud, because that's not true. It's just that we only push one image because that can be used to install any image. The choice of flavor we push was random.

Copy link
Member

Choose a reason for hiding this comment

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

I'd add another alert on top to clarify that, but the truth is that the script is literary only possible to run with the ubuntu image so I think it's good this way and the extra alert could clear out any doubts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Under review 🔍
Development

Successfully merging this pull request may close these issues.

3 participants