-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prefect.Deployment doesn't have a property pull_steps #9220
Comments
Hi @davzucky, thanks for the issue! What I'm hearing is that prior to running the prefect/src/prefect/cli/root.py Lines 505 to 520 in b6d0433
Can you explain more on why the prefect.yaml file pull step isn't sufficient to your use case? |
This issue is stale because it has been open 30 days with no activity. To keep this issue open remove stale label or comment. |
Hi @serinamarie
Hope this point help you to understand our current use case and how we arrive at using code for deployment. |
This issue is stale because it has been open 30 days with no activity. To keep this issue open remove stale label or comment. |
This is similar but slightly different, but I for one would love be able to modify |
Hitting this too, eg: param_s3: Deployment = Deployment.build_from_flow(
name="s3",
flow=flows.param_flow.param,
work_pool_name="kubes-pool",
pull_steps=[
{
"prefect_aws.deployments.steps.pull_from_s3": {
"requires": "prefect-aws>=0.3.0",
"bucket": bucket,
"folder": folder,
}
}
],
) Errors with
|
we need this too. our use case is slightly different, we deploy only one deployment, which is kind-of "template", and the rest of deployments are done by the users as copies of that template with schedule and input parameters modifications. So we need to be able to programmatically create/update pull steps thru the api |
We'd also like to add/change pull_steps programmatically. We're creating Prefect deployments through a Python script that hides complexity from our users. |
I think this is resolved by using the |
In my case, I'm building deployments programaticaly using I don't see how I could use @marcm-ml's suggestion of using |
You must provide the storage keyword in the RunnerDeployment.from_* methods. There are RemoteStorage (prefect.runner.storage.RemoteStorage) and Git Repository (prefect.runner.storage.GitRepository) classes available that implement the correct storage API the runner deployment expects. These storage classes implement the pull_steps and set them in the runner deployment |
Thanks @marcm-ml. But what I'm trying to accomplish is to run a shell script before the flow startup, using the |
Mh without too much context I can't suggest to much but maybe you can get away with implementing the Protocol in prefect.runner.storage via a custom class where you implement the methods of the protocol with the things you want it to do, e.g. executing a shell script. I hope this helps |
First check
Bug summary
The new deployment using Project was released with Prefect 2.10.x. This adds the ability not to have to pull flow definition from external storage like it was the case before.
However, to enable that, when we do deployment using code,
prefect.Deployment
doesn't have the propertypull_steps
that we could set.Reproduction
Prefect Deployment model does not have an argument. However, the function in the same module load_flow_from_flow_run is using this property.
This is working because this property exists on the ORM layer.
The call to client.create_deployment will need to be updated as well.
If you are happy with adding that, I will create a pull request
Error
I cannot set the property in the deployment object
Versions
Additional context
We need that because we control and run all our deployments using code.
The text was updated successfully, but these errors were encountered: