SCIRun icon indicating copy to clipboard operation
SCIRun copied to clipboard

Only initialize the CLI for headless mode and add Dockerfile

Open georgiastuart opened this issue 1 year ago • 15 comments

I've been helping a group use SCIRun on our local cluster. As part of that work, I made a couple changes to SCIRun that may be useful to others. Namely...

  1. Containerization was easier than keeping SCIRun happy with Cluster QT offerings, particularly after a cluster-wide OS update. I created a Dockerfile, which should be broadly useful.
  2. SCIRun refused to start within SLURM batch jobs or CLI interactive jobs and would only run if it was either (a) compiled completely headless or (b) run within our GUI desktop, even when -x was specified, since QT always tried to identify a display. To solve this, I added a check for -x or -h to the Main function to initialize the command line program instead.

Seems to work fine locally. Tested on an Ubuntu 24.04 system using the Apptainer runtime from a docker image.

georgiastuart avatar Dec 02 '24 21:12 georgiastuart

I also just pushed a tweak to the docs. Ubuntu 22.04 and later needs different QT5 package names, and I found that I needed to use -DQt_PATH for QT 5 instead of -DQt5_PATH or -DQt5_DIR. I'm happy to modify or revert if this isn't correct across the board, though.

georgiastuart avatar Dec 02 '24 21:12 georgiastuart

Thank you for the Docker file, that was a long-needed feature. I'll check the Windows and Mac builds and then we can probably merge this.

dcwhite avatar Dec 16 '24 15:12 dcwhite

Here's the issue, only 7 years old https://github.com/SCIInstitute/SCIRun/issues/1720

dcwhite avatar Dec 16 '24 15:12 dcwhite

I think the mac build failed because of the install-qt-action version being out of date. Bumped to v4.

georgiastuart avatar Dec 16 '24 15:12 georgiastuart

I think the mac build failed because of the install-qt-action version being out of date. Bumped to v4.

We might need 4.1 to fix the failure https://github.com/jurplel/install-qt-action/releases/tag/v4.1.0

dcwhite avatar Dec 16 '24 20:12 dcwhite

Hmm, @v4 should grab the latest in that major version series, so I think it's something else. I'm going to let the rest of the checks finish and then investigate further.

georgiastuart avatar Dec 16 '24 21:12 georgiastuart

According to https://github.com/orgs/community/discussions/48058 and https://github.com/jurplel/install-qt-action/tags, I think in this case it's using the older 4.0.0 tag, and the error looks exactly like 4.1.0's fix. I thought it would grab the latest too, but it seems to be repo-specific. Good to see SCIRun's rusty wheels getting some exercise, at least.

dcwhite avatar Dec 16 '24 21:12 dcwhite

While you're updating action versions, would you mind bumping upload-artifact too? https://github.blog/changelog/2024-04-16-deprecation-notice-v3-of-the-artifact-actions/

dcwhite avatar Dec 16 '24 23:12 dcwhite

I think it is pulling 4.1, that MacOS update refers to this removed brew install, not the pip install: https://github.com/jurplel/install-qt-action/commit/cb07ed2575f3d0f7ea333707339b2edac669fed1 . I think the v4 label grabs the branch, which is at the 4.1.1 commit.

Looks like it's this and the fix is to let the action manage python, which seems OK since SCIRun builds its own Python: https://github.com/jurplel/install-qt-action/issues/239

Updating that and the request above.

georgiastuart avatar Dec 17 '24 01:12 georgiastuart

Hah I hope you're OK with using this PR as a github action cleanup opportunity. The new Mac error is this old line that should not be needed anymore: https://github.com/SCIInstitute/SCIRun/pull/2438/files#diff-38c2966d1144b82978ca2cfe7650879fb15bd6da5845a3c616e8d152b29317f1R90

It was added in 2019 probably to fix some other problem (the commit message gave no details), so it can be deleted. It's in four places in the mac yml file.

dcwhite avatar Dec 17 '24 22:12 dcwhite

Np on the cicd cleanup opportunity! I removed the symlink lines and (I think) fixed the Windows Qt6 error (the Qt6_PATH env var is no longer set by the install action it looks like).

If y'all have a place to park a Docker image, I can throw in a Docker build workflow. Right now I build and host the container (internally) on our GitLab instance.

georgiastuart avatar Dec 18 '24 02:12 georgiastuart

For now you could try putting something here, I just created it: https://hub.docker.com/repository/docker/functoire/scirun/general If something is available there, we can get some SCI person to take over the publishing part (I'm no longer employed there).

dcwhite avatar Dec 18 '24 22:12 dcwhite

Meanwhile the headless Mac build is failing in Boost code, which would require an upgrade to Boost 1.86. Now that I don't expect you to do, unless you really want to take over as a maintainer...

dcwhite avatar Dec 18 '24 22:12 dcwhite

Hah! That's probably more than I can do at the moment 😉

I can glance at the boost issue, though. It may not be until the new year.

georgiastuart avatar Dec 21 '24 01:12 georgiastuart

I got it started by updating the Python repo. Boost will be in 2025, yeah. Happy holidays!

dcwhite avatar Dec 21 '24 03:12 dcwhite