Skip to content

Commit

Permalink
bugfixes and comments update
Browse files Browse the repository at this point in the history
Signed-off-by: Shyam Jesalpura <s.jesalpura@gmail.com>
  • Loading branch information
shyamjesal authored and ustiugov committed Jan 26, 2021
1 parent fca6967 commit fed1da6
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 52 deletions.
5 changes: 4 additions & 1 deletion scripts/clean_fcctr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,13 @@ for d in `find /var/lib/cni/ -mindepth 1 -maxdepth 1 -type d | grep -v networks
sudo rm -rf $d
done

# When executed inside a docker container, this command returns the container ID of the container.
# on a non container environment, this returns "/".
CONTAINERID=$(basename $(cat /proc/1/cpuset))

# Docker container ID is 64 characters long.
if [ 64 -eq ${#CONTAINERID} ]; then
echo Removing devmapper devices
echo Removing devmapper devices for the current container
for de in `sudo dmsetup ls| cut -f1|grep $CONTAINERID |grep snap`; do sudo dmsetup remove $de && echo Removed $de; done
sudo dmsetup remove "${CONTAINERID}_thinpool"
else
Expand Down
3 changes: 3 additions & 0 deletions scripts/create_devmapper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@ pushd /var/lib/firecracker-containerd/snapshotter/devmapper > /dev/null
DIR=/var/lib/firecracker-containerd/snapshotter/devmapper
POOL=fc-dev-thinpool

# When executed inside a docker container, this command returns the container ID of the container.
# on a non container environment, this returns "/".
CONTAINERID=$(basename $(cat /proc/1/cpuset))

# Docker container ID is 64 characters long.
if [ 64 -eq ${#CONTAINERID} ]; then
POOL="${CONTAINERID}_thinpool"
fi
Expand Down
34 changes: 32 additions & 2 deletions scripts/github_runner/Dockerfile.github_runner
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,37 @@ RUN apt-get update && \
make \
gcc \
iproute2 \
iptables
iptables \
apt-transport-https \
ca-certificates \
curl \
gcc \
g++ \
make \
acl \
net-tools \
git-lfs \
bc \
dmsetup \
gnupg-agent \
software-properties-common && \
sudo sysctl -w net.ipv4.conf.all.forwarding=1 && \
sudo swapoff -a && \
sudo sysctl net.ipv4.ip_forward=1 && \
sudo sysctl --system && \
sudo mkdir -p /etc/firecracker-containerd && \
sudo mkdir -p /var/lib/firecracker-containerd/runtime && \
sudo mkdir -p /etc/containerd/ && \
sudo curl -fsSL -o /var/lib/firecracker-containerd/runtime/hello-vmlinux.bin https://s3.amazonaws.com/spec.ccfc.min/img/hello/kernel/hello-vmlinux.bin

COPY ./setup_runner.sh /setup_runner.sh
COPY scripts/github_runner/setup_runner.sh /setup_runner.sh
COPY scripts/create_devmapper.sh /create_devmapper.sh
COPY bin/firecracker /usr/local/bin/
COPY bin/jailer /usr/local/bin/
COPY bin/containerd-shim-aws-firecracker /usr/local/bin/
COPY bin/firecracker-containerd /usr/local/bin/
COPY bin/firecracker-ctr /usr/local/bin/
COPY bin/default-rootfs.img /var/lib/firecracker-containerd/runtime/
COPY configs/firecracker-containerd/config.toml /etc/firecracker-containerd/
COPY configs/firecracker-containerd/firecracker-runtime.json /etc/containerd/
ENTRYPOINT /setup_runner.sh ; /entrypoint.sh
45 changes: 0 additions & 45 deletions scripts/github_runner/setup_crontab.sh

This file was deleted.

14 changes: 11 additions & 3 deletions scripts/github_runner/setup_runner.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

git clone https://github.com/ease-lab/vhive
cd vhive
./scripts/travis/setup_node.sh
# When executed inside a docker container, this command returns the container ID of the container.
# on a non container environment, this returns "/".
CONTAINERID=$(basename $(cat /proc/1/cpuset))

# Docker container ID is 64 characters long.
if [ 64 -eq ${#CONTAINERID} ]; then
# set thinpool device name dynamically
sudo sed -i "s/fc-dev-thinpool/${CONTAINERID}_thinpool/" /etc/firecracker-containerd/config.toml
fi

/create_devmapper.sh
9 changes: 8 additions & 1 deletion scripts/github_runner/setup_runner_host.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,11 @@ sudo apt-get install --yes docker-ce docker-ce-cli containerd.io >> /dev/null
sudo usermod -aG docker $USER
newgrp docker

./setup_crontab.sh
#setup crontab for nightly reboots
TMPFILE=$(mktemp)
#write out current crontab
crontab -l > $TMPFILE
#echo new cron into cron file
echo "00 00 * * * shutdown -r 0" >> $TMPFILE
#install new cron file
crontab $TMPFILE
3 changes: 3 additions & 0 deletions scripts/setup_containerd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ sudo curl -fsSL -o /var/lib/firecracker-containerd/runtime/hello-vmlinux.bin htt

sudo cp $CONFIGS/config.toml /etc/firecracker-containerd/

# When executed inside a docker container, this command returns the container ID of the container.
# on a non container environment, this returns "/".
CONTAINERID=$(basename $(cat /proc/1/cpuset))

# Docker container ID is 64 characters long.
if [ 64 -eq ${#CONTAINERID} ]; then
sudo sed -i "s/fc-dev-thinpool/${CONTAINERID}_thinpool/" /etc/firecracker-containerd/config.toml
fi
Expand Down

0 comments on commit fed1da6

Please sign in to comment.