charmed-hpc / slurm-snap

Snap package for Slurm. Slurm is a highly scalable cluster management and job scheduling system for large and small Linux clusters :balance_scale::penguin:
https://slurm.schedmd.com
Apache License 2.0
2 stars 3 forks source link

[Bug]: Files escape snap sandbox in `/run` and `/var/spool` #22

Open NucciTheBoss opened 3 months ago

NucciTheBoss commented 3 months ago

With further testing, I discovered that certain Slurm files are escaping the snap "sandbox". The sandbox technically doesn't exist since the Slurm snap is classically confined and not strictly confined, but to preserve the atomicity of the snap paths are directed to write data under snap-specific directories such as $SNAP_COMMON.

Unfortunately I noticed that supplying the --localstatedir and --runstatedir options to the Slurm configure script doesn't seem to do anything about this. Therefore, the easiest fix for this will be to preconfigure the SlurmctldPidFile and SlurmctldSpoolDir options when the Slurm snap is first installed via the install hook.

Should not start until #19 is fixed

NucciTheBoss commented 2 months ago

Hmm... to be honest, I think this a documentation issue rather than a bug :cockroach:

Reason saying is that the Slurm snap actually works perfectly fine even if the files are outside of the snap sandbox/snapshottable directories. We just don't like that since mostly everything is under $SNAP_COMMON. I think rather than add additional complexity by sorta "preseeding" default values that we need to fight with when an admin goes to set new values, it would be better to just provide base configuration in a getting started howto that just has our preferred values.

Using the approach above, now if someone decides to change the defaults or ship their own configuration, they'll understand why some files are outside of $SNAP_COMMON. "Oh, this is outside $SNAP_COMMON because I set the SlurmdSpoolDir to a different location."