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

ci: adjust Pyodide deps and retrieve prebuilt artifacts #744

Merged
merged 8 commits into from
Oct 22, 2023

Conversation

peter-gy
Copy link
Collaborator

@peter-gy peter-gy commented Oct 22, 2023

⚠️ The renderer cannot be used via JupyterLite at the moment, meaning that no actual visuals can be displayed when getting started with Draco through the browser. This PR adds a fix.

Screenshot 2023-10-22 at 15 27 24

Dependency Adjustments

This is caused by a regression introduced in #673 after we migrated to Pydantic 2: we migrated the pure-python project dependency, but not the Pyodide dependency.

We should add some tests around our WASM distribution soon.

To support Pydantic 2 in Pyodide I had to add Rust as a dependency to the Pyodide build environment, as https://github.com/pydantic/pydantic-core is written in Rust.

Using prebuilt artifacts in CI

Our latest Pyodide distribution is always hosted under https://dig.cmu.edu/draco2/jupyterlite/static/pyodide. Instead of rebuilding each artifact each time, we can do a diffing based on

  • the version of the latest, already-built artifact and
  • the version of the package specified in the local meta.yaml Pyodide recipe files

This simple idea is implemented in pyodide/cache_dl.py.

Post-PR Results

Screenshot 2023-10-22 at 16 27 37

needed as we use version 2+ and the official pyodide recipe maintains v `1.10.7`
Required as we need to compile Rust to WASM
required by `pydantic`
This should reduce CI time drastically
It is only used in the `web` group
Previously we marked packages as built when they
appeared as dependencies, even though the package
was meant to get built from source.
@peter-gy peter-gy enabled auto-merge (squash) October 22, 2023 05:42
@peter-gy peter-gy merged commit ca89c1a into main Oct 22, 2023
@peter-gy peter-gy deleted the fix/pyodide-distro-deps branch October 22, 2023 05:46
def load_recipe(package_name: str) -> Recipe | None:
path = get_recipe_path(package_name)
try:
return yaml.safe_load(open(path))

Check warning

Code scanning / CodeQL

File is not always closed

File is opened but is not closed.
peter-gy added a commit that referenced this pull request Oct 22, 2023
peter-gy added a commit that referenced this pull request Oct 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants