Vlad S
05/02/2024, 11:44 PMVlad S
05/02/2024, 11:44 PMmyflow.deploy(
        name="myflow-docker",
        work_pool_name="mypool-docker",
        image=DeploymentImage(
            name="myflow-image",
            tag="latest"
        ),
        push=False,
        build=False, 
    )prefect deployment inspect 'myflow-flow/myflow-docker'Vlad S
05/03/2024, 3:21 PMVlad S
05/03/2024, 3:23 PMVlad S
05/07/2024, 2:56 PMNate
05/07/2024, 3:04 PMpathNate
05/07/2024, 3:05 PMNate
05/07/2024, 3:05 PMVlad S
05/07/2024, 3:18 PMNate
05/07/2024, 3:23 PMNate
05/07/2024, 3:25 PMNate
05/07/2024, 3:29 PMMarvin
05/07/2024, 3:29 PMfrom_sourceservepython
import time
from prefect import flow, task
from pydantic import BaseModel, Field
class Data(BaseModel):
    key: str
    value: dict = Field(default_factory=dict)
@task
def fetch_data_for_key(key: str) -> Data:
    """A task that simulates fetching data from some source"""
    return Data(key=key, value={"data": "some data"})
@task
def process_data(data: Data) -> Data:
    """A task that simulates processing data"""
    print(f"Processing {data!r} (I swear)")
    time.sleep(3)
    return data
@flow
def work_i_need_to_do_sometimes(keys: list[str]):
    """Work you might need to do ever so often"""
    
    raw_data_futures = fetch_data_for_key.map(keys)
    process_data.map(raw_data_futures)
if __name__ == "__main__":
    work_i_need_to_do_sometimes.serve(
        name="sporradic-deployment",
        parameters={"keys": ["foo", "bar", "baz"]},
    )serveNate
05/07/2024, 3:30 PMNate
05/07/2024, 3:31 PMNate
05/07/2024, 3:32 PMVlad S
05/07/2024, 3:33 PMNate
05/07/2024, 3:40 PMVlad S
05/07/2024, 3:43 PMNate
05/07/2024, 3:47 PMVlad S
05/07/2024, 3:47 PMNate
05/07/2024, 3:53 PMVlad S
05/07/2024, 9:15 PMNate
05/07/2024, 9:18 PMNate
05/07/2024, 9:19 PMimageVlad S
05/07/2024, 9:34 PMNate
05/07/2024, 9:35 PMimageVlad S
05/07/2024, 9:39 PMI rebuilt with a repo name, but that doesn't work either:job_variables:
#       image: '{{ build_image.image }}'
        image: local/t1:latestNate
05/07/2024, 9:40 PMVlad S
05/07/2024, 9:46 PMNate
05/07/2024, 10:02 PMNate
05/07/2024, 10:03 PM» docker build . -t works-fine:local -f Dockerfile.demo» prefect --no-prompt deploy -n test» prefect worker start --pool 'docker-work'
» prefect deployment run 'healthcheck/test'Vlad S
05/07/2024, 10:04 PMNate
05/07/2024, 10:04 PMlatestVlad S
05/07/2024, 10:10 PMVlad S
05/07/2024, 10:26 PMNate
05/07/2024, 10:27 PMVlad S
05/08/2024, 5:43 PMVlad S
05/08/2024, 5:44 PMVlad S
05/08/2024, 5:45 PMNate
05/08/2024, 6:06 PMservices:
  worker:
    image: prefecthq/prefect:2-python3.12
    restart: always
    command:
      [
        "prefect",
        "worker",
        "start",
        "--pool",
        "docker-work",
        "--install-policy",
        "if-not-present"
      ]
    env_file:
      - ../../.env
    ports:
      - "8081:8081" # if you want healthchecks, otherwise not necessary
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - DOCKER_HOST=unix:///var/run/docker.sockNate
05/08/2024, 6:07 PMvolumes:
      - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - DOCKER_HOST=unix:///var/run/docker.sockVlad S
05/08/2024, 6:19 PMVlad S
05/09/2024, 4:02 PMVlad S
05/09/2024, 6:54 PMbenorbital
05/18/2024, 7:21 AM