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

Update pip usage example with CS9 #726

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,15 @@ already contains everything you need.
Containerfile.baseimage:

```Dockerfile
FROM quay.io/centos/centos:stream8

# python3.8 runtime, C build dependencies
RUN dnf -y install \
python38 \
python38-pip \
python38-devel \
FROM quay.io/centos/centos:stream9

# python3.9 runtime, C build dependencies
RUN dnf -y install 'dnf-command(config-manager)' && \
dnf config-manager --set-enabled crb && \
Copy link
Member

Choose a reason for hiding this comment

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

Disclaimer: I didn't know we had an example like this until you pointed it out.

CS is a rolling distro which breaks package updates more often than not sadly (at least it used to be the case). I mean what you have here is all fine but strictly from docs POV I just wonder if it deserves the promotion (even just as an example) since it requires the Content Ready Builder repo to enable headers. Anyway, I think this hunk would be slightly simplified if you replaced CS with an example using AlmaLinux or Rocky where you don't need either the config manager or the CRB repo.

Copy link
Contributor

Choose a reason for hiding this comment

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

Atomic reactor uses Fedora, so we might as well just do the same.

Copy link
Member

Choose a reason for hiding this comment

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

Works too.

dnf -y install \
python3 \
python3-pip \
python3-devel \
gcc \
make \
libffi-devel \
Expand Down Expand Up @@ -424,11 +426,11 @@ RUN source /tmp/cachi2.env && \
# We're using network isolation => cannot build the cryptography package with Rust
# (it downloads Rust crates)
export CRYPTOGRAPHY_DONT_BUILD_RUST=1 && \
python3.8 -m pip install -U pip && \
python3.8 -m pip install --use-pep517 -r requirements.txt && \
python3.8 -m pip install --use-pep517 .
python3 -m pip install -U pip && \
python3 -m pip install --use-pep517 -r requirements.txt && \
python3 -m pip install --use-pep517 .

CMD ["python3.8", "-m", "atomic_reactor.cli.main", "--help"]
CMD ["python3", "-m", "atomic_reactor.cli.main", "--help"]
```

We can then build the image as before while mounting the required Cachi2 data!
Expand Down