https://prefect.io logo
Title
d

David Bender

07/04/2022, 2:46 PM
Hey. Having an issue with a simple deployment- when I attempt to "deployment create" I encounter a ModuleNotFoundError for any local imports. Even though the flow runs successfully when executed locally. Is this a bug or a property of the DeploymentSpec that I need to work around?
โœ… 1
a

Anna Geller

07/04/2022, 2:52 PM
You need to package your dependencies It will get easier with the next release this week
d

David Bender

07/04/2022, 3:01 PM
Ah ok, thanks for the quick response! That's really helpful to know.
๐Ÿ™Œ 1
s

Samuel Hinton

07/06/2022, 2:38 AM
@Anna Geller does prefect 2 still use cloudpickle under the hood? Because v2 of cloudpickle has the
register_pickle_by_value
, and you can use that to tell cloudpickle that the entire module/package of your choice should be treated like a local function and included in the seriailsation
๐Ÿ™Œ 1
๐Ÿ‘€ 1
a

Anna Geller

07/06/2022, 11:44 AM
I don't to spoil to much but just watch the release 2.0b8 today - it's gonna support many serialization options
t

Thuy Tran

07/15/2022, 8:23 PM
I'm having the same problem - getting ModuleNotFoundError. But I'm confused about @Anna Geller comment to package the dependency. I'm running Prefect 2.0 on prem version. Am I supposed to add something like this to the Deployment:
packager=OrionPackager(serializer=ImportSerializer()),
If so that didn't work.
a

Anna Geller

07/17/2022, 11:08 AM
support for serializing modules is upcoming, but I'd recommend packaging it as part of your CI/CD instead (building Docker image, conda env or Python package as needed)
t

Thuy Tran

07/19/2022, 8:16 PM
@Anna Geller If we decide to use a Docker image, we would host it in our private registry. Are there attributes for specifying the credentials to access the docker registry in DockerFlowRunner?
a

Anna Geller

07/19/2022, 9:17 PM
no, the machine from which you create deployments would need to have the AWS CLI configured with an IAM user that has access to ECR if you experience any bugs in the process, feel free to open a GitHub issue
e

Ellie Redding

07/20/2022, 12:01 AM
@Anna Geller running into this also (and very new to Prefect, so apologies if Iโ€™m being obtuse). Iโ€™m trying to run a flow locally, with a local agent and server. Are you saying I have to build a docker image or python package in order to create/run a deployment locally? That seems like itโ€™ll really slow down the development process. Is there a workflow you recommend to smooth that out?
update: I was able to get this working by setting
PYTHONPATH
to include my working directory.
a

Anna Geller

07/20/2022, 1:26 AM
Thanks for the update