Blake Stefansen
07/17/2023, 8:45 PMChristopher Boyd
07/17/2023, 9:11 PMChristopher Boyd
07/17/2023, 9:11 PMChristopher Boyd
07/17/2023, 9:12 PMKevin Grismore
07/17/2023, 10:55 PMprefect.yaml
? I've got mine like this under the work pool but I'm not seeing the requests on the job:
job_variables:
customizations:
- op: add
path: /spec/template/spec/containers/0/resources
value:
requests:
cpu: 0.25
memory: 300mi
limits:
cpu: 0.25
memory: 300mi
Kevin Grismore
07/17/2023, 11:08 PMChristopher Boyd
07/17/2023, 11:22 PMKevin Grismore
07/18/2023, 12:53 AMresources
key to the manifest in the work pool template like so:
"job_manifest": {
"kind": "Job",
"spec": {
"template": {
"spec": {
"containers": [
{
"env": "{{ env }}",
"args": "{{ command }}",
"name": "prefect-job",
"image": "{{ image }}",
--> "resources": "{{ resources }}",
"imagePullPolicy": "{{ image_pull_policy }}",
then add the resources values to my prefect.yaml
like so:
definitions:
work_pools:
central-cluster: ¢ral-cluster
name: central-cluster
work_queue_name: default
job_variables:
--> resources:
requests:
cpu: 250m
memory: 300Mi
limits:
cpu: 250m
memory: 300Mi
Christopher Boyd
07/18/2023, 12:47 PMChristopher Boyd
07/18/2023, 12:48 PMKevin Grismore
07/18/2023, 12:50 PMChristopher Boyd
07/18/2023, 12:50 PMKevin Grismore
07/18/2023, 12:53 PMChristopher Boyd
07/18/2023, 12:54 PMKevin Grismore
07/18/2023, 1:00 PMcustomizations
in my yaml file was the way to go was because that worked in the past on a k8s job infra block, and it's in the docs near references to infra overrides, but that doesn't appear to be supported with the k8s worker. Which makes sense since we can easily customize the job template ourselves, but it's one of the few things about going from the infra block to a k8s work pool that doesn't line up.Blake Stefansen
07/18/2023, 1:49 PMChristopher Boyd
07/18/2023, 2:03 PM/opt/prefect
by default, and path + entrypoint specify what is executed (which can be automatically populated through prefect deploy
2. THe mount should occur when the pod spins up, so it would just be an attached volume at that mount point instead of the underlying container one. Really, this is entirely your prerogative of where to mount it. E.g. if you want to extract to /mnt/abcd then just ensure /mnt/abcd
is already mounted before hand
3. A mount volume is kind of irrelevant - if you mount it to a mountpoint, it’s completely invisible and transparent to prefectChristopher Boyd
07/18/2023, 2:05 PM/opt/prefect
(which is the default path in the container) and you mount a volume on /opt/prefect/flows
, its entirely transparent by design with Linux that you just transitioned to a different fsChristopher Boyd
07/18/2023, 2:06 PM/opt/prefect
and mount your volume to something like /opt/prefect/attached
or however you want to naming convention it. Then your pull step happens to bring your code in (either to the local fs, or the attached one), and does the thing to extract, where the only requirement is to extract to the attached volume with enough space