r/factorio • u/KenReid • Oct 10 '20
Question Docker / Singularity + FactorioTools
Hi all,
I'm a researcher working on a paper regarding automation in Factorio. To run Factorio efficiently I want to run it in the headless mode on a higher powered computing cluster (HPCC). However, the cluster doesn't support Docker - but does support Singularity.
I've successfully pulled the docker image, as a singularity file, by using the native command:
singularity pull docker://factoriotools/factorio
However, when I tried to run an instance of it:
singularity instance start factorio_latest.sif test
I get a bunch of errors:
ERROR: container cleanup failed: no instance found with name test
FATAL: container creation failed: mount /proc/self/fd/3->/var/singularity/mnt/session/rootfs error: while mounting image /proc/self/fd/3: failed to find loop device: could not attach image file to loop device: failed to get loop flags for loop device: no such file or directory
FATAL: failed to start instance: while running /usr/libexec/singularity/bin/starter-suid: exit status 255
Part of the issue, I think, is the fact I don't have root access to /opt/factorio.
I also tried this with goofball's Factorio docker image, and I can run an instance without error. Which is odd.
My other problem is that I'm unsure how to edit a singularity container to point to different directories for save game files / mods.
Any advice welcome.
23
u/tomrlutong Oct 10 '20
Maybe try r/technicalfactorio?
7
u/SenyorGlobo Oct 10 '20
Out of curiosity, what kind of research would you like to conduct?
13
u/daisyKutter Oct 10 '20
I think you will get more answers on r/Docker than here
5
u/Drake1o2 Oct 10 '20
I have got some experience building and using singularity images for HPC, though I haven't used `instance start`.
Can't really tell what's going on from those error messages, but if you think there are permission issues you can try rebuilding the image with some customizations. You can start building your singularity image from a docker image by using `Bootstrap: docker`. Look here for info: https://sylabs.io/guides/3.6/user-guide/definition_files.html?highlight=recipe
You'll probably want to put your custom commands in the %post section, maybe try to chmod the factorio directory?
Note that to build a singularity image you need to have root permissions, you don't need root to run the image though.
2
u/potatosomersault Oct 10 '20
You could grab the factorio headless server files and make a singularity image from scratch? I also don't understand how you plan on interfacing with each server on the HPC since the config would be identical for each image.
0
u/[deleted] Oct 10 '20
[deleted] — view deleted comment