- latch_cli.services.register.register.print_and_write_build_logs(build_logs: Iterable[latch_cli.services.register.utils.DockerBuildLogItem], image: str, pkg_root: pathlib.Path, *, progress_plain: bool = False)#
- latch_cli.services.register.register.print_upload_logs(upload_image_logs, image)#
- latch_cli.services.register.register.print_serialize_logs(serialize_logs, image)#
- latch_cli.services.register.register.register(pkg_root: str, disable_auto_version: bool = False, remote: bool = False, skip_confirmation: bool = False, snakefile: Optional[pathlib.Path] = None, *, progress_plain=False, use_new_centromere: bool = False)#
Registers a workflow, defined as python code, with Latch.
Kicks off a three-legged OAuth2.0 flow outlined in RFC6749. Logic scaffolding this flow and detailed documentation can be found in the latch.auth package
From a high-level, the user will be redirected to a browser and prompted to login. The SDK meanwhile spins up a callback server on a separate thread that will be hit when the browser login is successful with an access token.
The major constituent steps are:
Constructing a Docker image
Serializing flyte objects within an instantiated container
Uploading the container with a latch-owned registry
Registering serialized objects + the container with latch.
The Docker image is constructed by inferring relevant files + dependencies from the workflow package code itself. If a Dockerfile is provided explicitly, it will be used for image construction instead.
The registration flow makes heavy use of Flyte, and while the Latch SDK modifies many components to play nicely with Latch, eg. platform API, user-specific auth, the underlying concepts are nicely summarized in the flytekit documentation.
pkg_root – A valid path pointing to the worklow code a user wishes to register. The path can be absolute or relative. The path is always a directory, with its structure exactly as constructed and described in the cli.services.init function.
- class latch_cli.services.register.utils.DockerBuildLogItem#
- latch_cli.services.register.utils.build_image(ctx:, image_name: str, context_path: pathlib.Path, dockerfile: typing.Optional[pathlib.Path] = None) Iterable[latch_cli.services.register.utils.DockerBuildLogItem] #
- latch_cli.services.register.utils.serialize_pkg_in_container(ctx:, image_name: str, serialize_dir: str) Tuple[List[str], str] #
- latch_cli.services.register.utils.register_serialized_pkg(files: List[pathlib.Path], token: Optional[str], version: str, workspace_id: str, latch_register_url: str = 'https://nucleus.latch.bio/sdk/register-workflow') object #