Fix Colab notebook setup warnings#14
Conversation
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
bernalde
left a comment
There was a problem hiding this comment.
Reviewed the diff, surrounding bootstrap/test code, and documented test commands. I found no blocking issues.
| " except (metadata.PackageNotFoundError, ValueError):\n", | ||
| " return None\n", | ||
| "\n", | ||
| "QCI_RUNTIME_READY = Path(\"/content/.quip_qci_runtime_ready\") if IN_COLAB else None\n", |
There was a problem hiding this comment.
Nonblocking: QCI_RUNTIME_READY is created and later touched, but nothing reads it when deciding whether to install or restart. That makes the marker look like an unfinished restart guard and adds a little maintenance ambiguity. Consider removing the marker, or wiring it into the condition if it is intended to suppress repeated restarts after a successful install.
There was a problem hiding this comment.
Addressed in bfbe336. I removed the unused QCI_RUNTIME_READY marker and the now-unused Path import, then updated the smoke/source test coverage to assert the marker stays absent.
There was a problem hiding this comment.
Already addressed in bfbe336. No further change was needed in this pass; the marker remains removed and this thread is now outdated.
|
Pushed commit: bfbe336 Remove unused QCI Colab marker Main changes made:
Tests run and results:
Comments intentionally not addressed:
Remaining risks or follow-up items:
|
bernalde
left a comment
There was a problem hiding this comment.
Blocking issue: the new Julia Colab resolve behavior is not covered by an executable test. The current CI and local tests pass, but the regression coverage only checks for source snippets rather than exercising instantiate_project! under a manifest/runtime mismatch. I would not merge this until the blocking issue is addressed.
Tests run:
UV_CACHE_DIR=.uv-cache uv run --group docs python -m unittest discover -s tests- passed, 64 tests.make verify-julia-colab-mismatch-smoke- passed under Julia 1.12.6.python ./scripts/verify_colab_runtime_smokes.py --skip-julia- passed; printeddwave.samplers Colab smoke okandQCI Colab setup policy ok.git diff --check origin/main...HEAD- passed.
CI status from gh pr checks 14: build passed, julia-notebook-smokes passed, deploy skipped for pull_request.
| self.assertIn("Colab will allow Pkg to re-resolve the notebook environment", source) | ||
| self.assertIn("should_resolve_project_for_current_julia", source) | ||
| self.assertIn("Resolving Julia packages for current runtime Julia", source) | ||
| self.assertIn("Pkg.resolve()", source) |
There was a problem hiding this comment.
Blocking: This test only asserts that the bootstrap source contains Pkg.resolve(). It would still pass if instantiate_project! stopped calling it, called it before project activation, or gated it on the wrong runtime condition. Since the Julia fix depends on actually re-resolving stale manifests in Colab, please add an executable smoke test, for example in verify_colab_runtime_smokes.py, that creates a temporary project with an old julia_version, runs instantiate_project! with Colab detection enabled, and verifies the manifest is resolved for the current Julia version or that the resolve step ran.
There was a problem hiding this comment.
Addressed in 924c5eb. Added an executable Julia Colab resolve smoke in scripts/verify_colab_runtime_smokes.py; make verify-julia-colab-mismatch-smoke now creates a stale temp project, runs instantiate_project!, and checks the manifest version matches VERSION.
|
Commits pushed:
Main changes made:
Tests run and results:
Comments intentionally not addressed:
Remaining risks or follow-up items:
|
bernalde
left a comment
There was a problem hiding this comment.
No blocking issues found in this pass. I would approve this PR, but GitHub does not allow me to approve a PR authored by this account, so I am submitting this as a comment review.
Review summary:
- Blocking issues: none.
- Nonblocking issues: none.
- Questions: none.
- Tests run:
python -m unittest tests.test_verify_notebooks tests.test_notebook3_pair_sync- passed, 43 tests.python -m py_compile scripts/verify_colab_runtime_smokes.py- passed.jq empty notebooks_py/6-QCi_python.ipynb notebooks_jl/1-MathProg.ipynb notebooks_jl/2-QUBO.ipynb notebooks_jl/3-GAMA.ipynb notebooks_jl/4-DWave.ipynb notebooks_jl/5-Benchmarking.ipynb- passed.make verify-julia-colab-mismatch-smoke- passed under Julia 1.12.6, including the resolve smoke.UV_CACHE_DIR=.uv-cache uv run --group docs python -m unittest discover -s tests- passed, 64 tests.make verify-colab-python-runtime-smoke- initial sandbox run failed on DNS while downloading PyPI packages; rerun with network access passed and printeddwave.samplers Colab smoke okandQCI Colab setup policy ok.git diff --check origin/main...HEAD- passed.UV_CACHE_DIR=.uv-cache uv run --group docs jupyter book build --html --ci- not runnable locally because MyST reportsnpmasPackage Not Foundand requires npm >=8.6.0; the PRbuildCI job ran this successfully.gh pr checks 14-buildpassed,julia-notebook-smokespassed,deployskipped for pull_request.
- Merge recommendation: merge as-is.
|
Notebook rerun update:
No additional commit was needed. |
Summary
Base.invokelatestto avoid Julia 1.12 world-age warnings after including the bootstrap module.eqc-models-compatible NumPy/NetworkX stack before imports, then restart the Colab runtime once so NumPy is reloaded cleanly.Tests run
python -m unittest tests.test_verify_notebooks tests.test_notebook3_pair_sync- passed, 43 tests.python -m unittest discover -s tests- passed, 64 tests.UV_CACHE_DIR=.uv-cache uv run --group docs python -m unittest discover -s tests- passed, 64 tests.python ./scripts/verify_colab_runtime_smokes.py --skip-julia- passed; printeddwave.samplers Colab smoke okandQCI Colab setup policy ok.julia --project=./scripts -e 'include("./scripts/notebook_bootstrap.jl"); using .QuIPNotebookBootstrap; println(QuIPNotebookBootstrap.should_resolve_project_for_current_julia("notebooks_jl/envs/2-QUBO"; in_colab=true))'- passed, printedtrue.make verify-julia-colab-mismatch-smoke- passed under Julia 1.12.6.COLAB_RELEASE_TAG=local-test JULIA_DEPOT_PATH=/tmp/quip-issue13-julia-depot /home/bernalde/.julia/juliaup/julia-1.12.6+0.x64.linux.gnu/bin/julia --project=./scripts -e 'include("./scripts/notebook_bootstrap.jl"); using .QuIPNotebookBootstrap; QuIPNotebookBootstrap.instantiate_project!(ARGS[1]; precompile=false)' /tmp/quip-issue13-resolve-smoke- passed, loggedResolving Julia packages for current runtime Julia 1.12.6.git diff --check- passed.Notes about tests not run
UV_CACHE_DIR=.uv-cache uv run --group docs jupyter book build --html --cicould not run locally because MyST reportednpmasPackage Not Foundwhile requiring npm>=8.6.0.Closes #13