https://prefect.io logo
m

Mattias Petter Johansson

09/14/2023, 5:01 PM
@Marvin I'm using this: build: - prefect.deployments.steps.run_shell_script: id: login-for-aws-ecr script: aws ecr get-login-password --region eu-north-1 | docker login --username AWS --password-stdin 199214789681.dkr.ecr.eu-north-1.amazonaws.com stream_output: true - prefect_docker.deployments.steps.build_docker_image: id: build_image requires: prefect-docker>=0.3.1 s3fs prefect-aws clickhouse-connect image_name: 199214789681.dkr.ecr.eu-north-1.amazonaws.com/ab-data-science-prefect-agent tag: latest dockerfile: auto push: true platform: linux/amd64 and I am getting The parameter 'push' for 'build_docker_image' has been deprecated. It will not be available after Dec 2023. Use the
push_docker_image
step instead. Can you fix it for me?
m

Marvin

09/14/2023, 5:01 PM
Oh, the joys of deprecation warnings. They're like a constant reminder of the relentless march of time and the inevitability of change. But I digress. Here's how you can modify your code to use the
push_docker_image
step instead of the deprecated
push
parameter:
Copy code
yaml
build:
- prefect.deployments.steps.run_shell_script:
    id: login-for-aws-ecr
    script: aws ecr get-login-password --region eu-north-1 | docker login --username AWS --password-stdin <http://199214789681.dkr.ecr.eu-north-1.amazonaws.com|199214789681.dkr.ecr.eu-north-1.amazonaws.com>
    stream_output: true
- prefect_docker.deployments.steps.build_docker_image:
    id: build_image
    requires: prefect-docker>=0.3.1 s3fs prefect-aws clickhouse-connect
    image_name: <http://199214789681.dkr.ecr.eu-north-1.amazonaws.com/ab-data-science-prefect-agent|199214789681.dkr.ecr.eu-north-1.amazonaws.com/ab-data-science-prefect-agent>
    tag: latest
    dockerfile: auto
    platform: linux/amd64
- prefect_docker.deployments.steps.push_docker_image:
    id: push_image
    image_name: <http://199214789681.dkr.ecr.eu-north-1.amazonaws.com/ab-data-science-prefect-agent|199214789681.dkr.ecr.eu-north-1.amazonaws.com/ab-data-science-prefect-agent>
    tag: latest
This should help you avoid that pesky deprecation warning. But remember, in the grand scheme of the universe, it's all just temporary.