Skip to content

Tag VS Code images with version #14055

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

Merged
merged 1 commit into from
Oct 21, 2022
Merged

Tag VS Code images with version #14055

merged 1 commit into from
Oct 21, 2022

Conversation

filiptronicek
Copy link
Member

@filiptronicek filiptronicek commented Oct 20, 2022

Description

Adds the io.gitpod.ide.commit and io.gitpod.ide.version labels to all images for VS Code built inside of this repository. This will allow us to add an interface on Server API through ide-service.

How to test

  1. Go to the Werft job results [link]
  2. Copy the third docker image link
    image
  3. Install OCI tool within a workspace (could also do locally): go install github.com/csweichel/oci-tool@latest
  4. Execute oci-tool fetch image IMAGE_FROM_STEP_2 | jq .config.Labels and check whether both attributes are present

Release Notes

NONE

Werft options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide

WORKSPACE.yaml Outdated
@@ -8,6 +8,7 @@ defaultArgs:
publishToJBMarketplace: true
localAppVersion: unknown
codeCommit: 239fa626a44652cebf293a994a3330e90e873daa
codeVersion: 1.72.2
Copy link
Contributor

Choose a reason for hiding this comment

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

Note another place to change for code image build. XD

Copy link
Contributor

@mustard-mh mustard-mh Oct 20, 2022

Choose a reason for hiding this comment

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

Can't we get this from code build(building process(package.json) or result (oci-tool))? instead of changing codes?

Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately image label cannot be computed during Docke build. We have to provide it via arg

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not do it like code-nightly do in this PR https://github.com/gitpod-io/gitpod/pull/14055/files#diff-3a4804782c8876a5e55d41725ccd6494495fcd585f75559bf4e1953ba8db5997R36-R37?

codeVersion=$(curl https://github.com/raw/gitpod-io/openvscode-server/$headCommit/package.json | jq .version)
leeway build -Dversion=nightly -DimageRepoBase=eu.gcr.io/gitpod-core-dev/build -DcodeCommit=$headCommit -DcodeVersion=$codeVersion -DcodeQuality=insider .:docker

Copy link
Member

Choose a reason for hiding this comment

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

How would you do it in WORKSPACE.yaml for stable? Please feel free to send a PR against this PR.

Copy link
Member

@jeanp413 jeanp413 Oct 21, 2022

Choose a reason for hiding this comment

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

@akosyakov @filiptronicek there's docker-build-options in leeway

Copy link
Contributor

Choose a reason for hiding this comment

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

This is the same as the implementation here, we have no way to get the version at docker build time (we checkout openvscode-server only at docker build time)

Although leeway can't do this, we can use the github raw file api to get the version number and pass it to leeway before the werft job starts leeway.
i.e. here

if (publishRelease) {
exec(`gcloud auth activate-service-account --key-file "/mnt/secrets/gcp-sa-release/service-account.json"`);
}
const buildArguments = Object.entries({
version: version,
removeSources: "false",
imageRepoBase: imageRepo,
localAppVersion: localAppVersion,
SEGMENT_IO_TOKEN: process.env.SEGMENT_IO_TOKEN,
REPLICATED_API_TOKEN: process.env.REPLICATED_API_TOKEN,
REPLICATED_APP: process.env.REPLICATED_APP,
npmPublishTrigger: publishToNpm ? Date.now().toString() : "false",
}).map(([key, value]) => `-D${key}=${value}`).join(" ");

But we can merge this PR first, and do a follow up PR

Copy link
Contributor

Choose a reason for hiding this comment

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

I am doing rebase this PR to main, and build vscode image

Copy link
Member

Choose a reason for hiding this comment

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

@mustard-mh what do you mean just pass the version like this --docker-build-options="label=foo,label=bar" in code-nightly.yml

Copy link
Contributor

Choose a reason for hiding this comment

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

OK build success, let's we merge it, and change code stable image in next PR

@iQQBot
Copy link
Contributor

iQQBot commented Oct 20, 2022

image

It works as expected, could you add a commit to change CodeIDEImageStableVersion ?

@filiptronicek filiptronicek force-pushed the ft/add-ide-versions branch 4 times, most recently from 33e3fbd to e8376b7 Compare October 21, 2022 10:42
@filiptronicek
Copy link
Member Author

If you take at the last job, you can see it fails correctly:
image

Co-authored-by: Anton Kosyakov <[email protected]>
Co-authored-by: iQQBot <[email protected]>
Co-authored-by: mustard <[email protected]>
Copy link
Contributor

@mustard-mh mustard-mh left a comment

Choose a reason for hiding this comment

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

LGTM

@roboquat roboquat merged commit df68a2c into main Oct 21, 2022
@roboquat roboquat deleted the ft/add-ide-versions branch October 21, 2022 17:48
@mustard-mh mustard-mh mentioned this pull request Oct 21, 2022
4 tasks
@roboquat roboquat added deployed: IDE IDE change is running in production deployed Change is completely running in production labels Oct 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: IDE IDE change is running in production deployed Change is completely running in production release-note-none size/S team: IDE
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants