Skip to content

Commit

Permalink
Merge pull request #489 from latchbio/rahuldesai1/async-dispatcher
Browse files Browse the repository at this point in the history
add version field to dispatcher call
  • Loading branch information
rahuldesai1 authored Sep 17, 2024
2 parents ccf81b8 + e675b6d commit 48f9b35
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,13 @@ Types of changes

# Latch SDK Changelog

## 2.52.3 - 2024-08-29

### Changed

* Nextflow
- Update `nextflow` base image to version `v2.0.0`

## 2.52.2 - 2024-09-04

### Changed
Expand Down
1 change: 1 addition & 0 deletions latch_cli/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ class LatchConstants:
base_image: str = (
"812206152185.dkr.ecr.us-west-2.amazonaws.com/latch-base:fe0b-main"
)
nextflow_latest_version: str = "v2.0.0"
nextflow_latest_version: str = "v1.1.8"

file_max_size: int = 4 * Units.MiB
Expand Down
16 changes: 16 additions & 0 deletions latch_cli/nextflow/workflow.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
from dataclasses import fields, is_dataclass
from enum import Enum
from pathlib import Path
Expand All @@ -10,9 +11,11 @@
from latch.types.directory import LatchDir, LatchOutputDir
from latch.types.file import LatchFile
from latch.types.metadata import NextflowParameter
from latch_cli.constants import latch_constants
from latch_cli.snakemake.config.utils import get_preamble, type_repr
from latch_cli.snakemake.utils import reindent
from latch_cli.utils import identifier_from_str, urljoins
from latch_cli.workflow_config import LatchWorkflowConfig

template = """\
import sys
Expand Down Expand Up @@ -58,6 +61,7 @@ def initialize() -> str:
headers=headers,
json={{
"storage_expiration_hours": {storage_expiration_hours},
"version": {nextflow_version},
}},
)
resp.raise_for_status()
Expand Down Expand Up @@ -268,6 +272,17 @@ def get_results_code_block(parameters: Dict[str, NextflowParameter]) -> str:
return code_block


def get_nextflow_major_version(pkg_root: Path) -> int:
with (pkg_root / latch_constants.pkg_config).open("r") as f:
config = LatchWorkflowConfig(**json.load(f))

if "latch-base-nextflow" not in config.base_image:
return 1

version = config.base_image.split(":")[-1]
return int(version[1])


def generate_nextflow_workflow(
pkg_root: Path,
metadata_root: Path,
Expand Down Expand Up @@ -415,6 +430,7 @@ def generate_nextflow_workflow(
storage_gib=resources.storage_gib,
storage_expiration_hours=resources.storage_expiration_hours,
log_dir=log_dir,
nextflow_version=get_nextflow_major_version(pkg_root),
)

dest.write_text(entrypoint)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

setup(
name="latch",
version="v2.52.2",
version="v2.52.3",
author_email="kenny@latch.bio",
description="The Latch SDK",
packages=find_packages(),
Expand Down

0 comments on commit 48f9b35

Please sign in to comment.