Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating Windows getting started doc and Makefile misc #665

Merged
merged 1 commit into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ RUSTC ?= rustc

# We have a bit of fancy logic here to determine the target
# since we support building for gnu and musl
# TARGET must evenutually match one of the values in the cross.toml
# TARGET must eventually match one of the values in the cross.toml
HOST_TARGET = $(shell $(RUSTC) --version -v | sed -En 's/host: (.*)/\1/p')

# if TARGET is not set and we are using cross
# default to musl to facilitate easier use shim on other distros becuase of the static build
# default to musl to facilitate easier use shim on other distros because of the static build
# otherwise use the host target
ifeq ($(TARGET),)
ifeq ($(CARGO),cross)
Expand Down Expand Up @@ -118,7 +118,7 @@ test-wasm:
RUST_LOG=trace $(CARGO) test $(TARGET_FLAG) --package containerd-shim-wasm $(FEATURES_wasm) --verbose $(TEST_ARGS_SEP) --nocapture --test-threads=1

test-wasmedge:
# run tests in one thread to prevent paralellism
# run tests in one thread to prevent parallelism
RUST_LOG=trace $(CARGO) test $(TARGET_FLAG) --package containerd-shim-wasmedge $(FEATURES_wasmedge) --lib --verbose $(TEST_ARGS_SEP) --nocapture --test-threads=1
ifneq ($(OS), Windows_NT)
ifneq ($(patsubst %-musl,,xx_$(TARGET)),)
Expand All @@ -128,7 +128,7 @@ endif
endif

test-%:
# run tests in one thread to prevent paralellism
# run tests in one thread to prevent parallelism
RUST_LOG=trace $(CARGO) test $(TARGET_FLAG) --package containerd-shim-$* $(FEATURES_$*) --lib --verbose $(TEST_ARGS_SEP) --nocapture --test-threads=1

test-oci-tar-builder:
Expand All @@ -139,7 +139,7 @@ install: $(RUNTIMES:%=install-%);

install-%:
mkdir -p $(PREFIX)/bin
$(INSTALL) $(TARGET_DIR)/$(TARGET)/$(OPT_PROFILE)/containerd-shim-$*-v1 $(PREFIX)/bin/
$(INSTALL) $(TARGET_DIR)$(TARGET)/$(OPT_PROFILE)/containerd-shim-$*-v1 $(PREFIX)/bin/
$(LN) ./containerd-shim-$*-v1 $(PREFIX)/bin/containerd-shim-$*d-v1
$(LN) ./containerd-shim-$*-v1 $(PREFIX)/bin/containerd-$*d

Expand Down Expand Up @@ -203,7 +203,6 @@ load/oci: dist/img-oci.tar
@echo using containerd $(CTR_VERSION)
sudo ctr -n $(CONTAINERD_NAMESPACE) image import --all-platforms $<

.PHONY:
target/wasm32-wasi/$(OPT_PROFILE)/img-oci.tar: target/wasm32-wasi/$(OPT_PROFILE)/wasi-demo-app.wasm
mkdir -p ${CURDIR}/bin/$(OPT_PROFILE)/
cargo run --bin oci-tar-builder -- --name wasi-demo-oci --repo ghcr.io/containerd/runwasi --tag latest --module ./target/wasm32-wasi/$(OPT_PROFILE)/wasi-demo-app.wasm -o target/wasm32-wasi/$(OPT_PROFILE)/img-oci.tar
Expand Down
8 changes: 4 additions & 4 deletions docs/windows-getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ To finish off installing pre-requisites, install Rust following [this](https://w
After following these steps and navigating to the runwasi directory in your terminal:
- run `make build`,
- run `make install`,
- run `make test/out/img.tar`,
- open a secondary terminal and run `containerd`, and
- run `make test-image`, and
- run `make load`.

After this, you can execute an example, like: `ctr run --rm --runtime=io.containerd.wasmtime.v1 docker.io/library/wasmtest:latest testwasm`.
After this, you can execute an example, like: `ctr run --rm --runtime=io.containerd.wasmtime.v1 ghcr.io/containerd/runwasi/wasi-demo-app:latest testwasm`.

> To kill the process from the example, you can run: `ctr task kill -s SIGKILL testwasm`.

Expand Down Expand Up @@ -50,4 +49,5 @@ If you are using VS Code for development you can use the following `settings.jso
"WASMEDGE_LIB_DIR": "C:\\Program Files\\WasmEdge\\lib",
"WASMEDGE_INCLUDE_DIR": "C:\\Program Files\\WasmEdge\\include"
}
}
}
```
Loading