Skip to content
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
21 changes: 12 additions & 9 deletions .github/workflows/dep_build_wasm_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,25 @@
name: Build Wasm Examples

on:
workflow_dispatch: {}
workflow_call:
inputs:
docs_only:
description: Skip building if docs only
required: false
type: string
default: "false"
docs_only:
description: Skip building if docs only
required: false
type: string
default: "false"
schedule:
# Run at 1am UTC daily
- cron: '0 1 * * *'

permissions:
packages: write
contents: read

jobs:
build-wasm-examples:
if: ${{ inputs.docs_only == 'false' }}
if: ${{ inputs.docs_only == 'false' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -48,14 +52,13 @@ jobs:
with:
images: ${{ github.repository_owner }}/wasm-clang-builder
- name: Build and push wasm-clang-builder
# depedabot does not have push access to update the wasm-clang-builder image
if: github.actor != 'dependabot[bot]'
# Only push if not from a fork, not from pull request, and not from dependabot
uses: docker/build-push-action@v6
with:
context: src/wasmsamples
file: src/wasmsamples/dockerfile
load: true
push: true
push: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) && github.actor != 'dependabot[bot]' }}
build-args: |
WASI_SDK_VERSION_FULL=20.0
GCC_VERSION=12
Expand Down
4 changes: 2 additions & 2 deletions src/hyperlight_wasm/scripts/build-wasm-examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ else
echo This will take a while if it is the first time you are building the docker image.
echo Log in ${OUTPUT_DIR}/dockerbuild.log

docker pull ghcr.io/deislabs/wasm-clang-builder:latest
docker pull ghcr.io/hyperlight-dev/wasm-clang-builder:latest

docker build --build-arg GCC_VERSION=12 --build-arg WASI_SDK_VERSION_FULL=20.0 --cache-from ghcr.io/deislabs/wasm-clang-builder:latest -t wasm-clang-builder:latest . 2> ${OUTPUT_DIR}/dockerbuild.log
docker build --build-arg GCC_VERSION=12 --build-arg WASI_SDK_VERSION_FULL=20.0 --cache-from ghcr.io/hyperlight-dev/wasm-clang-builder:latest -t wasm-clang-builder:latest . 2> ${OUTPUT_DIR}/dockerbuild.log

for FILENAME in $(find . -name '*.c')
do
Expand Down
4 changes: 2 additions & 2 deletions src/wasmsamples/compile-wasm.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ where docker || (
set "dockeroutput=$(wslpath '%~2')"
)

%dockercmd% pull ghcr.io/deislabs/wasm-clang-builder:latest
%dockercmd% pull ghcr.io/hyperlight-dev/wasm-clang-builder:latest

echo Building docker image that has Wasm sdk. Should be quick if no changes to docker image.
echo Log in %2\dockerbuild.log
%dockercmd% build --build-arg GCC_VERSION=12 --build-arg WASI_SDK_VERSION_FULL=20.0 --cache-from ghcr.io/deislabs/wasm-clang-builder:latest -t wasm-clang-builder:latest !dockerinput! 2> %2dockerbuild.log
%dockercmd% build --build-arg GCC_VERSION=12 --build-arg WASI_SDK_VERSION_FULL=20.0 --cache-from ghcr.io/hyperlight-dev/wasm-clang-builder:latest -t wasm-clang-builder:latest !dockerinput! 2> %2dockerbuild.log

echo Building Wasm files in %1 and output to %2
for /R "%1" %%i in (*.c) do (
Expand Down
4 changes: 2 additions & 2 deletions src/wasmsamples/dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM ubuntu
ENV DEBIAN_FRONTEND=noninteractive
LABEL org.opencontainers.image.source=https://github.com/deislabs/hyperlight-wasm
LABEL org.opencontainers.image.source=https://github.com/hyperlight-dev/hyperlight-wasm

ARG GCC_VERSION=12

Expand All @@ -19,4 +19,4 @@ RUN wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WA
&& tar xvf wasi-sdk-${WASI_SDK_VERSION_FULL}-linux.tar.gz \
&& rm wasi-sdk-${WASI_SDK_VERSION_FULL}-linux.tar.gz \
&& mv /wasi-sdk-${WASI_SDK_VERSION_FULL} /opt/wasi-sdk
CMD ["/bin/sh"]
CMD ["/bin/sh"]
Loading