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

Add documentation on publishing private docker images to the organization package repository #90

Open
ninad-kamat opened this issue May 9, 2022 · 6 comments

Comments

@ninad-kamat
Copy link

No description provided.

@jorgepiloto
Copy link
Member

Thanks for opening this @ninad-kamat, sorry for the delay. I wonder if this topic must be included in the ansys-dev. Pinging here @chadqueen and @akaszynski to have some feedback on this.

@greschd
Copy link
Member

greschd commented May 24, 2022

Having gone through this process recently, let me just quickly note down a rough recount of steps:

  • Obtain a PAT with write access to pyansys packages. Subsequently referred to as GHCR_PAT
  • First, I uploaded a dummy image (because permissions weren't fully set up yet). From my local machine
    • echo $GHCR_PAT | docker login ghcr.io -u <username_of_pat> --password-stdin
    • docker tag <my_dummy_image> ghcr.io/pyansys/<container_name>
    • docker push ghcr.io/pyansys/<container_name>
  • Next, I polished the permissions, and made the connection between the repository and package:
    • For the repository <-> package link, I had set the "org.opencontainers.image.source": "https://github.com/pyansys/<repo_name>" label on the image. I think this was the "wrong" way of doing it though (the label means the repo can be used to build the container, which wasn't true here). Maybe this can also be achieved manually in the package settings https://github.com/pyansys/pyacp-private/pkgs/container/<container_name>.
      Once the connection is made, it doesn't appear to matter if the label is removed in later pushes to the package.
    • Switched visibility from "Internal" to "Private" in https://github.com/pyansys/pyacp-private/pkgs/container/<container_name>, and inherit the permissions from the repository
  • After the package is set up correctly, add the same steps as above to CI/CD, for updating the container
    • echo $GHCR_PAT | docker login ghcr.io -u <username_of_pat> --password-stdin
    • docker tag <container_image> ghcr.io/pyansys/<container_name>
    • docker push ghcr.io/pyansys/<container_name>

The permissions part is obviously specific to each project, but maybe these steps are nevertheless helpful.

@chadqueen
Copy link
Contributor

@greschd thanks for the details from your recent experience. is there already a doc you used as a basis and the detail above is supplementing that doc or do we need to create a doc from scratch for this?

@jorgepiloto it does seem like publishing private docker images is an internal dev portal type of topic, not sure if we can directly move this issue to that repository since it is in a different org so I made an issue there and put a link to this issue here:

https://github.com/ansys/ansys-dev/issues/51

@greschd
Copy link
Member

greschd commented May 25, 2022

is there already a doc you used as a basis

Not that I'm aware of, I was going off https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry mostly.

@jorgepiloto
Copy link
Member

Thanks for all the information provided on this, @greschd.

Transferring an issue to other is possible, @chadqueen. See the right-side panel:

transfer_issue

@jorgepiloto
Copy link
Member

jorgepiloto commented May 26, 2022

Let us solve this by adding a link to the "ansys-dev" where this topic is deeply explained.

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

No branches or pull requests

4 participants