Dagster Instance การกำหนดค่า config ใน dagster.yaml

dagster 1 ก.ย. 2021

Overview

DagsterInstance คือตัวกำหนดค่าที่ Dagster ต้องการ โดยจะ config ทำใน dagster.yaml ตัวอย่างเช่น ตำแหน่งที่จะจัดเก็บ history การรันที่ผ่านมาและบันทึกที่เกี่ยวข้อง การสตรีม raw logs จากฟังก์ชันการคำนวณของ solid วิธีจัดเก็บ local artifacts ในเครื่องและวิธีเปิดใช้การ runs

Processes และ Services ทั้งหมดที่เกิดขึ้นใน Dagster ควรแชร์ไฟล์ config ไว้ใน instance เดียว เพื่อให้แต่ละส่วนสามารถแบ่งปันข้อมูลได้อย่างมีประสิทธิภาพ

** สำหรับการกำหนดค่าที่สำคัญบางอย่าง เช่น การ execution แบบขนาน จะถูกตั้งค่าแบบ per-pipeline-run มากกว่าบน instance ดู Pipeline Runs สำหรับการกำหนดค่า pipeline **

Default local behavior

เมื่อเริ่มใช้งาน Dagster process เช่น ใน Dagit หรือ Dagster CLI commands ตัว Dagster จะพยายามโหลด instance ถ้าได้กำหนด environment variable ที่ชื่อ DAGSTER_HOME ไว้ Dagster จะมองหา config file ที่ $DAGSTER_HOME/dagster.yaml ไฟล์นี้จะมีการกำหนดค่าแต่ละรายการที่ประกอบขึ้นเป็น instance

โดยปกติแล้ว ถ้าหากไม่มี dagster.yaml หรือไม่มีการระบุไฟล์ในนั้น Dagster จะเก็บข้อมูลตามด่านล่างนี้ใน local filesystem ตามนี้

$DAGSTER_HOME
├── dagster.yaml
├── history
│   ├── runs
│   │   ├── 00636713-98a9-461c-a9ac-d049407059cd.db
│   │   └── ...
│   └── runs.db
└── storage
    ├── 00636713-98a9-461c-a9ac-d049407059cd
    │   └── compute_logs
    │       ├── my_solid.compute.complete
    │       ├── my_solid.compute.err
    │       ├── my_solid.compute.out
    │       └── ...
    └── ...

runs.db และ {run_id}.db files คือ SQLite database files ที่จะเก็บข้อมูลเกี่ยวกับ pipeline runs และ per-run event logs ตามลำดับ ใน compute_logs directories (หนึ่งรายการต่อการทำงานของไปป์ไลน์) จะเก็บ stdout และ stderr logs จากการ execution ของ compute functions ของแต่ละ solid ใน pipeline

ถ้า DAGSTER_HOME ไม่ถูกกำหนดไว้ ตัว Dagster tools จะสร้าง instance ชั่วคราวขึ้นมาเพื่อใช้ทำงาน ในกรณีนี้ การจัดเก็บบันทึกการทำงาน (run) และ event log storages จะถูกเก็บอยู่ในหน่วยความจำแทนที่จะเก็บไว้ในดิสก์ และ filesystem storage จะถูกเก็บใน directory ชั่วคราว ซึ่งจะถูกลบออกเมื่อจบกระบวนการ การทำงานแบบนี้เหมาะกับการ test และเป็นค่า default เมื่อเรียกใช้ Python API เช่น execute_pipeline โดยตรง

Instance Configuration YAML

ในการปรับใช้ Dagster แบบ deployment โดยทั่วไปจะต้องการกำหนดค่าส่วนประกอบต่างๆ หลายค่าบน instance ตัวอย่างเช่น ต้องการใช้ Postgres instance เพื่อจัดเก็บการรันและบันทึก event logs ที่เกี่ยวข้อง และเพื่อสตรีมบันทึกการคำนวณไปยัง S3 bucket

ในการทำงานแบบนี้ ให้ระบุไฟล์ $DAGSTER_HOME/dagster.yaml Dagit และ Dagster tools ทั้งหมดจะค้นหาไฟล์นี้เมื่อเริ่มต้นการทำงาน ใน dagster.yaml file คุณสามารถกำหนดค่าต่างๆ ของ Dagster Instance ของคุณได้ ซึ่งทั้งหมดมีรายละเอียดด้านล่างนี้

Dagster รองรับการดึงค่าอินสแตนซ์ YAML จากตัวแปร environment variables โดยใช้คีย์ env: ตามด้วย ชื่อตัวแปลที่มี value ตามที่กำหนด

Run Storage

configures  นี้จะเป็นการกำหนดค่า history ของการ runs จะบอกว่า run อะไรไปบ้าง ซึ่งรวมถึงข้อมูล metadata ของสถานะการ run,  timestamps ที่เกี่ยวข้อง และข้อมูลที่เป็นประโยชน์อื่นๆ เพื่อตรวจสอบประวัติการ run

ในการกำหนดค่า Run Storage คุณควรตั้งค่าแอตทริบิวต์ run_storage ใน dagster.yaml ของคุณ มีสามตัวเลือกที่ใช้ได้ตามนี้:

SqliteRunStorage (Default)

SqliteRunStorage เป็นการใช้ Sqlite DB เป็นที่เก็บข้อมูล

# there are two ways to set run_storage to SqliteRunStorage

# this config manually sets the directory (`base_dir`) for Sqlite to store run information in:
run_storage:
  module: dagster.core.storage.runs
  class: SqliteRunStorage
  config:
    base_dir: /path/to/dir

# and this config grabs the directory from an environment variable
run_storage:
  module: dagster.core.storage.runs
  class: SqliteRunStorage
  config:
    base_dir:
      env: SQLITE_RUN_STORAGE_BASE_DIR

PostgresRunStorage

PostgresRunStorage เป็นการใช้ Postgres DB เป็นที่เก็บข้อมูล

# There are three ways to set run_storage to PostgresRunStorage

# this config manually sets the Postgres credentials
run_storage:
  module: dagster_postgres.run_storage
  class: PostgresRunStorage
  config:
    postgres_db:
      username: { DAGSTER_PG_USERNAME }
      password: { DAGSTER_PG_PASSWORD }
      hostname: { DAGSTER_PG_HOSTNAME }
      db_name: { DAGSTER_PG_DB }
      port: 5432

# and this config grabs the database credentials from environment variables
run_storage:
  module: dagster_postgres.run_storage
  class: PostgresRunStorage
  config:
    postgres_db:
      username:
        env: DAGSTER_PG_USERNAME
      password:
        env: DAGSTER_PG_PASSWORD
      hostname:
        env: DAGSTER_PG_HOST
      db_name:
        env: DAGSTER_PG_DB
      port: 5432

# and this config sets the credentials via DB connection string / url:
run_storage:
  module: dagster_postgres.run_storage
  class: PostgresRunStorage
  config:
    postgres_url: { PG_DB_CONN_STRING }

# This config gets the DB connection string / url via environment variables:
run_storage:
  module: dagster_postgres.run_storage
  class: PostgresRunStorage
  config:
    postgres_url:
      env: PG_DB_CONN_STRING

MySQLRunStorage

MySQLRunStorage เป็นการใช้ MySQL DB เป็นที่เก็บข้อมูล

# There are three ways to set run_storage to MySQLRunStorage

# this config manually sets the MySQL credentials
run_storage:
  module: dagster_mysql.run_storage
  class: MySQLRunStorage
  config:
  mysql_db:
    username: { DAGSTER_MYSQL_USERNAME }
    password: { DAGSTER_MYSQL_PASSWORD }
    hostname: { DAGSTER_MYSQL_HOSTNAME }
    db_name: { DAGSTER_MYSQL_DB }
    port: 3306


# and this config grabs the database credentials from environment variables
run_storage:
  module: dagster_mysql.run_storage
  class: MySQLRunStorage
  config:
    mysql_db:
      username:
        env: DAGSTER_MYSQL_USERNAME
      password:
        env: DAGSTER_MYSQL_PASSWORD
      hostname:
        env: DAGSTER_MYSQL_HOSTNAME
      db_name:
        env: DAGSTER_MYSQL_DB
      port: 3306

# and this config sets the credentials via DB connection string / url:
run_storage:
  module: dagster_mysql.run_storage
  class: MySQLRunStorage
  config:
    mysql_url: { MYSQL_DB_CONN_STRING }

# this config grabs the MySQL connection string from environment variables
run_storage:
  module: dagster_mysql.run_storage
  class: MySQLRunStorage
  config:
    mysql_url:
      env: MYSQL_DB_CONN_STRING

Event Log Storage

ส่วนนี้จะทำหน้าที่ควบคุมโครงสร้างของ event logs ที่เกิดขึ้นในการ run แต่ละครั้ง ซึ่งรวมถึงเหตุการณ์ที่เกี่ยวข้องกับ solids starting/running/completing, pipeline events, และ event ที่เกี่ยวกับข้อมูล

ในการกำหนดค่า Event Log Storage คุณควรตั้งค่าแอตทริบิวต์ event_log_storage ใน dagster.yaml ของคุณ มีสี่ตัวเลือกที่ใช้ได้:

SqliteEventLogStorage (Default)

SqliteEventLogStorage ใช้ฐานข้อมูล Sqlite เป็นที่เก็บข้อมูลสำหรับ event logs อย่างไรก็ตาม ในแต่ละครั้งของการ run ใช้ฐานข้อมูล Sqlite แยกต่างหาก (เช่น ไดเร็กทอรี) สำหรับการรันแต่ละครั้ง ที่เก็บข้อมูลคือ _run-sharded_ ซึ่งหมายความว่าคุณลักษณะที่มีประโยชน์บางอย่าง เช่น Assets page จะไม่สามารถใช้งานได้ เนื่องจาก Dagster ไม่สามารถดำเนินการสืบค้นข้ามการทำงานได้

โปรดทราบว่าเมื่อปล่อยแอตทริบิวต์ event_log_storage ว่างไว้ Run Storage จะถูกตั้งค่าเป็น Sqlite โดยค่าเริ่มต้น หากคุณต้องการระบุ event_log_storage ด้วยตนเอง ให้เพิ่มข้อมูลโค้ดต่อไปนี้ใน dagster.yaml ของคุณ:

# there are two ways to set `event_log_storage` to SqliteEventLogStorage

# the first manually sets the directory (`base_dir`) to write event log data to:
event_log_storage:
  module: dagster.core.storage.event_log
  class: SqliteEventLogStorage
  config:
    base_dir: /path/to/dir

# and the second grabs the directory from an environment variable
event_log_storage:
  module: dagster.core.storage.event_log
  class: SqliteEventLogStorage
  config:
    base_dir:
      env: SQLITE_EVENT_LOG_STORAGE_BASE_DIR

ConsolidatedSqliteEventLogStorage (Experimental)

ConsolidatedSqliteEventLogStorage มีขึ้นเพื่อเลียนแบบพฤติกรรมของการจัดเก็บบันทึกเหตุการณ์บน Postgres หรือ MySQL เนื่องจากไม่ใช่ _run sharded_ กล่าวคือ การรันทั้งหมดจะคงอยู่ใน Sqlite DB เดียวกัน ซึ่งช่วยให้สามารถสืบค้นข้ามการ run ได้ (& ดังนั้นจึงใช้คุณลักษณะ Dagster บางอย่าง เช่น Assets page)

# there are two ways to set `event_log_storage` to ConsolidatedSqliteEventLogStorage

# the first manually sets the directory (`base_dir`) to write event log data to:
event_log_storage:
  module: dagster.core.storage.event_log
  class: ConsolidatedSqliteEventLogStorage
  config:
    base_dir: /path/to/dir

# and the second grabs the directory from an environment variable
event_log_storage:
  module: dagster.core.storage.event_log
  class: ConsolidatedSqliteEventLogStorage
  config:
    base_dir:
      env: CONSOLIDATED_SQLITE_EVENT_LOG_STORAGE_BASE_DIR

PostgresEventLogStorage

PostgresEventLogStorage ใช้ฐานข้อมูล Postgres ในการจัดเก็บ Event Log Storage

# There are four ways to set event_log_storage to PostgresEventLogStorage

# this config manually sets the Postgres credentials
event_log_storage:
  module: dagster_postgres.event_log
  class: PostgresEventLogStorage
  config:
    postgres_db:
      username: { DAGSTER_PG_USERNAME }
      password: { DAGSTER_PG_PASSWORD }
      hostname: { DAGSTER_PG_HOSTNAME }
      db_name: { DAGSTER_PG_DB }
      port: 5432

# and this config grabs the database credentials from environment variables
event_log_storage:
  module: dagster_postgres.event_log
  class: PostgresEventLogStorage
  config:
    postgres_db:
      username:
        env: DAGSTER_PG_USERNAME
      password:
        env: DAGSTER_PG_PASSWORD
      hostname:
        env: DAGSTER_PG_HOST
      db_name:
        env: DAGSTER_PG_DB
      port: 5432

# and this config sets the credentials via DB connection string / url:
event_log_storage:
  module: dagster_postgres.event_log
  class: PostgresEventLogStorage
  config:
    postgres_url: { PG_DB_CONN_STRING }

# This config gets the DB connection string / url via environment variables:
event_log_storage:
  module: dagster_postgres.event_log
  class: PostgresEventLogStorage
  config:
    postgres_url:
      env: PG_DB_CONN_STRING

MySQLEventLogStorage

MySQLEventLogStorage ใช้ฐานข้อมูล MySQL ในการจัดเก็บ Event Log Storage

# There are four ways to set event_log_storage to MySQLRunStorage

# this config manually sets the MySQL credentials
event_log_storage:
  module: dagster_mysql.event_log
  class: MySQLEventLogStorage
  config:
  mysql_db:
    username: { DAGSTER_MYSQL_USERNAME }
    password: { DAGSTER_MYSQL_PASSWORD }
    hostname: { DAGSTER_MYSQL_HOSTNAME }
    db_name: { DAGSTER_MYSQL_DB }
    port: 3306


# and this config grabs the database credentials from environment variables
event_log_storage:
  module: dagster_mysql.event_log_storage
  class: MySQLEventLogStorage
  config:
    mysql_db:
      username:
        env: DAGSTER_MYSQL_USERNAME
      password:
        env: DAGSTER_MYSQL_PASSWORD
      hostname:
        env: DAGSTER_MYSQL_HOSTNAME
      db_name:
        env: DAGSTER_MYSQL_DB
      port: 3306

# and this config sets the credentials via DB connection string / url:
event_log_storage:
  module: dagster_mysql.event_log_storage
  class: MySQLEventLogStorage
  config:
    mysql_url: { MYSQL_DB_CONN_STRING }

# this config grabs the MySQL connection string from environment variables
event_log_storage:
  module: dagster_mysql.event_log_storage
  class: MySQLEventLogStorage
  config:
    mysql_url:
      env: MYSQL_DB_CONN_STRING

Schedule Storage

ตัวเลือกนี้ใช้เก็บข้อมูลเพื่อให้ scheduler ใช้จัดการ state ของ schedules (เช่น การติดตามการทำงานในคิว) และบันทึกข้อมูลที่เกี่ยวข้องกับการทำนของส่วนนี้

การกำหนดค่าของ Schedule Storage คุณควรตั้งค่า key schedule_storage ใน dagster.yaml ซึ่งมีสามตัวเลือกที่ใช้ได้:

SqliteScheduleStorage (Default)

SqliteScheduleStorage ใช้ Sqlite DB เป็นโซลูชันการจัดเก็บข้อมูล Schedule

# there are two ways to set `schedule_storage` to SqliteScheduleStorage

# the first manually sets the directory (`base_dir`) to write schedule-related data to:
schedule_storage:
  module: dagster.core.storage.schedules
  class: SqliteScheduleStorage
  config:
    base_dir: /path/to/dir

# the second grabs the directory from an environment variable
schedule_storage:
  module: dagster.core.storage.schedules
  class: SqliteScheduleStorage
  config:
    base_dir:
      env: SQLITE_SCHEDULE_STORAGE_DIRECTORY

PostgreScheduleStorage

PostgresScheduleStorage ใช้ Postgres DB เป็นโซลูชันการจัดเก็บข้อมูล Schedule

# There are three ways to set schedule_storage to PostgresScheduleStorage

# this config manually sets the Postgres credentials
schedule_storage:
  module: dagster_postgres.schedule_storage
  class: PostgresScheduleStorage
  config:
    postgres_db:
      username: { DAGSTER_PG_USERNAME }
      password: { DAGSTER_PG_PASSWORD }
      hostname: { DAGSTER_PG_HOSTNAME }
      db_name: { DAGSTER_PG_DB }
      port: 5432

# and this config grabs the database credentials from environment variables
schedule_storage:
  module: dagster_postgres.schedule_storage
  class: PostgresScheduleStorage
  config:
    postgres_db:
      username:
        env: DAGSTER_PG_USERNAME
      password:
        env: DAGSTER_PG_PASSWORD
      hostname:
        env: DAGSTER_PG_HOST
      db_name:
        env: DAGSTER_PG_DB
      port: 5432

# and this config sets the credentials via DB connection string / url:
schedule_storage:
  module: dagster_postgres.schedule_storage
  class: PostgresScheduleStorage
  config:
    postgres_url: { PG_DB_CONN_STRING }

# This config gets the DB connection string / url via environment variables:
schedule_storage:
  module: dagster_postgres.schedule_storage
  class: PostgresScheduleStorage
  config:
    postgres_url:
      env: PG_DB_CONN_STRING

MySQLScheduleStorage

MySQLScheduleStorage ใช้ MySQL DB เป็นโซลูชันการจัดเก็บข้อมูล Schedule

# There are three ways to set schedule_storage to MySQLScheduleStorage

# this config manually sets the MySQL credentials
schedule_storage:
  module: dagster_mysql.schedule_storage
  class: MySQLScheduleStorage
  config:
  mysql_db:
    username: { DAGSTER_MYSQL_USERNAME }
    password: { DAGSTER_MYSQL_PASSWORD }
    hostname: { DAGSTER_MYSQL_HOSTNAME }
    db_name: { DAGSTER_MYSQL_DB }
    port: 3306


# and this config grabs the database credentials from environment variables
schedule_storage:
  module: dagster_mysql.schedule_storage
  class: MySQLScheduleStorage
  config:
    mysql_db:
      username:
        env: DAGSTER_MYSQL_USERNAME
      password:
        env: DAGSTER_MYSQL_PASSWORD
      hostname:
        env: DAGSTER_MYSQL_HOSTNAME
      db_name:
        env: DAGSTER_MYSQL_DB
      port: 3306

# and this config sets the credentials via DB connection string / url:
schedule_storage:
  module: dagster_mysql.schedule_storage
  class: MySQLScheduleStorage
  config:
    mysql_url: { MYSQL_DB_CONN_STRING }

# this config grabs the MySQL connection string from environment variables
schedule_storage:
  module: dagster_mysql.schedule_storage
  class: MySQLScheduleStorage
  config:
    mysql_url:
      env: MYSQL_DB_CONN_STRING

Run Launcher

ส่วนนี้จะเป็นการกำหนดว่าจะ execute การ run ที่ไหน

มีสองตัวเลือกที่ Dagster จัดเตรียมให้สำหรับ Run Launcher; ผู้ใช้ยังสามารถเขียน custom run launchers เองได้ ตรวจสอบหน้า Run Launcher page สำหรับข้อมูลเพิ่มเติม

ในการกำหนดค่า Run Launcher ตั้งค่า run_launcher ใน dagster.yaml ด้วยวิธีใดวิธีหนึ่งต่อไปนี้

DefaultRunLauncher (Default)

DefaultRunLauncher จะเรียก new process ใน node เดียวกันกับตำแหน่ง pipeline โปรดดูที่ Run Launcher Docs สำหรับข้อมูลเพิ่มเติม

run_launcher:
  module: dagster.core.launcher
  class: DefaultRunLauncher

K8sRunLauncher

K8sRunLauncher จะจัดสรร Kubernetes Job ต่อการ run โปรดดูที่ Run Launcher Docs สำหรับข้อมูลเพิ่มเติม

# there are multiple ways to configure the K8sRunLauncher

# you can set the follow configuration values directly
run_launcher:
  module: dagster_k8s.launcher
  class: K8sRunLauncher
  config:
    service_account_name: pipeline_run_service_account
    job_image: my_project/dagster_image:latest
    instance_config_map: dagster-instance
    postgres_password_secret: dagster-postgresql-secret

# alternatively, you can grab any of these config values from environment variables:
run_launcher:
  module: dagster_k8s.launcher
  class: K8sRunLauncher
  config:
    service_account_name:
      env: PIPELINE_RUN_SERVICE_ACCOUNT
    job_image:
      env: DAGSTER_IMAGE_NAME
    instance_config_map:
      env: DAGSTER_INSTANCE_CONFIG_MAP
    postgres_password_secret:
      env: DAGSTER_POSTGRES_SECRET

Run Coordinator

ส่วนนี้จะเป็นการกำหนดนโยบายที่ใช้ในการกำหนดกฎการจัดลำดับความสำคัญและขีดจำกัดการทำงานพร้อมกัน โปรดดูที่ Run Coordinator Docs สำหรับข้อมูลเพิ่มเติมและความช่วยเหลือในการแก้ปัญหา

ในการกำหนดค่า Run Coordinator ให้กำหนดค่าคีย์ run_coodinator ใน dagster.yaml ของคุณ มีสองตัวเลือก:

DefaultRunCoordinator (Default)

DefaultRunCoordinator จะส่งการรันไปยังตัวเรียกใช้งานทันที (ไม่มีการรัน Queued)

ดูข้อมูลเพิ่มเติมใน Run Coordinator Docs

# Since DefaultRunCoordinator is the default option, omitting the `run_coordinator` key will also suffice,
# but if you would like to set it explicitly:
run_coordinator:
  module: dagster.core.run_coordinator
  class: DefaultRunCoordinator

QueuedRunCoordinator

QueuedRunCoordinator ช่วยให้คุณสามารถกำหนดขีดจำกัดจำนวนการรันที่สามารถดำเนินการได้ในครั้งเดียว สิ่งนี้จะส่งงานที่ต้อง run ไปยัง Dequeuer process (เช่น Scheduler / Daemon) ผ่าน run storage โปรดทราบว่าการดำเนินการนี้ต้องใช้ daemon process เพื่อเปิดใช้งานการทำงานจริง

ตัวเลือกนี้มีความเป็นไปได้หลายอย่างในการกำหนดค่า ซึ่งทำให้ทั้ง Scheduler และ Daemon สามารถจำกัดจำนวนการรันได้พร้อมกันทั้งหมด และขีดจำกัดที่กำหนดได้มากขึ้นตาม run tags - เช่น ในบริการคลาวด์อาจสามารถรองรับการทำงานพร้อมกันได้ 4 ตัวเท่านั้น ดังนั้นจึงต้องมีการควบคุมปริมาณ เพื่อหลีกเลี่ยงปัญหาที่อาจเกิดขึ้นได้

ดูรายละเอียดเพิ่มเติมได้ที่ Run Coordinator Docs

# There are a few ways to configure the QueuedRunCoordinator:

# this first option has concurrency limits set to default values
run_coordinator:
  module: dagster.core.run_coordinator
  class: QueuedRunCoordinator

# this second option manually specifies limits:
run_coordinator:
  module: dagster.core.run_coordinator
  class: QueuedRunCoordinator
  config:
    max_concurrent_runs: 25
    tag_concurrency_limits:
      - key: "database"
        value: "redshift"
        limit: 4
      - key: "dagster/backfill"
        limit: 10

# as always, some or all of these values can be obtained from environment variables:
run_coordinator:
  module: dagster.core.run_coordinator
  class: QueuedRunCoordinator
  config:
    max_concurrent_runs:
      env: DAGSTER_OVERALL_CONCURRENCY_LIMIT
    tag_concurrency_limits:
      - key: "database"
        value: "redshift"
        limit:
          env: DAGSTER_REDSHIFT_CONCURRENCY_LIMIT
      - key: "dagster/backfill"
        limit:
          env: DAGSTER_BACKFILL_CONCURRENCY_LIMIT

Compute Log Storage

Compute log storage จะทำหน้าที่ควบคุมการ capture และสถานะความคงอยู่ของ stdout & stderr text logs

ในการกำหนดค่า Compute Log Storage ให้ตั้งค่าคีย์ compute_logs ใน dagster.yaml ของคุณ

LocalComputeLogManager (Default)

LocalComputeLogManager จะทำหน้าที่เขียน stdout & stderr logs ไปยังดิสก์

# there are two ways to set the directory that the LocalComputeLogManager writes
# stdout & stderr logs to

# You could directly set the `base_dir` key
compute_logs:
  module: dagster.core.storage.local_compute_log_manager
  class: LocalComputeLogManager
  config:
    base_dir: /path/to/directory

# Alternatively, you could set the `base_dir` key to an environment variable
compute_logs:
  module: dagster.core.storage.local_compute_log_manager
  class: LocalComputeLogManager
  config:
    base_dir:
      env: LOCAL_COMPUTE_LOG_MANAGER_DIRECTORY

AzureBlobComputeLogManager

AzureBlobComputeLogManager จะทำหน้าที่เขียน stdout & stderr logs ไปยัง Azure Blob Storage

# there are multiple ways to configure the AzureBlobComputeLogManager

# you can set the necessary configuration values directly:
compute_logs:
  module: dagster_azure.blob.compute_log_manager
  class: AzureBlobComputeLogManager
  config:
    storage_account: mycorp-dagster
    container: compute-logs
    secret_key: foo
    local_dir: /tmp/bar
    prefix: dagster-test-

# alternatively, you can obtain any of these config values from environment variables
compute_logs:
  module: dagster_azure.blob.compute_log_manager
  class: AzureBlobComputeLogManager
  config:
    storage_account:
      env: MYCORP_DAGSTER_STORAGE_ACCOUNT_NAME
    container:
      env: CONTAINER_NAME
    secret_key:
      env: SECRET_KEY
    local_dir:
      env: LOCAL_DIR_PATH
    prefix:
      env: DAGSTER_COMPUTE_LOG_PREFIX

S3ComputeLogManager

S3ComputeLogManager จะทำหน้าที่เขียน stdout & stderr logs ไปยัง AWS S3

# there are multiple ways to configure the S3ComputeLogManager

# you can set the config values directly:
compute_logs:
  module: dagster_aws.s3.compute_log_manager
  class: S3ComputeLogManager
  config:
    bucket: "mycorp-dagster-compute-logs"
    prefix: "dagster-test-"

# or grab some or all of them from environment variables
compute_logs:
  module: dagster_aws.s3.compute_log_manager
  class: S3ComputeLogManager
  config:
    bucket:
      env: MYCORP_DAGSTER_COMPUTE_LOGS_BUCKET
    prefix:
      env: DAGSTER_COMPUTE_LOG_PREFIX

Local Artifact Storage

ใช้เพื่อกำหนดค่าการจัดเก็บข้อมูลสำหรับ artifacts ใดๆ ที่ต้องใช้ดิสก์ภายในเครื่อง เช่น schedules หรือเมื่อใช้ filesystem IO manager เพื่อจัดการตัวกลาง

โปรดทราบว่า pipeline มี artifacts ที่ต้องส่งผ่าน IO manager ซึ่งไม่ได้กำหนดค่าด้วยวิธีนี้ แต่มีการกำหนดค่าในระดับ pipeline แทน (เช่น ผ่าน IO Managers)

ในการกำหนดค่า Local Artifact Storage ให้ตั้งค่า local_artifact_storage ดังต่อไปนี้ใน dagster.yaml ของคุณ:

LocalArtifactStorage (Default)

LocalArtifactStorage เป็นเพียงทางเลือกเดียวสำหรับ Local Artifact Storage ส่วนนี้กำหนดค่าไดเร็กทอรีที่ใช้โดย default filesystem IO Manager เช่นเดียวกับทุก schedule ที่เกี่ยวกับ artifacts ที่ require จะใช้ local disk

# there are two possible ways to configure LocalArtifactStorage

# example local_artifact_storage setup pointing to /var/shared/dagster directory
local_artifact_storage:
  module: dagster.core.storage.root
  class: LocalArtifactStorage
  config:
    base_dir: "/path/to/dir"

# alternatively, `base_dir` can be set to an environment variable
local_artifact_storage:
  module: dagster.core.storage.root
  class: LocalArtifactStorage
  config:
    base_dir:
      env: DAGSTER_LOCAL_ARTIFACT_STORAGE_DIR

Telemetry

This allows opting in/out (set to true by default) of Dagster collecting anonymized usage statistics.

To configure Telemetry, set the telemetry key in your dagster.yaml.

For more information on how and why we use telemetry, please visit the Telemetry Docs.

# Allows opting out of Dagster collecting usage statistics.
telemetry:
  enabled: false

แท็ก

Onyx

Just a middle-aged programmer, Can do many things but not the most.