Commit 4a0841f2 authored by Max's avatar Max
Browse files

Add Singularity CVMFS runner

parent dd68b0c3
......@@ -17,13 +17,17 @@ public class ContainerizerFactory {
*/
enum Containerizers {
/**
* Entry for Docker
* Entry for Singularity (CVMFS)
*/
SingularityCVMFS,
/**
* Entry for Singularity (local)
*/
Docker,
Singularity,
/**
* Entry for Singularity
* Entry for Docker
*/
Singularity
Docker
}
/**
......
package alien.site.containers;
import java.util.ArrayList;
import java.util.List;
import alien.site.packman.CVMFS;
/**
* @author mstoretv
*/
public class SingularityCVMFS extends Containerizer {
@Override
public List<String> containerize(final String cmd) {
final List<String> singularityCmd = new ArrayList<>();
singularityCmd.add(CVMFS.getSingularityPath() + "/" + "singularity");
singularityCmd.add("exec");
singularityCmd.add("-C");
singularityCmd.add("-B");
if(workdir != null) {
singularityCmd.add("/cvmfs:/cvmfs,/tmp:/tmp," + workdir + ":" + CONTAINER_JOBDIR); //TODO: remove /tmp after testing (not needed)
singularityCmd.add("--pwd");
singularityCmd.add(CONTAINER_JOBDIR);
}
else
singularityCmd.add("/cvmfs:/cvmfs");
singularityCmd.add(containerImgPath);
singularityCmd.add("/bin/bash");
singularityCmd.add("-c");
singularityCmd.add(envSetup + cmd);
return singularityCmd;
}
}
\ No newline at end of file
......@@ -193,4 +193,11 @@ public class CVMFS extends PackMan {
public static String getContainerPath() {
return CVMFS_BASE_DIR + "/containers/fs/singularity/centos7";
}
/**
* @return path to Singularity runtime in CVMFS
*/
public static String getSingularityPath() {
return CVMFS_BASE_DIR + "/containers/bin/singularity/current/bin";
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment