Skip to content

Commit

Permalink
Add windows platform
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Hickey <[email protected]>
  • Loading branch information
hickeyma committed Jul 1, 2020
1 parent 25dfe1a commit 175fbd1
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 13 deletions.
77 changes: 66 additions & 11 deletions .github/workflows/dockershim.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ jobs:
build-and-critest-dockershim:
strategy:
matrix:
os: [ubuntu-18.04]
os: [ubuntu-18.04] # Need to fix windows-2019 critest
# It was also disabled in travis ci
name: / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
steps:
Expand All @@ -28,37 +29,91 @@ jobs:
path: ${{github.workspace}}/src/github.com/kubernetes-sigs/cri-tools

- name: Install docker
shell: bash
run: |
sudo hack/install-docker.sh
hack/install-docker.sh
working-directory: ${{ github.workspace }}/src/github.com/kubernetes-sigs/cri-tools

- name: Build cri-tools
shell: bash
- name: Build cri-tools on Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
make
sudo PATH=$PATH GOPATH=$GOPATH make install
working-directory: ${{ github.workspace }}/src/github.com/kubernetes-sigs/cri-tools

- name: Build cri-dockerd
shell: bash
- name: Build cri-tools on Windows
if: startsWith(matrix.os, 'windows')
run: |
make
make install
working-directory: ${{ github.workspace }}/src/github.com/kubernetes-sigs/cri-tools

- name: Build cri-dockerd on Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo env GOPATH=$GOPATH hack/install-cri-dockerd.sh
working-directory: ${{ github.workspace }}/src/github.com/kubernetes-sigs/cri-tools

- name: Run critest
- name: Build cri-dockerd on Windows
if: startsWith(matrix.os, 'windows')
shell: bash
run: |
GOPATH=$GOPATH hack/install-cri-dockerd.sh
working-directory: ${{ github.workspace }}/src/github.com/kubernetes-sigs/cri-tools

- name: Run critest on Linux
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo make install.ginkgo
sudo env GOPATH=$GOPATH hack/run-critest.sh
sudo env GOPATH=$GOPATH hack/run-dockershim-critest.sh
working-directory: ${{ github.workspace }}/src/github.com/kubernetes-sigs/cri-tools

- name: Dump docker logs
if: always()
- name: Run critest on Windows
if: startsWith(matrix.os, 'windows')
shell: bash
run: |
set -o errexit
set -o nounset
set -o pipefail
set -x
export LANG=C
export LC_ALL=C
FOCUS="${FOCUS:-"Conformance"}"
SKIP="runtime should support apparmor|runtime should support reopening container log|runtime should support execSync with timeout|"
REPORT_DIR="${REPORT_DIR:-"/c/_artifacts"}"
# Start dockershim first
logs_dir="$GOPATH/logs"
mkdir -p $logs_dir
/usr/local/bin/cri-dockerd --v=10 --network-plugin="" --logtostderr >$logs_dir/cri-dockerd.log 2>&1 &
# Wait a while for dockershim starting.
sleep 10
# Run e2e test cases
# Skip reopen container log test because docker doesn't support it.
# 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.
mkdir -p "${REPORT_DIR}"
/usr/local/bin/critest --ginkgo.focus="${FOCUS}" --ginkgo.skip="${SKIP}" --report-dir="${REPORT_DIR}" --report-prefix="windows"
# Run benchmark test cases
/usr/local/bin/critest -benchmark
working-directory: ${{ github.workspace }}/src/github.com/kubernetes-sigs/cri-tools

- name: Dump docker logs on Linux
if: startsWith(matrix.os, 'ubuntu') && always()
run: |
mkdir -p ${{ github.workspace }}/logs
sudo journalctl -eu docker | sudo tee ${{ github.workspace }}/logs/docker.log
ls -atrl ${{ github.workspace }}/logs
- name: Dump docker logs on Windows
if: startsWith(matrix.os, 'windows') && always()
run: |
mkdir -p ${{ github.workspace }}/logs
journalctl -eu docker | tee ${{ github.workspace }}/logs/docker.log
ls -atrl ${{ github.workspace }}/logs
- name: Upload logs
if: always()
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 @@ -25,4 +25,4 @@ git clone https://github.com/dims/cri-dockerd $GOPATH/src/github.com/dims/cri-do
cd $GOPATH/src/github.com/dims/cri-dockerd

go install .
sudo mv $GOPATH/bin/cri-dockerd /usr/local/bin
mv $GOPATH/bin/cri-dockerd /usr/local/bin
2 changes: 1 addition & 1 deletion hack/run-critest.sh → hack/run-dockershim-critest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ arch=$(uname -m)
if [ "$arch" == x86_64 ]; then
docker run --rm -v /usr/local/bin:/target jpetazzo/nsenter
else
apt-get install util-linux
sudo apt-get install -y util-linux
fi

# Start dockershim first
Expand Down

0 comments on commit 175fbd1

Please sign in to comment.