Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unable to create a deployment with null pull steps #17303

Open
masonmenges opened this issue Feb 27, 2025 · 5 comments
Open

Unable to create a deployment with null pull steps #17303

masonmenges opened this issue Feb 27, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@masonmenges
Copy link
Contributor

masonmenges commented Feb 27, 2025

Bug summary

Trying to create a deployment with null pull steps in a prefect yaml file results in a validation error, this doesn't seem to affect the build or push steps.

Error:

1 validation error for DeploymentUpdate
pull_steps.0
  Input should be a valid dictionary 
    For further information visit https://errors.pydantic.dev/2.10/v/dict_type

Version info

Version:             3.2.7
API version:         0.8.4
Python version:      3.12.4
Git commit:          d4d9001e
Built:               Fri, Feb 21, 2025 7:39 PM
OS/Arch:             darwin/arm64
Profile:             masonsandbox
Server type:         cloud
Pydantic version:    2.10.6
Integrations:
  prefect-dask:      0.3.2
  prefect-snowflake: 0.28.0
  prefect-slack:     0.3.0
  prefect-gcp:       0.6.2
  prefect-aws:       0.5.0
  prefect-gitlab:    0.3.1
  prefect-dbt:       0.6.4
  prefect-docker:    0.6.1
  prefect-sqlalchemy: 0.5.1
  prefect-shell:     0.3.1

Additional context

example yaml

build:
- prefect_docker.deployments.steps.build_docker_image:
    id: build_image
    requires: prefect-docker>=0.3.1
    image_name: IMAGENAME
    tag: TAG
    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: null
@masonmenges masonmenges added the bug Something isn't working label Feb 27, 2025
@zzstoatzz zzstoatzz changed the title Unable to create a deployment will null pull steps Unable to create a deployment with null pull steps Feb 27, 2025
@cicdw
Copy link
Member

cicdw commented Feb 27, 2025

Assuming you are trying to set no pull steps, you can avoid this by setting pull: {}; we can probably update the DeploymentUpdate schema to account for this also.

@masonmenges
Copy link
Contributor Author

I did actually try with an empty dictionary and ran into the same issue, I ran through a few different attempts to get the deployment to create, It only worked for me if I passed "something" into the pull steps even just a dummy validation step like this

pull:
- prefect.deployments.steps.run_shell_script:
      id: test
      script: ls
      stream_output: True

pull: null and pull: {} both triggered the same validation error for me.

@cicdw
Copy link
Member

cicdw commented Feb 27, 2025

oh sorry I meant pull: [] @masonmenges

@desertaxle
Copy link
Member

@masonmenges do you have any details on the use case to create a deployment with no pull steps? I would think that setting no pull steps on a deployment could cause issues down the line.

@masonmenges
Copy link
Contributor Author

It mostly comes up around users who are creating their own docker images with their flow code stored in it and setting their working directories on the image and/or users running a Process Worker, setting it a second time often causes issues with the entrypoints they have defined on their deployments.

They can do something like this in those contexts but it's ultimately redundant as they're already defined the working directory in the image or they're running the worker from the root directory they're executing their flows from already.

pull:
- prefect.deployments.steps.set_working_directory:
      directory: .

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants