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

jenkins: add --json-key and --sdk-url to cork update commands #158

Merged
merged 1 commit into from
Oct 7, 2021

Conversation

tormath1
Copy link
Contributor

@tormath1 tormath1 commented Oct 5, 2021

it pulls flatcar/mantle#239 to be able to
use --json-key and --sdk-url in order to access private GCS bucket

Signed-off-by: Mathieu Tortuyaux [email protected]

Note for reviewers

  • I have a doubt regarding the availability of GOOGLE_APPLICATION_CREDENTIALS from each script
  • in jenkins/vm.sh we mix GS_DEVEL_CREDS and GOOGLE_APPLICATION_CREDENTIALS - I think they target the same file

CI: http://jenkins.infra.kinvolk.io:8080/job/os/job/manifest/3742/cldsv/

@tormath1 tormath1 self-assigned this Oct 5, 2021
@tormath1 tormath1 marked this pull request as ready for review October 5, 2021 08:08
@tormath1 tormath1 requested a review from a team October 5, 2021 08:08
jenkins/images.sh Outdated Show resolved Hide resolved
Copy link
Member

@dongsupark dongsupark left a comment

Choose a reason for hiding this comment

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

Looks ok.
A test CI run would be great.

@tormath1
Copy link
Contributor Author

tormath1 commented Oct 5, 2021

@tormath1 tormath1 changed the title jenkins: add --json-key to cork update commands jenkins: add --json-key and --sdk-url to cork update commands Oct 6, 2021
@tormath1
Copy link
Contributor Author

tormath1 commented Oct 6, 2021

@jepio @dongsupark I added too the --sdk-url to target the GCS bucket (otherwise it was defaulting to the mirror). CI is started (at least for the toolchain).

NOTE: I started the build with SDK_URL_PATH=/flatcar-jenkins/sdk and SDK_VERSION=3005.0.0 otherwise it fails to do some hack for using nightly SDK (https://github.com/kinvolk/jenkins-os/blob/5bb18e314ac7dab8e71038389fe4dd0bf09ccda3/os/manifest.groovy#L228-L233)

@krnowak
Copy link
Member

krnowak commented Oct 7, 2021

@tormath1 : For each script in the jenkins directory, you would need to look at the respective job file in jenkins-os. The GOOGLE_APPLICATION_CREDENTIALS thing is a mess, if you ask me. It's an env var that is probably also respected by mantle (try grepping for it there). So jenkins-os seems to specify it in environment, then mantle sometimes picks that up. It's horrible and annoying to track.

We seem to have two sets of creds - one for uploading the development files (GS_DEVEL_CREDS), and one for uploading release files (GS_RELEASE_CREDS). jenkins-os sets GOOGLE_APPLICATION_CREDENTIALS env var to one of them. In case of vms.sh, GS_RELEASE_CREDS is mapped to GOOGLE_APPLICATION_CREDENTIALS env var and GS_DEVEL_CREDS to GS_DEVEL_CREDS env var. See https://github.com/kinvolk/jenkins-os/blob/flatcar-master/os/board/vm-matrix.groovy#L432-L436

So your changes seem to be alright, but I'm not entirely sure about vms.sh. I'd say that if explicit specification of the key was missing, then it should fall back to GOOGLE_APPLICATION_CREDENTIALS, no?

@tormath1
Copy link
Contributor Author

tormath1 commented Oct 7, 2021

@krnowak thanks for the explanation - I really had a doubt regarding this duality GOOGLE_APPLICATION_CREDENTIALS / GS_DEVEL_CREDS.

I think we're good using GS_DEVEL_CREDS we don't want to upload but to download a SDK (from flatcar-jenkins) and we can see that the enter function does use this creds too in the fetch command, so that "makes sense" but it's a bit confusing.

it pulls flatcar/mantle#239 to be able to
use `--json-key` in order to access private GCS bucket

Signed-off-by: Mathieu Tortuyaux <[email protected]>
@tormath1 tormath1 force-pushed the tormath1/cork-private branch from 021db39 to 998d2f4 Compare October 7, 2021 12:41
@tormath1 tormath1 merged commit dc4e4a8 into main Oct 7, 2021
@tormath1 tormath1 deleted the tormath1/cork-private branch October 7, 2021 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants