latch_cli.services.init package#

Submodules#

latch_cli.services.init.init module#

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[source]#

Creates boilerplate workflow files in the user’s working directory.

Parameters:
  • pkg_name – A identifier for the workflow - will name the boilerplate directory as well as functions within the constructed package.

  • template

    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_type_str

    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

Example

>>> init("test-workflow", "empty", False)
    # The resulting file structure will look like
    #   test-workflow
    #   ├── version
    #   └── wf
    #       ├── __init__.py
    #       └── task.py

Module contents#