Ankit
01/27/2023, 2:07 PMprefect/src/prefect/agent.py
under get_infrastructure
overrides are added to an object called data but that's not used afterwards to update the infra instead infra_dict was used which was used to create data in the earlier steps. Can this be a reason of missing customizations I am trying to send via infra_overrides? Or am I looking at it incorrectly.Christopher Boyd
01/27/2023, 2:23 PMredsquare
01/27/2023, 2:24 PMinfra_overrides=dict()
customizations=[]
resourcesPatch = {
"op": "add",
"path": "/spec/template/spec/containers/0/resources",
"value": {
"requests": {
"cpu": cpu,
"memory": str(memory) + "Mi"
},
"limits": {
"cpu": cpu * 2,
"memory": str(memory * 2) + "Mi"
}
},
}
customizations.append(resourcesPatch)
infra_overrides['customizations'] = customizations
Ankit
01/27/2023, 2:25 PMcustomizations.append(resourcesPatch)
can I assume customizations
is a list?redsquare
01/27/2023, 2:25 PMAnkit
01/27/2023, 2:26 PMredsquare
01/27/2023, 2:26 PMAnkit
01/27/2023, 2:27 PMChristopher Boyd
01/27/2023, 2:28 PMAnkit
01/27/2023, 2:30 PM###
### A complete description of a Prefect Deployment for flow 'Test'
###
name: deployment_name
description: Flow in the location
version: 2ef3aa516556135c0d21e515dbeaa621
# The work queue that will handle this deployment's runs
work_queue_name: default
tags: []
parameters: {}
schedule: null
infra_overrides:
customizations:
- op: add
path: /spec/template/spec/resources
value:
limits:
memory: 2G
cpu: 8000m
requests:
memory: 1G
cpu: 4000m
###
### DO NOT EDIT BELOW THIS LINE
###
flow_name: Test Flow
manifest_path: null
infrastructure:
type: kubernetes-job
env:
EXTRA_PIP_PACKAGES: s3fs
labels: {}
name: null
command: null
image: {} #removed for sharing
namespace: jhub
service_account_name: null
image_pull_policy: Always
cluster_config: null
job:
apiVersion: batch/v1
kind: Job
metadata:
labels: {}
spec:
template:
spec:
parallelism: 1
completions: 1
restartPolicy: Never
containers:
- name: prefect-job
env: []
customizations: []
job_watch_timeout_seconds: 600
pod_watch_timeout_seconds: 600
stream_output: true
finished_job_ttl: 10
_block_document_id: a7b4912d-4b54-43f3-b675-8a996580214c
_block_document_name: kubejob-base
_is_anonymous: false
block_type_slug: kubernetes-job
_block_type_slug: kubernetes-job
storage: null
path: test
entrypoint: test/test.py:flow_function
parameter_openapi_schema:
title: Parameters
type: object
properties: {}
required: null
definitions: null
Christopher Boyd
01/27/2023, 4:20 PMAnkit
01/27/2023, 4:31 PMredsquare
01/27/2023, 4:49 PMChristopher Boyd
01/27/2023, 4:50 PMredsquare
01/27/2023, 4:53 PMChristopher Boyd
01/27/2023, 5:07 PMredsquare
01/27/2023, 5:23 PMAnkit
01/27/2023, 5:23 PMredsquare
01/27/2023, 5:24 PMAnkit
01/27/2023, 5:25 PMredsquare
01/27/2023, 5:27 PMChristopher Boyd
01/27/2023, 5:28 PM