Igor
09/14/2024, 5:56 PMMarvin
09/14/2024, 5:56 PMIgor
09/14/2024, 5:56 PMMarvin
09/14/2024, 5:56 PMjson
     "cpu_request": {
       "title": "CPU Request",
       "description": "The CPU allocation to request for this pod.",
       "default": "default",
       "type": "string"
     },
     "containers": [
       {
         "resources": {
           "requests": {
             "cpu": "{{ cpu_request }}"
           }
         }
       }
     ]Igor
09/14/2024, 5:58 PMMarvin
09/14/2024, 5:59 PMyaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: prefect-agent
spec:
  replicas: 1
  selector:
    matchLabels:
      app: prefect-agent
  template:
    metadata:
      labels:
        app: prefect-agent
    spec:
      containers:
      - name: prefect-agent
        image: prefecthq/prefect:3.0.2
        command: ["prefect", "agent", "start", "-q", "your-work-pool"]bash
# SSH into your dedicated machine and start the Prefect work pool
$ ssh user@dedicated-machine
$ prefect work-pool start -q your-work-poolIgor
09/14/2024, 6:03 PMMarvin
09/14/2024, 6:03 PMsh
     prefect deployment build my_flow.py:my_flow_function -n "My Deployment" -q "my-work-pool"
     prefect deployment apply my-flow-deployment.yamlpython
     from prefect import flow, task
     from prefect.deployments import Deployment
     from prefect.workers import WorkPool
     @task
     def my_task():
         print("Executing task in a specific work pool")
     @flow
     def my_flow():
         my_task()
     # Define and assign the deployment to a specific work pool
     deployment = Deployment.build_from_flow(
         flow=my_flow,
         name="my-deployment",
         work_queue_name="my-work-queue", # or work_pool_name="my-work-pool"
     )
     deployment.apply()Igor
09/14/2024, 6:04 PM