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

Consider sending fedmsg when stream metadata changes #225

Closed
bgilbert opened this issue Jul 22, 2019 · 7 comments · Fixed by coreos/fedora-coreos-pipeline#288
Closed

Consider sending fedmsg when stream metadata changes #225

bgilbert opened this issue Jul 22, 2019 · 7 comments · Fixed by coreos/fedora-coreos-pipeline#288
Assignees
Labels
jira for syncing to jira kind/new-feature

Comments

@bgilbert
Copy link
Contributor

Something might want to process stream metadata updates without polling.

@lucab
Copy link
Contributor

lucab commented Jul 23, 2019

Even in the case of polling, a "stream metadata updated" event can be used as a trigger to do an immediate refresh instead of waiting for the whole polling period.
Assuming the event stream can be watched by the general audience (i.e. it does not contain sensitive data that requires ACLs), this is interesting for the Cincinnati backend.

@jlebon
Copy link
Member

jlebon commented Aug 20, 2020

We should be able to do this pretty easily now that we're set up to send fedmsgs. See possible message template for this at #198 (comment).

@jlebon
Copy link
Member

jlebon commented Aug 20, 2020

So releases today actually happen in three steps:

Technically, it's released as part of the first step, but it doesn't actually show up on the website until the last step.

I think we should just have a fedmsg for each. The first one could be e.g. org.fedoraproject.prod.coreos.release and the second one org.fedoraproject.prod.coreos.metadata-update. We'll need to add change detection to the sync job so we just no-op if nothing actually changed.

@jlebon
Copy link
Member

jlebon commented Aug 20, 2020

Some context on this from IRC: this came up in a discussion with @AdamWill who was interested in these messages to be able to hook FCOS releases into openQA testing. One suggestion I made was to hook it to builds instead of releases so tests happen earlier. But we also today don't emit messages on new builds. So in total I think there would be 4 useful messages to add:

  • build started
  • build stopped (with final result)
  • build was released
  • stream metadata was synced

For the first two, see the first bikeshed message payload at #198 (comment).

(I realize this is hijacking the original ticket a bit, though it's good to think about how all these messages fit together.)

@AdamWill
Copy link

for my purposes, the key requirements are that the message be emitted when a new set of artifacts (specifically the "live" ISO and/or the disk images, assuming those can be booted if attached to a VM and fed an ignition file somehow, I haven't tested that yet) is available for download, and that a consumer can discover or reliably infer (by some kind of predictable and stable pattern) the location of the artifacts from the contents of the message.

@dustymabe
Copy link
Member

So in total I think there would be 4 useful messages to add:

  • build started
  • build stopped (with final result)
  • build was released
  • stream metadata was synced

SGTM

@jlebon jlebon self-assigned this Oct 29, 2020
@jlebon jlebon added the jira for syncing to jira label Oct 29, 2020
jlebon added a commit to jlebon/coreos-assembler that referenced this issue Oct 30, 2020
This function will be used for sending informational messages (i.e. for
which we don't expect a reply) other services may care about. The new
fedmsgs are, with prefix omitted:

- `build.state.change`: to signal build start and finish
- `stream.release`: to signal stream release
- `stream.metadata.update`: to signal stream metadata change

Ref: coreos/fedora-coreos-tracker#225
jlebon added a commit to jlebon/coreos-assembler that referenced this issue Oct 30, 2020
This function will be used for sending informational messages (i.e. for
which we don't expect a reply) other services may care about. The new
fedmsgs are, with prefix omitted:

- `build.state.change`: to signal build start and finish
- `stream.release`: to signal stream release
- `stream.metadata.update`: to signal stream metadata change

Ref: coreos/fedora-coreos-tracker#225
jlebon added a commit to jlebon/fedora-coreos-pipeline that referenced this issue Oct 30, 2020
This patch adds four new fedmsgs:
- `build.state.change`: emitted at the start and end of a build
- `stream.release`: emitted when a build is released
- `stream.metadata.update`: emitted for stream/graph metadata updates

This will allow other services to hook more closely into our process.
Some use cases right now are AWS Marketplace listing updates, mirrors
triggering a sync, and OpenQA testing the latest artifacts.

I started with a helper for sending the messages in `utils`, but I'd
like to get rid of `utils` down the line in favour of moving all that
functionality into the shared library.

Closes: coreos/fedora-coreos-tracker#225
jlebon added a commit to jlebon/fedora-coreos-pipeline that referenced this issue Oct 30, 2020
This patch adds four new fedmsgs:
- `build.state.change`: emitted at the start and end of a build
- `stream.release`: emitted when a build is released
- `stream.metadata.update`: emitted for stream/graph metadata updates

This will allow other services to hook more closely into our process.
Some use cases right now are AWS Marketplace listing updates, mirrors
triggering a sync, and OpenQA testing the latest artifacts.

I started with a helper for sending the messages in `utils`, but I'd
like to get rid of `utils` down the line in favour of moving all that
functionality into the shared library.

Closes: coreos/fedora-coreos-tracker#225
openshift-merge-robot pushed a commit to coreos/coreos-assembler that referenced this issue Nov 2, 2020
This function will be used for sending informational messages (i.e. for
which we don't expect a reply) other services may care about. The new
fedmsgs are, with prefix omitted:

- `build.state.change`: to signal build start and finish
- `stream.release`: to signal stream release
- `stream.metadata.update`: to signal stream metadata change

Ref: coreos/fedora-coreos-tracker#225
jlebon added a commit to jlebon/fedora-coreos-pipeline that referenced this issue Nov 4, 2020
This patch adds four new fedmsgs:
- `build.state.change`: emitted at the start and end of a build
- `stream.release`: emitted when a build is released
- `stream.metadata.update`: emitted for stream/graph metadata updates

This will allow other services to hook more closely into our process.
Some use cases right now are AWS Marketplace listing updates, mirrors
triggering a sync, and OpenQA testing the latest artifacts.

I started with a helper for sending the messages in `utils`, but I'd
like to get rid of `utils` down the line in favour of moving all that
functionality into the shared library.

Closes: coreos/fedora-coreos-tracker#225
jlebon added a commit to coreos/fedora-coreos-pipeline that referenced this issue Nov 9, 2020
This patch adds four new fedmsgs:
- `build.state.change`: emitted at the start and end of a build
- `stream.release`: emitted when a build is released
- `stream.metadata.update`: emitted for stream/graph metadata updates

This will allow other services to hook more closely into our process.
Some use cases right now are AWS Marketplace listing updates, mirrors
triggering a sync, and OpenQA testing the latest artifacts.

I started with a helper for sending the messages in `utils`, but I'd
like to get rid of `utils` down the line in favour of moving all that
functionality into the shared library.

Closes: coreos/fedora-coreos-tracker#225
@jlebon
Copy link
Member

jlebon commented Nov 12, 2020

@AdamWill this is in production now. Here is an example fedmsg emitted when a build is done:

https://apps.fedoraproject.org/datagrepper/id?id=2020-81657c3b-9703-431a-8c3c-0b409743fac4&is_raw=true&size=extra-large

Copying relevant snippet for posterity:

{
  "topic": "org.fedoraproject.prod.coreos.build.state.change", 
  "msg": {
    "build_id": "32.20201111.20.0", 
    "stream": "testing-devel", 
    "basearch": "x86_64", 
    "build_dir": "https://builds.coreos.fedoraproject.org/prod/streams/testing-devel/builds/32.20201111.20.0/x86_64", 
    "state": "FINISHED", 
    "result": "SUCCESS"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
jira for syncing to jira kind/new-feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants