Skip to content

Commit

Permalink
Update wasm image (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
Meakk authored Aug 23, 2024
1 parent ed2f962 commit 88478ef
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 13 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/build_docker_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
steps:

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
push: ${{ github.ref == 'refs/heads/main' }}
tags: ghcr.io/f3d-app/f3d-ci:latest
Expand All @@ -33,32 +33,36 @@ jobs:
steps:

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
push: ${{ github.ref == 'refs/heads/main' }}
tags: ghcr.io/f3d-app/f3d-wasm:latest
file: webassembly/Dockerfile
build-args: |
CMAKE_BUILD_PARALLEL_LEVEL=4
ASSIMP_VERSION=v5.4.2
VTK_VERSION=1fb0e032df606c64c37448edccf24825e45fb8a4
build_f3d-superbuild-ci:
runs-on: ubuntu-latest
steps:

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push superbuild
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
push: ${{ github.ref == 'refs/heads/main' }}
tags: ghcr.io/f3d-app/f3d-superbuild-ci:latest
Expand All @@ -69,15 +73,15 @@ jobs:
steps:

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}


- name: Build and push wheels
uses: docker/build-push-action@v3
uses: docker/build-push-action@v6
with:
push: ${{ github.ref == 'refs/heads/main' }}
tags: ghcr.io/f3d-app/f3d-wheels-manylinux-ci:latest
Expand Down
57 changes: 52 additions & 5 deletions webassembly/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,50 @@
FROM dockcross/web-wasm:20240529-0dade71
FROM dockcross/web-wasm:20240529-0dade71 AS base

# Install VTK
ENV vtk_sha 603cf290299950e64cd3f3463ad3dc3a67b74137
######################################
# Assimp
######################################
FROM base AS assimp

RUN git clone https://gitlab.kitware.com/vtk/vtk.git /vtk-src
ARG CMAKE_BUILD_PARALLEL_LEVEL=8
ARG ASSIMP_VERSION
RUN [ -n "$ASSIMP_VERSION" ]

RUN cd /vtk-src && git checkout $vtk_sha
ADD https://github.com/assimp/assimp/archive/refs/tags/$ASSIMP_VERSION.tar.gz /assimp-src.tar.gz

RUN mkdir -p /assimp-src && tar -xzf /assimp-src.tar.gz -C /assimp-src --strip-components 1 && rm -rf /assimp-src.tar.gz

RUN cmake -S /assimp-src -B /assimp-build \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX:PATH=/depends \
-DASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT=OFF \
-DASSIMP_BUILD_ASSIMP_TOOLS=OFF \
-DASSIMP_BUILD_3MF_IMPORTER=ON \
-DASSIMP_BUILD_COLLADA_IMPORTER=ON \
-DASSIMP_BUILD_DXF_IMPORTER=ON \
-DASSIMP_BUILD_FBX_IMPORTER=ON \
-DASSIMP_BUILD_OFF_IMPORTER=ON \
-DASSIMP_BUILD_X_IMPORTER=ON \
-DASSIMP_BUILD_SAMPLES=OFF \
-DASSIMP_BUILD_TESTS=OFF \
-DASSIMP_BUILD_ZLIB=ON \
-DASSIMP_NO_EXPORT=ON \
-DASSIMP_WARNINGS_AS_ERRORS=OFF

RUN cmake --build /assimp-build --target install && rm -rf /assimp-src /assimp-build

######################################
# VTK
######################################
FROM base AS vtk

ARG CMAKE_BUILD_PARALLEL_LEVEL=8
ARG VTK_VERSION
RUN [ -n "$VTK_VERSION" ]

ADD https://gitlab.kitware.com/vtk/vtk/-/archive/$VTK_VERSION/vtk-$VTK_VERSION.tar.gz /vtk-src.tar.gz

RUN mkdir -p /vtk-src && tar -xzf /vtk-src.tar.gz -C /vtk-src --strip-components 1 && rm -rf /vtk-src.tar.gz

RUN cmake -S /vtk-src -B /vtk-build \
-DBUILD_SHARED_LIBS=OFF \
Expand Down Expand Up @@ -48,3 +87,11 @@ RUN cmake -S /vtk-src -B /vtk-build \
-DVTK_VERSIONED_INSTALL=OFF

RUN cmake --build /vtk-build --target install && rm -rf /vtk-src /vtk-build

######################################
# Copy artifacts from previous builds
######################################
FROM base

COPY --from=assimp /depends /depends
COPY --from=vtk /depends /depends

0 comments on commit 88478ef

Please sign in to comment.