Skip to content

feat(ci): support workflow for docker image building #21626

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

Merged
merged 30 commits into from
May 7, 2025

Conversation

kwannoel
Copy link
Contributor

@kwannoel kwannoel commented Apr 28, 2025

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

Closes #21601.

This PR reduces margin for human error due to manual tagging of images. It also makes tagging entirely optional. We can automatically generate semantically correct tagging after this PR:

v<X.Y.Z[-alpha]>--<label>--<commit_sha>--<git-branch>

We use --, to clearly delimit different sections. Since hyphens - can be used within each segment as well. It will only be a problem if developer uses - as a prefix or suffix. I think that's unlikely.

Test workflow dispatch via cli (actual use will just be via github UI for workflows, see screenshot below):

 gh workflow run 'Build Docker Image' --ref kwannoel/workflow-update-branch --field label='mylabel'

example run

After this PR is merged, we can have a similar UX to this (we won't actual fill in a version, just an arbitrary tag, ignore that part):

Screenshot 2025-04-29 at 4 52 32 PM

This gives us a "form-filling experience", as requested by @BugenZhao. It's inspired by the work by @arkbriar for image building in our other repositories.

Subsequently, I will add docs for how to use this workflow in our internal and developer docs.

Checklist

  • I have written necessary rustdoc comments.
  • I have added necessary unit tests and integration tests.
  • I have added test labels as necessary.
  • I have added fuzzing tests or opened an issue to track them.
  • My PR contains breaking changes.
  • My PR changes performance-critical code, so I will run (micro) benchmarks and present the results.
  • I have checked the Release Timeline and Currently Supported Versions to determine which release branches I need to cherry-pick this PR into.

Documentation

  • My PR needs documentation updates.
Release note

@kwannoel kwannoel force-pushed the kwannoel/workflow-update-branch branch from 1e14fd4 to e462af7 Compare April 29, 2025 06:41
@kwannoel kwannoel changed the title add validation parts for docker image building feat(ci): support workflow for docker image building Apr 29, 2025
@github-actions github-actions bot added type/feature Type: New feature. and removed Invalid PR Title labels Apr 29, 2025
@kwannoel kwannoel marked this pull request as ready for review April 29, 2025 08:53
@kwannoel kwannoel requested a review from hzxa21 April 29, 2025 08:54
@kwannoel kwannoel requested a review from BugenZhao May 3, 2025 03:57
@kwannoel kwannoel force-pushed the kwannoel/workflow-update-branch branch from ff7aff5 to fb373ba Compare May 3, 2025 04:05
echo "LABEL=$LABEL" >> $GITHUB_ENV

# Build the image tag
IMAGE_TAG="v$VERSION--$LABEL--$COMMIT_SHA--$NO_SLASH_BRANCH_NAME"
Copy link
Member

Choose a reason for hiding this comment

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

Is it expected to have 2 dash here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, because branch name can also include dash. I want to clearly delimit each segment. So the tag name is machine readable, and further validation can be done.

@kwannoel kwannoel requested a review from BugenZhao May 6, 2025 11:22
@kwannoel
Copy link
Contributor Author

kwannoel commented May 6, 2025

Any further comments?

@kwannoel kwannoel added this pull request to the merge queue May 7, 2025
Merged via the queue into main with commit fc7ea34 May 7, 2025
10 of 11 checks passed
@kwannoel kwannoel deleted the kwannoel/workflow-update-branch branch May 7, 2025 17:04
Copy link
Contributor

github-actions bot commented May 7, 2025

✅ Cherry-pick PRs (or issues if encountered conflicts) have been created successfully to all target branches.

github-merge-queue bot pushed a commit that referenced this pull request May 8, 2025
github-merge-queue bot pushed a commit that referenced this pull request May 8, 2025
github-merge-queue bot pushed a commit that referenced this pull request May 8, 2025
github-merge-queue bot pushed a commit that referenced this pull request May 8, 2025
Copy link
Member

@xxchan xxchan left a comment

Choose a reason for hiding this comment

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

Maybe we should also only allow images build from the action here and disallow manual building? (unless with some flag)

kwannoel added a commit that referenced this pull request May 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI: When building patch branches, ensure the base branch has the same semver
3 participants