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 custom rocky dockerfiles #53

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
d58b0d9
Copy and paste in rocky-container from upstream
JohnGarbutt May 24, 2022
2c7357a
Move 8.5 base container and add pulp repos
JohnGarbutt May 24, 2022
d5317fe
Use base image closer to pulp snapshot
JohnGarbutt May 24, 2022
c480b18
Move back to docker's rocky linux image
JohnGarbutt May 30, 2022
a9f4b48
Add cloud-init into the image
JohnGarbutt May 30, 2022
4fa1b21
Use centos advanced virt to get libvirt
JohnGarbutt May 30, 2022
48f0645
Include qemu-kvm
JohnGarbutt May 30, 2022
f115198
Move to dry-er custom rocky container
JohnGarbutt Jun 8, 2022
4829a37
Add mofed
JohnGarbutt Jun 8, 2022
30a0cd6
Merge remote-tracking branch 'origin/johng-rocky-pulp' into johng-roc…
JohnGarbutt Jun 8, 2022
8bca2c0
Move to mofed name
JohnGarbutt Jun 8, 2022
dc16325
First go at 8.6 container
JohnGarbutt Jun 8, 2022
80c9b24
Fix up bits of the 8.6 image
JohnGarbutt Jun 8, 2022
0c83181
Try to add new pulp repos
JohnGarbutt Jun 8, 2022
3162cce
Fix ceph gpg key
JohnGarbutt Jun 8, 2022
2e51b08
Fix up perftest version issue
JohnGarbutt Jun 8, 2022
f0a174d
Add docker-ce repo
JohnGarbutt Jun 9, 2022
f06d9f0
rockylinux : create machine-id early
jovial Aug 9, 2022
b717ca7
Add a delay to cloud-init-local.service
jovial Aug 9, 2022
1b49e6c
Install kmod-mpt3sas
jovial Aug 9, 2022
7badf2c
Install packages from generic cloud image
jovial Aug 11, 2022
dc0acff
Remove cockpit
jovial Aug 11, 2022
f5025f0
Merge pull request #43 from stackhpc/will/rocky-container
jovial Aug 24, 2022
75017e4
Bump Rocky 8.6 snapshot versions
jovial Sep 20, 2022
6521962
Fix version lock
jovial Sep 20, 2022
91da79c
Hardcode repository ids for ease of update
jovial Sep 21, 2022
d1699cf
Make ceph repo ID easily overidable
jovial Sep 22, 2022
8a859e7
Enable gpgcheck for all repos
jovial Sep 22, 2022
78b355c
Use localfile for GPG key
jovial Sep 22, 2022
35d67a7
Revert to using upstream mellanox repo
jovial Sep 26, 2022
7509182
basearch undefined?
jovial Sep 26, 2022
64277c5
Build OFED from source, to match latest kernel (#52)
JohnGarbutt Sep 26, 2022
0895d2a
Remove untested 8.5 image
JohnGarbutt Dec 7, 2022
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
130 changes: 130 additions & 0 deletions elements/rocky-container-pulp/8.6-pulp-mofed
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
# syntax=docker/dockerfile:1.4.3

# To build this image you need enable docker build kit. This is for the heredoc support.

FROM docker.io/library/rockylinux:8
Copy link
Member

Choose a reason for hiding this comment

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

Might need the 8.6 tag instead of the 8 tag?


ARG rocky_version=8.6

# /etc/machine-id needs to be populated for /bin/kernel-install to
# correctly copy kernels into /boot. We will clear this out in the
# final image.
RUN systemd-machine-id-setup

RUN curl -L https://www.centos.org/keys/RPM-GPG-KEY-CentOS-SIG-Storage -o /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage\
&& curl -L https://www.mellanox.com/downloads/ofed/RPM-GPG-KEY-Mellanox -o /etc/pki/rpm-gpg/RPM-GPG-KEY-Mellanox\
&& curl -L https://download.docker.com/linux/centos/gpg -o /etc/pki/rpm-gpg/RPM-GPG-KEY-docker

COPY <<Rocky-BaseOS.repo <<Rocky-Extras.repo <<Rocky-AppStream.repo <<Rocky-PowerTools.repo <<Rocky-NFV.repo <<ceph.repo <<docker.repo /etc/yum.repos.d/
[baseos]
name=Rocky Linux $releasever - BaseOS
enabled=1
baseurl=https://pulp.128-232-222-245.sslip.io/pulp/content/rocky/8.6/BaseOS/x86_64/os/20220914T080246/
Copy link
Member Author

Choose a reason for hiding this comment

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

This really should somehow be a variable

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like the best way would be if we had build arg support in DIB for the containerfile element?

gpgcheck=1
repo_gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
Rocky-BaseOS.repo
[extras]
name=Rocky Linux $releasever - Extras
enabled=1
baseurl=https://pulp.128-232-222-245.sslip.io/pulp/content/rocky/8.6/extras/x86_64/os/20220904T041706/
gpgcheck=1
repo_gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
Rocky-Extras.repo
[appstream]
name=Rocky Linux $releasever - AppStream
enabled=1
baseurl=https://pulp.128-232-222-245.sslip.io/pulp/content/rocky/8.6/AppStream/x86_64/os/20220918T035853/
gpgcheck=1
repo_gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
Rocky-AppStream.repo
[powertools]
name=Rocky Linux $releasever - PowerTools
enabled=1
baseurl=https://pulp.128-232-222-245.sslip.io/pulp/content/rocky/8.6/PowerTools/x86_64/os/20220918T035853/
gpgcheck=1
repo_gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
Rocky-PowerTools.repo
[nfv]
name=Rocky Linux $releasever - NFV
enabled=1
baseurl=https://pulp.128-232-222-245.sslip.io/pulp/content/rocky/8.6/nfv/x86_64/os/20220918T035853/
gpgcheck=1
repo_gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rockyofficial
Rocky-NFV.repo
[ceph]
name=CentOS-$releasever - Ceph Nautilus
enabled=1
baseurl=https://pulp.128-232-222-245.sslip.io/pulp/content/centos/8/storage/x86_64/ceph-nautilus/20211122T102435/
gpgcheck=1
repo_gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Storage
ceph.repo
[docker]
name=docker-ce-for-centos-8-20211122T102435
enabled=1
baseurl=https://pulp.128-232-222-245.sslip.io/pulp/content/docker-ce/centos/8/x86_64/stable/20211122T102435/
gpgcheck=1
repo_gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-docker
docker.repo

RUN dnf update -y --refresh

# Install/remove packages from https://git.rockylinux.org/rocky/kickstarts/-/blob/r8/Rocky-8-GenericCloud.ks
RUN dnf install -y @core --allowerasing
RUN dnf install -y chrony dnf yum cloud-init cloud-utils-growpart NetworkManager \
dracut-config-generic dracut-norescue firewalld gdisk grub2 \
kernel nfs-utils rsync tar dnf-utils yum-utils \
python3-jsonschema qemu-guest-agent dhcp-client \
rocky-release rng-tools
RUN dnf erase -y aic94xx-firmware alsa-firmware alsa-lib alsa-tools-firmware \
ivtv-firmware iwl100-firmware iwl1000-firmware iwl105-firmware \
iwl135-firmware iwl2000-firmware iwl2030-firmware iwl3160-firmware \
iwl3945-firmware iwl4965-firmware iwl5000-firmware iwl5150-firmware \
iwl6000-firmware iwl6000g2a-firmware iwl6000g2b-firmware iwl6050-firmware \
iwl7260-firmware libertas-sd8686-firmware libertas-sd8787-firmware \
libertas-usb8388-firmware biosdevname iprutils plymouth

RUN dnf install -y cloud-init libvirt qemu-kvm ceph-common edk2-ovmf qemu-kvm-block-rbd cyrus-sasl docker-ce

# From the base dib element
RUN dnf install -y findutils util-linux sudo python3 NetworkManager

RUN systemctl unmask console-getty.service dev-hugepages.mount \
getty.target sys-fs-fuse-connections.mount systemd-logind.service \
systemd-remount-fs.service

RUN curl -L https://www.mellanox.com/downloads/ofed/MLNX_OFED-5.7-1.0.2.0/MLNX_OFED_SRC-5.7-1.0.2.0.tgz --output /tmp/MLNX_OFED_SRC-5.7-1.0.2.0.tgz \
Copy link
Member

Choose a reason for hiding this comment

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

Would be good to parameterise the version of OFED as well

&& cd /tmp \
&& tar -xzf MLNX_OFED_SRC-5.7-1.0.2.0.tgz \
&& dnf install -y perl cmake kernel-devel python36-devel perl-generators python36 python3-Cython rpm-build elfutils-libelf-devel zlib-devel gcc-c++ gdb-headless glib2-devel patch lsof libmnl-devel openssl-devel pciutils-devel pkgconf-pkg-config libstdc++-devel libnl3-devel libtool python3-docutils numactl-devel systemd-devel kernel-rpm-macros glibc-devel pciutils gcc valgrind-devel \
&& /tmp/MLNX_OFED_SRC-5.7-1.0.2.0/install.pl --hypervisor --kernel 4.18.0-372.26.1.el8_6.x86_64 \
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible to figure out the installed kernel version - can we assign a variable for this by running a command in the dockerfile?

&& rm -rf /tmp/MLNX_OFED_SRC-5.7-1.0.2.0*

# Workaround for: Unable to find a system nic for <MAC_ADDRESS> from cloud-init
# https://askubuntu.com/questions/1400527/unable-to-find-a-system-nic-while-running-cloud-init
COPY <<delay.conf /etc/systemd/system/cloud-init-local.service.d
[Service]
ExecStartPre=sleep 30
delay.conf

# Add hack because perftest in mofed conflicts and is older than rocky 8.6 version
RUN dnf install python3-dnf-plugin-versionlock -y
RUN dnf versionlock add "perftest-0:4.5-0.17.g6f25f23.57102.*"

# Add support for MPTSAS raid controllers. This kernel module was included in
# CentOS 7. We now need an alternative source. Don't leave elrepo installed
# to avoid installing other packages of unknown providence.
RUN rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org \
&& dnf install -y https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm \
Copy link
Contributor

Choose a reason for hiding this comment

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

possibly we should layer this on top of a more generic image

&& dnf versionlock add "kmod-mpt3sas-39.100.00.00-1.el8_6.elrepo.x86_64" \
&& dnf install -y kmod-mpt3sas \
&& dnf remove -y elrepo-release.noarch

# DIB will do this, but run it here to test we are good
RUN dnf update -y
17 changes: 17 additions & 0 deletions elements/rocky-container-pulp/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
=======================
rocky custom containers

Choose a reason for hiding this comment

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

rocky container pulp

=======================

This makes use of the upstream dib element rocky-container.

To use these container files simple set something like this:::

overcloud_dib_os_element: rocky-container

overcloud_dib_env_vars_extra:
DIB_CONTAINERFILE_DOCKERFILE: "{{ source_checkout_path }}/stackhpc-image-elements/elements/rocky-container-pulp/8.5-pulp

Choose a reason for hiding this comment

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

It would be nice if pulling in this element did this for you


overcloud_dib_git_elements_extra:
- repo: https://github.com/stackhpc/stackhpc-image-elements
local: "{{ source_checkout_path }}/stackhpc-image-elements"
elements_path: elements