-
Notifications
You must be signed in to change notification settings - Fork 839
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
[CI] Distribute connect
as a rpk managed plugin
#2825
Conversation
connect
as a rpk managed pluginconnect
as a rpk managed plugin
ce82e8a
to
8c56abc
Compare
connect
as a rpk managed pluginconnect
as a rpk managed plugin
7dafd90
to
133880b
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.
🚀 lgtm, this is great!
133880b
to
4193ea8
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.
needs guard in upload_plugin.yml
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.
LGTM
Hey @jackietung-redpanda, I'm aiming to tag a release later today, is this PR required before we do it or can it wait until the one afterwards? |
6b1ee87
to
91fca6a
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.
i think PRs from forks will still have errors in upload_plugin.yml
, but if you only create PRs from branches on redpanda-data/connect
you will be fine
dismissing my review to unblock merge, but left comment on suggested change
91fca6a
to
18ff172
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.
LGTM
Project context is here.
This PR tackles the workflow of uploading
connect
to a designed S3 repo, which acts as the "rpk plugin" repo, used only byconnect
for now.plugin_uploader.py
To be run after
goreleaser
has built the binaries.upload-archives
creates and uploads the archives.upload-manifest
creates and uploads the finalmanifest.json
file. RPK usesmanifest.json
to know what plugins are available and how to download them (download URL, etc.). Comes with unit tests, basic linters, type checkers, setup in CI.Additional release workflow
.github/workflows/upload_plugin.yml
. High level:goreleaser build
plugin_uploader.py upload-archives ...
plugin_uploader.py upload-manifest ...
Only uploads for real when triggered from a release tag (inc. RC). Otherwise, runs in
--dry-run
mode - no writes to S3.Why not use
goreleaser
built in blob publish support?Goreleaser has "blob" publish support, which kind of can do
upload-archives
in spirit. However, our use case requires additional flexibility in how we set S3 object tags. Ourmanifest.json
must contain SHA256 checksums of the binary payload WITHIN thetar.gz
(rpk
requirement). It would not work gracefully with said blob publishing within Goreleaser.manifest.json
construction logic (upload-archives
) would be needed in any case and most cleanly implemented separately from goreleaser.Generally the design of goreleaser is not conducive to running, testing, debugging, retrying specific parts of the
goreleaser
steps. E.g. Publishing steps are all or nothing. To test blob publishing, one would also be publishing to Github!Overall the monolithic design of goreleaser's runtime makes things tricky for more complex use cases.
Thankfully
goreleaser
provides a clean interface for extension scripts (artifacts.json
,metadata.json
)Why not use
goreleaser
custom publisher support?Similar reasoning to above.
Note the calculus may be different for other use cases. E.g. next task is to build Linux packages for
redpanda-connect
(deb / rpm). The functionality may fit much more closely such that we can accept the drawbacks we describe here. We do that forredpanda-console
(seenfpm
usage there).Why not extend existing
release.yml
Github action workflow?This could be an option in the long term. However this functionality is new and may introduce instability in the main
release.yml
pipeline in the meantime. It will be much cleaner to test, debug, run (and rerun!) as an independent workflow. Some observations:goreleaser release
, onlygoreleaser build
!release.yml
pushes real Github releases and may not be idempotent!Once we gain confidence that both
.github/workflows/upload_plugin.yml
ANDrelease.yml
are very reliable, we can consider merging intorelease.yml
.