Managing Astro Deployments

作者 astronomercbe1141f547b無授權條款451 個星標收錄於 2026年10月8日更新於 2026年10月8日儲存庫今天更新

Manage Astronomer production deployments with Astro CLI. Use when the user wants to authenticate, switch workspaces, create/update/delete deployments, or deploy code to production.

僅含說明DevOps & Cloud
AI 產生的概覽

指導使用 Astro CLI 進行身分驗證、管理工作區,以及建立、更新、刪除和部署 Astronomer 正式環境部署。

功能
此技能提供透過 Astro CLI 操作 Astronomer 正式環境部署的說明與命令範例。內容涵蓋身分驗證、列出與切換工作區、列出與檢查部署、建立、更新與刪除部署、部署程式碼(完整部署、僅 DAG、僅映像、強制部署),以及管理部署 API 權杖。也包含常見工作流程,例如首次正式環境部署、迭代式 DAG 開發,以及將程式碼從預備環境推廣到正式環境。
適用情境
當使用者想要登入 Astronomer、切換工作區、建立、更新或刪除部署,或將程式碼推送到 Astronomer 正式環境部署時使用。它也適用於管理部署 API 權杖,以及執行從預備到正式環境的推廣流程。
執行需求
需要安裝並完成身分驗證的 Astro CLI(astro login,瀏覽器式 OAuth);需要連線至 Astronomer 的網路存取。不隨附指令碼,僅為說明文件。

Astro Deployment Management

This skill helps you manage production Astronomer deployments using the Astro CLI.

For local development, see the managing-astro-local-env skill. For production troubleshooting, see the troubleshooting-astro-deployments skill.


Authentication

All deployment operations require authentication:

bash
# Login to Astronomer (opens browser for OAuth)astro login

Authentication tokens are stored locally for subsequent commands. Run this before any deployment operations.


Workspace Management

Deployments are organized into workspaces:

bash
# List all accessible workspacesastro workspace list
# Switch to a specific workspaceastro workspace switch <WORKSPACE_ID>

Workspace context is maintained between sessions. Most deployment commands operate within the current workspace context.


List and Inspect Deployments

bash
# List deployments in current workspaceastro deployment list
# List deployments across all workspacesastro deployment list --all
# Inspect specific deployment (detailed info)astro deployment inspect <DEPLOYMENT_ID>
# Inspect by name (alternative to ID)astro deployment inspect --deployment-name data-service-stg

What inspect Shows

  • Deployment status (HEALTHY, UNHEALTHY)
  • Runtime version and Airflow version
  • Executor type (CELERY, KUBERNETES, LOCAL)
  • Scheduler configuration (size, count)
  • Worker queue settings (min/max workers, concurrency, worker type)
  • Resource quotas (CPU, memory)
  • Environment variables
  • Last deployment timestamp and current tag
  • Webserver and API URLs
  • High availability status

Create Deployments

bash
# Create with default settingsastro deployment create
# Create with specific executorastro deployment create --label production --executor celeryastro deployment create --label staging --executor kubernetes
# Executor options:#   - celery: Best for most production workloads#   - kubernetes: Best for dynamic scaling, isolated tasks#   - local: Best for development only

Update Deployments

bash
# Enable DAG-only deploys (faster iteration)astro deployment update <DEPLOYMENT_ID> --dag-deploy-enabled
# Update other settings (use --help for full options)astro deployment update <DEPLOYMENT_ID> --help

Delete Deployments

bash
# Delete a deployment (requires confirmation)astro deployment delete <DEPLOYMENT_ID>

Destructive: This cannot be undone. All DAGs, task history, and metadata will be lost.


Deploy Code to Production

Full Deploy

Deploy both DAGs and Docker image (required when dependencies change):

bash
astro deploy <DEPLOYMENT_ID>

Use when:

  • Dependencies changed (requirements.txt, packages.txt, Dockerfile)
  • First deployment of new project
  • Significant infrastructure changes

DAG-Only Deploy (Recommended for Iteration)

Deploy only DAG files, skip Docker image rebuild:

bash
astro deploy <DEPLOYMENT_ID> --dags

Use when:

  • Only DAG files changed (Python files in dags/ directory)
  • Quick iteration during development
  • Much faster than full deploy (seconds vs minutes)

Requires: --dag-deploy-enabled flag set on deployment (see Update Deployments)

Image-Only Deploy

Deploy only Docker image, skip DAG sync:

bash
astro deploy <DEPLOYMENT_ID> --image-only

Use when:

  • Only dependencies changed
  • Dockerfile or requirements updated
  • No DAG changes

Force Deploy

Bypass safety checks and deploy:

bash
astro deploy <DEPLOYMENT_ID> --force

Caution: Skips validation that could prevent broken deployments.


Deployment API Tokens

Manage API tokens for programmatic access to deployments:

bash
# List tokens for a deploymentastro deployment token list --deployment-id <DEPLOYMENT_ID>
# Create a new tokenastro deployment token create \  --deployment-id <DEPLOYMENT_ID> \  --name "CI/CD Pipeline" \  --role DEPLOYMENT_ADMIN
# Create token with expirationastro deployment token create \  --deployment-id <DEPLOYMENT_ID> \  --name "Temporary Access" \  --role DEPLOYMENT_ADMIN \  --expiry 30  # Days until expiration (0 = never expires)

Roles:

  • DEPLOYMENT_ADMIN: Full access to deployment

Note: Token value is only shown at creation time. Store it securely.


Common Workflows

First-Time Production Deployment

bash
# 1. Loginastro login
# 2. Switch to production workspaceastro workspace listastro workspace switch <PROD_WORKSPACE_ID>
# 3. Create deploymentastro deployment create --label production --executor celery
# 4. Note the deployment ID, then deployastro deploy <DEPLOYMENT_ID>

Iterative DAG Development

bash
# 1. Enable fast deploys (one-time setup)astro deployment update <DEPLOYMENT_ID> --dag-deploy-enabled
# 2. Make DAG changes locally
# 3. Deploy quicklyastro deploy <DEPLOYMENT_ID> --dags

Promoting Code from Staging to Production

bash
# 1. Deploy to staging firstastro workspace switch <STAGING_WORKSPACE_ID>astro deploy <STAGING_DEPLOYMENT_ID>
# 2. Test in staging
# 3. Deploy same code to productionastro workspace switch <PROD_WORKSPACE_ID>astro deploy <PROD_DEPLOYMENT_ID>

Configuration Management

bash
# View CLI configurationastro config get
# Set configuration valueastro config set <KEY> <VALUE>
# Check CLI versionastro version
# Upgrade CLI to latest versionastro upgrade

Tips

  • Use --dags flag for fast iteration (seconds vs minutes)
  • Always test in staging workspace before production
  • Use deployment inspect to verify deployment health before deploying
  • Deployment IDs are permanent, names can change
  • Most commands work with deployment ID; inspect also accepts --deployment-name
  • Set --dag-deploy-enabled once per deployment for fast deploys
  • Keep workspace context visible with astro workspace list (shows asterisk for current)

Related Skills

  • troubleshooting-astro-deployments: Investigate deployment issues, view logs, manage environment variables
  • managing-astro-local-env: Manage local Airflow development environment
  • setting-up-astro-project: Initialize and configure Astro projects

來源與署名

來源:astronomer/agents位於skills/managing-astro-deployments提交cbe1141

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架