Configuration Extension
Add Enroot-specific fields to SlurmConfig in pkg/slurm/types.go:23-27:
EnrootDefaultOptions []string `yaml:"EnrootDefaultOptions" default:"[\"--rw\"]"`
EnrootPrefix string `yaml:"EnrootPrefix"`
EnrootPath string `yaml:"EnrootPath"`
ContainerRuntime string `yaml:"ContainerRuntime" default:"singularity"` // "singularity" or "enroot"
Command Structure Adaptation
- Singularity: singularity run/exec [options] [image] [command] [args]
- Enroot: enroot start [options] [container_name] [command] [args]
Key differences:
- Enroot requires container creation before execution (enroot create)
- Enroot uses container names instead of direct image paths -> How to handle images?
Implementation Changes
Abstract Container Runtime (pkg/slurm/Create.go:86-160)
Replace hardcoded Singularity logic with runtime abstraction:
Mount Handling (pkg/slurm/prepare.go:346-347)
Enroot mount differences:
Environment Variables (pkg/slurm/prepare.go:196-234)
Enroot environment handling:
Image Management Strategy
Image Import Phase
# Check if container exists
enroot list | grep -q $CONTAINER_NAME || \
# Import and create if not exists
enroot import $IMAGE_URI && \
enroot create --name $CONTAINER_NAME $IMAGE_SQSH
Container Lifecycle
Script Generation Modifications
Pre-execution Setup
# Container preparation phase
prepare_enroot_containers() {
for container in $CONTAINERS; do
if ! enroot list | grep -q $container; then
enroot import $IMAGE_URI
enroot create --name $container $IMAGE_SQSH
fi
done
}
Command Construction
# Enroot execution
runCtn container-name enroot start --rw \
--mount /host/path:/container/path \
--env KEY=VALUE \
container-name \
/command args
Backward Compatibility
Configuration Extension
Add Enroot-specific fields to SlurmConfig in pkg/slurm/types.go:23-27:
Command Structure Adaptation
Key differences:
Implementation Changes
Abstract Container Runtime (pkg/slurm/Create.go:86-160)
Replace hardcoded Singularity logic with runtime abstraction:
Mount Handling (pkg/slurm/prepare.go:346-347)
Enroot mount differences:
Environment Variables (pkg/slurm/prepare.go:196-234)
Enroot environment handling:
Image Management Strategy
Image Import Phase
Container Lifecycle
Script Generation Modifications
Pre-execution Setup
Command Construction
Backward Compatibility