https://prefect.io logo
Title
j

John Horn

02/22/2023, 11:40 PM
# prefect version
23:39:04.743 | DEBUG   | prefect.client - Connecting to API at <https://api.prefect.cloud/api/accounts/57e0246d-d752-4737-b29a-192e8f6eb886/workspaces/6d439078-f534-4a0a-89e0-9c4ced644d6a/>
Version:             2.5.0
API version:         0.8.2
Python version:      3.8.16
Git commit:          eac37918
Built:               Thu, Oct 6, 2022 12:41 PM
OS/Arch:             linux/aarch64
Profile:             default
Server type:         cloud
I am trying to create a deployment that calls a flow with a flow_run_name parameter. I am guessing that my prefect version needs to be updated however I don't know how to upgrade the prefect cloud version. My actual local prefect agent is using the latest 2.8.2 but I'm guessing it is prefect cloud that is stuck on 2.5.0 and I see no documentation on how to update that.
@flow(flow_run_name='testing123')
TypeError: flow() got an unexpected keyword argument 'flow_run_name'
n

Nate

02/23/2023, 1:06 AM
hi @John Horn
I am guessing that my prefect version needs to be updated
I'd guess the same! you should not have to update prefect cloud (in fact, that's not a thing you can do), just your local version of the
prefect
package. so in your local dev env / agent env you could do
pip install -U prefect
j

John Horn

02/23/2023, 1:40 AM
the weird thing is I am using a docker agent based on prefect 2.8.2, but when I run prefect version it returns me the cloud server version. Is there a way to get the version of the agent and not the version of the cloud server?
n

Nate

02/23/2023, 1:44 AM
hmm I'm not sure what you mean by
when I run prefect version it returns me the cloud server version
is the output you shared above what you get when you run
prefect version
in the environment where you're running your agent?
j

John Horn

02/23/2023, 2:06 AM
correct it is. what throws me off is
Built:               Thu, Oct 6, 2022 12:41 PM
OS/Arch:             linux/aarch64
Profile:             default
Server type:         cloud
I thought that was the version of the cloud but now I know better.
its weird because my docker image version is : prefect-orion:2.8.2
n

Nate

02/23/2023, 2:10 AM
hmm, are you using an infrastructure block to specify the image on your deployment?
j

John Horn

02/23/2023, 2:16 AM
I believe I am.
infrastructure=DockerContainer(
            image='prefect-orion:2.8.2',
that's why the prefect version return was really throwing me off. I even deleted all my docker images and rebuilt to make sure I didn't have a straggler getting in there
🤔 1
I tried messing with the image_pull_policy as well and tried IF_NOT_PRESENT as well as ALWAYS
n

Nate

02/23/2023, 2:22 AM
does your flow require special deps or could you try using
prefecthq/prefect:2.8.2-python3.{minor version}
for the
image
?
actually how are you running your agent? I think it is what needs to update its prefect version
j

John Horn

02/23/2023, 9:37 PM
I'm spinning up a container locally using docker compose. The base Dockerfile utilizes 2.8.2
FROM prefecthq/prefect:2.8.2-python3.8
Dockerfile:
FROM prefecthq/prefect:2.8.2-python3.8

RUN apt update && \
    apt install -y vim && \
    pip install psycopg2-binary s3fs && \
    pip install --upgrade httpcore==0.16.2 \
    pip install gcsfs==2022.11.0

WORKDIR /
COPY requirements.txt requirements.txt
RUN pip3 install -r requirements.txt
docker compose service yaml
services:
  # --------------------------------------#
  #             Docker Agent              #
  # --------------------------------------#
  prefect-agent:
    build: .
#    image: ${PREFECT_AGENT_IMAGE}
    command:
      - prefect
      - agent
      - start
      - -q
      - default
and the command to kick off the agents
docker-compose -f docker-compose.yaml up -d --force-recreate --no-deps --scale prefect-agent=10
I tried again wiping all images and rebuilding using the --no-cache option
and get the same response:
prefect version
21:39:48.043 | DEBUG   | prefect.client - Connecting to API at <https://api.prefect.cloud/api/accounts/57e0246d-d752-4737-b29a-192e8f6eb886/workspaces/6d439078-f534-4a0a-89e0-9c4ced644d6a/>
Version:             2.5.0
API version:         0.8.2
Python version:      3.8.16
Git commit:          eac37918
Built:               Thu, Oct 6, 2022 12:41 PM
OS/Arch:             linux/aarch64
Profile:             default
Server type:         cloud
not sure how this solved it but I changed the image to be:
prefecthq/prefect:2.8.1-python3.8