Skip to content

Instantly share code, notes, and snippets.

@cgwalters
Created January 2, 2020 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cgwalters/4135ab18f7ead2d51c968fa303b5c45b to your computer and use it in GitHub Desktop.
Save cgwalters/4135ab18f7ead2d51c968fa303b5c45b to your computer and use it in GitHub Desktop.
Extend previous coreos-assembler build with a new AWS region

First you'll need an initialized cosa workdir:

cosa init https://github.com/coreos/fedora-coreos-config

Now, we need the previous build data: coreos/coreos-assembler#1013

But we can hand-roll that too:

$ buildid=31.20191219.20.1
$ mkdir -p builds/${buildid}/x86_64
$ (cd builds/${buildid}/x86_64 && curl -LO https://builds.coreos.fedoraproject.org/prod/streams/testing-devel/builds/${buildid}/x86_64/meta.json)

Extend with the new region:

$ cosa aws-replicate --build "${buildid}" --region me-south-1

And save the updated meta.json:

$ cosa buildupload --build "${buildid}" s3://...
@sosiouxme
Copy link

for 4.2 arch is not included in the path. but even after removing that, the buildupload didn't work for me:

 cosa buildupload --build "${buildid}" s3 s3://art-rhcos-ci/releases/rhcos-4.2
NOTICE: No tmp/builds-source.txt file; uploading without buildprep?
Targeting build: 42.80.20191002.0
Traceback (most recent call last):
  File "/usr/lib/coreos-assembler/cmd-buildupload", line 191, in <module>
    sys.exit(main())
  File "/usr/lib/coreos-assembler/cmd-buildupload", line 30, in main
    args.func(args)
  File "/usr/lib/coreos-assembler/cmd-buildupload", line 66, in cmd_upload_s3
    for arch in builds.get_build_arches(args.build):
  File "/usr/lib/coreos-assembler/cosalib/builds.py", line 76, in get_build_arches
    assert False, "Build not found!"
AssertionError: Build not found!

Eventually just used the aws tool directly...

# aws s3 cp s3/meta.json s3://art-rhcos-ci/releases/rhcos-4.2/42.80.20191002.0/meta.json 
upload: s3/meta.json to s3://art-rhcos-ci/releases/rhcos-4.2/42.80.20191002.0/meta.json

@cgwalters
Copy link
Author

Eventually just used the aws tool directly...

That's totally fine! It's intentional that the "cosa schema" is just some JSON and files stored in S3, not much magic to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment