Skip to content

Commit

Permalink
ci: add userspace convertor E2E
Browse files Browse the repository at this point in the history
Signed-off-by: Bowei Zhuang <[email protected]>
  • Loading branch information
WaberZhuang committed Jan 25, 2024
1 parent a03d841 commit 174b877
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 9 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ci-userspace-convertor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,26 @@ jobs:
docker run -d -p 5000:5000 --restart always --name registry registry:2
sleep 3s
- name: Prepare Images
working-directory: ci/scripts
shell: bash
run: |
bash prepare_image.sh registry.hub.docker.com/overlaybd/centos:centos7.9.2009 localhost:5000/centos:centos7.9.2009 && \
bash prepare_image.sh registry.hub.docker.com/overlaybd/ubuntu:22.04 localhost:5000/ubuntu:22.04 && \
bash prepare_image.sh registry.hub.docker.com/overlaybd/redis:7.2.3 localhost:5000/redis:7.2.3 && \
bash prepare_image.sh registry.hub.docker.com/overlaybd/wordpress:6.4.2 localhost:5000/wordpress:6.4.2 && \
bash prepare_image.sh registry.hub.docker.com/overlaybd/nginx:1.25.3 localhost:5000/nginx:1.25.3
- name: CI - uconv reproduce
working-directory: ci/uconv_reproduce
shell: bash
run: |
bash ci-uconv-reproduce.sh
- name: CI - uconv E2E
working-directory: ci/scripts
shell: bash
run: |
/opt/overlaybd/snapshotter/convertor -r localhost:5000/redis -i 7.2.3 --overlaybd 7.2.3_overlaybd --turboOCI 7.2.3_turbo
bash run_container.sh localhost:5000/redis:7.2.3_overlaybd
bash run_container.sh localhost:5000/redis:7.2.3_turbo
6 changes: 2 additions & 4 deletions ci/build_image/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ RUN apt-get update && apt-get install -y apt-transport-https ca-certificates cur
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \
apt-get update && apt-get install -y docker-ce docker-ce-cli containerd.io && \
apt-get clean && rm -rf /var/lib/apt/lists/*

RUN \
apt update && apt install -y libnl-3-200 libnl-genl-3-200 libcurl4-openssl-dev libaio-dev wget less kmod && \
apt-get install -y libnl-3-200 libnl-genl-3-200 libcurl4-openssl-dev libaio-dev wget less kmod && \
apt-get clean && rm -rf /var/lib/apt/lists/* && \
wget https://github.com/containerd/overlaybd/releases/download/v${OBD_VERSION}/overlaybd-${OBD_VERSION}-0ubuntu1.22.04.x86_64.deb && \
dpkg -i overlaybd-${OBD_VERSION}-0ubuntu1.22.04.x86_64.deb && \
dpkg -i overlaybd-snapshotter_${RELEASE_VERSION}_amd64.deb && \
Expand Down
11 changes: 11 additions & 0 deletions ci/scripts/prepare_image.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

from=${1:?}
to=${2:?}

set -e

ctr i pull "${from}"
ctr i tag "${from}" "${to}"
ctr i push "${to}"
ctr i rm "${from}"
13 changes: 13 additions & 0 deletions ci/scripts/run_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
#
# rpull and run on-demand

image=$1
container_name=${2:-test}

/opt/overlaybd/snapshotter/ctr rpull "${image}"
ctr run -d --net-host --snapshotter=overlaybd "${image}" "${container_name}"
ctr t ls | grep "${container_name}"
ctr t kill -s 9 "${container_name}" && sleep 5s && ctr t ls
ctr c rm "${container_name}" && ctr c ls
ctr i rm "${image}"
5 changes: 0 additions & 5 deletions ci/uconv_reproduce/ci-uconv-reproduce.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,6 @@ result=0

for image in "${images[@]}"
do
from_img="registry.hub.docker.com/overlaybd/${image}"
ctr i pull "${from_img}" &> /dev/null
ctr i tag "${from_img}" "${registry}/${image}" &> /dev/null
ctr i push "${registry}/${image}" &> /dev/null

img=${image%%":"*}
tag=${image##*":"}
echo "${img} ${tag}"
Expand Down

0 comments on commit 174b877

Please sign in to comment.