-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloud-config.yaml
52 lines (51 loc) · 2.42 KB
/
cloud-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#cloud-config
runcmd:
- apt-get update
- curl -fsSL https://get.docker.com | sh
- apt-get install podman -y
- apt-get install iperf3 #used to bind the interface associated with the address <host>
- echo " " >> /etc/containers/registries.conf
- echo "# Allow to use docker.io as default registry" >> /etc/containers/registries.conf
- echo "unqualified-search-registries = [\"docker.io\"]" >> /etc/containers/registries.conf
- apt-get install -y ca-certificates fuse3 sqlite3 consul libfuse-dev
- nohup consul agent -client "::" -dev &
- ARCH="amd64"
- VERSION="0.5.1"
- pushd $(mktemp --directory) && wget "https://github.com/superfly/litefs/releases/download/v${VERSION}/litefs-v${VERSION}-linux-${ARCH}.tar.gz" && tar xvf "litefs-v${VERSION}-linux-${ARCH}.tar.gz" && sudo mv litefs /usr/local/bin && popd
- add-apt-repository ppa:git-core/ppa -y --update && apt-get install git -y
- mkdir -p $HOME/litefs-primary
- curl -O https://storage.googleapis.com/golang/go1.20.1.linux-amd64.tar.gz
- tar -xvf go1.20.1.linux-amd64.tar.gz
- cp -r go /usr/local
- mv go /root
- echo "export GOROOT=/usr/local/go" >> $HOME/.profile
- echo "export GOPATH=$HOME/go" >> $HOME/.profile
- source $HOME/.profile
- echo "export PATH=$GOPATH/bin:$GOROOT/bin:$PATH" >> $HOME/.profile
- source $HOME/.profile
- apt install -y build-essential
- apt install rustc -y
- git clone https://github.com/firecracker-microvm/firecracker
- ARCH="$(uname -m)"
- ./firecracker/tools/devtool --unattended build
- cp ./firecracker/build/cargo_target/${ARCH}-unknown-linux-musl/debug/firecracker /usr/bin
- cp ./firecracker/build/cargo_target/${ARCH}-unknown-linux-musl/debug/jailer /usr/bin
- sh -c "$(curl -ssL https://taskfile.dev/install.sh)" -- -d -b /usr/local/bin
- git clone https://github.com/nshimiyimanaamani/sparkd.git
- wget https://cdn.openbsd.org/pub/OpenBSD/OpenSSH/portable/openssh-9.3p2.tar.gz
- tar -xvf openssh-9.3p1.tar.gz
- cd openssh-9.3p1
- ./configure --prefix=/usr --sysconfdir=/etc/ssh --with-md5-passwords --with-privsep-path=/var/lib/sshd
- make
- make install
- mkdir /var/lib/sshd
- groupadd sshd
- useradd -g sshd -c 'sshd privsep' -d /var/lib/sshd -s /bin/false sshd
- ssh-keygen -A
- cp contrib/redhat/sshd.init /etc/init.d/sshd
- chmod +x /etc/init.d/sshd
- update-rc.d sshd defaults
- service sshd start
- cd /sparkd
- task all
- nohup litefs mount -config litefs.yml ./bin &