Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use setup-emsdk instead of emscripten dockerfile in samples.yml. #18422

Merged
merged 2 commits into from
Sep 3, 2024

Conversation

ScottTodd
Copy link
Member

Also delete the now unused emscripten.Dockerfile (it's technically still referenced in a commented out cross_compile_and_test build, but that can be added back as needed using this same technique).

Progress on #15332 - one less Dockerfile to maintain.

Tested here: https://github.com/ScottTodd/iree/actions/runs/10691087132/job/29636852886 (this samples.yml workflow runs on a nightly schedule).

skip-ci: no impact on other workflows

@ScottTodd ScottTodd added infrastructure Relating to build systems, CI, or testing cleanup 🧹 platform/web 🌐 Web-specific build, execution, benchmarking, and deployment labels Sep 3, 2024
Copy link
Collaborator

@saienduri saienduri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@@ -61,7 +61,6 @@ jobs:

web:
runs-on: ubuntu-20.04
container: gcr.io/iree-oss/emscripten@sha256:2dd4c52f1bb499ab365aad0111fe5538b685d88af38636b409b0cf6a576ab214
env:
VENV_DIR: ${{ github.workspace }}/.venv
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be cleaner to add env variables here in future btw

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trueee... I could simplify the various places this is done, like

- name: Install build dependencies
run: |
sudo apt update
sudo apt install -y ninja-build
echo "CC=clang" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV

Copy link
Member

@marbre marbre Sep 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines -32 to -46
# Emscripten writes into its cache location (outside of the CMake build
# directory).
# We can either
# (A) Grant broad write permissions to the cache directory to be able to run
# our scripts under different users.
# (B) Mount a user home directory when using the image.
# Since (A) requires less configuration, we'll do that. If multiple tools would
# want a user directory (like Bazel), we should switch to (B).
# See https://github.com/emscripten-core/emsdk/issues/535
RUN mkdir -p "${EM_CACHE}" && chmod -R 777 "${EM_CACHE}"

# Normally we'd run `source emsdk_env.sh`, but that doesn't integrate with
# Docker's environment properties model. Instead, we directly extend the path
# to include the directories suggested by `emsdk activate`.
ENV PATH="${EMSDK}:${EMSDK}/upstream/emscripten:$PATH"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good riddance to these hacks 🥳

@ScottTodd ScottTodd merged commit 1124be8 into iree-org:main Sep 3, 2024
23 checks passed
@ScottTodd ScottTodd deleted the infra-web-docker branch September 3, 2024 22:05
ScottTodd added a commit that referenced this pull request Sep 4, 2024
Follow-up to
#18422 (comment) and
#18421 (comment).

This style is more compact, but it does remove some context that could
be useful - that the CC/CXX environment variables are for the build
toolchain and are related to CMake and Ninja.

The 'runtime' workflow is cross platform and also sets this
conditionally:
https://github.com/iree-org/iree/blob/1124be8025995b64804e9f02b62a0354b25dfb2b/.github/workflows/ci.yml#L112-L124
See
https://github.com/iree-org/iree-template-runtime-cmake/blob/main/.github/workflows/build-and-test.yml
for a more comprehensive example where we also branch on gcc and clang
in the same matrix.
IanWood1 pushed a commit to IanWood1/iree that referenced this pull request Sep 8, 2024
…e-org#18422)

Also delete the now unused `emscripten.Dockerfile` (it's technically
still referenced in a commented out `cross_compile_and_test` build, but
that can be added back as needed using this same technique).

Progress on iree-org#15332 - one less
Dockerfile to maintain.

Tested here:
https://github.com/ScottTodd/iree/actions/runs/10691087132/job/29636852886
(this samples.yml workflow runs on a nightly schedule).

skip-ci: no impact on other workflows
IanWood1 pushed a commit to IanWood1/iree that referenced this pull request Sep 8, 2024
…org#18425)

Follow-up to
iree-org#18422 (comment) and
iree-org#18421 (comment).

This style is more compact, but it does remove some context that could
be useful - that the CC/CXX environment variables are for the build
toolchain and are related to CMake and Ninja.

The 'runtime' workflow is cross platform and also sets this
conditionally:
https://github.com/iree-org/iree/blob/1124be8025995b64804e9f02b62a0354b25dfb2b/.github/workflows/ci.yml#L112-L124
See
https://github.com/iree-org/iree-template-runtime-cmake/blob/main/.github/workflows/build-and-test.yml
for a more comprehensive example where we also branch on gcc and clang
in the same matrix.
josemonsalve2 pushed a commit to josemonsalve2/iree that referenced this pull request Sep 14, 2024
…e-org#18422)

Also delete the now unused `emscripten.Dockerfile` (it's technically
still referenced in a commented out `cross_compile_and_test` build, but
that can be added back as needed using this same technique).

Progress on iree-org#15332 - one less
Dockerfile to maintain.

Tested here:
https://github.com/ScottTodd/iree/actions/runs/10691087132/job/29636852886
(this samples.yml workflow runs on a nightly schedule).

skip-ci: no impact on other workflows
josemonsalve2 pushed a commit to josemonsalve2/iree that referenced this pull request Sep 14, 2024
…org#18425)

Follow-up to
iree-org#18422 (comment) and
iree-org#18421 (comment).

This style is more compact, but it does remove some context that could
be useful - that the CC/CXX environment variables are for the build
toolchain and are related to CMake and Ninja.

The 'runtime' workflow is cross platform and also sets this
conditionally:
https://github.com/iree-org/iree/blob/1124be8025995b64804e9f02b62a0354b25dfb2b/.github/workflows/ci.yml#L112-L124
See
https://github.com/iree-org/iree-template-runtime-cmake/blob/main/.github/workflows/build-and-test.yml
for a more comprehensive example where we also branch on gcc and clang
in the same matrix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup 🧹 infrastructure Relating to build systems, CI, or testing platform/web 🌐 Web-specific build, execution, benchmarking, and deployment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants