Skip to content

Instantly share code, notes, and snippets.

@juliusl
Created January 13, 2023 19:48
Show Gist options
  • Save juliusl/c6147e57c927954c25b6f52439747e35 to your computer and use it in GitHub Desktop.
Save juliusl/c6147e57c927954c25b6f52439747e35 to your computer and use it in GitHub Desktop.
User-Data
## template: jinja
#cloud-config
merge_how:
- name: list
settings: [append]
- name: dict
settings: [no_replace, recurse_list]
write_files:
# Create nydusd config
- content: |
{
"device": {
"backend": {
"type": "registry",
"config": {
"scheme": "https",
"skip_verify": false,
"timeout": 5,
"connect_timeout": 5,
"retry_limit": 2,
}
},
"cache": {
"type": "blobcache",
"config": {
"work_dir": "cache"
}
}
},
"mode": "direct",
"digest_validate": false,
"iostats_files": false,
"enable_xattr": true,
"fs_prefetch": {
"enable": true,
"threads_count": 4
}
}
path: /etc/nydusd-config.json
runcmd:
- useradd -m -s /bin/bash -p "" juliusl
- chage -d 0 juliusl
- usermod -a -G sudo juliusl
# Install deps
- wget https://github.com/google/googletest/archive/refs/tags/release-1.10.0.tar.gz
- tar -zxvf release-1.10.0.tar.gz
- cd googletest-release-1.10.0; cmake CMakeLists.txt
- make; make install
# Install overlaybd-tcmu kernel service
- cd ..; git clone https://github.com/containerd/overlaybd.git
- cd overlaybd; git submodule update --init
- mkdir build; cd build; cmake ..; make -j; make install
- systemctl enable /opt/overlaybd/overlaybd-tcmu.service
- systemctl start overlaybd-tcmu
# Install containerd + runc
- moby_runc_package_url=https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/m/moby-runc/moby-runc_1.0.2%2Bazure-1_amd64.deb
- moby_runc_package_file="./moby-runc.deb"
- curl -sSL $moby_runc_package_url -o $moby_runc_package_file
- sudo dpkg --force-all -i $moby_runc_package_file
- moby_containerd_package_url=https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/m/moby-containerd/moby-containerd_1.6.6%2Bazure-ubuntu20.04u1_amd64.deb
- moby_containerd_package_file="./moby-containerd.deb"
- curl -sSL $moby_containerd_package_url -o $moby_containerd_package_file
- sudo dpkg --force-all -i $moby_containerd_package_file
# Install overlaybd snapshotter
- su juliusl -s /bin/bash -c 'export PATH=$PATH:/usr/local/go/bin; go version'
- su juliusl -s /bin/bash -c 'git clone https://github.com/containerd/accelerated-container-image.git ~/accelerated-container-image'
- su juliusl -s /bin/bash -c 'export PATH=$PATH:/usr/local/go/bin; cd ~/accelerated-container-image; make'
# Install Nydus
- cd /home/juliusl;
- wget https://github.com/dragonflyoss/image-service/releases/download/v2.1.0-rc.3.1/nydus-static-v2.1.0-rc.3.1-linux-amd64.tgz
- tar -zxvf nydus-static-v2.1.0-rc.3.1-linux-amd64.tgz; rm nydus-static-v2.1.0-rc.3.1-linux-amd64.tgz;
- cd nydus-static; cp nydusd nydus-image /usr/local/bin; cp nydusify nydus-overlayfs /usr/local/bin;
# Install Nydus-Snapshotter
- cd /home/juliusl;
- wget https://github.com/containerd/nydus-snapshotter/releases/download/v0.2.4/nydus-snapshotter-v0.2.4-x86_64.tgz
- tar -zxvf nydus-snapshotter-v0.2.4-x86_64.tgz
- cd nydus-snapshotter; cp containerd-nydus-grpc /usr/local/bin;
packages:
- pkg-config
- libgflags-dev
- libcurl4-openssl-dev
- libssl-dev
- libaio-dev
- libnl-3-dev
- libnl-genl-3-dev
- libpci-dev
- make
- cmake
- g++
- gcc
- linux-virtual
- linux-cloud-tools-virtual
- linux-tools-virtual
- zsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment