Hi guys, I'm trying to run docker agent with local...
# prefect-cloud
p
Hi guys, I'm trying to run docker agent with local process. And error shows up as
ModuleNotFoundError: No module named 'prefect_airbyte
I did install prefect airbyte in my local machine (as global system). Did I miss anythings?
1
j
You will need to either bake the package into the image or specify it with with EXTRA_PIP_PACKAGES environment variable. See this section of the docs.
p
Thanks Jeff Hale for replying, I did list out the extra_pip_packages in process in json type (like the one in guideline for s3 aws) but it seems not working. Did I need to back the package to the docker agent image instead?
j
You shouldn’t need to. Can you share your deployment build command/code or your block, the stack trace, and your flow code?
p
Sure! So my object is to trigger airbyte connection (airbyte in local host). I use agent in a docker container to make sure it always listen to work queue from prefect cloud. Here is the command for t*he docker agent*: (docker-compose.yml)
Copy code
agent1:    
image: prefecthq/prefect:2.7.0-python3.10    
restart: always    
entrypoint: ["prefect", "agent", "start", "-q", "APP"]    
environment:     
- PREFECT_API_URL=<https://api.prefect.cloud/api/accounts/>...     
- PREFECT_API_KEY=${PREFECT_API_KEY}
 profiles: ["agent"]
and for the infras Process Block Environment:
Copy code
{
  "EXTRA_PIP_PACKAGES": "prefect-airbyte"
}
Deployment yaml file:
Copy code
name: local_airbyte_app_9h_22h
description: null
version: 5188ce9706e9d6a172b0eabef7c2592b
# The work queue that will handle this deployment's runs
work_queue_name: APP
tags: []
parameters: {}
schedule:
  cron: 20 9-22 * * *
  timezone: UTC
  day_or: true
infra_overrides: {}

###
### DO NOT EDIT BELOW THIS LINE
###
flow_name: local-9h-22h-main-flow
manifest_path: null
infrastructure:
  type: process
  env: 
EXTRA_PIP_PACKAGES:prefectairbyte==0.1.3
  labels: {}
  name: null
  command: null
  stream_output: true
  working_dir: null
  _block_document_id: acb72c21-cf69-498a-9f07-65aa3c57003b
  _block_document_name: local
  _is_anonymous: false
  block_type_slug: process
  _block_type_slug: process
storage:
  repository: <https://github.com/phucdee/>...
  reference: phucdee
  access_token: '**********'
  _block_document_id: 792c039a-7ac3-4b49-8643-b93f3e076ae5
  _block_document_name: github
  _is_anonymous: false
  block_type_slug: github
  _block_type_slug: github
path: ''
entrypoint: local_airbyte_app_9h_22h.py:local_9h_22h_main_flow
parameter_openapi_schema:
  title: Parameters
  type: object
  properties: {}
  required: null
  definitions: null