Skip to content

Automatically initialize Apptainer#20447

Open
natefoo wants to merge 14 commits intogalaxyproject:devfrom
natefoo:auto-init-apptainer
Open

Automatically initialize Apptainer#20447
natefoo wants to merge 14 commits intogalaxyproject:devfrom
natefoo:auto-init-apptainer

Conversation

@natefoo
Copy link
Member

@natefoo natefoo commented Jun 12, 2025

Ultimately the goal here is to support easier production deployments where Galaxy itself does not have to be installed in the shared FS. Admins can configure the tool_dependency_dir to be on the shared FS and then we can just use Apptainer + a galaxy-job-execution container for running set_meta().

I should probably add a few more tests but wanted to get this out here for comment in case people don't like the direction I've taken.

How to test the changes?

(Select all options that apply)

  • I've included I will include appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. Configure some resolvers in container_resolvers where s/singularity/apptainer/
    2. Set auto_init: true
    3. Try setting prefix and/or exec to change where Apptainer is installed.

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

@natefoo
Copy link
Member Author

natefoo commented Jun 13, 2025

I added some unit tests, I am a little iffy on adding to the integration tests since they are a good bit slower and our tests are already slow enough. Since the Apptainer resolvers are just the Singularity resolvers in a trenchcoat we wouldn't be testing anything new. I can add a test of the auto-init functionality though if we want.

@natefoo natefoo marked this pull request as ready for review June 13, 2025 16:30
@github-actions github-actions bot added this to the 25.1 milestone Jun 13, 2025
@mvdbeek
Copy link
Member

mvdbeek commented Aug 1, 2025

This seems to do so much more than just initialize apptainer ? About the core apptainer install idea, this will have the same issues that conda auto init has, namely it breaks and leaves behind lock files in our production setup with multiple processes. It'd seem significantly cleaner if this was just a separate command you can launch.

assert self.app_info.apptainer_prefix
apptainer_prefix = self.app_info.apptainer_prefix
apptainer_context = ApptainerContext(apptainer_prefix=apptainer_prefix, apptainer_exec=apptainer_exec)
deps_ensure_installed(apptainer_context, install_apptainer, self.auto_init)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surely that'll only work on linux

@natefoo
Copy link
Member Author

natefoo commented Aug 4, 2025

It'd seem significantly cleaner if this was just a separate command you can launch.

I just assumed we'd want things done similar to how everything else is done but I'm actually very happy for that to be the case. I'll scrap this and make a simpler version.

@mvdbeek
Copy link
Member

mvdbeek commented Sep 25, 2025

There's a lot of cool stuff in here though, maybe you can just drop the auto_init stuff and we could merge this ?

@ahmedhamidawan
Copy link
Member

Hey @natefoo 👋 . Any updates on this?

@natefoo
Copy link
Member Author

natefoo commented Oct 3, 2025

Without auto_init I think a lot of the other changes aren't worth keeping, @mvdbeek did you have any specific thoughts on what was good? i.e. that's sort of the whole purpose of the apptainer resolver and all the refactoring that was done in support of that.

@mvdbeek mvdbeek modified the milestones: 25.1, 26.0 Oct 7, 2025
@guerler guerler modified the milestones: 26.0, 26.1 Jan 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants