Upgrade containerd in e2e image

Containerd in e2e image was using native one in ubuntu, it should be updated to the latest release.

Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
danfengliu 2020-10-21 02:56:14 +00:00
parent 73981062a9
commit b388078a3e
6 changed files with 41 additions and 6 deletions

View File

@ -18,6 +18,7 @@ harbor_logs_bucket="harbor-ci-logs"
#echo "content_language = en" >> $botofile #echo "content_language = en" >> $botofile
#echo "default_project_id = $GS_PROJECT_ID" >> $botofile #echo "default_project_id = $GS_PROJECT_ID" >> $botofile
DIR="$(cd "$(dirname "$0")" && pwd)" DIR="$(cd "$(dirname "$0")" && pwd)"
E2E_IMAGE="goharbor/harbor-e2e-engine:2.6"
# GS util # GS util
function uploader { function uploader {
@ -30,7 +31,7 @@ set +e
docker ps docker ps
# run db auth api cases # run db auth api cases
if [ "$1" = 'DB' ]; then if [ "$1" = 'DB' ]; then
docker run -i --privileged -v $DIR/../../:/drone -v $DIR/../:/ca -w /drone goharbor/harbor-e2e-engine:2.5 robot -v ip:$2 -v ip1: -v HARBOR_PASSWORD:Harbor12345 /drone/tests/robot-cases/Group1-Nightly/Setup.robot /drone/tests/robot-cases/Group0-BAT/API_DB.robot docker run -i --privileged -v $DIR/../../:/drone -v $DIR/../:/ca -w /drone $E2E_IMAGE robot -v ip:$2 -v ip1: -v HARBOR_PASSWORD:Harbor12345 /drone/tests/robot-cases/Group1-Nightly/Setup.robot /drone/tests/robot-cases/Group0-BAT/API_DB.robot
elif [ "$1" = 'LDAP' ]; then elif [ "$1" = 'LDAP' ]; then
# run ldap api cases # run ldap api cases
python $DIR/../../tests/configharbor.py -H $IP -u $HARBOR_ADMIN -p $HARBOR_ADMIN_PASSWD -c auth_mode=ldap_auth \ python $DIR/../../tests/configharbor.py -H $IP -u $HARBOR_ADMIN -p $HARBOR_ADMIN_PASSWD -c auth_mode=ldap_auth \
@ -39,7 +40,7 @@ elif [ "$1" = 'LDAP' ]; then
ldap_search_password=admin \ ldap_search_password=admin \
ldap_base_dn=dc=example,dc=com \ ldap_base_dn=dc=example,dc=com \
ldap_uid=cn ldap_uid=cn
docker run -i --privileged -v $DIR/../../:/drone -v $DIR/../:/ca -w /drone goharbor/harbor-e2e-engine:2.5 robot -v ip:$2 -v ip1: -v HARBOR_PASSWORD:Harbor12345 /drone/tests/robot-cases/Group1-Nightly/Setup.robot /drone/tests/robot-cases/Group0-BAT/API_LDAP.robot docker run -i --privileged -v $DIR/../../:/drone -v $DIR/../:/ca -w /drone $E2E_IMAGE robot -v ip:$2 -v ip1: -v HARBOR_PASSWORD:Harbor12345 /drone/tests/robot-cases/Group1-Nightly/Setup.robot /drone/tests/robot-cases/Group0-BAT/API_LDAP.robot
else else
rc=999 rc=999
fi fi

View File

@ -2,9 +2,10 @@ FROM ubuntu:18.04
ENV LANG C.UTF-8 ENV LANG C.UTF-8
# V 2.0 # V 2.0
# V 2.0.1: upgrade docker to version 19.03.12 # V 2.0.1: upgrade docker to version 19.03.12
# V 2.5 Add support for e2e py-test # V 2.5 Add support for e2e py-test
RUN apt-get update && apt-get install -y --no-install-recommends wget curl gnupg2 RUN apt-get update && apt-get install -y --no-install-recommends wget curl gnupg2
RUN apt-get install libseccomp2
RUN wget --no-check-certificate -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - RUN wget --no-check-certificate -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
@ -80,6 +81,11 @@ RUN apt-get update && apt install libnss3-tools && \
RUN pip3 install pyasn1 google-apitools==0.5.31 gsutil robotframework==3.2.1 robotframework-sshlibrary robotframework-httplibrary requests dbbot robotframework-seleniumlibrary==4.3.0 robotframework-pabot robotframework-JSONLibrary --upgrade RUN pip3 install pyasn1 google-apitools==0.5.31 gsutil robotframework==3.2.1 robotframework-sshlibrary robotframework-httplibrary requests dbbot robotframework-seleniumlibrary==4.3.0 robotframework-pabot robotframework-JSONLibrary --upgrade
ENV CONTAINERD_VERSION 1.3.4
RUN wget https://storage.googleapis.com/cri-containerd-release/cri-containerd-${CONTAINERD_VERSION}.linux-amd64.tar.gz && \
tar --no-overwrite-dir -C / -xzf cri-containerd-${CONTAINERD_VERSION}.linux-amd64.tar.gz
# Install docker, docker compose # Install docker, docker compose
RUN wget https://download.docker.com/linux/static/stable/x86_64/docker-19.03.12.tgz && \ RUN wget https://download.docker.com/linux/static/stable/x86_64/docker-19.03.12.tgz && \
tar --strip-components=1 -xvzf docker-19.03.12.tgz -C /usr/bin && \ tar --strip-components=1 -xvzf docker-19.03.12.tgz -C /usr/bin && \
@ -157,8 +163,11 @@ ENV DIND_COMMIT 3b5fac462d21ca164b3778647420016315289034
RUN wget "https://raw.githubusercontent.com/docker/docker/${DIND_COMMIT}/hack/dind" -O /usr/local/bin/dind \ RUN wget "https://raw.githubusercontent.com/docker/docker/${DIND_COMMIT}/hack/dind" -O /usr/local/bin/dind \
&& chmod +x /usr/local/bin/dind && chmod +x /usr/local/bin/dind
COPY containerd_config.toml /etc/containerd/config.toml
# This container needs to be run in privileged mode(run with --privileged option) to make it work # This container needs to be run in privileged mode(run with --privileged option) to make it work
COPY dockerd-entrypoint.sh /usr/local/bin/dockerd-entrypoint.sh COPY dockerd-entrypoint.sh /usr/local/bin/dockerd-entrypoint.sh
RUN chmod +x /usr/local/bin/dockerd-entrypoint.sh RUN chmod +x /usr/local/bin/dockerd-entrypoint.sh
VOLUME /var/lib/docker VOLUME /var/lib/docker

View File

@ -0,0 +1,12 @@
[plugins]
[plugins.cri]
stream_server_address = ""
stream_server_port = "10010"
enable_selinux = false
sandbox_image = ""
stats_collect_period = 10
systemd_cgroup = false
[plugins.cri.containerd]
snapshotter = "native"
[plugins.cri.containerd.default_runtime]
runtime_type = "io.containerd.runtime.v1.linux"

View File

@ -38,8 +38,5 @@ if [ "$1" = 'dockerd' ]; then
set -- sh "$(which dind)" "$@" "--insecure-registry=0.0.0.0/0" set -- sh "$(which dind)" "$@" "--insecure-registry=0.0.0.0/0"
fi fi
containerd &
echo "$@" echo "$@"
exec "$@" exec "$@"

View File

@ -138,6 +138,17 @@ Start Docker Daemon Locally
Sleep 2s Sleep 2s
[Return] ${handle} [Return] ${handle}
Start Containerd Daemon Locally
${handle}= Start Process containerd > ./daemon-local.log 2>&1 & shell=True
FOR ${IDX} IN RANGE 5
${pid}= Run pidof containerd
Log To Console pid: ${pid}
Exit For Loop If '${pid}' != '${EMPTY}'
Sleep 2s
END
Sleep 2s
[Return] ${handle}
Prepare Docker Cert Prepare Docker Cert
[Arguments] ${ip} [Arguments] ${ip}
Wait Unitl Command Success mkdir -p /etc/docker/certs.d/${ip} Wait Unitl Command Success mkdir -p /etc/docker/certs.d/${ip}

View File

@ -28,6 +28,8 @@ Nightly Test Setup
Run Keyword CA setup ${ip} ${HARBOR_PASSWORD} Run Keyword CA setup ${ip} ${HARBOR_PASSWORD}
Log To Console Start Docker Daemon Locally ... Log To Console Start Docker Daemon Locally ...
Run Keyword Start Docker Daemon Locally Run Keyword Start Docker Daemon Locally
Log To Console Start Containerd Daemon Locally ...
Run Keyword Start Containerd Daemon Locally
Log To Console wget mariadb ... Log To Console wget mariadb ...
Run wget ${prometheus_chart_file_url} Run wget ${prometheus_chart_file_url}
@ -45,7 +47,10 @@ Nightly Test Setup For Nightly
Run Keyword If '${ip1}' != '${EMPTY}' CA setup For Nightly ${ip1} ${HARBOR_PASSWORD} /ca/ca1.crt Run Keyword If '${ip1}' != '${EMPTY}' CA setup For Nightly ${ip1} ${HARBOR_PASSWORD} /ca/ca1.crt
Run Keyword If '${ip1}' != '${EMPTY}' Run rm -rf ./harbor_ca.crt Run Keyword If '${ip1}' != '${EMPTY}' Run rm -rf ./harbor_ca.crt
Run Keyword CA setup For Nightly ${ip} ${HARBOR_PASSWORD} Run Keyword CA setup For Nightly ${ip} ${HARBOR_PASSWORD}
Log To Console Start Docker Daemon Locally ...
Run Keyword Start Docker Daemon Locally Run Keyword Start Docker Daemon Locally
Log To Console Start Containerd Daemon Locally ...
Run Keyword Start Containerd Daemon Locally
CA Setup For Nightly CA Setup For Nightly
[Arguments] ${ip} ${HARBOR_PASSWORD} ${cert}=/ca/ca.crt [Arguments] ${ip} ${HARBOR_PASSWORD} ${cert}=/ca/ca.crt