I use the code to register the deployment, but whe...
# ask-community
l
I use the code to register the deployment, but when I modify the name, the re-registration does not take effect, what do I need to do in Perfect 2.0, and I use the -f parameter in Perfect 1.0
🙃can help me?
c
Hi @lialzm - what is the command that you are using? “registering” the deployment in Prefect 2 is analogous to applying it - Step 1 is building:
prefect deployment build ./healthcheck.py:healthcheck -n <deployment name>
Step 2 is applying it (can be done with --apply too):
prefect deployment apply <output file from above>
l
@Christopher Boyd hi , I use code
Copy code
deployment = Deployment.build_from_flow(
    flow=download,
    name="test",
    storage=ali,
    schedule=(CronSchedule(cron="0 16 * * *"))
)
deployment.apply()
c
and you’re saying when you execute this, it does not update the deployment name?
do you have an example, or can you show what does happen?
l
I run the deployment locally for the first time, and then I deploy to the container to re-run the deployment. I find that the deployment has not changed, the update time has not changed, and the changes after the first deployment have not taken effect
c
can you share your steps?
Like a reproducible example of what you are doing?
l
step1 : test.py (this file path is /home)
Copy code
deployment = Deployment.build_from_flow(
    flow=download,
    name="test",
    storage=ali,
    schedule=(CronSchedule(cron="0 16 * * *"))
)
deployment.apply()
try command
python test.py
to check flow setp2: use docker to deploy
Copy code
WORKDIR /code
COPY . /code
CMD python test.py && prefect agent start --work-queue "default"
setp3: run flow by prefect cloud have a error like flow could not in /home
c
It doesn’t look like you are specifying any sort of docker infrastructure in your deployment
l
prefect 2 can't use local agent in docker🥲 ? when I use prefect 1 is can work