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

WIP: Install crictl from RPM #125

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

frobware
Copy link
Contributor

@frobware frobware commented Sep 5, 2024

Exploratory PR to investigate how we can enable a repository to provide cri-tools.

Copy link

codecov bot commented Sep 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 27.61%. Comparing base (31f17c3) to head (74c7494).
Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #125   +/-   ##
=======================================
  Coverage   27.61%   27.61%           
=======================================
  Files          81       81           
  Lines        6999     6999           
=======================================
  Hits         1933     1933           
  Misses       4877     4877           
  Partials      189      189           
Flag Coverage Δ
unittests 27.61% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Contributor

mergify bot commented Sep 5, 2024

@frobware, this pull request is now in conflict and requires a rebase.

@mergify mergify bot added the needs-rebase label Sep 5, 2024
Copy link
Contributor

mergify bot commented Sep 6, 2024

@frobware, this pull request is now in conflict and requires a rebase.

@mergify mergify bot added the needs-rebase label Sep 6, 2024
Copy link
Contributor

@anfredette anfredette left a comment

Choose a reason for hiding this comment

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

Just a couple of comments.


RUN subscription-manager repos --enable=rhocp-4_DOT_17-for-rhel-9-x86_64-rpms

RUN ${DNF_CMD} -y install wget tar gzip ca-certificates cri-tools && \
Copy link
Contributor

Choose a reason for hiding this comment

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

I installed wget, tar and gzip so I could unpack the crictl-*-tar.gz, so we wouldn't need them if we're doing an RPM install of crictl. I think you added ca-certificates -- possibly so you could remove --no-check-certificate. Do we still need it?

Copy link
Contributor Author

@frobware frobware Sep 9, 2024

Choose a reason for hiding this comment

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

Re: ca-certificates. No, it shouldn’t be needed once we're just installing cri-tools vi dnf. In fact, I believe we can remove all of these ancillary packages. The PR’s initial goal was primarily to see how the addition of the subscription-manager repository would pan out.

@@ -22,7 +20,7 @@ COPY . .
# by leaving it empty we can ensure that the container and binary shipped on it will have the same platform.
RUN CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} go build -mod vendor -o bpfman-agent ./cmd/bpfman-agent/main.go

FROM --platform=$TARGETPLATFORM registry.access.redhat.com/ubi9/ubi-minimal:9.4-1227
FROM --platform=$TARGETPLATFORM registry.access.redhat.com/ubi9/ubi:9.4
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know how much bigger this is than the ubi-minimal?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

% podman images| grep ubi9
registry.access.redhat.com/ubi9/ubi          9.4         f1b92832563d  12 days ago  221 MB
registry.access.redhat.com/ubi9/ubi          latest      f1b92832563d  12 days ago  221 MB
registry.access.redhat.com/ubi9/ubi-minimal  latest      16f404cd0c33  12 days ago  101 MB

Double-checking with image inspect, I see:

% podman image inspect ubi9/ubi | grep \"Size\":
          "Size": 220828778,

% podman image inspect ubi9/ubi-minimal | grep \"Size\":
          "Size": 100927499,

so the minimal image is ~half the size.

If we want to persist with the minimal then we could install subscription-manager in the minimal image ala:

[root@bb47957e72f1 /]# microdnf install -y /usr/bin/find /usr/bin/xargs 

[root@bb47957e72f1 /]# microdnf install -y /usr/bin/subscription-manager

Note: I installed find and xargs as prerequisites because, when installing only subscription-manager, I noticed the following messages at the end of the installation:

[root@bb47957e72f1 /]# microdnf install -y /usr/bin/subscription-manager
...
Installing: python3-subscription-manager-rhsm;1.29.40-1.el9;x86_64;ubi-9-baseos-rpms
Installing: subscription-manager;1.29.40-1.el9;x86_64;ubi-9-baseos-rpms
Created symlink /etc/systemd/system/multi-user.target.wants/rhsmcertd.service → /usr/lib/systemd/system/rhsmcertd.service.
/var/tmp/rpm-tmp.fJ9M2l: line 17: find: command not found
/var/tmp/rpm-tmp.fJ9M2l: line 17: xargs: command not found

Once subscription-manager is installed we can enable the repo:

[root@bb47957e72f1 /]# subscription-manager register --user [email protected]
Registering to: subscription.rhsm.redhat.com:443/subscription
Password:
The system has been registered with ID: 79308da8-d8b6-4595-b15f-b71e6209f0e7
The registered system name is: bb47957e72f1

[root@bb47957e72f1 /]# subscription-manager repos --enable=rhocp-4.16-for-rhel-9-x86_64-rpms
Repository 'rhocp-4.16-for-rhel-9-x86_64-rpms' is enabled for this system.

[root@bb47957e72f1 /]# microdnf install -y cri-tools
Downloading metadata...
Downloading metadata...
Downloading metadata...
Package                                                                                     Repository                          Size
Installing:
 cri-tools-1.29.0-4.el9.x86_64                                                              rhocp-4.16-for-rhel-9-x86_        9.9 MB
Transaction Summary:
 Installing:        1 packages
 Reinstalling:      0 packages
 Upgrading:         0 packages
 Obsoleting:        0 packages
 Removing:          0 packages
 Downgrading:       0 packages
Downloading packages...
Running transaction test...
Installing: cri-tools;1.29.0-4.el9;x86_64;rhocp-4.16-for-rhel-9-x86_64-rpms
Complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants