diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3d9a422ea..b9cc15300 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,6 +30,7 @@ jobs: run: | echo "::set-env name=GOPATH::${{ github.workspace }}" echo "::add-path::${{ github.workspace }}/bin" + - name: Checkout uses: actions/checkout@v2 with: @@ -39,6 +40,7 @@ jobs: if: startsWith(matrix.os, 'ubuntu') run: | sudo apt-get install -y btrfs-tools libseccomp-dev + - name: Make run: | make build @@ -61,6 +63,7 @@ jobs: run: | echo "::set-env name=GOPATH::${{ github.workspace }}" echo "::add-path::${{ github.workspace }}/bin" + - name: Checkout uses: actions/checkout@v2 with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8165998b3..e2ced7da2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -68,3 +68,89 @@ jobs: run: | sudo GOPATH=$GOPATH GOPROXY=$GOPROXY TEST_RUNTIME=$TEST_RUNTIME TESTFLAGS_PARALLEL=1 make integration EXTRA_TESTFLAGS=-no-criu working-directory: src/github.com/containerd/containerd + + cri: + name: CRI + runs-on: ubuntu-18.04 + timeout-minutes: 10 + + strategy: + matrix: + runtime: [v1, v2] + runc: [runc, crun] + exclude: + - runtime: v1 + runc: crun + + steps: + - name: Set env + shell: bash + run: | + echo "::set-env name=GOPATH::${{ github.workspace }}" + echo "::add-path::${{ github.workspace }}/bin" + + - name: Checkout containerd + uses: actions/checkout@v2 + with: + path: src/github.com/containerd/containerd + + - name: Install dependencies + env: + RUNC_FLAVOR: ${{ matrix.runc }} + run: | + sudo PATH=$PATH GOPATH=$GOPATH script/setup/install-seccomp + sudo PATH=$PATH GOPATH=$GOPATH RUNC_FLAVOR=$RUNC_FLAVOR script/setup/install-runc + sudo PATH=$PATH GOPATH=$GOPATH script/setup/install-cni + sudo PATH=$PATH GOPATH=$GOPATH script/setup/install-critools + working-directory: src/github.com/containerd/containerd + + - name: Install protobuf + run: | + sudo env PATH=$PATH GOPATH=$GOPATH script/setup/install-protobuf + sudo chmod +x /usr/local/bin/protoc + sudo chmod og+rx /usr/local/include/google /usr/local/include/google/protobuf /usr/local/include/google/protobuf/compiler + sudo chmod -R og+r /usr/local/include/google/protobuf/ + protoc --version + working-directory: src/github.com/containerd/containerd + + - name: Install criu + run: | + sudo apt-get install -y \ + libprotobuf-dev \ + libprotobuf-c-dev \ + protobuf-c-compiler \ + protobuf-compiler \ + python-protobuf \ + libnl-3-dev \ + libnet-dev \ + libcap-dev \ + python-future \ + socat + wget https://github.com/checkpoint-restore/criu/archive/v3.13.tar.gz -O criu.tar.gz + tar -zxf criu.tar.gz + cd criu-3.13 + sudo make install-criu + + - name: Install containerd + run: | + make binaries + sudo make install + working-directory: src/github.com/containerd/containerd + + - name: CRI test + env: + TEST_RUNTIME: io.containerd.runc.${{ matrix.runtime }} + run: | + sudo mkdir -p /etc/containerd + sudo bash -c "cat > /etc/containerd/config.toml < /tmp/containerd-cri.log & + sudo ctr version + sudo PATH=$PATH GOPATH=$GOPATH critest --runtime-endpoint=/var/run/containerd/containerd.sock --parallel=8 + TEST_RC=$? + test $TEST_RC -ne 0 && cat /tmp/containerd-cri.log + sudo pkill containerd + sudo rm -rf /etc/containerd + test $TEST_RC -eq 0 || /bin/false