Skip to content

Commit c74949d

Browse files
DavidBuzatu-Marianustiugov
authored andcommitted
Included stargz setup in main guide doc
Signed-off-by: David-Marian Buzatu <[email protected]> Signed-off-by: davidbuzatu-marian <[email protected]>
1 parent 31a1979 commit c74949d

File tree

2 files changed

+80
-31
lines changed

2 files changed

+80
-31
lines changed

docs/quickstart_guide.md

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ To see how to setup a single node cluster with stock-only or gVisor, see [Develo
2525
1. [Deploy Functions](#1-deploy-functions)
2626
2. [Invoke Functions](#2-invoke-functions)
2727
3. [Delete Deployed Functions](#3-delete-deployed-functions)
28+
5. [Deploying eStargz-based Functions](#v-deploying-estargz-based-functions)
29+
1. [Deploy and Invoke Functions](#1-deploy-and-invoke-functions)
30+
2. [Delete Deployed Function](#2-delete-deployed-function)
2831

2932
## I. Host platform requirements
3033
### 1. Hardware
@@ -87,12 +90,38 @@ SSD-equipped nodes are highly recommended. Full list of CloudLab nodes can be fo
8790
>
8891
> This script can print `Command failed` when creating the devmapper at the end. This can be safely ignored.
8992

93+
> **Note:**
94+
>
95+
> [eStargz](https://github.com/containerd/stargz-snapshotter/tree/cmd/v0.12.1) is a
96+
> lazily-pullable image format developed to improve the performance of container boot-ups by
97+
> making better usage of the layering structure of container images. The image format is
98+
> compatible to [OCI](https://github.com/opencontainers/image-spec/)/[Docker](https://github.com/moby/moby/blob/master/image/spec/v1.2.md) images, therefore it allows pushing images to
99+
> standard container registries.
100+
> To enable runs with `stargz` images, setup kubelet by adding the `stock-only` and `use-stargz`
101+
> flags as follows:
102+
> ```bash
103+
> ./scripts/cloudlab/setup_node.sh stock-only use-stargz > >(tee -a /tmp/vhive-logs
104+
> setup_worker_kubelet.stdout) 2> >(tee -a /tmp/vhive-logs/setup_worker_kubelet.stderr >&2)
105+
> ```
106+
> **IMPORTANT**
107+
> Currently `stargz` is only supported in native kubelet contexts without firecracker.
108+
> Therefore, the following steps from this guide must **not** be executed:
109+
> * `2.3`,
110+
> * `2.4`,
111+
> * `2.5`.
112+
113+
90114
### 2. Setup Worker Nodes
91115
**On each worker node**, execute the following instructions below **as a non-root user with sudo rights** using **bash**:
92116
1. Run the script that setups kubelet:
93117
```bash
94118
./scripts/cluster/setup_worker_kubelet.sh > >(tee -a /tmp/vhive-logs/setup_worker_kubelet.stdout) 2> >(tee -a /tmp/vhive-logs/setup_worker_kubelet.stderr >&2)
95119
```
120+
> **IMPORTANT:**
121+
> If step `1.3` was executed with the `stock-only` flag, execute the following instead:
122+
> ```bash
123+
> ./scripts/cluster/setup_worker_kubelet.sh stock-only > >(tee -a /tmp/vhive-logs/setup_worker_kubelet.stdout) 2> >(tee -a /tmp/vhive-logs/setup_worker_kubelet.stderr >&2)
124+
> ```
96125
2. Start `containerd` in a background terminal named `containerd`:
97126
```bash
98127
sudo screen -dmS containerd bash -c "containerd > >(tee -a /tmp/vhive-logs/containerd.stdout) 2> >(tee -a /tmp/vhive-logs/containerd.stderr >&2)"
@@ -149,7 +178,7 @@ SSD-equipped nodes are highly recommended. Full list of CloudLab nodes can be fo
149178
```bash
150179
sudo screen -dmS containerd bash -c "containerd > >(tee -a /tmp/vhive-logs/containerd.stdout) 2> >(tee -a /tmp/vhive-logs/containerd.stderr >&2)"
151180
```
152-
2. Run the script that creates the multinode cluster:
181+
2. Run the script that creates the multinode cluster (without `stargz`):
153182
```bash
154183
./scripts/cluster/create_multinode_cluster.sh > >(tee -a /tmp/vhive-logs/create_multinode_cluster.stdout) 2> >(tee -a /tmp/vhive-logs/create_multinode_cluster.stderr >&2)
155184
```
@@ -168,6 +197,14 @@ SSD-equipped nodes are highly recommended. Full list of CloudLab nodes can be fo
168197
> ```
169198
> Please copy the both lines of this command.
170199
200+
> **IMPORTANT:**
201+
> If you built the cluster using the `stock-only` flag, execute the following
202+
> script instead:
203+
> ```bash
204+
> ./scripts/cluster/create_multinode_cluster.sh stock-only > >(tee -a /tmp/vhive-logs/
205+
> create_multinode_cluster.stdout) 2> >(tee -a /tmp/vhive-logs/create_multinode_cluster.stderr >&2)
206+
> ```
207+
171208
### 4. Configure Worker Nodes
172209
**On each worker node**, execute the following instructions below **as a non-root user with sudo rights** using **bash**:
173210
@@ -207,6 +244,18 @@ Execute the following below **as a non-root user with sudo rights** using **bash
207244
```bash
208245
./scripts/cloudlab/setup_node.sh;
209246
```
247+
> **Note:**
248+
> To enable runs with `stargz` images, setup kubelet by adding the `stock-only` and `use-stargz`
249+
> flags as follows:
250+
> ```bash
251+
> ./scripts/cloudlab/setup_node.sh; stock-only use-stargz
252+
> ```
253+
> **IMPORTANT**
254+
> Currently `stargz` is only supported in native kubelet contexts without firecracker.
255+
> Therefore, the following steps from this guide must **not** be executed:
256+
> * `2.3`,
257+
> * `2.4`,
258+
> * `2.5`.
210259
2. Start `containerd` in a background terminal named `containerd`:
211260
```bash
212261
sudo screen -dmS containerd containerd; sleep 5;
@@ -231,12 +280,24 @@ Execute the following below **as a non-root user with sudo rights** using **bash
231280
```bash
232281
./scripts/cluster/create_one_node_cluster.sh
233282
```
283+
> **IMPORTANT:**
284+
> If you setup the node using the `stock-only` flag, execute the following
285+
> script instead:
286+
> ```bash
287+
> ./scripts/cluster/create_one_node_cluster.sh stock-only
288+
> ```
234289
235290
### 2. Clean Up
236291
```bash
237292
./scripts/github_runner/clean_cri_runner.sh
238293
```
239294
295+
> **IMPORTANT:**
296+
> If the setup script was done using the `stock-only` and `use-stargz` flags, add the corresponding flags to the script as follows:
297+
> ```bash
298+
> ./scripts/github_runner/clean_cri_runner.sh stock-only use-stargz
299+
> ```
300+
240301
### 3. Using a Script
241302
This script stops the existing cluster if any, cleans up and then starts a fresh single-node cluster.
242303
@@ -289,6 +350,24 @@ for benchmarking asynchronous (i.e., Knative Eventing) case and more details abo
289350
### 3. Delete Deployed Functions
290351
**On the master node**, execute the following instructions below using **bash**:
291352
353+
1. Delete **all** deployed functions:
354+
```bash
355+
kn service delete --all
356+
```
357+
358+
## V. Deploying eStargz-based Functions
359+
This section provides an example function run using a `nodejs` base image that has been converted to the `stargz` format. To create other images supported by `stargz`, please refer to the [creating-estargz-images-using-ctr-remote](https://github.com/containerd/stargz-snapshotter/tree/cmd/v0.12.1#creating-estargz-images-using-ctr-remote) section of the official `stargz` repository.
360+
### 1. Deploy and Invoke Functions
361+
**On the master node**, execute the following using **bash**:
362+
363+
```bash
364+
kn service apply <name> -f <yaml_config_path> --concurrency-target 1
365+
```
366+
367+
Interact with the deployed function from any node using the exposed interface of the deployed function.
368+
### 2. Delete Deployed Function
369+
**On the master node**, execute the following using **bash**:
370+
292371
1. Delete **all** deployed functions:
293372
```bash
294373
kn service delete --all

docs/stargz/stargz_guide.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)