-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 7492b18
Showing
22 changed files
with
2,045 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
workflow_dispatch: { } | ||
|
||
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | ||
permissions: | ||
contents: "write" | ||
pages: "write" | ||
id-token: "write" | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "pages" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
build-and-deploy: | ||
|
||
runs-on: "ubuntu-latest" | ||
|
||
environment: | ||
name: "github-pages" | ||
url: "${{ steps.deployment.outputs.page_url }}" | ||
|
||
steps: | ||
# Prepare | ||
- uses: "actions/checkout@v4" | ||
with: | ||
lfs: "true" | ||
|
||
# Build | ||
- run: "./build.sh" | ||
|
||
# Deploy | ||
- uses: "actions/configure-pages@v5" | ||
- uses: "actions/upload-pages-artifact@v3" | ||
with: | ||
path: 'export' | ||
- id: "deployment" | ||
uses: "actions/deploy-pages@v4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/web/out.wasm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# OCP C2W | ||
|
||
This project can build [Build123d](https://github.com/gumyr/build123d)-based CAD | ||
models (which relies on [OCP](https://github.com/CadQuery/OCP)) **completely inside the web browser**, thanks to [container2wasm](https://github.com/ktock/container2wasm). | ||
|
||
- You can [run the demo script on github pages](https://yeicor-3d.github.io/ocp-c2w/). It works, but it is **extremely slow**... | ||
- You can also get an **interactive console** and basic networking by [clicking this link](https://yeicor-3d.github.io/ocp-c2w/?args=bash&net=browser). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -ex | ||
|
||
docker build --tag c2w-build123d --network host docker | ||
|
||
./c2w --debug-image --dockerfile docker/Dockerfile.c2w c2w-build123d web/out.wasm | ||
|
||
echo "web/out.wasm is ready. Run server.py to serve web/ files on http://localhost:8000" |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM python:3-slim as base | ||
|
||
RUN apt-get update && apt-get install -y libgl1 && rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /app | ||
|
||
COPY tea_cup.py requirements.txt . | ||
|
||
RUN pip install --no-cache-dir -r requirements.txt | ||
|
||
RUN /bin/bash -c "find /usr/local/lib/python* -name '*.so*' -size +10M -print0 | tar -czvf libs.tar.gz --remove-files --null -T /dev/stdin | tee /dev/stderr" | ||
|
||
FROM python:3-slim | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=base / / | ||
|
||
ENTRYPOINT ["/bin/bash", "-exc", "tar -C / -xzvf libs.tar.gz && rm libs.tar.gz && python -m trace --ignore-dir=$(python -c 'import sys; sep=\":\"; print(sep.join(sys.path)[1:])') -t ./tea_cup.py" ] |
Oops, something went wrong.