ClassViz-Tool is a Galaxy Interactive Tool that:
- Validates SVIF (Simple Visualization Input Format) JSON files against a built‑in schema.
- Copies the validated JSON into the tool’s data directory for visualization.
- Serves an HTML/JavaScript/CSS interface on a local HTTP server (default port 7800).
After execution, Galaxy shows a link pointing to the interactive visualization served by ClassViz.
- A working Galaxy instance (tested with Galaxy release 23.0+).
- Docker installed and running (required to build & run the ClassViz container).
- Node ≥ 18 (only for the
gx‑it‑proxyhelper). - Basic familiarity with the command line and with restarting Linux services (
systemctl).
cd galaxy/tools
mkdir -p moonshot && cd moonshot
git clone https://github.com/your-org/ClassViz-Tool.git- Open
galaxy/config/tool_conf.xml(or.sample). - Add the following inside a
<section>block:
<section name="Moonshot" id="moonshot">
<tool file="moonshot/ClassViz-Tool/classviz.xml" />
</section>cd ClassViz-Tool
docker build -t classviz:latest .Tip : All example configuration snippets live under
config_files.
Add or verify the following entries:
gravity:
gx_it_proxy:
enable: true
port: 4002
galaxy:
job_config_file: config/job_conf.yml
interactivetools_enable: true
interactivetools_map: database/interactivetools_map.sqlite
interactivetools_proxy_host: localhost:4002 # Locally
interactivetools_upstream_proxy: false # Locally
outputs_to_working_directory: true
galaxy_infrastructure_url: http://localhost:8080 # Locallyenvironments:
docker_env:
runner: local
docker_enabled: true
interactive: true
docker_set_user: root
tools:
- id: "classviz"
environment: docker_env
execution:
default: default
environments:
default: # non‑interactive tools
runner: local
docker_enabled: false
interactive: falseIf you still work with XML, a reference XML-based job configuration (job_conf.xml) is still available under config_files/classviz if you need them.
Full examples are available under
Some pieces sit outside of the tool itself and must be installed at the system level.
# One‑time install (requires npm)
npm install -g @galaxyproject/gx-it-proxyCreate or edit the systemd unit galaxy-gx-it-proxy.service (usually via sudo systemctl edit galaxy-gx-it-proxy.service) so that the ExecStart line contains :
ExecStart=/usr/local/bin/gx-it-proxy --ip 127.0.0.1 --port 4002 \
--sessions /srv/galaxy/var/interactivetools_map.sqlite \
--proxyPathPrefix /interactivetool/ep --verboseWhy
/srv/galaxy/var? Anything undervar/is writable by Galaxy, letting the proxy store its session DB.
Reload and start the service:
sudo systemctl daemon-reload
sudo systemctl restart galaxy-gx-it-proxy.serviceAppend the following block to your Galaxy server (e.g. /etc/nginx/sites-enabled/galaxy) before your location / {:
location ~* ^/interactivetool/ep/(.+)$ {
proxy_pass http://127.0.0.1:4002;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_read_timeout 3600s;
}Restart Nginx:
sudo systemctl reload nginxWith the proxy and the web rule in place, Galaxy can expose interactive tools under /interactivetool/ep/….
-
Start Galaxy
sh run.sh
-
Launch ClassViz‑Tool in the Galaxy UI: Tools ▶ Moonshot ▶ ClassViz‑Tool.
-
Upload SVIF JSON
- Choose your
.jsonfile and click Run.
- Choose your
-
View the visualization
-
Galaxy will display a message:
ClassViz running… go to User > Interactive Tools -
Click User ▶ Active Interactive Tools, then click ClassViz.
-
Galaxy starts and stops the HTTP server automatically.
- Input JSON: provided by Galaxy as
input.json. - Copied File:
data/input.svifinside the container.
In classviz.xml:
<command detect_errors="exit_code">
<![CDATA[
python /opt/classviz/classviz.py "$input" \
"/opt/classviz/data/input.svif"
]]>
</command>• $input = uploaded file path
• data/input.svif = validated copy.
The Python script loads JSON, validates it against SVIF_SCHEMA, then writes identical bytes to /opt/classviz/data/input.svif.
- Uses Python’s
ThreadingHTTPServerto serve thetool_dirfolder. - Reads port from
GALAXY_IT_PORT(default 7800). - Accessible from the User ▶ Active Interactive Tools
Run all unit tests (schema, copy, server startup):
python3 -m unittest discover -v tests| Symptom | Possible cause | Quick fix | |
|---|---|---|---|
| Random "file not found" errors; some ClassViz jobs executed on the host runner instead of Docker | An old handler process still maps classviz → default runner | Fully stop all handler units, then start them again so they reload job_conf.yml:sudo systemctl stop galaxy-handler@0.service galaxy-handler@1.servicesudo systemctl start galaxy-handler@0.service galaxy-handler@1.service |
|
| Handlers (or Gunicorn workers) stick around after a restart | orphaned main.py processes |
Stop the units, check with `ps aux grep main.py`, kill leftovers, then start the units again | |
| Docker "permission denied" when Galaxy tries to spawn the container | Galaxy service user not in the docker group | sudo usermod -aG docker galaxy_usrLog out and back in or restart the Galaxy service |
|
job_conf.yml seemingly ignored |
job_config: is already specified inline in galaxy.yml |
Comment out the inline section or move your interactive & default runners there |
These notes cover the most common issues encountered in production. If the automated tasks above fail for any reason, you can reproduce each step manually using the same commands.
- Robustness (non‑JSON upload handling)
- Download uploaded JSON into
classviz/data - Auto‑load input file when opening the viewer
- Upcoming: Live‑reload when the SVIF file changes
Last updated: July 2025