Skip to content

Commit

Permalink
fix gvisor cleanup and add gocache on github runner
Browse files Browse the repository at this point in the history
Signed-off-by: JooYoung Park <jooyoung.park73@gmail.com>
  • Loading branch information
JooyoungPark73 authored and lrq619 committed Apr 25, 2024
1 parent 532496d commit 617f6c7
Show file tree
Hide file tree
Showing 11 changed files with 99 additions and 82 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Expand Up @@ -30,17 +30,17 @@ jobs:
runs-on: ubuntu-20.04
steps:

- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
# to add commit DCO checks later
fetch-depth: 21

- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}

- name: Check code
uses: golangci/golangci-lint-action@v4.0.0
with:
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/build_setup.yml
Expand Up @@ -22,14 +22,18 @@ jobs:
name: Build setup scripts
runs-on: ubuntu-20.04
steps:
- name: Set up Go 1.21
uses: actions/setup-go@v5
with:
go-version: '1.21'


- name: Check out the code
uses: actions/checkout@v4

- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Build scripts
run: pushd scripts && go build -o setup_tool && popd

Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/cri_minio_test.yml
Expand Up @@ -33,14 +33,17 @@ jobs:
steps:
- name: Setup TMPDIR
run: mkdir -p $TMPDIR

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up Go 1.21
- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version: '1.21'

- name: Check out code into the Go module directory
uses: actions/checkout@v4
go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Build
run: go build
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/cri_stock_containerd_test.yml
Expand Up @@ -23,10 +23,13 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up golang
- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Build setup scripts
run: pushd scripts && go build -o setup_tool && popd
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/cri_tests.yml
Expand Up @@ -27,10 +27,13 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up golang
- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version: "1.21"
go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Add rsync
run: |
Expand Down
23 changes: 10 additions & 13 deletions .github/workflows/integration_tests.yml
Expand Up @@ -30,32 +30,29 @@ jobs:
matrix:
test-name: [test, test-man-bench]
steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
lfs: true

- name: Set up Go 1.21
- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Upgrade git
run: |
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt update
sudo apt install git -y

- name: Add rsync
run: |
sudo apt update
sudo apt install rsync -y
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
lfs: true
- name: Build setup scripts
run: pushd scripts && go build -o setup_tool && popd
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/nightly_tests.yml
Expand Up @@ -19,23 +19,20 @@ jobs:
steps:
- name: Setup TMPDIR
run: mkdir -p $TMPDIR

- name: Set up Go 1.21
uses: actions/setup-go@v5
with:
go-version: '1.21'

- name: Upgrade git
run: |
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt update
sudo apt install git -y

- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
lfs: true

- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Build setup scripts
run: pushd scripts && go build -o setup_tool && popd

Expand Down Expand Up @@ -77,14 +74,17 @@ jobs:
- name: Setup TMPDIR
run: mkdir -p $TMPDIR

- name: Set up Go 1.21
uses: actions/setup-go@v5
with:
go-version: '1.21'

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Build setup scripts
run: pushd scripts && go build -o setup_tool && popd

Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/openyurt-unit-test.yml
Expand Up @@ -22,14 +22,17 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Set up Go 1.21
uses: actions/setup-go@v5
with:
go-version: '1.21'

- name: Check out the code
uses: actions/checkout@v4

- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Build scripts
run:
pushd scripts/openyurt-deployer && go build -o oy_deploy && popd
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/stargz_tests.yml
Expand Up @@ -42,10 +42,13 @@ jobs:
- name: Checkout LFS objects
run: git lfs checkout

- name: Set up Go 1.21
- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version: '1.21'
go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Build setup scripts
run: pushd scripts && go build -o setup_tool && popd
Expand Down
48 changes: 24 additions & 24 deletions .github/workflows/unit_tests.yml
Expand Up @@ -28,20 +28,22 @@ jobs:
matrix:
module: [misc, networking, snapshotting]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up Go 1.21
- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version: '1.21'

go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Build setup scripts
run: pushd scripts && go build -o setup_tool && popd

Expand Down Expand Up @@ -73,20 +75,22 @@ jobs:
matrix:
module: [profile]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up Go 1.21
- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version: '1.21'

go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Build setup scripts
run: pushd scripts && go build -o setup_tool && popd

Expand Down Expand Up @@ -121,22 +125,18 @@ jobs:
matrix:
module: [ ctriface, ctriface/image, devmapper ]
steps:

- name: Set up Go 1.21
uses: actions/setup-go@v5
with:
go-version: '1.21'

- name: Upgrade git
run: |
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt update
sudo apt install git -y
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
lfs: true

- name: Set up Go version in go.mod file
uses: actions/setup-go@v5
with:
go-version-file: ${{ github.workspace }}/go.mod
cache-dependency-path: |
**/go.sum
**/go.mod
- name: Add rsync
run: |
Expand Down
5 changes: 3 additions & 2 deletions scripts/github_runner/clean_cri_runner.sh
Expand Up @@ -37,9 +37,9 @@ fi

KUBECONFIG=/etc/kubernetes/admin.conf kn service delete --all
if [ "$SANDBOX" == "stock-only" ]; then
sudo kubeadm reset --cri-socket /run/containerd/containerd.sock -f
sudo kubeadm reset --cri-socket unix:///run/containerd/containerd.sock -f
else
sudo kubeadm reset --cri-socket /etc/vhive-cri/vhive-cri.sock -f
sudo kubeadm reset --cri-socket unix:///etc/vhive-cri/vhive-cri.sock -f
fi

if [ "$SANDBOX" == "firecracker" ]; then
Expand Down Expand Up @@ -91,6 +91,7 @@ fi

if [ "$SANDBOX" == "gvisor" ]; then
echo Cleaning /run/gvisor-containerd/*
sudo umount /run/gvisor-containerd/io.containerd.runtime.v2.task/default/*/rootfs
sudo rm -rf /run/gvisor-containerd/*

echo Cleaning /var/lib/gvisor-containerd/*
Expand Down

0 comments on commit 617f6c7

Please sign in to comment.