-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[improve][build] Improve the publishing of docker image #20433
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
Conversation
15d3eac to
3c799d9
Compare
I support this change, but the usage of The default build process should have built pulsar/docker/pulsar-all/pom.xml Lines 71 to 86 in bdd1bf1
We might have to dig deeper. A possible way to prevent using an old image would be to use a per-build invocation tag instead of using |
|
Using the Git SHA as part of the tag and ensuring that the repository is clean before building would be a useful improvement over the changes already in this PR. The problem with project.version is that it's not unique. It's better than The https://github.com/git-commit-id/git-commit-id-maven-plugin maven plugin could be used to find out the commit hash. |
|
Note that I didn't use the We should update the script to use this command and see why it didn't pick the correct image. |
|
Hi @lhotari, thank you for your explanation!
I agreed that use Git SHA, which is unique, but we can also use the project.version when building the apachepulsar/puslar-all:3.0.0 image, and we use the apachepulsar/pulsar:3.0.0 as the base image, which will does not cause version confusion unless you provide the wrong version number. |
|
Hi @cbornet, it looks your command is correct, I need to reproduce your case. If you still have build logs on your computer, please let me know. |
|
Hi, I don't think this is the root cause. The root cause is here: #20420 (comment) I have pushed a PR to address the root cause: #20435 |
|
@RobertIndie Good catch! BTW, we still need to update the Right now we have I think we should the maven command instead shell script, we also cherry-pick the build and script changes for other branches to unify the release process. please let me know your thoughts. |
Signed-off-by: Zixuan Liu <nodeces@gmail.com>
3c799d9 to
fafadee
Compare
The version number doesn't address the problem since the version number doesn't uniquely identify the build product (artifact). The project.version is not much better than @nodece Your PR would be a good solution by simply continuing the work and making it use a tag that is for example a combination of the project.version and the git sha. I hope you could consider this. |
|
I guess we would need to backport the solution to all maintenance branches so that maintenance release docker images don't get mixed up. The script shouldn't attempt to push the |
eolivelli
left a comment
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.
+1
|
@nicoloboschi PTAL |
RobertIndie
left a comment
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 see that some parts of the changes are moved from #20435 to here.
I agree that we need to update the publish.sh script. But after Pulsar 3.0, the method for building docker image is different. Please see #20420 (comment)
I am afraid that the publish.sh in this PR doesn't build the arm64 image.
I think this PR can be focused on the improvement of publish.sh. And #20435 can focus on the fix of the current build.
lhotari
left a comment
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.
- Git SHA should be part of the tag (it could be an extra tag) so that it is unique and ensures that the correct parent image is used, also in the case that the build ordering wouldn't be effective for some reason.
- what if "pulsar-all" gets built before "pulsar" in the build?
- Pushing the latest tag should be prevented in maintenance branch publishing process and scripts used to do the publishing
@RobertIndie @cbornet @tisonkun Is https://pulsar.apache.org/contribute/release-process/#stage-docker-images up-to-date with this information? |
@cbornet Would you mind getting the process description in https://pulsar.apache.org/contribute/release-process/#stage-docker-images up-to-date with this information? /cc @tisonkun |
|
I think we need to handle the two points :
|
|
Move to #20462 |
Motivation
docker/publish.shscript always publishes the latest image, this causes the pulsar version issue: [Bug] Latest docker image version should be 2.11.0 #19544pulsar-all/Dockerfilealways uses theapachepulsar/pulsar:latestas the base image, so cause [Bug] pulsar-all 3.0.0 docker image contains Pulsar 2.11.0 #20420Modifications
docker/publish.shscript.PULSAR_IMAGEto thedocker/pulsar-all/Dockerfileto avoid using incorrect image.Documentation
docdoc-requireddoc-not-neededdoc-complete