Skip to content

Commit 768a936

Browse files
authored
Remove deislabs references from dockerfile and scripts (#51)
Allowed dep_build_wasm_examples to be run on demand so we can force update of sample builder image, also only set push to true if the PR does not come from a fork (since we cannot push the package from a fork), finally add a schedule so that the image gets updated if there are changes. Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>
1 parent 518b702 commit 768a936

File tree

4 files changed

+18
-15
lines changed

4 files changed

+18
-15
lines changed

.github/workflows/dep_build_wasm_examples.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,25 @@
44
name: Build Wasm Examples
55

66
on:
7+
workflow_dispatch: {}
78
workflow_call:
89
inputs:
9-
docs_only:
10-
description: Skip building if docs only
11-
required: false
12-
type: string
13-
default: "false"
10+
docs_only:
11+
description: Skip building if docs only
12+
required: false
13+
type: string
14+
default: "false"
15+
schedule:
16+
# Run at 1am UTC daily
17+
- cron: '0 1 * * *'
1418

1519
permissions:
1620
packages: write
1721
contents: read
1822

1923
jobs:
2024
build-wasm-examples:
21-
if: ${{ inputs.docs_only == 'false' }}
25+
if: ${{ inputs.docs_only == 'false' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
2226
runs-on: ubuntu-latest
2327
steps:
2428
- uses: actions/checkout@v4
@@ -48,14 +52,13 @@ jobs:
4852
with:
4953
images: ${{ github.repository_owner }}/wasm-clang-builder
5054
- name: Build and push wasm-clang-builder
51-
# depedabot does not have push access to update the wasm-clang-builder image
52-
if: github.actor != 'dependabot[bot]'
55+
# Only push if not from a fork, not from pull request, and not from dependabot
5356
uses: docker/build-push-action@v6
5457
with:
5558
context: src/wasmsamples
5659
file: src/wasmsamples/dockerfile
5760
load: true
58-
push: true
61+
push: ${{ (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false) && github.actor != 'dependabot[bot]' }}
5962
build-args: |
6063
WASI_SDK_VERSION_FULL=20.0
6164
GCC_VERSION=12

src/hyperlight_wasm/scripts/build-wasm-examples.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ else
2929
echo This will take a while if it is the first time you are building the docker image.
3030
echo Log in ${OUTPUT_DIR}/dockerbuild.log
3131

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

34-
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
34+
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
3535

3636
for FILENAME in $(find . -name '*.c')
3737
do

src/wasmsamples/compile-wasm.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ where docker || (
1414
set "dockeroutput=$(wslpath '%~2')"
1515
)
1616

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

1919
echo Building docker image that has Wasm sdk. Should be quick if no changes to docker image.
2020
echo Log in %2\dockerbuild.log
21-
%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
21+
%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
2222

2323
echo Building Wasm files in %1 and output to %2
2424
for /R "%1" %%i in (*.c) do (

src/wasmsamples/dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM ubuntu
22
ENV DEBIAN_FRONTEND=noninteractive
3-
LABEL org.opencontainers.image.source=https://github.com/deislabs/hyperlight-wasm
3+
LABEL org.opencontainers.image.source=https://github.com/hyperlight-dev/hyperlight-wasm
44

55
ARG GCC_VERSION=12
66

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

0 commit comments

Comments
 (0)