diff --git a/.github/workflows/action-build.yml b/.github/workflows/action-build.yml index 0b80ecd88..431d33f06 100644 --- a/.github/workflows/action-build.yml +++ b/.github/workflows/action-build.yml @@ -37,9 +37,6 @@ jobs: run: ./scripts/setup-cross.sh ${{ inputs.target }} - name: Build run: make build-${{ inputs.runtime }} - - name: Validate docs - if: ${{ inputs.runtime == 'common' }} - run: ./scripts/validate-docs.sh - name: Run tests timeout-minutes: 5 run: | diff --git a/crates/containerd-shim-wasm/Cargo.toml b/crates/containerd-shim-wasm/Cargo.toml index cc891a94e..97ad1c3a2 100644 --- a/crates/containerd-shim-wasm/Cargo.toml +++ b/crates/containerd-shim-wasm/Cargo.toml @@ -55,4 +55,3 @@ tempfile = { workspace = true } [features] testing = ["dep:containerd-shim-wasm-test-modules", "dep:env_logger", "dep:tempfile"] generate_bindings = ["ttrpc-codegen"] -generate_doc = [] diff --git a/crates/containerd-shim-wasm/README.md b/crates/containerd-shim-wasm/README.md index a1454c7db..ef195301d 100644 --- a/crates/containerd-shim-wasm/README.md +++ b/crates/containerd-shim-wasm/README.md @@ -1,4 +1,4 @@ -![runwasi logo](../../art/logo/runwasi_logo_icon.svg) +![runwasi logo](https://raw.githubusercontent.com/containerd/runwasi/e251de3307bbdc8bf3229020ea2ae2711f31aafa/art/logo/runwasi_logo_icon.svg) # containerd-shim-wasm diff --git a/crates/containerd-shim-wasm/build.rs b/crates/containerd-shim-wasm/build.rs index 5c1f10c5f..c8ebb6405 100644 --- a/crates/containerd-shim-wasm/build.rs +++ b/crates/containerd-shim-wasm/build.rs @@ -5,19 +5,8 @@ use std::fs; use ttrpc_codegen::{Codegen, ProtobufCustomize}; #[cfg(not(feature = "generate_bindings"))] -#[cfg(not(feature = "generate_doc"))] fn main() {} -#[cfg(feature = "generate_doc")] -fn main() { - use std::io::Write; - println!("cargo:rerun-if-changed=doc"); - println!("cargo:rerun-if-missing=README.md"); - let mut f = std::fs::File::create("README.md").unwrap(); - f.write_all(include_bytes!("doc/header.md")).unwrap(); - f.write_all(include_bytes!("doc/doc.md")).unwrap(); -} - #[cfg(feature = "generate_bindings")] fn main() { println!("cargo:rerun-if-changed=protos"); diff --git a/crates/containerd-shim-wasm/doc/doc.md b/crates/containerd-shim-wasm/doc/doc.md deleted file mode 100644 index f04faaa1f..000000000 --- a/crates/containerd-shim-wasm/doc/doc.md +++ /dev/null @@ -1,36 +0,0 @@ -A library to help build containerd shims for wasm workloads. - -## Usage - -```rust -use containerd_shim as shim; -use containerd_shim_wasm::sandbox::{ShimCli, Instance, Nop} - -fn main() { - shim::run::>("io.containerd.nop.v1", opts); -} -``` - -The above example uses the built-in `Nop` instance which does nothing. -You can build your own instance by implementing the `Instance` trait. - -```rust -use containerd_shim as shim; -use containerd_shim_wasm::sandbox::{ShimCli, Instance} - -struct MyInstance { - // ... -} - -impl Instance for MyInstance { - // ... -} - -fn main() { - shim::run::>("io.containerd.myshim.v1", opts); -} -``` - -containerd expects the shim binary to be installed into `$PATH` (as seen by the containerd process) with a binary name like `containerd-shim-myshim-v1` which maps to the `io.containerd.myshim.v1` runtime which would need to be configured in containerd. It (containerd) also supports specifying a path to the shim binary but needs to be configured to do so. - -This crate is not tied to any specific wasm engine. \ No newline at end of file diff --git a/crates/containerd-shim-wasm/doc/header.md b/crates/containerd-shim-wasm/doc/header.md deleted file mode 100644 index 478c9687a..000000000 --- a/crates/containerd-shim-wasm/doc/header.md +++ /dev/null @@ -1,4 +0,0 @@ -![runwasi logo](../../art/logo/runwasi_logo_icon.svg) - -# containerd-shim-wasm - diff --git a/crates/containerd-shim-wasm/src/lib.rs b/crates/containerd-shim-wasm/src/lib.rs index a61a914f5..5d7a33158 100644 --- a/crates/containerd-shim-wasm/src/lib.rs +++ b/crates/containerd-shim-wasm/src/lib.rs @@ -1,4 +1,4 @@ -#![doc = include_str!("../doc/doc.md")] +#![doc = include_str!("../README.md")] #![doc( html_logo_url = "https://raw.githubusercontent.com/containerd/runwasi/e251de3307bbdc8bf3229020ea2ae2711f31aafa/art/logo/runwasi_logo_icon.svg" )] diff --git a/scripts/validate-docs.sh b/scripts/validate-docs.sh deleted file mode 100755 index 4c5f710ac..000000000 --- a/scripts/validate-docs.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -set -e - -CARGO_FLAGS="" -if [[ $RUNNER_OS == "Windows" ]]; then - CARGO_FLAGS="--no-default-features" -fi - -# Only containerd-shim-wasm has the generate_doc feature -${CARGO:-cargo} build -p containerd-shim-wasm --verbose --features generate_doc $CARGO_FLAGS -git status --porcelain | grep README.md || exit 0 - -echo "README.md is not up to date. Please run 'cargo build --all --features generate_doc' and commit the changes." >&2 -exit 1