Docker
Prerequisites
To run Docker agents locally, you must have the Docker engine installed on your machine. More information can be found here.
Configuring your Docker agent
Docker agents are configured using a YML file:
# docker_agent.yml
agent:
type: docker
image: <base image>
server_url: # URL to the docker server
requirements: # path to requirements.txt, relative to this file
env:
<env var 1>: 'env var 1 value'The YML file has a single top-level key, agent. This key contains all the configurations needed for your agent. Specifically:
type: this will always bedockerfor Docker agentsimage: the base image for your custom, Prism Docker image. If this is not specified, then Prism defaults topython:3.10.8-slim-bullseye.server_url: URL to the Docker server. If this is not specified, then Prism defaults tounix://var/run/docker.sockrequirements: path to therequirements.txtfile. This path must be relative to the path of the agent YML file.env:{key,value}pairs representing environment variables to add to your Docker image
Example agent
For the remainder of this guide, let's assume that we have the following project.
And, let's assume that we defined our docker_agent.yml as follows:
Note the way we specified the requirements key. We can do this because docker_agent.yml and requirements.txt are in the same directory.
Creating your Docker agent
You can build your Docker agent using the command: prism agent apply -f <path to agent YML>:
This commands builds a custom Docker image. In the example above, this image is called etl-project-docker-agent:1.0.
Multiple prism agent apply calls will increment the tag associated with the custom Docker image. For example, if we were to call prism agent apply again, then Prism would re-build the Docker image and name it etl-project-docker-agent:1.1.
Running your Docker agent
There are two commands you can use to run your Docker agent.
More information on these commands can be found in the CLI section.
Last updated