<@ULVA73B9P> I have a self-hosted version of prefect server deployed with following docker-compose. ...
e

Emmanuel Rambeau

11 months ago
@Marvin I have a self-hosted version of prefect server deployed with following docker-compose. It worked with the image prefecthq/prefect:2-python3.10, but no more with the image prefecthq/prefect:3-latest version Now in the UI I have the following error : "Can't connect to Server API at http://0.0.0.0:4200. Check that it's accessible from your machine." I tried with localhost or 127.0.0.1 but the UI is no more accessible. How can I fix it ? Below is my docker-compose.yaml services: server: container_name: prefect-server image: prefecthq/prefect:3-latest restart: unless-stopped volumes: - ./server:/root/.prefect - /home/data/flows:/opt/prefect/flows entrypoint: ["prefect", "server", "start"] environment: - PREFECT_SERVER_API_HOST=127.0.0.1 - PREFECT_API_DATABASE_CONNECTION_URL=postgresql+asyncpg://postgres:postgres@db:5432/prefect ports: - 4200:4200 depends_on: - db worker: container_name: prefect-worker image: prefecthq/prefect:3-latest restart: unless-stopped entrypoint: ["/opt/prefect/entrypoint.sh", "prefect", "worker", "start", "--pool", "default"] environment: - PREFECT_API_URL=http://server:4200/api depends_on: - server db: container_name: prefect-database image: postgres:16-bookworm restart: unless-stopped environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres - POSTGRES_DB=prefect expose: - 5432 volumes: - ./postgres:/var/lib/postgresql/data
Hi <@ULVA73B9P>, I’ve been struggling for about 5 days now trying to run my Flows on K8 :cry: I f...
e

Eric Sales De Andrade

about 2 years ago
Hi @Marvin, I’ve been struggling for about 5 days now trying to run my Flows on K8 😢 I followed this guide to the point. AKS Workpool is showing green and working (I can see my pods start). Flows are working correctly locally but when running on the K8 worker, always fail with the same error
FileNotFoundError: [Errno 2] No such file or directory: '/opt/prefect/flows'
In my deployment YAML I’ve tried both options to build the docker file -
auto
and manually specifying it as below.
# Dockerfile
FROM prefecthq/prefect:2-python3.11
COPY requirements.txt .
RUN pip install -r requirements.txt --trusted-host <http://pypi.python.org|pypi.python.org> --no-cache-dir
ADD flows /opt/prefect/flows
I’ve also tried building the deployment using the CLI as well as Python methods
Deployment.build_from_flow
but to no avail. The docker build and push to ACR are successful. My
prefect.yaml
looks like this
# Welcome to your prefect.yaml file! You can use this file for storing and managing
# configuration for deploying your flows. We recommend committing this file to source
# control along with your flow code.

# Generic metadata about this project
name: prefect-example
prefect-version: 2.13.1

# build section allows you to manage and build docker images
build:
  - prefect_docker.deployments.steps.build_docker_image:
      id: build_image
      requires: prefect-docker>=0.3.1
      image_name: XYZ
      tag: latest
      dockerfile: auto
      platform: "linux/amd64"

# push section allows you to manage if and how this project is uploaded to remote locations
push:
  - prefect_docker.deployments.steps.push_docker_image:
      requires: prefect-docker>=0.3.1
      image_name: "{{ build_image.image_name }}"
      tag: "{{ build_image.tag }}"

# pull section allows you to provide instructions for cloning this project in remote locations
pull:
  - prefect.deployments.steps.set_working_directory:
      directory: /opt/prefect/flows

# the deployments section allows you to provide configuration for deploying flows
deployments:
  - name: airbyte_syncs
    version:
    tags: []
    description:
    entrypoint: flows/XYZ.py:XYZ
    parameters: {}
    work_pool:
      name: AKS Workpool
      work_queue_name:
      job_variables:
        image: "{{ build_image.image }}"
    schedule:
I’ve tried reading extensively through the forums, Slack, SO, Google, ChatGPT everything. But not sure why that path issue arises. Can anyone help? Thanks in advance thank you