Tom Klein
12/02/2021, 2:20 PMPrefect
for the various benefits it could offer
i saw that there's support for "docker" and "kubernetes" tasks but since my DevOps knowledge is kind of limited i was wondering if (by any chance) there's some examples of that kind of usage laying around somewhere or if you could at least give your thoughts about whether what I'm thinking even makes sense?alex
12/02/2021, 2:25 PMStartContainer
task to run a container from a pre-built Docker image.Anna Geller
RunNamespacedJob
task and here are two examples of how it can be used: https://github.com/anna-geller/packaging-prefect-flows/tree/master/flows_task_libraryAnna Geller
Tom Klein
12/02/2021, 2:39 PMTom Klein
12/02/2021, 2:41 PMPrefect
but i'm fine with the build-process being handled by a CI/CD system unrelated to Docker and wired into our GitHub accountTom Klein
12/02/2021, 2:43 PMKevin Kho
Tom Klein
12/02/2021, 3:07 PMCodeFresh
) which i'm not really involved in, i.e. - our DevOps (manually) wire some github repo to be built on every commit, and automatically be pushed into ECR upon success
They then (manually) create (upon request from us) some K8s job (or long-running service, or whatever) based on said image (this is done once per job/service/etc. , as part of its initial setup)
and then when we "deploy" (using our deploy dashboard) - the latest image is taken from ECR and pushed to k8s using their DevOps magic
at which point is the "ahead of time" you're referring to, relative to this process?Kevin Kho
Kevin Kho
Tom Klein
12/02/2021, 3:10 PMgit clone
, docker build
,push to ECR
) that somehow "sends this" (this being the image path) somewhere that Prefect will know of, right?Tom Klein
12/02/2021, 3:12 PMKevin Kho
Tom Klein
12/02/2021, 3:13 PMKevin Kho
Tom Klein
12/02/2021, 3:15 PMTom Klein
12/02/2021, 3:20 PMKevin Kho
Tom Klein
12/02/2021, 3:30 PMTom Klein
12/02/2021, 3:33 PMAnna Geller
steps:
- run: pip install prefect
- run: prefect auth login --key $PREFECT_API_KEY
- run: export PREFECT__CLOUD__USE_LOCAL_SECRETS=false && prefect kv set YOUR_FLOW_ECR_IMAGE_URL "<http://XXXX.dkr.ecr.us-east-1.amazonaws.com/image_name:tag|XXXX.dkr.ecr.us-east-1.amazonaws.com/image_name:tag>"
Anna Geller
Tom Klein
12/02/2021, 6:08 PMTom Klein
12/02/2021, 6:10 PMAnna Geller
Tom Klein
12/02/2021, 6:13 PMwhich
things run, or when
or in what
order, but not where
or how
...Anna Geller
Tom Klein
12/02/2021, 6:18 PMTom Klein
12/02/2021, 6:48 PMservice-name
to its ECR image, so i guess we can talk to our DevOps to make it so we utilize the same mapping for Prefect...
and then we'll just need to know the name/type of the container we're interested in, and not the actual ECR pathKevin Kho