Skip to content

Commit fcadca8

Browse files
DavidBuzatu-Marianustiugov
authored andcommitted
Added github workflow script and eStargz container configuration
Signed-off-by: David-Marian Buzatu <[email protected]> Removed redundant temp file creation step from workflow Signed-off-by: David-Marian Buzatu <[email protected]> Changed script flag to use string instead Signed-off-by: David-Marian Buzatu <[email protected]> Updated file access for stargz script Signed-off-by: David-Marian Buzatu <[email protected]> Updated path to stargz knative service information Signed-off-by: David-Marian Buzatu <[email protected]> Added sudo to cluster creation in workflow Signed-off-by: David-Marian Buzatu <[email protected]> Fixed path of stargz config file Signed-off-by: David-Marian Buzatu <[email protected]> Removed sudo from script Signed-off-by: David-Marian Buzatu <[email protected]> Fixed workflow copy and sudo issue Signed-off-by: David-Marian Buzatu <[email protected]> Signed-off-by: davidbuzatu-marian <[email protected]>
1 parent 119ed7f commit fcadca8

File tree

4 files changed

+78
-4
lines changed

4 files changed

+78
-4
lines changed

.github/workflows/stargz_tests.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: vHive stock-only stargz tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
paths-ignore:
7+
- 'docs/**'
8+
- '**.md'
9+
- 'function-images/**'
10+
pull_request:
11+
branches: [ main ]
12+
paths-ignore:
13+
- 'docs/**'
14+
- '**.md'
15+
- 'function-images/**'
16+
workflow_dispatch:
17+
18+
env:
19+
GOOS: linux
20+
GO111MODULE: on
21+
22+
jobs:
23+
stargz-container-test:
24+
name: Test running stargz-based image using kn
25+
runs-on: ubuntu-20.04
26+
steps:
27+
28+
- name: Set up Go 1.18
29+
uses: actions/setup-go@v3
30+
with:
31+
go-version: 1.18
32+
33+
- name: Check out code into the Go module directory
34+
uses: actions/checkout@v3
35+
36+
- name: Setup stock-only node
37+
run: sudo ./scripts/cloudlab/setup_node.sh stock-only use-stargz
38+
39+
- name: Check containerd service is running
40+
run: sudo screen -list | grep "containerd"
41+
42+
- name: Check stargz-snapshotter is running
43+
run: sudo systemctl is-active --quiet stargz-snapshotter
44+
45+
- name: Setup single-node cluster
46+
run: sudo ./scripts/cluster/create_one_node_cluster.sh stock-only
47+
48+
- name: Run test container with kn
49+
run: sudo kn service apply stargz-test -f ./configs/knative_workloads/stargz-node.yaml --concurrency-target 1
50+
51+
- name: Curl container
52+
run: curl http://stargz-test.default.192.168.1.240.sslip.io | grep "Hello World"
53+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: serving.knative.dev/v1
2+
kind: Pod
3+
metadata:
4+
name: stargz-test
5+
spec:
6+
template:
7+
spec:
8+
containers:
9+
- name: nodejs-stargz
10+
image: ghcr.io/stargz-containers/node:17.8.0-esgz
11+
command: ["node"]
12+
args:
13+
- -e
14+
- var http = require('http');
15+
http.createServer(function(req, res) {
16+
res.writeHead(200);
17+
res.end('Hello World!\n');
18+
}).listen(80);
19+
ports:
20+
- containerPort: 80

scripts/cloudlab/setup_node.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ if [ "$SANDBOX" == "firecracker" ]; then
6060
fi
6161

6262
if [ -z "$USE_STARGZ" ]; then
63-
USE_STARGZ=false
63+
USE_STARGZ="no-stargz"
6464
fi
6565

66-
if [ "$USE_STARGZ" = true]; then
66+
if [ "$USE_STARGZ" == "use-stargz" ]; then
6767
$SCRIPTS/stargz/setup_stock_only_stargz.sh
6868
fi

scripts/stargz/setup_stock_only_stargz.sh

100644100755
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
#!/bin/bash
22

33
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
4-
ROOT="$( cd $DIR && cd .. && pwd)"
4+
ROOT="$( cd $DIR && cd ../.. && pwd)"
55
BINS=$ROOT/bin
66
CONFIGS=$ROOT/configs/stargz
77

88
# Get stargz snapshotter tar
99
wget --continue --quiet https://github.com/containerd/stargz-snapshotter/releases/download/v0.13.0/stargz-snapshotter-v0.13.0-linux-amd64.tar.gz
1010

1111
# Copy stargz config
12-
sudo cp $CONFIGS/config.toml /etc/containerd/
12+
sudo mkdir -p /etc/containerd
13+
sudo cp $CONFIGS/config.toml /etc/containerd/config.toml
1314

1415
# Unzip stargz binary and install it
1516
sudo tar -C /usr/local/bin -xvf stargz-snapshotter-v0.13.0-linux-amd64.tar.gz containerd-stargz-grpc ctr-remote

0 commit comments

Comments
 (0)