Hey everyone, I have got the docker agent working...
# prefect-community
Hey everyone, I have got the docker agent working with GPU based on the instructions from @Kevin Kho. But how do I run a flow locally in the agent and not by spinning up a new docker agent? The problem with this is that the new docker agent being created by prefect when triggered by the flow is actually not having runtime as Nvidia and doesn't see the Nvidia drivers and devices which makes it run in CPU. So I would like to know if it is possible to run the flow in the docker agent itself with starting a new Docker agent for the Docker run? Thanks, Sen
Hey @Sen, a bit confused by the phrasing. Do you mean spinning up a docker container (rather than agent)? The Docker agent spins a container to run the flow in. If you want to run it inside the same container, I think you’d need a local agent in a docker container of that you create
@Kevin Kho yeah you are right.. I meant spinning up a docker container to run the flow.. The new docker container being brought up to run the flow can't access the GPU..
Copy code
# Starting the Prefect DockerAgent
    prefect_agent = DockerAgent(
        name="TranslationEvaluator Agent",
        labels=["On_Prem_TranslationEvaluator_Dockerized", f"IP:{HOST_IP}", "GPU"],

So instead of doing this in the container.. you mean to say I need to start a local agent.. is that right?
Yeah…Then you would have to use the Local Agent instead of Docker Agent because Docker Agent spins up a new container. So you can run the Local Agent inside a Docker container I guess and the flow will run in the container.
Yeah that’s right
and in the flow.. do I need to change my run_config and storage as well
RunConfig can’t use DockerRun anymore so you need LocalRun, but you should not need to change storage
👍 1