Hi Team I have a question @task(__ __ image=ubunt...
# flyte-support
a
Hi Team I have a question @task(__ __ image=ubuntu:latest service account=sample_sa volume(claim_name) _ __ _) def sample function(): return output @workflow def sample_workflow(): sample function how can i give image name, service account and other parameters while running the workflow like while running the command
a
you can use
pyflyte run --image --service-account
a
I think it is possible if i declare in function like below def my_task(image:str, service-account:str): return output But, I am trying inside the task decorator for pod template
a
you can use
Copy code
@task(container_image=str)
but for task-level Service Account you're probably better off with a PodTemplate
a
@task( pod_template=PodTemplate( primary_container_name="dumppod", pod_spec=V1PodSpec( host_ipc=True, restart_policy="Never", service_account="default", service_account_name="default", containers=[ V1Container( name="primary", image_pull_policy="Always", resources={"requests": {"cpu": "4", "memory": "12Gi"}}, ), V1Container( name="dumppod", image="google/cloud-sdk", volume_mounts=[ V1VolumeMount( name="gcs-volume", mount_path="/mnt/gcs" ) ] ), ], volumes=[ V1Volume( name="gcs-volume", persistent_volume_claim=V1PersistentVolumeClaimVolumeSource( claim_name="gcs-pvc-flyte"(claim-name) ) ) ], ), ) ) def use_persistent_volume(): time.sleep(6000) # Your logic to use the mounted volume print("Using the mounted volume at /mnt/gcs") @workflow def pvc_usando_workflow(): use_persistent_volume() suppose this is the task config I have I want to give claim_name while running the flyte workflow instead of hard coding as "gcs-pvc-flyte" how can i achieve this?