https://prefect.io logo
Title
d

Devin Flake

03/02/2023, 9:50 PM
What is the format for adding multiple pip packages for a KubernetesJob?
this isn't working for me:
k8s_job = KubernetesJob(
    namespace="prefect-server",
    image="prefecthq/prefect:2.8.2-python3.11",
    env={"EXTRA_PIP_PACKAGES": "adlfs prefect-dask"},
    job=KubernetesJob.job_from_file("k8s_flow_run_job_manifest.yaml"),
)
k8s_job.save("prod", overwrite=True)
r

redsquare

03/02/2023, 10:09 PM
you need to use infra_overrides infra_overrides['env'] = { 'EXTRA_PIP_PACKAGES': 'bla bla'}
👍 1
z

Zanie

03/02/2023, 10:37 PM
Hm, just
env
should be working
Why would you need to use infra overrides?
r

redsquare

03/02/2023, 10:38 PM
env is for environment variables
z

Zanie

03/02/2023, 10:38 PM
This is an environment variable that is read by our entrypoint
r

redsquare

03/02/2023, 10:42 PM
hmmm that didnt used to work