Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cluster restart script #208

Merged
merged 3 commits into from
Apr 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions .github/workflows/cri_minio_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,8 @@ jobs:
GOPATH: /root/tmp/gopath
run: go build

- name: Create logdir
run: mkdir -p -m777 -p /tmp/ctrd-logs/${{ github.run_id }}

- name: Start Containerd
run: sudo containerd 1>/tmp/ctrd-logs/${{ github.run_id }}/ctrd.out 2>/tmp/ctrd-logs/${{ github.run_id }}/ctrd.err &

- name: Start Firecracker-containerd
run: sleep 1s && sudo /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>/tmp/ctrd-logs/${{ github.run_id }}/fccd.out 2>/tmp/ctrd-logs/${{ github.run_id }}/fccd.err &

- name: Start vHive
run: sleep 1s && sudo ./vhive -dbg 1>/tmp/ctrd-logs/${{ github.run_id }}/fccd.out 2>/tmp/ctrd-logs/${{ github.run_id }}/fccd.err &

- name: Create k8s cluster
run: sleep 1s && ./scripts/cluster/create_one_node_cluster.sh
- name: Start vHive cluster
run: ./scripts/cloudlab/start_onenode_vhive_cluster.sh

- name: modify $PATH
env:
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

### Added

- Added [script](./scripts/cloudlab/start_onenode_vhive_cluster.sh) to (re)start vHive single node cluster in a push-button.
- CRI test logs are now stored as GitHub artifacts.

### Changed

### Fixed
Expand Down Expand Up @@ -31,7 +34,6 @@ Other
- vHive now also supports vanilla Knative benchmarking and testing (i.e., using containers for function sandboxes).
More info [here](./docs/developers_guide.md#Testing-stock-Knative-images).


### Changed
- Bumped up the Firecracker version to v0.24 with REAP snapshots support.
- Bumped up all Knative components to version v0.21.
Expand Down
2 changes: 2 additions & 0 deletions configs/.wordlist.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ ASBD
Asheim
ASPLOS
autoscaling
autostart
backend
Backend
baseurl
Expand Down Expand Up @@ -240,6 +241,7 @@ NUMA
OCI
Ocin
OneLab
onenode
Onur
OpenCV
orchestrator
Expand Down
10 changes: 2 additions & 8 deletions cri/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,9 @@
EXTRAGOARGS:=-v -race -cover
CTRDLOGDIR:=/tmp/ctrd-logs/${GITHUB_RUN_ID}
test:
sudo mkdir -p -m777 -p $(CTRDLOGDIR)
sudo containerd 1>$(CTRDLOGDIR)/ctrd.out 2>$(CTRDLOGDIR)/ctrd.err &
sleep 1s
sudo /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$(CTRDLOGDIR)/fccd.out 2>$(CTRDLOGDIR)/fccd.err &
sleep 1s
sudo ./../vhive -dbg 1>$(CTRDLOGDIR)/orch.out 2>$(CTRDLOGDIR)/orch.err &
sleep 1s

./../scripts/cluster/create_one_node_cluster.sh
./../scripts/cloudlab/start_onenode_vhive_cluster.sh

sleep 2m
KUBECONFIG=/etc/kubernetes/admin.conf ./../scripts/setup_zipkin.sh
sleep 5s
Expand Down
13 changes: 12 additions & 1 deletion docs/quickstart_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,18 +118,29 @@ kn service delete --all

## Setup a single-node cluster (master and worker functionality on the same node)

```
### Manual
Start each component separately.

```bash
ustiugov marked this conversation as resolved.
Show resolved Hide resolved
./scripts/cloudlab/setup_node.sh
sudo containerd
sudo PATH=$PATH /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml
source /etc/profile && go build && sudo ./vhive
./scripts/cluster/create_one_node_cluster.sh
```

### Clean up
```bash
./scripts/github_runner/clean_cri_runner.sh
ustiugov marked this conversation as resolved.
Show resolved Hide resolved
```

### Using a script
This script stops the existing cluster if any, cleans up and then starts a fresh single-node cluster.

```bash
scripts/cloudlab/start_onenode_vhive_cluster.sh <folder to store logs>
```

## CloudLab deployment notes

### CloudLab Profile
Expand Down
59 changes: 59 additions & 0 deletions scripts/cloudlab/start_onenode_vhive_cluster.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
#!/bin/bash

# MIT License
#
# Copyright (c) 2020 Dmitrii Ustiugov, Plamen Petrov and EASE lab
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
ROOT="$( cd $DIR && cd .. && cd .. && pwd)"
SCRIPTS=$ROOT/scripts

$SCRIPTS/github_runner/clean_cri_runner.sh

CTRDLOGDIR=$1

if [ -z $CTRDLOGDIR ] && [ -z "$GITHUB_RUN_ID" ] ; then
echo "[ERROR]: The log-directory argument is missing"
echo "USAGE: start_onenode_vhive_cluster.sh <Directory to store logs>"
exit -1
else
if [ -z "$CTRDLOGDIR" ]; then
CTRDLOGDIR=/tmp/ctrd-logs/$GITHUB_RUN_ID
fi
fi

echo "using $CTRDLOGDIR for storing logs"

sudo mkdir -p -m777 -p $CTRDLOGDIR
sudo containerd 1>$CTRDLOGDIR/ctrd.out 2>$CTRDLOGDIR/ctrd.err &
sleep 1s
sudo /usr/local/bin/firecracker-containerd --config /etc/firecracker-containerd/config.toml 1>$CTRDLOGDIR/fccd.out 2>$CTRDLOGDIR/fccd.err &
sleep 1s

if [ ! -f "$ROOT/vhive" ]; then
source /etc/profile && cd $ROOT && go build
fi
sleep 1s

cd $ROOT && sudo ./vhive -dbg 1>$CTRDLOGDIR/orch.out 2>$CTRDLOGDIR/orch.err &
sleep 1s

$SCRIPTS/cluster/create_one_node_cluster.sh
1 change: 1 addition & 0 deletions scripts/setup_system.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ sudo apt-get -y install \
dmsetup \
gnupg-agent \
software-properties-common \
iproute2 \
skopeo >> /dev/null

# stack size, # of open files, # of pids
Expand Down