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.
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.
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.
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.
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.
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
| 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") |
4cf21c8 to
3021ce1
Compare
3021ce1 to
09d433d
Compare
yuqi-zhang
left a comment
There was a problem hiding this comment.
Let's give it a try, thanks for the fix!
|
/lgtm |
Closes: #328