KAFKA-19686 : release - Trigger docker builds with rc and release#21963
KAFKA-19686 : release - Trigger docker builds with rc and release#21963muralibasani wants to merge 4 commits intoapache:trunkfrom
Conversation
mimaison
left a comment
There was a problem hiding this comment.
Thanks for looking into this. I left a few suggestions
| if github.GITHUB_REPO != "apache/kafka": | ||
| print(f"NOTE: Using custom repository: {github.GITHUB_REPO}") | ||
| if confirm("Trigger Docker image build workflows via GitHub Actions?"): | ||
| github_token = preferences.get('github_token', lambda: prompt("Enter your GitHub personal access token (with 'actions' scope): ")) |
There was a problem hiding this comment.
Can we have some detail how to generate a token?
There was a problem hiding this comment.
Added get token instructions to template, so when user starts the script, it prints them. https://github.com/apache/kafka/pull/21963/changes#diff-e0b37c325cc2eb8c49ab256555554edc05bf4e316f6d6d728169bdc50eba68c7R271
| for image_type in ["jvm", "native"]: | ||
| github.trigger_docker_build_test(github_token, dev_branch, image_type, kafka_url) | ||
| print("\nDocker Build Test workflows triggered successfully for both JVM and native images.") | ||
| if confirm("Also trigger Docker RC release workflows to push RC images to DockerHub?"): |
There was a problem hiding this comment.
Instead of asking whether to run this step or not, the prompt should ask to go check the builds have succeeded and the reports indicate no CVEs where found. If CVEs are found then we need to update the Dockerfiles and rerun until no CVEs are detected.
Once this is done, the following steps should be run.
There was a problem hiding this comment.
Could we also print links to the builds this triggers?
There was a problem hiding this comment.
Now the flow is in 2 steps.
- Docker Build Test workflows with cve scan prompts
- RC release
There was a problem hiding this comment.
Added a test interactive script and updated pr description with it's execution. There we can see how are the prompts.
There was a problem hiding this comment.
Build run urls are printed yes.
49324d3 to
855a4c1
Compare
@mimaison Thankyou for the review. Made the below changes.
|
|
@mimaison possible for another review ? |
|
@dejan2609 possible for you to review this one ? |
https://issues.apache.org/jira/browse/KAFKA-19686
How It Works
After the RC tag is pushed, the script prompts: "Trigger Docker image
build workflows via GitHub Actions?"
If the user accepts:
Collects the user's GitHub Personal Access Token (with step-by-step
generation instructions; token is saved in preferences for reuse)
Step 1 — Build & CVE scan: Triggers docker_build_and_test.yml for
both JVM and native images. Then asks the user to verify builds passed
with no CVEs. If CVEs are found (n), the user fixes the Dockerfiles
(docker/jvm/Dockerfile, docker/native/Dockerfile) and the script
re-triggers automatically. This loop continues until builds are clean.
Step 2 — RC release: Triggers docker_rc_release.yml for both JVM and
native, pushing RC images to DockerHub with the correct names
(apache/kafka:{rc_tag}, apache/kafka-native:{rc_tag}).
The entire Docker flow is optional — if the user declines the initial
prompt, the existing release flow is unchanged. No new dependencies were
added (only Python stdlib urllib).
Supports GITHUB_DRY_RUN=true (prints API calls without executing) and
GITHUB_REPO=user/fork (test against a personal fork)
Added a interactive test for docker flow. GITHUB_DRY_RUN=true python3
test_docker_trigger_interactive.py