-
Notifications
You must be signed in to change notification settings - Fork 111
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
Copy tested AMI to more regions #330
Copy tested AMI to more regions #330
Conversation
Still playing with/testing this - it looks like we at least also need to replicate the launch permissions, and possibly the tags. |
e3ef6e6
to
5ccc449
Compare
OK so I updated this to support copying tags and making the image public. Currently hitting:
AFAICS, mantle has some code to retry/poll for GCE, but not for AWS? Googling for the error I see other people hitting it though, looks like at least... Oh wait, hey there's https://docs.ansible.com/ansible/devel/modules/ec2_ami_copy_module.html#ec2-ami-copy-module |
5ccc449
to
ae8333d
Compare
Some more investigation turns up the handy |
ad1aa5e
to
4cf21c8
Compare
OK, the script seems to work for me locally. I didn't test the Lifting WIP - but let's wait to merge till next Monday at the earliest. |
One thing I want to note about this is that the "AMI JSON" format intentionally matches the existing Container Linux schema. |
Jenkinsfile.aws-test
Outdated
${WORKSPACE}/aws-${AWS_REGION}.json \ | ||
s3://${S3_PUBLIC_BUCKET}/aws-${AWS_REGION}-tested.json | ||
# Upload the json files to a public location | ||
for k in aws-${AWS_REGION}-tested.json aws-tested.json; do |
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.
We renamed aws-${AWS_REGION}-tested.json
to aws-${AWS_REGION}.json
in the workspace. It's only called aws-${AWS_REGION}-tested.json
in the bucket and the artifact server.
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 I rebased and fixed this ⬇️ , thanks for spotting it.
Jenkinsfile.aws-test
Outdated
# Upload the json files to a public location | ||
for k in aws-${AWS_REGION}-tested.json aws-tested.json; do | ||
aws s3 cp --acl public-read ${WORKSPACE}/\${k} \ | ||
s3://${S3_PUBLIC_BUCKET}/\${k} |
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.
Is there a reason we're uploading them separately? I'm not against it, just thought it might be slightly confusing to have aws-us-test-1-tested.json
for us-east-1
and aws-tested.json
in a list format for us-east-2
and us-west-1
, in case someone attempts to query, they would have to do different formatted queries for the 2 json files.
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 think my vote would be to delete the old file after ensuring that no one is using it.
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.
As in remove aws-us-test-1-tested.json
and have a list in aws-tested.json
? I think that makes sense.
Jenkinsfile.aws-test
Outdated
@@ -86,6 +99,7 @@ node(NODE) { | |||
sshUserPrivateKey(credentialsId: params.ARTIFACT_SSH_CREDS_ID, keyFileVariable: 'KEY_FILE'), | |||
]) { | |||
utils.rsync_file_out_dest(ARTIFACT_SERVER, KEY_FILE, "${WORKSPACE}/aws-${AWS_REGION}.json", "${images}/aws-${AWS_REGION}-tested.json") | |||
utils.rsync_file_out_dest(ARTIFACT_SERVER, KEY_FILE, "${WORKSPACE}/aws-tested.json", "${images}/aws-tested.json") |
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.
Same thought as above
4cf21c8
to
3021ce1
Compare
3021ce1
to
09d433d
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.
Let's give it a try, thanks for the fix!
/lgtm |
Closes: #328