Skip to content

Commit

Permalink
add docker tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stlankes committed Feb 20, 2025
1 parent 477a7cb commit 7569c2f
Showing 1 changed file with 58 additions and 1 deletion.
59 changes: 58 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- run: cargo fmt -- --check

crio:
name: Setup, build and test CRI-O
name: Setup, build and test (CRI-O)
runs-on: ubuntu-latest
env:
KUBERNETES_VERSION: v1.32
Expand Down Expand Up @@ -107,3 +107,60 @@ jobs:
crictl rm $CONTAINERID
crictl stopp $PODID
crictl rmp $PODID
docker:
name: Setup, build and test (Docker)
runs-on: ubuntu-latest
env:
KUBERNETES_VERSION: v1.32
CRIO_VERSION: v1.32
steps:
- name: Install Docker
run: |
sudo apt-get remove conmon
sudo apt-get update
sudo apt-get install -y docker.io
- name: Pull images
run: |
docker pull ghcr.io/hermit-os/rusty_demo:latest
- name: Setup rootfs
run: |
docker export $(docker create ghcr.io/hermit-os/rusty_demo:latest) > runh-image.tar
mkdir -p /home/runner/runh-image/rootfs
tar -xf runh-image.tar -C /home/runner/runh-image/rootfs
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build runh
run: |
cargo install --locked --path .
sudo cp /home/runner/.cargo/bin/runh /usr/sbin/runh
sudo chown root:root /usr/sbin/runh
sudo chmod a+rx /usr/sbin/runh
- name: Setup runh with Docker
shell: sudo bash --noprofile --norc -eo pipefail {0}
run: |
sed -i 's/{/{ "default-runtime": "runc", "runtimes": { "runh": { "path": "\/home\/runner\/.cargo\/bin\/runh", "runtimeArgs": ["-l", "debug"] } },/g' /etc/docker/daemon.json
>&2 cat /etc/docker/daemon.json
systemctl restart docker || systemctl status docker
- name: Check Docker runtime
run: docker info|grep -i runtime
- name: Test runh standalone
shell: sudo bash --noprofile --norc -eo pipefail {0}
if: ${{ always() && steps.runh-crio-setup.outcome == 'success' }}
run: |
cd /home/runner/runh-image
tree .
runh --root /run/runh spec --bundle . --args /hermit/rusty_demo
runh --root /run/runh -l debug create --bundle . runh-container
runh --root /run/runh -l debug start runh-container
sleep 10
runh --root /run/runh -l debug delete runh-container
- name: Test runh with Docker
shell: sudo bash --noprofile --norc -eo pipefail {0}
if: ${{ always() && steps.runh-crio-setup.outcome == 'success' }}
run: |
docker run --runtime=runh -it -d -p 9975:9975 ghcr.io/hermit-os/rusty_demo:latest > container.id
export CONTAINERID=$(cat container.id)
sleep 2
docker logs $CONTAINERID
docker stop $CONTAINERID

0 comments on commit 7569c2f

Please # to comment.