-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Conversation
WORKSPACE.yaml
Outdated
@@ -8,6 +8,7 @@ defaultArgs: | |||
publishToJBMarketplace: true | |||
localAppVersion: unknown | |||
codeCommit: 239fa626a44652cebf293a994a3330e90e873daa | |||
codeVersion: 1.72.2 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
gitpod/.werft/jobs/build/build-and-publish.ts
Lines 44 to 57 in cb83111
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
It works as expected, could you add a commit to change CodeIDEImageStableVersion ? |
c3ac5fc
to
1b7086c
Compare
1b7086c
to
eec63ed
Compare
33e3fbd
to
e8376b7
Compare
If you take at the last job, you can see it fails correctly: |
c79c18a
to
1f6abe9
Compare
Co-authored-by: Anton Kosyakov <[email protected]> Co-authored-by: iQQBot <[email protected]> Co-authored-by: mustard <[email protected]>
1f6abe9
to
8297f57
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Description
Adds the
io.gitpod.ide.commit
andio.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 throughide-service
.How to test
go install github.com/csweichel/oci-tool@latest
oci-tool fetch image IMAGE_FROM_STEP_2 | jq .config.Labels
and check whether both attributes are presentRelease Notes
Werft options:
If enabled this will build
install/preview
Valid options are
all
,workspace
,webapp
,ide