Repository navigation
Publish a container image and add serve flags for remote use - #560
Merged
Merged
Conversation
pauladkisson
added a commit
that referenced
this pull request
Oct 14, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
pauladkisson
force-pushed
the
single_port
branch
from
October 15, 2026 19:19
409dd0b to
74ce2f9
Compare
Adds a Dockerfile (with Chromium for plot export), a workflow that builds the image on pull requests touching it and pushes it to ghcr.io/lernerlab/guppy on each release, and a how-to page for running it with Apptainer on a cluster or with Docker. guppy gains --port, --address and --no-browser so the server can be reached through a known port from another machine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pages now open the same way locally and in a container, so the section describing the blocked-tab notification no longer applies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pauladkisson
force-pushed
the
containerize
branch
from
October 15, 2026 19:20
4a5ad2d to
6db5118
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 15, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pauladkisson
marked this pull request as ready for review
October 16, 2026 21:14
pauladkisson
enabled auto-merge
October 16, 2026 21:15
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #358
Details (AI-generated)
Closes #358. The how-to for using the published image is in #569, which stays in draft until the image is on ghcr.
Dockerfileonpython:3.12-slimwith Debian'schromiumandchromium-driverfor the dashboard's PNG/SVG export. It installs GuPPy from the build context, and its entrypoint isguppy --no-browser --port 5006, so arguments such as--input-rootare appended..dockerignoreallowlists only what the install needs..github/workflows/container-image.ymlbuildslinux/amd64and runs--versionin the image. Pull requests that touch the image's inputs only build it. A published release, or a manual dispatch, also pushes it toghcr.io/lernerlab/guppy. A release pushes the release tag andlatest; a dispatch frommainpushes the tagmain.guppy --port,--address, and--no-browser, passed throughserve_apptopn.serve. Defaults are unchanged: a free port, every interface, and a browser opened.serve_appprintsGuPPy is starting. Open the address below in your browser, and press Ctrl+C here to stop GuPPy.and passesverbose=True, so Panel follows it withLaunching server at <url>once it is serving, and the image setsPYTHONUNBUFFERED=1so both lines reachdocker runoutput immediately.The image is amd64 only. The
numcodecsversion thatzarr<3resolves to has no Linux arm64 wheel, so an arm64 build fails without a compiler.Checking the image with a local build
Both walkthroughs build the image from this branch, so nothing has to be published first. The Docker commands use the paths on my machine: the branch checkout at
/Users/pauladkisson/Documents/CatalystNeuro/Guppy/worktrees/containerizeand the main checkout's/Users/pauladkisson/Documents/CatalystNeuro/Guppy/GuPPy/testing_data. They use the fulltesting_data/download (the one thefull_datatests read): its folders are the input root, and itsoutput_folderis the output root.testing_data/is mounted read-only withoutput_foldermounted writable on top, so GuPPy can only write intooutput_folder. On an Apple silicon Mac the build and the container run under emulation, so expect the build to take several minutes and the app to be slower than a native install.Docker
Build the image:
Check that it starts and reports the branch's version:
Start GuPPy on
testing_data/:Once the server is up, the terminal prints:
Open
http://localhost:5006. The folder selector should start at/dataand list theSampleData_*folders. Reload once to check that a second load also renders.Open
SampleData_csv, selectsample_data_csv_1, and run it through the pipeline: label the stores (Sample_Control_Channelascontrol_region,Sample_Signal_Channelassignal_region,Sample_TTLasttl), then Read Raw Data, Preprocess, and PSTH. Each step's result page opens in the same browser on port 5006. The new run folder appears under/Users/pauladkisson/Documents/CatalystNeuro/Guppy/GuPPy/testing_data/output_folder/SampleData_csv/.Open Visualization and save a plot as PNG and as SVG. That checks the Chromium and ChromeDriver inside the image.
Stop the container with Ctrl+C in its terminal.
--rmremoves it.Apptainer
Apptainer runs on Linux, usually a shared cluster, and clusters rarely have Docker. So the image is built with Docker on your own machine, saved as an archive, and converted to an Apptainer image on the cluster. The cluster also needs a copy of
testing_data/. The cluster-side paths and hosts stay as placeholders:<user>,<login-host>, and<node>are your cluster login, and/path/to/testing_datais where the copy lives there.On your own machine, build the image as in Docker step 1 and save it:
docker save guppy:local -o ~/guppy_local.tarCopy the archive to the cluster:
On the cluster, load Apptainer if your cluster uses modules (check with
apptainer --version), and convert the archive:If the build fails with "disk quota exceeded",
/tmpis too small for the unpacked image. Point Apptainer's scratch space at a folder on disk withAPPTAINER_TMPDIR=~/apptainer_tmp(create it first) in front of the same command.Start GuPPy on the node you will use, serving on that node only:
Once the server is up, the terminal prints:
If port 5006 is taken on that node, pick another and use it in step 5 too.
On your own machine, forward the port through the login host to that node (
hostnameon the node prints its name):Open
http://localhost:5006and repeat Docker steps 4 to 6, with the folder selector starting at/testing_data. The run folder appears undertesting_data/output_folder/SampleData_csv/on the cluster.Stop GuPPy with Ctrl+C on the node and close the SSH session.
Verification
Built the amd64 image locally from this branch under emulation on an Apple silicon Mac.
--versionreports 2.0.0b5. Docker steps 1 to 4 work: step 3 prints the startup message andLaunching server at http://localhost:5006, and with its mounts the homepage served on127.0.0.1:5006lists theSampleData_*folders, and a second load renders with no console errors. Chromium and ChromeDriver 155 are present in the image. Earlier on this branch, with the same image contents, Preprocess ran and opened its result view, Visualization opened, and PNG and SVG export worked inside the container. Mapping host port 8080 to 5006 is refused by Bokeh's websocket origin check. The Apptainer walkthrough was run in an Ubuntu 26.04 arm64 VM under Parallels on an Apple silicon Mac, standing in for both login and compute node: Apptainer from its PPA,qemu-user-binfmtto run the amd64 image (Apptainer warns that the architecture does not match), and the build neededAPPTAINER_TMPDIRbecause/tmpis RAM-backed. GuPPy served with the read-only and writable binds and was reached throughssh -Lfrom the Mac. It works, but very slowly under QEMU emulation. A real cluster with its modules and scheduler is still untested.tests/unit/test_main.pyandtests/unit/test_app.py: 22 passed.🤖 Generated with Claude Code