Mattias Petter Johansson
09/12/2023, 2:25 PMMarvin
09/12/2023, 2:26 PMbash
docker build --tag <http://199214789681.dkr.ecr.eu-north-1.amazonaws.com/data-science:latest|199214789681.dkr.ecr.eu-north-1.amazonaws.com/data-science:latest> ./agent
Then, push this image to your ECR repository:
bash
docker push <http://199214789681.dkr.ecr.eu-north-1.amazonaws.com/data-science:latest|199214789681.dkr.ecr.eu-north-1.amazonaws.com/data-science:latest>
Finally, modify your Prefect deployment command to use the Docker image from your ECR repository. You'll need to specify the image in the --storage-block
argument:
bash
prefect deployment build \
./flows/coinapi-import-aggregated.py:import_coinapi_rates_aggregated \
--interval 1800 \
--timezone Europe/Stockholm \
-n coinapi-test-depl-3 \
--storage-block docker/199214789681.dkr.ecr.eu-north-1.amazonaws.com/data-science:latest \
--infra-block ecs-task/dynamic-ecs-task-3 \
--pool ecs-workpool \
--limit 1 \
--work-queue default \
--output prefect-test.yaml \
--apply
Remember to replace <http://199214789681.dkr.ecr.eu-north-1.amazonaws.com/data-science:latest|199214789681.dkr.ecr.eu-north-1.amazonaws.com/data-science:latest>
with the actual path to your Docker image in ECR.
And there you have it. I hope this helps. Or at least, I hope it doesn't make things worse.Mattias Petter Johansson
09/12/2023, 2:30 PMMarvin
09/12/2023, 2:31 PM--registry
argument instead of --storage-block
. Here's how you can do it:
bash
prefect deployment build \
./flows/coinapi-import-aggregated.py:import_coinapi_rates_aggregated \
--interval 1800 \
--timezone Europe/Stockholm \
-n coinapi-test-depl-3 \
--registry <http://199214789681.dkr.ecr.eu-north-1.amazonaws.com/data-science:latest|199214789681.dkr.ecr.eu-north-1.amazonaws.com/data-science:latest> \
--infra-block ecs-task/dynamic-ecs-task-3 \
--pool ecs-workpool \
--limit 1 \
--work-queue default \
--output prefect-test.yaml \
--apply
Remember to replace <http://199214789681.dkr.ecr.eu-north-1.amazonaws.com/data-science:latest|199214789681.dkr.ecr.eu-north-1.amazonaws.com/data-science:latest>
with the actual path to your Docker image in your registry.
I hope this brings you the joy you humans seem to derive from such things.