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

[ISSUE #913] Push docker image to apache repo #4282

Merged
merged 2 commits into from
Nov 15, 2023

Conversation

kartiktayal
Copy link
Contributor

Fixes #913.

Motivation

Currently, the workflow only pushed to eventmesh repo on dockerhub
We need the docker image to be pushed under apache repo as well

Modifications

Added the tag for pushing to apache repo on dockerhub

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable)
  • If a feature is not applicable for documentation, explain why?
  • If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

@kartiktayal kartiktayal changed the title Push docker image to apache repo [Enhancement #913]Push docker image to apache repo Jul 25, 2023
@kartiktayal kartiktayal changed the title [Enhancement #913]Push docker image to apache repo [Enhancement #913] Push docker image to apache repo Jul 25, 2023
@mxsm mxsm changed the title [Enhancement #913] Push docker image to apache repo [ISSUE #913] Push docker image to apache repo Jul 27, 2023
@codecov
Copy link

codecov bot commented Jul 28, 2023

Codecov Report

Attention: 99 lines in your changes are missing coverage. Please review.

Comparison is base (2bfc1ae) 16.09% compared to head (54c1e9c) 16.62%.
Report is 20 commits behind head on master.

❗ Current head 54c1e9c differs from pull request most recent head 67dbcdf. Consider uploading reports for the commit 67dbcdf to get more accurate results

Files Patch % Lines
.../eventmesh/runtime/core/protocol/RetryContext.java 0.00% 38 Missing ⚠️
...eventmesh/runtime/boot/AbstractRemotingServer.java 0.00% 9 Missing ⚠️
...time/core/protocol/producer/EventMeshProducer.java 0.00% 8 Missing ⚠️
...spring/source/connector/SpringSourceConnector.java 0.00% 6 Missing ⚠️
...untime/core/protocol/producer/ProducerManager.java 0.00% 6 Missing ⚠️
...core/protocol/http/consumer/EventMeshConsumer.java 0.00% 5 Missing ⚠️
...http/processor/LocalUnSubscribeEventProcessor.java 0.00% 3 Missing ⚠️
...e/eventmesh/protocol/http/HttpProtocolAdaptor.java 0.00% 2 Missing ⚠️
...he/eventmesh/runtime/boot/EventMeshGrpcServer.java 0.00% 2 Missing ⚠️
...re/protocol/http/push/AbstractHTTPPushRequest.java 0.00% 2 Missing ⚠️
... and 15 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #4282      +/-   ##
============================================
+ Coverage     16.09%   16.62%   +0.53%     
- Complexity     1550     1603      +53     
============================================
  Files           730      743      +13     
  Lines         28640    28575      -65     
  Branches       2523     2479      -44     
============================================
+ Hits           4611     4752     +141     
+ Misses        23581    23372     -209     
- Partials        448      451       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kartiktayal
Copy link
Contributor Author

Can I please get some reviews on this @Alonexc @mxsm

.github/workflows/build.yaml Outdated Show resolved Hide resolved
@kartiktayal
Copy link
Contributor Author

Request for review @Pil0tXia

@Pil0tXia
Copy link
Member

Pil0tXia commented Aug 2, 2023

I saw your push history, but there was no effective tag available, which causes an error when pulling.

image

image

@kartiktayal
Copy link
Contributor Author

I saw your push history, but there was no effective tag available, which causes an error when pulling.

image

image

I actually deleted the image after it was pushed. Will trigger the workflow again later today if you need to check the image.

@Pil0tXia
Copy link
Member

Pil0tXia commented Aug 2, 2023

Yes, please let me test it. 😊

@kartiktayal
Copy link
Contributor Author

Done. You should have the image at location kartiktayal/eventmesh

@Pil0tXia
Copy link
Member

Pil0tXia commented Aug 2, 2023

You may use the following command to run the docker:

sudo docker run -d --name eventmesh-test -p 10000:10000 -p 10105:10105 -p 10205:10205 -p 10106:10106 -v /data/eventmesh/rocketmq/conf/eventmesh.properties:/data/app/eventmes
h/conf/eventmesh.properties -t kartiktayal/eventmesh:latest

It started successfully and there were log outputs:

image

image

I would like to inform you that EventMesh needs the following JVM options to start:

-Dlog4j.configurationFile=eventmesh-runtime/conf/log4j2.xml
-Deventmesh.log.home=eventmesh-runtime/logs
-Deventmesh.home=eventmesh-runtime
-DconfPath=eventmesh-runtime/conf

They were already configurated in docker/Dockerfile and eventmesh-runtime/bin/start.sh. You can set Dockerfile path with file field of docker/build-push-action:

image

Some information about Dockerfile: https://stackoverflow.com/questions/57153917/how-to-set-jvm-settings-in-dockerfile.

In addition, we would like to build and push docker images only when there is a new release, such as 1.9.0 and the future releases. This requires you to configure events that trigger workflows, details of which can be found at https://docs.github.com/zh/actions/using-workflows/events-that-trigger-workflows#release, and make some modification on tags field to tag them with the current version. Here is an example: https://stackoverflow.com/questions/66017161/add-a-tag-to-a-docker-image-if-theres-a-git-tag-using-github-action https://docs.docker.com/build/ci/github-actions/manage-tags-labels/.

Good job. 👍

@kartiktayal
Copy link
Contributor Author

Thank you so much. Will work on building this on release workflow.

@kartiktayal kartiktayal force-pushed the enhance_913 branch 3 times, most recently from 4ae2b93 to 9f357e3 Compare August 10, 2023 17:16
@kartiktayal
Copy link
Contributor Author

@Pil0tXia , I hope the changes are as requested.
I used the command
docker pull kartiktayal/eventmesh:testing
and I was able to pull the image using this tag

Copy link
Member

@Pil0tXia Pil0tXia left a comment

Choose a reason for hiding this comment

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

image

image

Good job, LGTM.

If the repo has a correct setting of secrets.DOCKERHUB_USERNAME and secrets.DOCKERHUB_PASSWORD, then the workflow will work.

@kartiktayal
Copy link
Contributor Author

@Alonexc , is this PR good to merge or is there anything pending in this?

@xwm1992
Copy link
Contributor

xwm1992 commented Aug 17, 2023

The problem of secrets.DOCKERHUB_USERNAME and secrets.DOCKERHUB_PASSWORD has not been solved yet, temporarily unable to successfully push the image to the eventmesh mirror warehouse, and will continue to follow up this pr.

xwm1992
xwm1992 previously approved these changes Aug 18, 2023
@Pil0tXia
Copy link
Member

Mind before merge: eventmesh/eventmesh line should be removed and leave apache/eventmesh only to make default secrets work.

@kartiktayal
Copy link
Contributor Author

kartiktayal commented Aug 18, 2023

Mind before merge: eventmesh/eventmesh line should be removed and leave apache/eventmesh only to make default secrets work.

Do you want me to remove the eventmesh/eventmesh path from the image tag?
Let me know if you need that, will update the PR

@Pil0tXia
Copy link
Member

@kartiktayal Yes, please. Because the current default repo secret will not be able to support both apache and eventmesh namespace, and the former is preferred.

@kartiktayal
Copy link
Contributor Author

@Pil0tXia Done.

xwm1992
xwm1992 previously approved these changes Aug 25, 2023
@Pil0tXia
Copy link
Member

@mxsm This script can be triggered manually after merging to check that our repo's default secret setting is correct.

@Pil0tXia
Copy link
Member

@xwm1992 @qqeasonchen The dockerhub access of the repo has been acquired. This PR can be merged to test its functionality.

@kartiktayal You may merge the lastest master branch to this PR to pass the CI.

@kartiktayal
Copy link
Contributor Author

@xwm1992 @qqeasonchen The dockerhub access of the repo has been acquired. This PR can be merged to test its functionality.

@kartiktayal You may merge the lastest master branch to this PR to pass the CI.

Done.

@xwm1992
Copy link
Contributor

xwm1992 commented Nov 15, 2023

@kartiktayal @Pil0tXia
Here is the eventmesh apache docker hub repo: https://hub.docker.com/r/apache/eventmesh
and I have changed the build.yaml for username: ${{ secrets.DOCKERHUB_USER }} & password: ${{ secrets.DOCKERHUB_TOKEN }}

@lrhkobe lrhkobe merged commit 709b211 into apache:master Nov 15, 2023
11 checks passed
@kartiktayal kartiktayal deleted the enhance_913 branch November 15, 2023 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] upload eventmesh docker image into apache repo
5 participants