Jai Deo
08/04/2021, 10:41 AMKevin Kho
Jai Deo
08/04/2021, 2:12 PMJai Deo
08/04/2021, 2:12 PMKevin Kho
KubernetesRun
in the Flow? What image does that use? That one would need Python.Jai Deo
08/04/2021, 2:28 PMJai Deo
08/04/2021, 2:29 PMJai Deo
08/04/2021, 2:30 PMKevin Kho
Jai Deo
08/04/2021, 2:31 PMJai Deo
08/04/2021, 2:32 PMJai Deo
08/04/2021, 2:34 PMKevin Kho
KubernetesRun
like this ?
flow.run_config = KubernetesRun(image="prefecthq/prefect",env={"SOME_VAR": "value"})
Jai Deo
08/04/2021, 2:46 PMJai Deo
08/04/2021, 2:47 PMKevin Kho
Jai Deo
08/04/2021, 2:50 PMKevin Kho
Jai Deo
08/04/2021, 2:52 PMKevin Kho
job_template
for the Flow run or the one to spin up the agent?Jai Deo
08/04/2021, 2:56 PMJai Deo
08/04/2021, 2:57 PMKevin Kho
Jai Deo
08/04/2021, 3:09 PMKevin Kho
Jai Deo
08/04/2021, 3:13 PMJai Deo
08/04/2021, 3:13 PMJai Deo
08/04/2021, 3:14 PMJai Deo
08/04/2021, 3:14 PMKevin Kho
Jai Deo
08/04/2021, 3:17 PMJai Deo
08/04/2021, 3:17 PMJai Deo
08/04/2021, 3:18 PMKevin Kho
Jai Deo
08/04/2021, 3:22 PMJai Deo
08/04/2021, 3:22 PMKevin Kho
from prefect.run_configs import KubernetesRun
flow.run_config = KubernetesRun(env={"EXTRA_PIP_PACKAGES": "scikit-learn matplotlib"})
so you can install pandas this way. Will continue the explanation though.
====================================================
I think we’re confusing the container term here. I believe the Azure Blob Storage calls their storage unit a container. This container is a separate concept from the Docker container. So with this flow.storage = …
, you are taking a Flow and storing it as a blob inside the Azure Blob Storage Container. This has nothing to do with Docker.
So when I’m asking about where you store your containers, I meant to say the Docker images. In Azure, there is a service called Azure Container Registry where you build images and then push it up there. If you have something like:
flow.storage = Docker(registry_url="<my-registry.io>", image_name="my_flow")
This will build your Flow in a container and upload it to the registry specified. Then when you do KubernetesRun
, it will automatically grab that image that was built if you don’t specify any.
====================================================
So that Storage
in Azure, is separate from the container that will run the Flow. Prefect will pull the Flow from there, and then run it on top of the Docker container specified in the KubernetesRun
. So you can build a Docker image with all of your dependencies, upload it to Azure Container Registry, and then specify that in KubernetesRun
and your flow will run on top of that.Jai Deo
08/04/2021, 3:48 PMJai Deo
08/04/2021, 3:48 PMKevin Kho
EXTRA_PIP_PACKAGES
is not meant to be for production but is easier for development.Jai Deo
08/05/2021, 12:01 PMJai Deo
08/05/2021, 12:01 PM