### Install Spin CLI Source: https://github.com/spinframework/containerd-shim-spin/blob/main/images/spin-dapr/README.md Installs the Spin CLI tool. This command downloads the installer script and moves the spin binary to /usr/local/bin. ```sh curl -fsSL https://developer.fermyon.com/downloads/install.sh | bash sudo mv ./spin /usr/local/bin/ ``` -------------------------------- ### Provide Application Details Source: https://github.com/spinframework/containerd-shim-spin/blob/main/containerd-shim-spin/quickstart.md Example of providing details when prompted by 'spin new'. ```output $ spin new -t http-rust qs-wasm-spin Description: An example app for the quickstart HTTP path: /hi ``` -------------------------------- ### Build, Install, and Run Containerd Shim Spin Source: https://github.com/spinframework/containerd-shim-spin/blob/main/README.md Execute this command to build, install, and run the shim binary. Ensure dependencies are set up first. ```bash make run ``` -------------------------------- ### Install Docker 24.0.0-beta.2 Source: https://github.com/spinframework/containerd-shim-spin/blob/main/deployments/kind/DockerSetup.md Installs the specified beta version of Docker using the official installation script. Ensure you have uninstalled previous versions first. ```shell curl -fsSL https://get.docker.com -o get-docker.sh sudo CHANNEL=test sh get-docker.sh ``` -------------------------------- ### Build and Install Shim Source: https://github.com/spinframework/containerd-shim-spin/blob/main/conformance-tests/README.md Build the release version of the shim and copy the binary to the system's executable path. ```sh cargo build --release sudo cp target/release/containerd-shim-spin-v2 /usr/bin/ ``` -------------------------------- ### Start Kind Cluster with Spin Shim Source: https://github.com/spinframework/containerd-shim-spin/blob/main/containerd-shim-spin/quickstart.md Starts a Kind cluster pre-configured with the containerd-shim-spin. Ensure containerd is enabled in your Docker settings. ```bash cat < Docker version 24.0.0-beta.2 ``` -------------------------------- ### Install Dapr CLI Source: https://github.com/spinframework/containerd-shim-spin/blob/main/images/spin-dapr/README.md Installs the Dapr command-line interface. Ensure you have curl installed. ```sh curl -fsSL https://raw.githubusercontent.com/dapr/cli/master/install/install.sh | bash ``` -------------------------------- ### Create Kind Cluster with Spin Shim Source: https://github.com/spinframework/containerd-shim-spin/blob/main/deployments/kind/README.md Builds a Kind cluster image with the Spin shim and configures containerd. Applies runtime classes and an example workload, then forwards the service port and tests with curl. ```shell docker build -t kind-shim-test deployments/kind cat < GET /hello HTTP/1.1 > Host: 0.0.0.0:8081 > User-Agent: curl/7.68.0 > Accept: */* > * Mark bundle as not supporting multiuse < HTTP/1.1 200 OK < Content-Length: 22 < Date: Mon, 10 Oct 2022 20:39:43 GMT < Content-Type: text/plain; charset=utf-8 < * Connection #0 to host 0.0.0.0 left intact Hello world from Spin! ``` -------------------------------- ### Configure containerd for Spin Runtime (v2+) Source: https://github.com/spinframework/containerd-shim-spin/blob/main/README.md Add this configuration to your containerd `config.toml` if you are using containerd version 2 or later. It maps the 'spin' runtime type to the shim binary and enables SystemdCgroup. ```toml [plugins."io.containerd.cri.v1.runtime".containerd.runtimes.spin] runtime_type = "io.containerd.spin.v2" [plugins."io.containerd.cri.v1.runtime".containerd.runtimes.spin.options] SystemdCgroup = true ``` -------------------------------- ### Build and Load Docker Image for Spin App Source: https://github.com/spinframework/containerd-shim-spin/blob/main/images/spin-dapr/README.md Builds a Docker image for the Spin application and loads it into the Kind cluster. This makes the application's container image available to the cluster. ```sh # create an image and load it into Kind docker build images/spin-dapr -t spin-dapr:latest --load kind load docker-image spin-dapr:latest --name wasm-cluster ``` -------------------------------- ### Configure containerd for Spin Runtime (older) Source: https://github.com/spinframework/containerd-shim-spin/blob/main/README.md Add this configuration to your containerd `config.toml` for versions prior to containerd 2. It maps the 'spin' runtime type to the shim binary and enables SystemdCgroup. ```toml [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.spin] runtime_type = "io.containerd.spin.v2" [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.spin.options] SystemdCgroup = true ``` -------------------------------- ### Smoke test the release with a Kind cluster Source: https://github.com/spinframework/containerd-shim-spin/blob/main/release.md Optional: Smoke test the new release by creating a Kind cluster with the shim and deploying a test workload. Replace version numbers as needed. ```console cat <