diff --git a/.github/workflows/ci-userspace-convertor.yml b/.github/workflows/ci-userspace-convertor.yml index 2a5350db..202be4a0 100644 --- a/.github/workflows/ci-userspace-convertor.yml +++ b/.github/workflows/ci-userspace-convertor.yml @@ -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 diff --git a/ci/build_image/Dockerfile b/ci/build_image/Dockerfile index ce4d9b5f..f465b6ec 100644 --- a/ci/build_image/Dockerfile +++ b/ci/build_image/Dockerfile @@ -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 && \ diff --git a/ci/scripts/prepare_image.sh b/ci/scripts/prepare_image.sh new file mode 100755 index 00000000..a2779005 --- /dev/null +++ b/ci/scripts/prepare_image.sh @@ -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}" diff --git a/ci/scripts/run_container.sh b/ci/scripts/run_container.sh new file mode 100755 index 00000000..17886dae --- /dev/null +++ b/ci/scripts/run_container.sh @@ -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}" diff --git a/ci/uconv_reproduce/ci-uconv-reproduce.sh b/ci/uconv_reproduce/ci-uconv-reproduce.sh index c12bd4cd..558f329f 100644 --- a/ci/uconv_reproduce/ci-uconv-reproduce.sh +++ b/ci/uconv_reproduce/ci-uconv-reproduce.sh @@ -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}"