Skip to content

Commit 55da665

Browse files
refactor: wasm32-wasi renamed to wasm32-wasip1 & rust to 1.78
proxy-wasm/proxy-wasm-rust-sdk#277 https://blog.rust-lang.org/2024/04/09/updates-to-rusts-wasi-targets.html Signed-off-by: Anton Engelhardt <[email protected]>
1 parent 96a52db commit 55da665

File tree

9 files changed

+21
-20
lines changed

9 files changed

+21
-20
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
run: rustc --version && cargo --version
4949

5050
- name: Clippy
51-
run: cargo clippy --release --all-targets --target=wasm32-wasi -- -D warnings
51+
run: cargo clippy --release --all-targets --target=wasm32-wasip1 -- -D warnings
5252

5353
fmt:
5454
runs-on: ubuntu-latest
@@ -116,7 +116,7 @@ jobs:
116116
117117
- name: Build wasm-oidc-plugin
118118
run: |
119-
cargo build --target wasm32-wasi --release
119+
cargo build --target wasm32-wasip1 --release
120120
121121
- name: Upload plugin as artifact
122122
uses: actions/upload-artifact@v4

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
3131
- name: Build
3232
run: |
33-
cargo build --target wasm32-wasi --release
33+
cargo build --target wasm32-wasip1 --release
3434
3535
- name: Archive production artifacts
3636
uses: actions/upload-artifact@v4

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: Clippy
4646
run: |
4747
rustc --version && cargo --version
48-
cargo clippy --release --all-targets --target=wasm32-wasi -- -D warnings
48+
cargo clippy --release --all-targets --target=wasm32-wasip1 -- -D warnings
4949
5050
fmt:
5151
runs-on: ubuntu-latest
@@ -176,7 +176,7 @@ jobs:
176176
177177
- name: Build wasm-oidc-plugin
178178
run: |
179-
cargo build --target wasm32-wasi --release
179+
cargo build --target wasm32-wasip1 --release
180180
181181
- name: Upload plugin as artifact
182182
uses: actions/upload-artifact@v4

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
FROM rust:1.75.0 AS builder
1+
FROM rust:1.78.0 AS builder
22

33
COPY src/ src/
44
COPY Cargo.toml Cargo.toml
55
COPY Cargo.lock Cargo.lock
66

7-
RUN rustup target add wasm32-wasi
7+
RUN rustup target add wasm32-wasip1
88

9-
RUN cargo build --target=wasm32-wasi --release
9+
RUN cargo build --target=wasm32-wasip1 --release
1010

1111
##################################################
1212

1313
FROM envoyproxy/envoy:v1.31-latest
1414

15-
COPY --from=builder /target/wasm32-wasi/release/wasm_oidc_plugin.wasm /etc/envoy/proxy-wasm-plugins/wasm_oidc_plugin.wasm
15+
COPY --from=builder /target/wasm32-wasip1/release/wasm_oidc_plugin.wasm /etc/envoy/proxy-wasm-plugins/wasm_oidc_plugin.wasm
1616

1717
CMD [ "envoy", "-c", "/etc/envoy/envoy.yaml" ]

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
build:
2-
cargo build --target wasm32-wasi --release
2+
cargo build --target wasm32-wasip1 --release
33
run:
4-
cargo build --target wasm32-wasi --release
4+
cargo build --target wasm32-wasip1 --release
55
docker-compose up
66
run-background:
7-
cargo build --target wasm32-wasi --release
7+
cargo build --target wasm32-wasip1 --release
88
docker-compose up -d
99
docker-image:
1010
docker buildx build --platform linux/amd64 -f Dockerfile -t antonengelhardt/wasm-oidc-plugin:latest .

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ apt install build-essential
3333
# Install Rustup
3434
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
3535
# Enable WASM compilation target
36-
cargo build --target wasm32-wasi --release
36+
cargo build --target wasm32-wasip1 --release
3737
```
3838

3939
## Run
@@ -51,7 +51,7 @@ make run
5151
1. **Building the plugin:**
5252

5353
```sh
54-
cargo build --target wasm32-wasi --release
54+
cargo build --target wasm32-wasip1 --release
5555
# or
5656
make build
5757
```
@@ -74,9 +74,10 @@ To deploy the plugin to production, the following steps are needed (either manua
7474

7575
1. Build the plugin
7676

77-
1.1 with `cargo build --target wasm32-wasi --release` - this can be done in a [initContainer](./k8s/deployment.yaml) (see [k8s](./k8s) folder) and then copy the binary to the path `/etc/envoy/proxy-wasm-plugins/` in the envoy container.
77+
1.1 with `cargo build --target wasm32-wasip1 --release` - this can be done in a [initContainer](./k8s/deployment.yaml) (see [k8s](./k8s) folder) and then copy the binary to the path `/etc/envoy/proxy-wasm-plugins/` in the envoy container.
78+
79+
1.2 by using the pre-built Docker image [antonengelhardt/wasm-oidc-plugin](https://hub.docker.com/r/antonengelhardt/wasm-oidc-plugin).
7880

79-
1.2 by using the pre-built Docker image [antonengelhardt/wasm-oidc-plugin](https://hub.docker.com/r/antonengelhardt/wasm-oidc-plugin).
8081
2. Run envoy as a container with the `envoy.yaml` file mounted through the [ConfigMap](./k8s/configmap.yml) as a volume.
8182
3. Set up [Service](./k8s/service.yml), [Certificate](./k8s/certificate-production.yml), [Ingress](./k8s/ingress.yml) to expose the Envoy to the internet.
8283

@@ -212,7 +213,7 @@ Google does exactly that:
212213

213214
```json
214215
{
215-
"jwks_uri": "https://www.googleapis.com/oauth2/v3/certs"
216+
"jwks_uri": "https://www.googleapis.com/oauth2/v3/certs"
216217
}
217218
```
218219

docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ services:
99
- "10000:10000"
1010
volumes:
1111
- ./envoy.yaml:/etc/envoy/envoy.yaml
12-
- ./target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins
12+
- ./target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins
1313
networks:
1414
- envoymesh
1515
# Additional options:

k8s/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ jobs:
118118
119119
- name: Build wasm-oidc-plugin
120120
run: |
121-
cargo build --target wasm32-wasi --release
121+
cargo build --target wasm32-wasip1 --release
122122
123123
- name: Upload plugin as artifact
124124
uses: actions/upload-artifact@v4

k8s/deployment-init-container.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ spec:
3636
apk add git
3737
git clone -b main https://${GITHUB_PAT}@github.com/your-org/your-repo.git #! Change URL and branch
3838
cd your-repo #! Change directory
39-
cargo build --target wasm32-wasi --release
39+
cargo build --target wasm32-wasip1 --release
4040
cp target/wasm32-wasi/release/name_of_your_wasm_plugin.wasm /plugins/name_of_your_wasm_plugin.wasm #! Rename, if necessary
4141
4242
env:

0 commit comments

Comments
 (0)