container module
- class container.clumapp(pwd='/home/runner/work/pyclmuapp/pyclmuapp/docs/workdir', input_path: str = 'inputfolder', output_path: str = 'outputfolder', log_path: str = 'logfolder', scripts_path: str = 'scriptsfolder', container_type: str = 'docker')
Bases:
object
The class for running CLMU-App.
- Parameters:
pwd (str) – The path to the working directory. The default is “wokdir”.
input_path (str) – The path to the folder for the input of CLMU-App.
output_path (str) – The path to the folder for the output of CLMU-App.
log_path (str) – The path to the folder for the log of CLMU-App.
scripts_path (str) – The path to the folder for the scripts of CLMU-App.
container_type (str) – The type of the container for CLMU-App. The supported types are: - docker: The docker container. - singularity: The singularity container.
- - input_path
The path to the folder for the input of CLMU-App.
- Type:
str
- - output_path
The path to the folder for the output of CLMU-App.
- Type:
str
- - log_path
The path to the folder for the log of CLMU-App.
- Type:
str
- - image_name
The name of the image for CLMU-App.
- Type:
str
- - container_name
The name of the container for CLMU-App.
- Type:
str
- - caseconfig
The configuration of the case to be built.
- Type:
dict
- - fsurdat_path
The path to the surface input file.
- Type:
str
- - save_name
The name of the output file.
- Type:
str
- - caseconfig
The configuration of the case to be built.
- Type:
dict
- - clmu_run
The object for running CLMU-App.
- Type:
Methods
case_clean
([case_name])Clean the case artifacts.
case_scripts
([mode])Copy the scripts to the input folder.
create_folder
(folder_path)Create folders for the scripts ,input, output and log of CLMU-App if it does not exist.
docker
([cmd, iflog, password, cmdlogfile, ...])Run the docker command.
- case_clean(case_name: str | None = None) None
Clean the case artifacts. :param case_name: The name of the case to be cleaned. :type case_name: str
- case_scripts(mode: str = 'usp') None
Copy the scripts to the input folder.
- Parameters:
mode (str) – The mode of the scripts. The supported modes are:
- create_folder(folder_path) str
Create folders for the scripts ,input, output and log of CLMU-App if it does not exist.
- Parameters:
folder_path (str) – The path to the folder to be created.
- Returns:
The path to the folder created.
- Return type:
folder_path (str)
- docker(cmd: str = 'run', iflog: bool = True, password: str = 'None', cmdlogfile: str | None = None, dockersript: str = 'docker.sh') None
Run the docker command.
- Parameters:
cmd (str) – The docker command to be run. The supported commands are: - pull: Pull the docker image. - chmod: Change the mode of a file. - run: create a docker container. - exec: Execute the docker command.
iflog (bool, optional) – If log is needed. The default is True.
password (str, optional) – The password for the sudo command. The default is “None”.
cmdlogfile (str, optional) – The name of the log file. The default is “dockercmd.log”.
dockersript (str, optional) – The name of the docker script. The default is “docker.sh”.