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

[Feature]: Publish description and readme to Docker Hub #3842

Open
yurishkuro opened this issue Aug 2, 2022 · 25 comments · Fixed by #6118
Open

[Feature]: Publish description and readme to Docker Hub #3842

yurishkuro opened this issue Aug 2, 2022 · 25 comments · Fixed by #6118
Labels
enhancement good first issue Good for beginners help wanted Features that maintainers are willing to accept but do not have cycles to implement

Comments

@yurishkuro
Copy link
Member

Requirement

As a user downloading Jaeger images from Docker Hub, I want to be able to read a description and basic usage in the Docker Hub repositories.

Problem

Right now most of Jaeger's Docker Hub repositories contain neither description nor the readme.

Proposal

Use Docker Hub API to push the README files from the respective cmd/*** dirs when publishing Docker images.

Example: https://github.com/peter-evans/dockerhub-description/blob/main/src/dockerhub-helper.ts

Open questions

No response

@yurishkuro yurishkuro added enhancement help wanted Features that maintainers are willing to accept but do not have cycles to implement good first issue Good for beginners labels Aug 2, 2022
@YashasviChaurasia
Copy link

@yurishkuro i would like to work on this issue.

@yurishkuro
Copy link
Member Author

Great, go for it. Don't worry about the descriptions themselves, we first want to set up the process, and then we can improve the readmes.

@YashasviChaurasia
Copy link

@yurishkuro

I have Tested the Workflow and have tested it on my personal repository to upload Readme files on two different docker-hub repos namely "yashasvichaurasia/testing" and "yashasvichaurasia/testlife"

Following are some screenshots:

Screenshot 2022-08-07 at 1 34 01 AM

Screenshot 2022-08-07 at 1 35 31 AM

Screenshot 2022-08-07 at 1 36 39 AM

Screenshot 2022-08-07 at 1 42 58 AM

@YashasviChaurasia
Copy link

YashasviChaurasia commented Aug 6, 2022

@yurishkuro
I have written the jobs in '.yml' in the following template where I have assumed the admin username and password to be in the following repository secrets as we would require admin privileges while accessing docker hub while using this workflow:

    - name: Docker Hub Description
      uses: peter-evans/dockerhub-description@v3
      with:
        username: ${{ secrets.DOCKERHUB_USERNAME }}
        password: ${{ secrets.DOCKERHUB_PASSWORD }}
        repository: peterevans/dockerhub-description
        readme-filepath: ./path/to/README.md

In one .yml file, I have created multiple jobs which will upload Readme's to different docker-hub repositories when a push is triggered on the Github repo.

Kindly evaluate my way of thinking and let me know if I should create a PR if it is correct.
Thank you

@yurishkuro
Copy link
Member Author

We don't want to pass Dockerhub credentials to unofficial / 3rd-party GH actions like peter-evans/dockerhub-description@v3. It would be better to have the code directly in Jaeger repo. Also, we run a script to build & publish many different images, I think it would make more sense to upload READMEs as part of that script rather than manually list each image in the GH action.

@YashasviChaurasia
Copy link

YashasviChaurasia commented Aug 6, 2022

Ok, I will get on to work on that.
Thank you

@YashasviChaurasia
Copy link

@yurishkuro could you help me out on how to proceed , I am feeling a bit stuck with the Dockerhub API.
Thank you

@yurishkuro
Copy link
Member Author

I haven't investigated it, but the link I have in the description shows code example of submitting via the api. I assume we can do it similarly with just a curl command that we can include in one of the scripts.

@h20220025
Copy link

hey @yurishkuro this issue seems interesting and i want to work on this issue so could you allow me to work on the same:)

@yurishkuro
Copy link
Member Author

@h20220025 you don't need to ask permission, go for it.

@h20220025
Copy link

could you please assign this to me ???

@yurishkuro yurishkuro assigned yurishkuro and h20220025 and unassigned yurishkuro Sep 8, 2022
@h20220025
Copy link

Thank You @yurishkuro

@h20220025
Copy link

hey @YashasviChaurasia, are you still working on the same ???
if yes please let me know.

@YashasviChaurasia
Copy link

hey @YashasviChaurasia, are you still working on the same ???
if yes please let me know.

yes, I am working on this but you can submit a PR if you are able to solve the issue.

@Pushkarm029
Copy link
Member

@SaarthakMaini are you still working on this?

@yurishkuro
Copy link
Member Author

This is still up for grabs, and a very useful feature to solve.

@varshith257
Copy link
Contributor

@yurishkuro I am ready to grab it.

@yurishkuro
Copy link
Member Author

Feel free. I recommend reviewing comments on the previous PR to avoid repeating the same things.

yurishkuro added a commit that referenced this issue Oct 26, 2024
## Which problem is this PR solving?
Fixes: #3842 

## Description of the changes
- Added a shell script that publishes README.md files along with docker
images to docker hub

## How was this change tested?
- Locally as well as on fork

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`

---------

Signed-off-by: Meet Soni <meetsoni3017@gmail.com>
Signed-off-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
Co-authored-by: Yuri Shkuro <yurishkuro@users.noreply.github.com>
@yurishkuro
Copy link
Member Author

@inosmeet the PR didn't work once merged:

2024-10-26T01:38:52.0430636Z 🛑 Failed to update Docker Hub README for jaegertracing/jaeger-tracegen with status code 401
2024-10-26T01:38:52.0432014Z Full response: {"message":"unauthorized","errinfo":{}}
2024-10-26T01:38:52.0432550Z
2024-10-26T01:38:52.1479920Z Failed to update Quay.io README for jaegertracing/jaeger-tracegen with status code 403
2024-10-26T01:38:52.1480759Z Full response: {"error": "CSRF token was invalid or missing."}

when you were testing it did you define special permissions for the token?

@yurishkuro yurishkuro reopened this Oct 26, 2024
@inosmeet
Copy link
Contributor

Just Read & Write.

@yurishkuro
Copy link
Member Author

@inosmeet it's not working for me. I was actually able to get the script to succeed after I did a docker login locally, but if I am not logged it, the curl commands fail on authorization.

Can you point to the documentation that describes the corresponding REST APIs?

yurishkuro added a commit that referenced this issue Oct 27, 2024
## Which problem is this PR solving?
- Part of #3842

## Description of the changes
- Remove echoing of commands from upload script
- remove test file that doesn't check much

Signed-off-by: Yuri Shkuro <github@ysh.us>
@inosmeet
Copy link
Contributor

@yurishkuro The API endpoint we're using is undocumented. I got the reference from here

@yurishkuro
Copy link
Member Author

@inosmeet how did you generate the tokens you used? I only have PAT available to the workflow, but the issue you linked mentioned "properly scoped JWT generated from a PAT". Same question for quay.

@inosmeet
Copy link
Contributor

@yurishkuro I used DockerHub website to create PAT manually. And it gives a scoped JWT for authentication. Same for quay, we can generate token manually from the website.

@yurishkuro
Copy link
Member Author

It looks like it started working for Docker (I had to give Delete permission to the token, not just read/write), but it's still not working for Quay, even if I give the user Admin role. Maybe because we're using a robot account for Quay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue Good for beginners help wanted Features that maintainers are willing to accept but do not have cycles to implement
Projects
None yet
6 participants