diff --git a/misc/prepare.sh b/misc/prepare.sh index 41052f02d92..d424a770c55 100644 --- a/misc/prepare.sh +++ b/misc/prepare.sh @@ -2,24 +2,24 @@ SNAPSHOTTER_CONFIG="misc/performance/snapshotter_config.toml" if [ "$1" == "takeover_test" ]; then - SNAPSHOTTER_CONFIG="misc/takeover/snapshotter_config.toml" + sed -i 's/recover_policy = "restart"/recover_policy = "failover"/' "$SNAPSHOTTER_CONFIG" fi -readonly SNAPSHOTTER_VERSION=0.14.0 -readonly NERDCTL_VERSION=1.7.6 -readonly CNI_PLUGINS_VERSION=1.5.0 +readonly SNAPSHOTTER_VERSION=`curl -s https://api.github.com/repos/containerd/nydus-snapshotter/releases/latest | grep tag_name | cut -f4 -d "\""` +readonly NERDCTL_VERSION=`curl -s https://api.github.com/repos/containerd/nerdctl/releases/latest | grep tag_name | cut -f4 -d "\"" | sed 's/^v//g'` +readonly CNI_PLUGINS_VERSION=`curl -s https://api.github.com/repos/containernetworking/plugins/releases/latest | grep tag_name | cut -f4 -d "\""` # setup nerdctl and nydusd env sudo install -D -m 755 contrib/nydusify/cmd/nydusify /usr/local/bin sudo install -D -m 755 target/release/nydusd target/release/nydus-image /usr/local/bin -wget https://github.com/containerd/nydus-snapshotter/releases/download/v$SNAPSHOTTER_VERSION/nydus-snapshotter-v$SNAPSHOTTER_VERSION-linux-amd64.tar.gz -tar zxvf nydus-snapshotter-v$SNAPSHOTTER_VERSION-linux-amd64.tar.gz +wget https://github.com/containerd/nydus-snapshotter/releases/download/$SNAPSHOTTER_VERSION/nydus-snapshotter-$SNAPSHOTTER_VERSION-linux-amd64.tar.gz +tar zxvf nydus-snapshotter-$SNAPSHOTTER_VERSION-linux-amd64.tar.gz sudo install -D -m 755 bin/containerd-nydus-grpc /usr/local/bin sudo wget https://github.com/containerd/nerdctl/releases/download/v$NERDCTL_VERSION/nerdctl-$NERDCTL_VERSION-linux-amd64.tar.gz sudo tar -xzvf nerdctl-$NERDCTL_VERSION-linux-amd64.tar.gz -C /usr/local/bin sudo mkdir -p /opt/cni/bin -sudo wget https://github.com/containernetworking/plugins/releases/download/v$CNI_PLUGINS_VERSION/cni-plugins-linux-amd64-v$CNI_PLUGINS_VERSION.tgz -sudo tar -xzvf cni-plugins-linux-amd64-v$CNI_PLUGINS_VERSION.tgz -C /opt/cni/bin +sudo wget https://github.com/containernetworking/plugins/releases/download/$CNI_PLUGINS_VERSION/cni-plugins-linux-amd64-$CNI_PLUGINS_VERSION.tgz +sudo tar -xzvf cni-plugins-linux-amd64-$CNI_PLUGINS_VERSION.tgz -C /opt/cni/bin sudo install -D misc/performance/containerd_config.toml /etc/containerd/config.toml sudo systemctl restart containerd sudo install -D misc/performance/nydusd_config.json /etc/nydus/nydusd-config.fusedev.json diff --git a/misc/takeover/snapshotter_config.toml b/misc/takeover/snapshotter_config.toml deleted file mode 100644 index f9d660b435e..00000000000 --- a/misc/takeover/snapshotter_config.toml +++ /dev/null @@ -1,132 +0,0 @@ -version = 1 -# Snapshotter's own home directory where it stores and creates necessary resources -root = "/var/lib/containerd/io.containerd.snapshotter.v1.nydus" -# The snapshotter's GRPC server socket, containerd will connect to plugin on this socket -address = "/run/containerd-nydus/containerd-nydus-grpc.sock" -daemon_mode = "dedicated" -# Whether snapshotter should try to clean up resources when it is closed -cleanup_on_close = false - -[system] -# Snapshotter's debug and trace HTTP server interface -enable = true -# Unix domain socket path where system controller is listening on -address = "/run/containerd-nydus/system.sock" - -[system.debug] -# Snapshotter can profile the CPU utilization of each nydusd daemon when it is being started. -# This option specifies the profile duration when nydusd is downloading and uncomproessing data. -daemon_cpu_profile_duration_secs = 5 -# Enable by assigning an address, empty indicates pprof server is disabled -pprof_address = "" - -[daemon] -# Specify a configuration file for nydusd -nydusd_config = "/etc/nydus/nydusd-config.fusedev.json" -nydusd_path = "/usr/local/bin/nydusd" -nydusimage_path = "/usr/local/bin/nydus-image" -# fusedev or fscache -fs_driver = "fusedev" -# How to process when daemon dies: "none", "restart" or "failover" -recover_policy = "failover" -# Nydusd worker thread number to handle FUSE or fscache requests, [0-1024]. -# Setting to 0 will use the default configuration of nydusd. -threads_number = 4 -# Log rotation size for nydusd, in unit MB(megabytes) -log_rotation_size = 100 - -[cgroup] -# Whether to use separate cgroup for nydusd. -enable = true -# The memory limit for nydusd cgroup, which contains all nydusd processes. -# Percentage is supported as well, please ensure it is end with "%". -# The default unit is bytes. Acceptable values include "209715200", "200MiB", "200Mi" and "10%". -memory_limit = "" - -[log] -# Print logs to stdout rather than logging files -log_to_stdout = false -# Snapshotter's log level -level = "info" -log_rotation_compress = true -log_rotation_local_time = true -# Max number of days to retain logs -log_rotation_max_age = 7 -log_rotation_max_backups = 5 -# In unit MB(megabytes) -log_rotation_max_size = 100 - -[metrics] -# Enable by assigning an address, empty indicates metrics server is disabled -address = ":9110" - -[remote] -convert_vpc_registry = false - -[remote.mirrors_config] -# Snapshotter will overwrite daemon's mirrors configuration -# if the values loaded from this driectory are not null before starting a daemon. -# Set to "" or an empty directory to disable it. -#dir = "/etc/nydus/certs.d" - -[remote.auth] -# Fetch the private registry auth by listening to K8s API server -enable_kubeconfig_keychain = false -# synchronize `kubernetes.io/dockerconfigjson` secret from kubernetes API server with specified kubeconfig (default `$KUBECONFIG` or `~/.kube/config`) -kubeconfig_path = "" -# Fetch the private registry auth as CRI image service proxy -enable_cri_keychain = false -# the target image service when using image proxy -#image_service_address = "/run/containerd/containerd.sock" - -[snapshot] -# Let containerd use nydus-overlayfs mount helper -enable_nydus_overlayfs = false -# Insert Kata Virtual Volume option to `Mount.Options` -enable_kata_volume = false -# Whether to remove resources when a snapshot is removed -sync_remove = false - -[cache_manager] -# Disable or enable recyclebin -disable = false -# How long to keep deleted files in recyclebin -gc_period = "24h" -# Directory to host cached files -cache_dir = "" - -[image] -public_key_file = "" -validate_signature = false - -# The configuraions for features that are not production ready -[experimental] -# Whether to enable stargz support -enable_stargz = false -# Whether to enable referrers support -# The option enables trying to fetch the Nydus image associated with the OCI image and run it. -# Also see https://github.com/opencontainers/distribution-spec/blob/main/spec.md#listing-referrers -enable_referrer_detect = false -# Whether to enable authentication support -# The option enables nydus snapshot to provide backend information to nydusd. -enable_backend_source = false -[experimental.tarfs] -# Whether to enable nydus tarfs mode. Tarfs is supported by: -# - The EROFS filesystem driver since Linux 6.4 -# - Nydus Image Service release v2.3 -enable_tarfs = false -# Mount rafs on host by loopdev and EROFS -mount_tarfs_on_host = false -# Only enable nydus tarfs mode for images with `tarfs hint` label when true -tarfs_hint = false -# Maximum of concurrence to converting OCIv1 images to tarfs, 0 means default -max_concurrent_proc = 0 -# Mode to export tarfs images: -# - "none" or "": do not export tarfs -# - "layer_verity_only": only generate disk verity information for a layer blob -# - "image_verity_only": only generate disk verity information for all blobs of an image -# - "layer_block": generate a raw block disk image with tarfs for a layer -# - "image_block": generate a raw block disk image with tarfs for an image -# - "layer_block_with_verity": generate a raw block disk image with tarfs for a layer with dm-verity info -# - "image_block_with_verity": generate a raw block disk image with tarfs for an image with dm-verity info -export_mode = ""