https://prefect.io logo
Title
l

lialzm

01/09/2023, 8:01 AM
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

Christopher Boyd

01/10/2023, 2:37 PM
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

lialzm

01/10/2023, 3:29 PM
@Christopher Boyd hi , I use code
deployment = Deployment.build_from_flow(
    flow=download,
    name="test",
    storage=ali,
    schedule=(CronSchedule(cron="0 16 * * *"))
)
deployment.apply()
c

Christopher Boyd

01/10/2023, 3:30 PM
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

lialzm

01/10/2023, 3:35 PM
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

Christopher Boyd

01/10/2023, 3:36 PM
can you share your steps?
Like a reproducible example of what you are doing?
l

lialzm

01/10/2023, 3:40 PM
step1 : test.py (this file path is /home)
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
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

Christopher Boyd

01/10/2023, 3:45 PM
It doesn’t look like you are specifying any sort of docker infrastructure in your deployment
l

lialzm

01/10/2023, 3:52 PM
prefect 2 can't use local agent in docker🥲 ? when I use prefect 1 is can work