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

release: Copy oscontainer to quay.io #383

Closed

Conversation

cgwalters
Copy link
Member

This is a bit hacky but should work. My initial goal here
is just automated uploads of our builds, so that we can
start getting a better feel for managing "ostree-in-container"
releases.

We should sync to quay.io/coreos but that needs someone to set that up.

Also, I'd like to make the destination configurable in the same
way as the S3 bucket, proposal PR in coreos/fedora-coreos-config#1175

Closes: #359

This is a bit hacky but should work.  My initial goal here
is just automated uploads of our builds, so that we can
start getting a better feel for managing "ostree-in-container"
releases.

We should sync to `quay.io/coreos` but that needs someone to set that up.

Also, I'd like to make the destination configurable in the same
way as the S3 bucket, proposal PR in coreos/fedora-coreos-config#1175

Closes: coreos#359
@cgwalters
Copy link
Member Author

Enabling this requires:

$ oc create secret generic oscontainer-registry --from-file=dockercfg=/path/to/quay.io/creds

Copy link
Member

@jlebon jlebon left a comment

Choose a reason for hiding this comment

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

Could you add an [OPTIONAL] section to the HACKING.md about how to provision the secret?

Comment on lines +57 to +59
- name: oscontainer-registry
mountPath: /run/kubernetes/secrets/oscontainer-registry
readOnly: true
Copy link
Member

Choose a reason for hiding this comment

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

So one recent-ish move is going away from the "all secrets mounted into the cosa pod" model towards Jenkins secrets. See e.g. 7449712.

So concretely, this would mean doing it like this:

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. I understand the reasons for that, but this is not very DRY. Maybe we can figure out how to automatically scrape all relevant secrets from the namespace into Jenkins creds.

Alternatively, one approach is to run separate pods with separate creds, but that would entail a lot more state juggling.

Copy link
Member

Choose a reason for hiding this comment

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

Having something which auto-generates creds from OpenShift secrets makes sense to me. It doesn't seem like JCASC natively supports this, though it wouldn't be hard to just write a script which generates the drop-ins based on an annotation or something.

--arch=all s3://${s3_stream_dir}/builds
""")
}

def oscontainer_secret = "/run/kubernetes/secrets/oscontainer-registry/dockercfg";
if (utils.pathExists(oscontainer_secret)) {
Copy link
Member

Choose a reason for hiding this comment

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

Maybe for now, let's conditionalize this on non-production builds to start with?

stage('Sync oscontainer to quay.io') {
shwrap("""ociarchive=\$(cosa meta --image-path ostree)
case \${ociarchive} in
*ociarchive) skopeo copy --authfile=$oscontainer_secret oci-archive://\${ociarchive} docker://quay.io/cgwalters/fcos:${params.STREAM};;
Copy link
Member

Choose a reason for hiding this comment

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

I'll try to get an answer to #359 (comment) so we can update this.

@cgwalters
Copy link
Member Author

Superceded by #457

@cgwalters cgwalters closed this Jan 25, 2022
cgwalters added a commit to cgwalters/coreos-layering-examples that referenced this pull request Jan 27, 2022
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.

add ostree-container upload support
2 participants