Skip to content

fix(setup): add Ubuntu 24.04 setup script; seed illumination config from .example - #706

Open
hongquanli wants to merge 1 commit into
masterfrom
fix/ubuntu-24.04-setup
Open

hongquanli wants to merge 1 commit into
masterfrom
fix/ubuntu-24.04-setup

Conversation

@hongquanli

Copy link
Copy Markdown
Contributor

Summary

  • Fresh installs crash at startup. machine_configs/illumination_channel_config.yaml is gitignored (chore: ignore machine-specific configs and Xeryon settings #546), so on a new clone no channel configs get generated and LiveControlWidget dies with AttributeError: 'NoneType' object has no attribute 'name' ("no general config for profile 'default'"). fix(ci): provide illumination_channel_config example for tests #548 fixed this for CI only. ConfigRepository.get_illumination_config() now creates the file from its .example on first load and logs a warning to edit it; an existing file is never overwritten. This covers Ubuntu, Windows (which has no setup script), and installs whose copy was deleted by a pull. The CI cp step from fix(ci): provide illumination_channel_config example for tests #548 is removed as redundant.
  • New software/setup_24.04.sh, based on setup_22.04.sh:
    • PIP_BREAK_SYSTEM_PACKAGES=1: 24.04's Python is externally managed (PEP 668), so bare pip3 install refuses to run. Packages still go to ~/.local as before.
    • Keeps the pip upgrade: 24.04's pip 24.0 backtracks into pandas 1.5.3, which has no Python 3.12 wheel and fails to build.
    • "numpy<2" on every pip call: each call resolves on its own, and the opencv step was pulling numpy 2.x.
    • Installs the Daheng gxipy API with pip3 install <dir> instead of sudo python3 setup.py install.
    • git clone --recurse-submodules, or git submodule update --init for an existing repo.
    • The desktop shortcut uses gnome-terminal -- … instead of the deprecated -e.
  • Both setup scripts:
    • Drop basicpy. BaSiCPy 2.0 depends on torch, which pulls ~20 NVIDIA/CUDA wheels (several GB). It is only used by control/stitcher.py, which the GUI does not import; only tools/script_stitch_slide.py needs it.
    • Add tensorstore and xarray, required by the ndviewer_light submodule. CI doesn't catch this because it leaves that submodule uninitialized.
  • README: 24.04 instructions.

Test plan

  • Ran setup_24.04.sh on a fresh Ubuntu 24.04.4 desktop (Python 3.12.3)
  • Before the repository fix: reproduced the startup crash. After: main_hcs.py --simulation generates the default profile configs and runs without errors
  • tests/control/core/config: 90 passed, including 3 new tests (seed when missing / don't overwrite existing / no-op without .example)
  • Reproduced the fix(ci): provide illumination_channel_config example for tests #548 CI scenario (no user_profiles/, no illumination YAML, no cp step): config is seeded, and test_MultiPointController.py + test_widgets.py pass once tensorstore is installed
  • black 24.10.0 (pre-commit version): no changes
  • CI on this PR

🤖 Generated with Claude Code

…rom .example

A fresh clone crashes at startup: illumination_channel_config.yaml is
gitignored (#546), so no channel configs are generated and
LiveControlWidget fails with "no general config for profile 'default'".
ConfigRepository now creates the file from its .example on first load
(never overwriting an existing one). This covers Ubuntu, Windows, and
installs whose copy was removed by a pull, and replaces the CI-only cp
step from #548.

setup_24.04.sh, based on setup_22.04.sh:
- set PIP_BREAK_SYSTEM_PACKAGES=1 (PEP 668 blocks bare pip3 install)
- pin numpy<2 on every pip call (opencv otherwise pulls numpy 2.x)
- pip-install the gxipy API instead of sudo setup.py install
- clone with --recurse-submodules
- use `gnome-terminal --` in the desktop shortcut

Both setup scripts:
- drop basicpy: 2.0 depends on torch, which pulls several GB of CUDA
  wheels; it is only used by control/stitcher.py, which the GUI does
  not import
- add tensorstore and xarray, required by the ndviewer_light submodule

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant