Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork19
Create a dedicated WASI container#56
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
8 commits Select commitHold shift + click to select a range
a8abb21 Create a dedicated WASI container
brettcannon45ec757 Fix the naming of the WASI test CI job
brettcannon65c06fa Update base image label in Dockerfile
brettcannon0ab6b5d Merge branch 'main' into wasicontainer
brettcannon448ce9e Merge branch 'wasicontainer' of github.com:brettcannon/cpython-devcon…
brettcannonaa61a07 Fix CI references to "devcontainer" for the WASI container
brettcannon7133a80 Fix symlinking wasmtime
brettcannonb006a02 Fix naming for the checkout action
brettcannonFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -11,6 +11,7 @@ on: | ||
| options: | ||
| - autoconf | ||
| - devcontainer | ||
| - wasicontainer | ||
| run-name: "Release: ${{ inputs.package }}" | ||
20 changes: 20 additions & 0 deletionswasicontainer/Dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| FROM ghcr.io/python/devcontainer:latest | ||
| LABEL org.opencontainers.image.base.name="ghcr.io/python/wasicontainer:latest" | ||
| LABEL org.opencontainers.image.source="https://github.com/python/cpython-devcontainers" | ||
| LABEL org.opencontainers.image.title="CPython WASI development container" | ||
| LABEL org.opencontainers.image.description="CPython development container with the tooling to work on WASI builds." | ||
| LABEL org.opencontainers.image.authors="Brett Cannon" | ||
| ARG TARGETARCH | ||
| # WASI SDK versions are controlled in install-wasi.sh. | ||
| ENV WASI_SDK_ROOT=/opt | ||
| ENV WASMTIME_VERSION=36.0.2 | ||
| ENV WASMTIME_HOME=/opt/wasmtime | ||
| RUN mkdir -p /opt/cpython-devcontainer/bin | ||
| COPY --chmod=755 install-wasi.sh /opt/cpython-devcontainer/bin/ | ||
| RUN /opt/cpython-devcontainer/bin/install-wasi.sh |
3 changes: 3 additions & 0 deletionswasicontainer/README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| A container for developing CPython for WASI. | ||
| It is based on the dev container, and thus includes the same common utilities. |
45 changes: 45 additions & 0 deletionswasicontainer/install-wasi.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| #! /bin/bash -ex | ||
| mkdir --parents ${WASI_SDK_ROOT} | ||
| # For 3.11, 3.12. | ||
| # There is no Arm support for WASI SDK < 23. | ||
| if [ "${TARGETARCH}" = "amd64" ]; then | ||
| URL=https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-16/wasi-sdk-16.0-linux.tar.gz | ||
| curl --location $URL | tar --directory ${WASI_SDK_ROOT} --extract --gunzip | ||
| fi | ||
| case "${TARGETARCH}" in | ||
| amd64) WASI_ARCH="x86_64" ;; | ||
| arm64) WASI_ARCH="arm64" ;; | ||
| *) echo "Unsupported TARGETARCH: ${TARGETARCH}" && exit 1 ;; | ||
| esac && \ | ||
| # 24: 3.13, 3.14 | ||
| # The URL format only works for WASI SDK >= 23. | ||
| WASI_SDK_VERSIONS=(24) | ||
| for VERSION in "${WASI_SDK_VERSIONS[@]}"; do | ||
| URL=https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${VERSION}/wasi-sdk-${VERSION}.0-${WASI_ARCH}-linux.tar.gz | ||
| curl --location $URL | tar --directory ${WASI_SDK_ROOT} --extract --gunzip | ||
| done | ||
| # For Python 3.13 as Tools/wasm/wasi.py expects /opt/wasi-sdk by default. | ||
| ln -s ${WASI_SDK_ROOT}/wasi-sdk-24.0*/ /opt/wasi-sdk | ||
| mkdir --parents ${WASMTIME_HOME} | ||
| case "${TARGETARCH}" in | ||
| amd64) WASMTIME_ARCH="x86_64" ;; | ||
| arm64) WASMTIME_ARCH="aarch64" ;; | ||
| *) echo "Unsupported TARGETARCH: ${TARGETARCH}" && exit 1 ;; | ||
| esac | ||
| URL="https://github.com/bytecodealliance/wasmtime/releases/download/v${WASMTIME_VERSION}/wasmtime-v${WASMTIME_VERSION}-${WASMTIME_ARCH}-linux.tar.xz" | ||
| curl --location $URL | | ||
| xz --decompress | | ||
| tar --strip-components 1 --directory ${WASMTIME_HOME} -x | ||
| # Put `wasmtime` on $PATH. | ||
| ln -s ${WASMTIME_HOME}/wasmtime* /usr/local/bin |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.