Skip to content

Commit

Permalink
Fix cri-dockerd CI runs
Browse files Browse the repository at this point in the history
github.com/Mirantis/cri-dockerd has changed a couple things that were
affecting the CI. The code has moved to a src/ subdirectory so running
'go install .' at the root of the repo fails on finding anything. The
default addresses have also changed from /var/run/dockershim.sock
(and //./pipe/dockershim) to /var/run/cri-dockerd.sock. This change just
cds to the src subdirectory before trying to build/install anything and
passes the right addresses to the dockershim critest runs.

Signed-off-by: Daniel Canter <[email protected]>
  • Loading branch information
dcantah committed Dec 30, 2021
1 parent b0c7dbf commit 0ee4b31
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/dockershim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
set -o pipefail
git clone https://github.com/Mirantis/cri-dockerd $GOPATH/src/github.com/Mirantis/cri-dockerd
cd $GOPATH/src/github.com/Mirantis/cri-dockerd
cd $GOPATH/src/github.com/Mirantis/cri-dockerd/src
go mod tidy
# Need the flag for errors building on Windows
Expand Down Expand Up @@ -107,14 +107,16 @@ jobs:
SKIP="runtime should support execSync|runtime should support portforward|runtime should support starting container with log|runtime should support execSync with timeout|runtime should support removing running container|runtime should support port mapping with only container port|runtime should support creating container|runtime should support starting container with volume|runtime should support exec with tty=true and stdin=true|runtime should support set hostname|runtime should support removing stopped container|runtime should support removing created container|runtime should support running PodSandbox|runtime should support port mapping with host port and container port|runtime should support exec with tty=false and stdin=false|runtime should support DNS config|runtime should support attach|runtime should support listing container stats|runtime should support reopening container log|runtime should support stopping container|runtime should support starting container with volume when host path is a symlink|runtime should support removing PodSandbox|runtime should support stopping PodSandbox|runtime should support starting container"
# Start dockershim first
/usr/local/bin/cri-dockerd --v=10 --network-plugin="" --logtostderr &> "${REPORT_DIR}/dockerd-cri.log" &
ep=npipe:////./pipe/dockershim
/usr/local/bin/cri-dockerd --v=10 --network-plugin="" --container-runtime-endpoint=${ep} --logtostderr &> "${REPORT_DIR}/dockerd-cri.log" &
pid=$!
# Wait a while for dockershim starting.
sleep 10
# Run cri test cases
/usr/local/bin/critest --ginkgo.focus="${FOCUS}" --ginkgo.skip="${SKIP}" --report-dir="${REPORT_DIR}" --report-prefix="windows"
ls ${REPORT_DIR}
TEST_RC1=$?
test $TEST_RC1 -ne 0 && cat ${REPORT_DIR}/dockerd-cri.log
Expand Down
2 changes: 1 addition & 1 deletion hack/install-cri-dockerd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set -o pipefail
# Build cri-dockerd

git clone https://github.com/Mirantis/cri-dockerd $GOPATH/src/github.com/Mirantis/cri-dockerd
cd $GOPATH/src/github.com/Mirantis/cri-dockerd
cd $GOPATH/src/github.com/Mirantis/cri-dockerd/src

go install .
sudo mv $GOPATH/bin/cri-dockerd /usr/local/bin
6 changes: 3 additions & 3 deletions hack/run-dockershim-critest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ fi
# Start dockershim first
logs_dir="$GOPATH/logs"
mkdir -p $logs_dir
sudo /usr/local/bin/cri-dockerd --v=10 --network-plugin="" --logtostderr >$logs_dir/cri-dockerd.log 2>&1 &
ep="unix:///var/run/dockershim.sock"
sudo /usr/local/bin/cri-dockerd --v=10 --network-plugin="" --container-runtime-endpoint=${ep} --logtostderr >$logs_dir/cri-dockerd.log 2>&1 &

# Wait a while for dockershim starting.
sleep 10
Expand All @@ -48,8 +49,7 @@ sleep 10
# Skip runtime should support execSync with timeout because docker doesn't
# support it.
# Skip apparmor test as we don't enable apparmor yet in this CI job.
sudo critest -ginkgo.skip=${SKIP} -parallel 1

sudo critest -ginkgo.skip=${SKIP} -parallel 1

# Run benchmark test cases
sudo critest -benchmark

0 comments on commit 0ee4b31

Please sign in to comment.