Skip to content

Commit

Permalink
✨ Complete e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
Shark committed Aug 18, 2022
1 parent 9c22b4f commit a4d0ac6
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 13 deletions.
10 changes: 9 additions & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM rust:1.63

RUN apt-get update \
&& apt-get install -y --no-install-recommends zsh sudo openjdk-11-jre pre-commit \
&& apt-get install -y --no-install-recommends zsh sudo openjdk-11-jre pre-commit lld less \
&& adduser --disabled-password --u 1000 --gid 65534 --gecos '' rust \
&& echo "rust ALL = (ALL) NOPASSWD: ALL" >> /etc/sudoers.d/rust

Expand All @@ -14,6 +14,14 @@ RUN touch ~/.zshrc \
&& rustup component add rustfmt \
&& rustup component add clippy \
&& cargo install cargo-expand \
&& mkdir ~/.cargo \
&& git clone https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh \
&& cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc \
&& echo 'ZSH_THEME="simple"' >> ~/.zshrc

COPY <<EOF /home/rust/.cargo/config.toml
[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "link-arg=-fuse-ld=lld"]
EOF

ENV EDITOR="code --wait"
19 changes: 11 additions & 8 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ plugin
Dockerfile
target
benchmark
wasm-modules/contrib/http-request/target
wasm-modules/contrib/image-processor/target
wasm-modules/examples/ferris-says/target
wasm-modules/examples/text2qr/target
wasm-modules/templates/assemblyscript/node_modules
wasm-modules/templates/assemblyscript/*.wasm
wasm-modules/templates/rust/target
wasm-modules/templates/tinygo/*.wasm
.devcontainer
.vscode
argo-plugin
benchmark
doc
wasm-modules
README.md
LICENSE.txt
.pre-commit-config.yaml
.gitignore
.dockerignore
2 changes: 1 addition & 1 deletion .github/workflows/build-container-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
tags: sh4rk/wasm-workflows-plugin:${{ steps.tag.outputs.tag }}
outputs: type=docker,dest=/tmp/container-image.tar
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max,compression=estargz

- name: Compress the image
run: bzip2 /tmp/container-image.tar
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ jobs:
runs-on: ubuntu-latest
needs: [build]
steps:
- uses: actions/checkout@v2

- name: Install k8s tooling
run: .devcontainer/install-k8s.sh

Expand All @@ -24,7 +26,7 @@ jobs:

- name: Load image into kind k8s node
run: |
bunzip /tmp/container-image.tar.bz2
bunzip2 /tmp/container-image.tar.bz2
kind load image-archive /tmp/container-image.tar
rm /tmp/container-image.tar
Expand All @@ -37,11 +39,11 @@ jobs:
argo executor-plugin build .
- name: Install Executor Plugin
run: kubectl apply -f argo-plugin/wasm-executor-plugin-configmap.yaml
run: kubectl -n argowf apply -f argo-plugin/wasm-executor-plugin-configmap.yaml

- name: Create Wasm Workflow
run: |
workflow_name="$(kubectl -n argowf create -f https://raw.githubusercontent.com/Shark/wasm-workflows-plugin/67ae607ec65e1ac93bc1749c5f7a9bde4b673cfd/wasm-modules/examples/ferris-says/workflow.yaml)"
workflow_name="$(kubectl -n argowf create -o name -f https://raw.githubusercontent.com/Shark/wasm-workflows-plugin/67ae607ec65e1ac93bc1749c5f7a9bde4b673cfd/wasm-modules/examples/ferris-says/workflow.yaml)"
echo "WORKFLOW_NAME=$workflow_name" >> $GITHUB_ENV
- name: Wait for the workflow to finish
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@ indoc = "1.0.6"
# https://github.com/johnthagen/min-sized-rust
[profile.release]
lto = true

[profile.dev]
debug = 0 # disables debug info - can be activated when required
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ COPY . .
RUN cargo chef prepare --recipe-path recipe.json

FROM chef AS builder
RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends lld
ENV RUSTFLAGS="-C link-args=-fuse-ld=lld" CARGO_INCREMENTAL=0
COPY --from=planner /app/recipe.json recipe.json
# Build dependencies - this is the caching Docker layer!
RUN cargo chef cook --release --recipe-path recipe.json
Expand Down

0 comments on commit a4d0ac6

Please sign in to comment.