Service to initialize boilerplate.
- latch_cli.services.init.init.init(pkg_name: str, template: str | None, expose_dockerfile: bool = True, base_image_type_str: str = 'default') bool #
Creates boilerplate workflow files in the user’s working directory.
pkg_name – A identifier for the workflow - will name the boilerplate directory as well as functions within the constructed package.
A template to use for the workflow. If None, you will be prompted to choose a template.
”empty”: An empty workflow wrapper
”subprocess”: An example workflow that runs a subprocess
”r”: A template workflow for executing an R script
”conda”: A template workflow for executing code within a conda environment
expose_dockerfile – Whether to expose a Dockerfile in the workflow. If true, the Dockerfile will be created at init time and can be modified. Otherwise, the Dockerfile will be created at registration time and the user will not be able to modify it. At any point, the user can switch modes by executing latch dockerfile . in the workflow directory.
Base image to use for the workflow. Default value is “default”. The following options are available:
”default”: with no additional dependencies
”cuda”: with Nvidia CUDA/cuDNN (cuda 11.4.2, cudnn 8) drivers
”opencl”: with OpenCL (ubuntu 18.04) drivers
”docker”: with the Docker daemon
>>> init("test-workflow", "empty", False) # The resulting file structure will look like # test-workflow # ├── version # └── wf # ├── __init__.py # └── task.py