Skip to content

Commit

Permalink
Also build a c9s toolbox container
Browse files Browse the repository at this point in the history
That one will only contain buildroot deps and is not intended to be the
primary pet toolbox container.
  • Loading branch information
jlebon committed Feb 24, 2024
1 parent ec52634 commit a6ce8e3
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 26 deletions.
35 changes: 31 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Build

env:
QUAY_BASE: quay.io/jlebon/pet
TOOLBOX: registry.fedoraproject.org/fedora-toolbox
FEDORA_TOOLBOX: registry.fedoraproject.org/fedora-toolbox
CENTOS_TOOLBOX: quay.io/toolbx-images/centos-toolbox

on:
push:
Expand Down Expand Up @@ -31,8 +32,8 @@ jobs:
cosa=$(curl -L https://raw.githubusercontent.com/coreos/coreos-assembler/main/Dockerfile | grep '^FROM ' | cut -f2 -d:)
echo "cosa=$cosa" >> $GITHUB_OUTPUT
echo "matrix=$(seq $stable $rawhide | jq -cnR '[inputs]')" >> $GITHUB_OUTPUT
build:
name: "Build container image"
build-fedora:
name: "Build Fedora container images"
needs: query
runs-on: ubuntu-latest
strategy:
Expand All @@ -48,7 +49,7 @@ jobs:
run: |
set -xeuo pipefail
n=${{ matrix.releasever }}
podman build --from $TOOLBOX:$n -t "${{ env.QUAY_BASE }}:f$n" .
podman build --from $FEDORA_TOOLBOX:$n -t "${{ env.QUAY_BASE }}:f$n" .
- name: Push
run: |
set -xeuo pipefail
Expand Down Expand Up @@ -81,3 +82,29 @@ jobs:
fi
git commit -m "README.md: update build date"
git push
build-centos:
name: "Build CentOS container images"
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tag: [stream9]
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@v1.3.0
- name: Check out repository
uses: actions/checkout@v3
- name: Build
run: |
set -xeuo pipefail
podman build --from $CENTOS_TOOLBOX:${{ matrix.tag }} -t "${{ env.QUAY_BASE }}:${{ matrix.tag }}" -f Containerfile.buildroot
- name: Push
run: |
set -xeuo pipefail
mkdir -p ~/.docker
cat > ~/.docker/config.json <<EOF
${{ secrets.QUAY_AUTH }}
EOF
n=${{ matrix.releasever }}
podman push "${{ env.QUAY_BASE }}:${{ matrix.tag }}"
rm ~/.docker/config.json
6 changes: 6 additions & 0 deletions Containerfile.buildroot
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# This is a subset of the pet image, containing only build dependencies.
FROM overridden
MAINTAINER Jonathan Lebon <jonathan@jlebon.com>
COPY . /pet
RUN cd /pet && ./build-buildroot && rm -rf /pet
CMD ["/bin/bash"]
3 changes: 2 additions & 1 deletion build
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ fi
# everything in the FCOS buildroot image
(git clone https://github.com/coreos/fedora-coreos-config
cd fedora-coreos-config
sed -i -e '/updates-testing/ d' ci/buildroot/install-buildroot.sh
ci/buildroot/install-buildroot.sh)

# install our packages
grep -v '^#' deps.txt | xargs dnf install -y
grep -v '^#' deps.txt deps-pet.txt | xargs dnf install -y

# we want the host srv
rmdir /srv && ln -sT /run/host/srv /srv
Expand Down
30 changes: 30 additions & 0 deletions build-buildroot
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
set -euo pipefail

dnf config-manager --set-enabled crb
dnf install -y epel-release epel-next-release
dnf install -y centpkg

# rpm-ostree test deps
(git clone https://github.com/coreos/rpm-ostree
cd rpm-ostree
ci/install-test-deps.sh)

# everything in the FCOS buildroot image
(git clone https://github.com/coreos/fedora-coreos-config
cd fedora-coreos-config
sed -i -e '/updates-testing/ d' ci/buildroot/install-buildroot.sh
ci/buildroot/install-buildroot.sh)

# but then also redo this because the deps are slightly different when actually
# building RPMs
sudo dnf builddep -y rpm-ostree

# install our packages
grep -v '^#' deps.txt | xargs dnf install -y

# we want the host srv
rmdir /srv && ln -sT /run/host/srv /srv

# install rhsetup
cp rhsetup /usr/bin
17 changes: 17 additions & 0 deletions deps-pet.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
mosh

fedpkg

# for decrypting GPG files
pinentry

# for YubiKey
yubikey-manager

# language servers for helix
python-lsp-server
nodejs-bash-language-server
# already pulled in via buildroot deps, but for completeness
clang-tools-extra
# for generating clangd's `compile_commands.json`
bear
16 changes: 0 additions & 16 deletions deps.txt
Original file line number Diff line number Diff line change
@@ -1,31 +1,15 @@
tmux
mosh
wl-clipboard

# provides /usr/bin/errno
moreutils

fedpkg
python3-ipython
gdb
fzf
ripgrep
bat
mold

# for decrypting GPG files
pinentry

# for YubiKey
yubikey-manager

git-delta
ShellCheck

# language servers for helix
python-lsp-server
nodejs-bash-language-server
# already pulled in via buildroot deps, but for completeness
clang-tools-extra
# for generating clangd's `compile_commands.json`
bear
12 changes: 7 additions & 5 deletions rhsetup
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ cd /etc/pki/ca-trust/source/anchors
sudo curl -O https://certs.corp.redhat.com/certs/Current-IT-Root-CAs.pem
sudo update-ca-trust extract

cd /etc/yum.repos.d/
sudo curl -L -O https://download.devel.redhat.com/rel-eng/RCMTOOLS/rcm-tools-fedora.repo
# https://docs.engineering.redhat.com/display/RCMDOC/RCM+Tools+Release+Guide?focusedCommentId=339593129#comment-339593129
sudo sed -i -e 's,$basearch,x86_64,' /etc/yum.repos.d/rcm-tools-fedora.repo
sudo dnf install -y rhel-packager
if [ "${ID}" = fedora ]; then
cd /etc/yum.repos.d/
sudo curl -L -O https://download.devel.redhat.com/rel-eng/RCMTOOLS/rcm-tools-fedora.repo
# https://docs.engineering.redhat.com/display/RCMDOC/RCM+Tools+Release+Guide?focusedCommentId=339593129#comment-339593129
sudo sed -i -e 's,$basearch,x86_64,' /etc/yum.repos.d/rcm-tools-fedora.repo
sudo dnf install -y rhel-packager
fi

if [ -e /run/host/etc/krb5.conf.d/redhat ]; then
sudo ln -s /run/host/etc/krb5.conf.d/redhat /etc/krb5.conf.d/
Expand Down

0 comments on commit a6ce8e3

Please sign in to comment.