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

run createrepo via docker #2856

Merged
merged 7 commits into from Feb 1, 2021
Merged

run createrepo via docker #2856

merged 7 commits into from Feb 1, 2021

Conversation

vilmibm
Copy link
Contributor

@vilmibm vilmibm commented Jan 27, 2021

Fixes #2851

As of Ubuntu 20.04, the createrepo command is no longer installable via official packages.

We'd like to run our linux packaging automation on Ubuntu 20.04, so we needed a new way of running
createrepo until it's re-packaged in Ubuntu 21.04.

This PR adds a script that users Docker to run a precompiled C version of createrepo in a Fedora
environment.

OPEN QUESTION : should we speed up the docker stuff, here? In theory I'd like to avoid having to re-pull the fedora base every run of our release pipeline. Is a docker hub image the answer? or is there another approach? I'll point out though that it didn't "feel" like it took that long in my prerelease test runs.

@vilmibm vilmibm added this to Backlog 🗒 in The GitHub CLI via automation Jan 27, 2021
@vilmibm vilmibm requested review from mislav and samcoe January 27, 2021 00:56
@vilmibm vilmibm moved this from Backlog 🗒 to Needs review 🤔 in The GitHub CLI Jan 27, 2021
Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

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

This looks good! I would just like to see pwd mounting between host and container filesystems to avoid the potentially brittle copying of files that are being worked on.

If we wanted to speed up the creation on this container, perhaps we can pre-package it and publish on GitHub Packages?

script/createrepo.sh Outdated Show resolved Hide resolved
RUN yum install -y createrepo_c
RUN mkdir /packages
CMD touch /tmp/foo
COPY dist/*.rpm /packages/
Copy link
Contributor

@mislav mislav Jan 27, 2021

Choose a reason for hiding this comment

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

This copies rpm files from the host filesystem into the container, bloating it and preventing container reuse.

Would it be better to instead mount the directory from the host into the container using Docker volumes? That way the createrepo command can operate on rpm files and create the necessary directory structure straight on the host, without having to copy anything to-and-from the container.

Something like:

## Dockerfile:
...
ENTRYPOINT ["createrepo"]

## usage on the host:
docker run --rm --volume "$PWD":/packages --workdir /packages createrepo "$@"

Now the current working directory is mounted as /packages inside the container and the createrepo command should be able to easily access it, including writing back to it.

@vilmibm
Copy link
Contributor Author

vilmibm commented Jan 27, 2021

Thanks very much for the docker tip @mislav , I was learning all this stuff for the first time and am much happier with the volume+run solution. This should be good to go now and if you're okay with punting on optimizing the speed of this I am too.

@vilmibm vilmibm requested a review from mislav January 27, 2021 19:30
The GitHub CLI automation moved this from Needs review 🤔 to Needs to be merged 🎉 Jan 28, 2021
Copy link
Contributor

@mislav mislav left a comment

Choose a reason for hiding this comment

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

Looks great. Thank you for testing this out!

@vilmibm vilmibm merged commit de5c04f into trunk Feb 1, 2021
The GitHub CLI automation moved this from Needs to be merged 🎉 to Pending Release 🥚 Feb 1, 2021
@github-actions github-actions bot moved this from Pending Release 🥚 to Done 💤 in The GitHub CLI Feb 17, 2021
@mislav mislav deleted the fix-rpms branch March 23, 2021 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
The GitHub CLI
  
Done 💤
Development

Successfully merging this pull request may close these issues.

Fix release job
3 participants