public class DockerUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
AWS_EFS
Docker container root user EFS directory
|
static String |
AWS_EFS_DB
Docker container root user DB directory
|
protected static String |
BLJ_BASH
Docker image name for simple bash scripts (awk,gzip,pear).
|
protected static String |
COMPUTE_SCRIPT
Docker environment variable holding the name of the compute script file: "COMPUTE_SCRIPT"
|
static String |
CONTAINER_BLJ_DIR
Docker container BioLockJ installation directory: "/app/biolockj"
|
static String |
CONTAINER_BLJ_SUP_DIR
Docker container blj_support directory: "/app/blj_support"
|
static String |
CONTAINER_CONFIG_DIR
All containers mount the host
Config directory to the container volume:
"/mnt/efs/config" |
static String |
CONTAINER_DB_DIR
Some containers mount a database to the containers "db" volume: "/mnt/efs/db"
|
static String |
CONTAINER_INPUT_DIR
All containers mount the host "input.dirPaths" to the container "input" volume:
"/mnt/efs/input"
|
static String |
CONTAINER_META_DIR
Some containers mount the "metadata.filePath" to the container "meta" volume:
"/mnt/efs/metadata"
|
static String |
CONTAINER_OUTPUT_DIR
All containers mount "internal.pipelineDir" to the container volume:
"/mnt/efs/pipelines"
|
static String |
CONTAINER_PRIMER_DIR
Some containers mount the "trimPrimers.filePath" to the containers "primer":
"/mnt/efs/primer" volume.
|
protected static String |
DEFAULT_DOCKER_HUB_USER
Name of the BioLockJ Docker account ID: "biolockj"
|
protected static String |
DOCKER_HUB_USER
Config name of the Docker Hub user with the BioLockJ containers: "docker.user"Docker Hub URL: https://hub.docker.com By default the "biolockj" user is used to pull the standard modules, but advanced users can deploy their own versions of these modules and add new modules in their own Docker Hub account. |
static String |
DOCKER_ROOT_HOME
Docker container root user $HOME directory
|
protected static String |
SAVE_CONTAINER_ON_EXIT
Config property removed the default --rm flag on docker run command if set to TRUE:
"docker.saveContainerOnExit" |
static String |
SPAWN_DOCKER_CONTAINER
Name of the bash script function used to generate a new Docker container: "spawnDockerContainer"
|
Constructor and Description |
---|
DockerUtil() |
Modifier and Type | Method and Description |
---|---|
static List<String> |
buildSpawnDockerContainerFunction(BioModule module)
Build the "spawnDockerContainer" method, which takes container name, in/out port, and optionally script
path parameters.
|
static String |
getDockerImage(BioModule module)
Return the name of the Docker image needed for the given module.
|
static String |
getDockerUser(BioModule module)
Return the Docker Hub user ID.
|
static File |
getDockerVolumeDir(String prop,
String containerPath)
Get mapped Docker system File from
Config directory-property by replacing the host system path
with the mapped container path. |
static File |
getDockerVolumeFile(String prop,
String containerPath)
Get mapped Docker system File from
Config file-property by replacing the host system path with
the mapped container path. |
static String |
getDockerVolumePath(String path,
String containerPath)
Get Docker file path through mapped volume
|
static String |
getImageName(BioModule module)
Return the Docker Image name for the given class name.
Return "blj_bash" for simple bash script modules that don't rely on special software Class names contain no spaces, words are separated via CamelCaseConvension. Docker image names cannot contain upper case letters, so this method substitutes "_" before the lower-case version of each capital letter. Example: JavaModule becomes java_module |
static String |
getImageVersion(BioModule module)
Get the Docker image version if defined in the
Config fileIf not found, return the default version "latest" |
static boolean |
hasDB(BioModule module)
Function used to determine if an alternate database has been defined (other than /db).
|
static boolean |
inAwsEnv()
Return TRUE if running in AWS (based on Config props).
|
static boolean |
inDockerEnv()
Return TRUE if running in AWS (based on Config props).
|
static boolean |
isDirectMode()
Return TRUE if runtime parameters indicate attempt to run in direct mode
|
public static final String AWS_EFS
public static final String AWS_EFS_DB
public static final String CONTAINER_BLJ_DIR
public static final String CONTAINER_BLJ_SUP_DIR
public static final String CONTAINER_CONFIG_DIR
Config
directory to the container volume:
"/mnt/efs/config"public static final String CONTAINER_DB_DIR
public static final String CONTAINER_INPUT_DIR
public static final String CONTAINER_META_DIR
public static final String CONTAINER_OUTPUT_DIR
public static final String CONTAINER_PRIMER_DIR
public static final String DOCKER_ROOT_HOME
public static final String SPAWN_DOCKER_CONTAINER
protected static final String BLJ_BASH
protected static final String COMPUTE_SCRIPT
protected static final String DEFAULT_DOCKER_HUB_USER
protected static final String DOCKER_HUB_USER
Config
name of the Docker Hub user with the BioLockJ containers: "docker.user"protected static final String SAVE_CONTAINER_ON_EXIT
Config
property removed the default --rm flag on docker run command if set to TRUE:
"docker.saveContainerOnExit"public static List<String> buildSpawnDockerContainerFunction(BioModule module) throws Exception
module
- BioModuleException
- if unable to build the functionpublic static String getDockerImage(BioModule module) throws Exception
module
- BioModuleException
- if errors occurpublic static String getDockerUser(BioModule module)
module
- BioModulepublic static File getDockerVolumeDir(String prop, String containerPath) throws Exception
Config
directory-property by replacing the host system path
with the mapped container path.public static File getDockerVolumeFile(String prop, String containerPath) throws Exception
Config
file-property by replacing the host system path with
the mapped container path.public static String getDockerVolumePath(String path, String containerPath)
path
- Config
file or directory pathcontainerPath
- Local container pathpublic static String getImageName(BioModule module) throws Exception
module
- BioModuleException
- if errors occurpublic static String getImageVersion(BioModule module)
Config
filemodule
- BioModulepublic static final boolean hasDB(BioModule module) throws Exception
module
- BioModuleException
- if errors occurpublic static boolean inAwsEnv() throws Exception
Exception
- if errors occurpublic static boolean inDockerEnv()
public static boolean isDirectMode()