https://prefect.io logo
Title
y

YD

12/30/2022, 4:41 PM
Issues with deploying flows in Prefect 2.0 When running
prefect deployment build <file name>.py:r<flow name> -q local  --name <deployment name> --path ~/<deployment path> --skip-upload
in the
yaml
file, the
entrypoint:
uses a relative path, which does not work when running the deployment from the cloud dashboard. When I change it to a full path, it works, but I think that should not be the behavior, particularly since the
entrypoint
is below the
### DO NOT EDIT BELOW THIS LINE
b

Bianca Hoch

12/30/2022, 5:01 PM
Hi YD, what type of error are you getting when running the deployment from the UI? Is the flow and deployment stored on your local machine?
I'll also drop a few resources here that should be helpful if you're just getting start with deployments: • How does the “prefect deployment build” and “apply” CLI work and how can you customize it?Deployments are now simpler and declarativePrefect Deployments FAQ (PDF)Deployment Docs
y

YD

12/31/2022, 7:35 AM
I gave up on it for now… things that runs on laptop do not run on AWS instance with the same python version I get errors when creating the YAML on some flows that I did not get when running the same command on my laptop. I get errors like
task_future.wait()  # block until completion
AttributeError: 'bool' object has no attribute 'wait'
on code that runs on laptop. not clear why I think I will stay with Prefect 1.0 a little longer
Example for a command that work on laptop but produce error on AWS Ubuntu python 3.8.10
prefect deployment build ../weekly_git_models_update.py:run_git_models_update -q aws2 --tag AWS --name yquark_deployment --skip-upload
Error
Script at '../weekly_git_models_update.py' encountered an exception: AttributeError("module 'numpy' has no attribute 'typeDict'")
b

Bianca Hoch

01/03/2023, 11:00 PM
Would you be able to share a minimal reproducible example of your code? For the first error you mention (
AttributeError: 'bool' object has no attribute 'wait'
), are you calling wait() for a task's
PrefectFuture
to return a
State
? ie:
@flow 
def my_flow():
    future = add_one.submit(1) # return PrefectFuture
    state = future.wait() # return State
Example was pulled from here if you need more references.
For the second error, I'm not terribly familiar with that one. I did find this fairly recent stack overflow thread that may be related to what you are seeing, however.
The recommendation there is to change the version of numpy being used to an older one.
y

YD

01/05/2023, 5:06 AM
Hi… I need to do it over the weekend…
The issue is that it works fine on my laptop but not on the AWS EC2 Machine I will provide in the weekend, the exact setting of the AWS EC2
EC2 Ubuntu 20.04 LTS US-West region python 3.8.10 after starting the instance I install the following:
sudo apt update 
sudo apt upgrade
sudo apt full-upgrade
sudo apt-get update && sudo apt-get dist-upgrade
sudo apt install -y python3-pip python3 python3-setuptools build-essential libssl-dev libffi-dev python3-dev python3-venv libpq-dev
sudo apt-get install -y python3-sklearn
sudo apt-get install -y python3-sklearn-lib
sudo apt-get install python3-sklearn-doc
sudo apt install sqlite3 
sudo apt-get update -y
sudo reboot

pip3 install pip --upgrade
pip3 install prefect

-- installing postgres
sudo apt update
sudo apt install postgresql postgresql-contrib
sudo systemctl start postgresql.service

prefect cloud login --key ...
prefect cloud workspace set --workspace "..."
I tried recreating a new instance several times
the error I get is as if the
result
from
result = test_1.submit(True, True)
is not a typical object that should be returned from a task, but just the value, in the case the boolean value.
I hope I am not mixing my replays to the different issues 🙂
b

Bianca Hoch

01/09/2023, 5:46 PM
Hi YD! Sorry for the delay on getting back to you. I noticed that you posted recently about solving the numpy issue. I just wanted to post that here to help keep track of things: https://prefect-community.slack.com/archives/CL09KU1K7/p1673144993933119
Are you still running into the other issues that you mentioned here?