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

aws-test: Drop need for parameters, just use latest/ #312

Merged
merged 3 commits into from
Sep 27, 2018

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Sep 25, 2018

Get rid of the need to pass parameters to the aws-test job in
preparations for turning on keepUndefinedParameters=true (edit: false, not true!) in the
Jenkins instance.

We only every run the aws-test job from the cloud job, so we know at
that point that the latest output is in latest/. We can just resolve
that back to a specific versioned dir before proceeding.

This normalizes the aws-test job to take the exact same parameters as
the others, and makes it easy to e.g. run the job manually like the
others.

See thread for context.

(Untested)

@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 25, 2018
Copy link
Contributor

@dm0- dm0- left a comment

Choose a reason for hiding this comment

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

Do we care about the ability to rerun tests on an image, like when it fails due to flakes?

@@ -216,7 +216,7 @@ node(NODE) {
string(credentialsId: params.AWS_CI_ACCOUNT, variable: 'AWS_CI_ACCOUNT'),
]) {
sh """
amijson=${dirpath}/aws-${AWS_REGION}-smoketested.json
amijson=${dirpath}/aws-${AWS_REGION}.json
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, we decided to add the smoketested tag since we run rhcos.basic tests in the cloud job before we generate the ami, thus the generated image should at least boot, can ssh, etc. I'm ok with changing it, but that's the original reasoning we had behind it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Since we don't upload it at all if it doesn't pass the smoketest, I think I'm OK with omitting it. Kinda bikeshed though, I'm fine keeping it if someone feels strongly about it.

currentBuild.description = "version=${version} ami=${ami_intermediate}"
sh """
# Do testing with intermediate aws image passed in by cloud job
if ! kola -b rhcos -p aws --aws-type ${aws_type} --tapfile rhcos-aws.tap --aws-ami ${ami_intermediate} --aws-region ${AWS_REGION} -j ${NUM_VMS} run; then
if ! kola -b rhcos -p aws --aws-type t2.small --tapfile rhcos-aws.tap --aws-ami ${ami_intermediate} --aws-region ${AWS_REGION} -j ${NUM_VMS} run; then
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we wanted to keep the configurable for potential future use, but again I'm ok with changing it to be hard defined to simplify things

Copy link
Member Author

Choose a reason for hiding this comment

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

Ahh OK, in that case we can make it a proper parameter. Though until then, I'd rather not make define_properties() more complex until we need it?

@jlebon
Copy link
Member Author

jlebon commented Sep 25, 2018

Do we care about the ability to rerun tests on an image, like when it fails due to flakes?

Hmm, not sure. If the test fails, we can just rerun it, right? Sure, the latest/ might've changed again, but that's the one we'd want to promote anyway.

try {
utils.inside_assembler_container("-v /srv:/srv") {
stage("Sync In") {
withCredentials([
string(credentialsId: params.ARTIFACT_SERVER, variable: 'ARTIFACT_SERVER'),
sshUserPrivateKey(credentialsId: params.ARTIFACT_SSH_CREDS_ID, keyFileVariable: 'KEY_FILE'),
]) {
dirpath = "${images}/cloud/latest"
sh "mkdir -p ${dirpath}"
utils.rsync_file_in(ARTIFACT_SERVER, KEY_FILE, "${dirpath}/meta.json")
Copy link
Member

Choose a reason for hiding this comment

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

Doing things like this is going to trigger the problems I was trying to solve with #211 right?

Copy link
Member Author

Choose a reason for hiding this comment

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

I think we could adapt it when we adapt the rest of this script, no? E.g. we could just rsync to the workspace instead of /srv. Or I might be misunderstanding what you mean.

Copy link
Member Author

Choose a reason for hiding this comment

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

This job wouldn't be too hard to rework without /srv given that we're only syncing tiny JSON files. Let's do that in a follow-up patch?

Copy link
Member

Choose a reason for hiding this comment

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

As is today it adds a risk that we'll clobber a meta.json built by the cloud job right?

Copy link
Member Author

Choose a reason for hiding this comment

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

We're only rsync'ing out to one location though, right? (${images}/aws-${AWS_REGION}-tested.json). And that file is owned by this job.

Copy link
Member

Choose a reason for hiding this comment

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

We're rsyncing in to the same path though.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ohh sigh, yes I see it now. OK, will take a look at it tomorrow.

Copy link
Member Author

Choose a reason for hiding this comment

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

OK, whipped something up in ⬇️. The delta is now larger though... so I'll have to test this after all.

@jlebon jlebon force-pushed the pr/undefined-params branch from a4e3734 to 4901a51 Compare September 26, 2018 17:56
@jlebon
Copy link
Member Author

jlebon commented Sep 26, 2018

Rebased to resolve conflicts! ⬆️

@miabbott
Copy link
Member

I like these changes 😄 LGTM

@jlebon
Copy link
Member Author

jlebon commented Sep 26, 2018

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 26, 2018
I found it misleading that the `cloud` job uploaded the AMI JSON
metadata with `-smoketested.json` appended *before* it was even tested.
Let's make this clearer by keeping that suffix off until it's actually
true.
Get rid of the need to pass parameters to the `aws-test` job in
preparations for turning on `keepUndefinedParameters=true` in the
Jenkins instance.

We only every run the `aws-test` job from the `cloud` job, so we know at
that point that the latest output is in `latest/`. We can just resolve
that back to a specific versioned dir before proceeding.

This normalizes the `aws-test` job to take the exact same parameters as
the others, and makes it easy to e.g. run the job manually like the
others.
We shouldn't `rsync` to the shared `/srv` location. Just sync directly
to our `WORKSPACE` to avoid races.

See also openshift#211.
@jlebon jlebon force-pushed the pr/undefined-params branch from 77a0490 to a5a1f58 Compare September 27, 2018 13:46
@jlebon
Copy link
Member Author

jlebon commented Sep 27, 2018

OK, rebased and tested, modulo the bits that actually push out to AWS/artifact server!
/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 27, 2018
@cgwalters
Copy link
Member

OK let's give it a try!

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 27, 2018
@openshift-merge-robot openshift-merge-robot merged commit 6588070 into openshift:master Sep 27, 2018
jlebon added a commit to jlebon/os that referenced this pull request Sep 27, 2018
Minor regression from openshift#312. We no longer copy this file in `/srv` now,
we upload it directly from our workspace.
@cgwalters
Copy link
Member

This normalizes the aws-test job to take the exact same parameters as
the others, and makes it easy to e.g. run the job manually like the
others.

I had a question about this. We could instead add parameters to the test job, and if we wanted to retest, we'd use "rebuild last" instead of just "rebuild" which should pass the exact same parameters - right?

@yuqi-zhang
Copy link
Contributor

I assume the key parameter is just the ami, then we would just revert back to passing in the ami as a parameter from another job?

@jlebon
Copy link
Member Author

jlebon commented Oct 10, 2018

We could instead add parameters to the test job, and if we wanted to retest, we'd use "rebuild last" instead of just "rebuild" which should pass the exact same parameters - right?

Yeah, basically this whole PR tried to solve the need for parameters by completely nixing them. We could've also made them explicit parameters only for the aws job at the expense of slightly complicating define_properties().

@jlebon jlebon deleted the pr/undefined-params branch April 23, 2023 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants