square-agency-59624
11/03/2025, 5:44 AMancient-wolf-19325
11/03/2025, 5:44 AMsquare-agency-59624
11/03/2025, 7:01 AM@fl.workflow
def train_by_comet_key_dynamic_wf(
keys: list[str],
ddh_uuid: str,
rcddh_uuid: str,
project: str = "rama",
):
fl.map_task(train_by_comet_key_task)(keys, ddh_uuid, rcddh_uuid, project)
@fl.task(
container_image=hv_image_spec,
resources=fl.Resources(cpu="16", mem="32Gi", gpu="1", ephemeral_storage="15Gi"),
shared_memory=True,
environment=dotenv_values(),
)
def train_by_comet_key_task(
key: str,
ddh_uuid: str,
rcddh_uuid: str,
project: str,
module_name: Optional[str] = None,
):
run_train_by_comet_key(
key=key,
ddh_uuid=ddh_uuid,
rcddh_uuid=rcddh_uuid,
project=project,
module_name=module_name,
)ancient-wolf-19325
11/03/2025, 7:01 AM@fl.workflow
def train_by_comet_key_dynamic_wf(
keys: list[str],
ddh_uuid: str,
rcddh_uuid: str,
project: str = "rama",
):
return fl.map_task(train_by_comet_key_task)(
key=keys, ddh_uuid=ddh_uuid, rcddh_uuid=rcddh_uuid, project=project
)
This ensures that key is mapped over, while the other arguments are fixed for each invocation (Flyte map_task docs, Flytesnacks example).
Would you like a step-by-step explanation or more advanced usage examples?
Sources:
- Flyte map_task docs
- Flytesnacks example 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.square-agency-59624
11/03/2025, 7:21 AM@fl.workflow
def train_by_comet_key_map_tasks_wf(
model_ids: list[str],
ddh_uuid: str,
rcddh_uuid: str,
project: str = "rama",
):
partial_task = functools.partial(
train_by_comet_key_task,
ddh_uuid=ddh_uuid,
rcddh_uuid=rcddh_uuid,
project=project,
module_name=None,
)
fl.map_task(partial_task)(model_ids)
@fl.task(
container_image=hv_image_spec,
resources=fl.Resources(cpu="16", mem="32Gi", gpu="1", ephemeral_storage="15Gi"),
shared_memory=True,
environment=dotenv_values(),
)
def train_by_comet_key_task(
key: str,
ddh_uuid: str,
rcddh_uuid: str,
project: str,
module_name: Optional[str] = None,
):
run_train_by_comet_key(
key=key,
ddh_uuid=ddh_uuid,
rcddh_uuid=rcddh_uuid,
project=project,
module_name=module_name,
)
I'm running into an error saying that the image is not accessible.
failed to authorize: failed to fetch anonymous token: unexpected status from GET request to <https://gitlab.com/jwt/auth>.... 403 Forbiddenancient-wolf-19325
11/03/2025, 7:21 AM