managing-astro-local-env について
Astro CLI でローカル Airflow 環境を管理するスキルです。環境の起動や停止、状態確認、ログ、コンテナ操作、トラブルシューティング、Airflow のアップグレードを扱います。
主な機能
- 01Airflow の起動、停止、再起動
- 02環境状態の確認
- 03コンポーネントログの表示
- 04コンテナへのアクセスと Airflow CLI の実行
- 05一般的な設定問題の調査
- 06Airflow バージョンの互換性テストと変更
活用シーン
- 01ローカル Airflow 環境の起動
- 02scheduler または webserver のログ確認
- 03DAG が表示されない問題の調査
- 04Airflow バージョンの互換性テスト
インストール
コマンドをコピーしてターミナルで実行します。
$
npx skills add https:/ / github.com/ necatiarslan/ airflow-vscode-extension --skill managing-astro-local-envインストール後、Claude Code で/managing-astro-local-envを入力して読み込まれたか確認します。
詳細
Astro のローカル環境
このスキルでは、Astro CLI を使用してローカルの Airflow 環境を管理できます。
注:これらは外部 CLI の操作です。VS Code 拡張機能内でランタイムを確認する場合は、拡張機能のツールを使用してください。
起動/停止/再起動
# Start local Airflow (webserver at http://localhost:8080)
astro dev start
# Stop containers (preserves data)
astro dev stop
# Kill and remove volumes (clean slate)
astro dev kill
# Restart all containers
astro dev restart
# Restart specific component
astro dev restart --scheduler
astro dev restart --webserver
デフォルトの認証情報:admin / admin
次を変更した後は再起動してください:requirements.txt、packages.txt、Dockerfile
ステータスを確認する
astro dev ps
ログを表示する
# All logs
astro dev logs
# Specific component
astro dev logs --scheduler
astro dev logs --webserver
# Follow in real-time
astro dev logs -f
コンテナーのシェルにアクセスする
# Bash into scheduler container
astro dev bash
# Run Airflow CLI commands
astro dev run airflow info
astro dev run airflow dags list
トラブルシューティング
| 問題 | 解決策 |
|---|---|
| ポート 8080 が使用中 | 他のコンテナーを停止するか、.astro/config.yaml を編集してください |
| コンテナーが起動しない | astro dev kill の後に astro dev start を実行してください |
| パッケージのインストールに失敗した | requirements.txt の構文を確認してください |
| DAG が表示されない | astro dev parse を実行して、インポートエラーがないか確認してください |
| ディスクの空き容量が不足している | docker system prune を実行してください |
環境をリセットする
astro dev kill
astro dev start
Airflow をアップグレードする
まず互換性をテストする
astro dev upgrade-test
バージョンを変更する
-
Dockerfile を編集します:
FROM quay.io/astronomer/astro-runtime:13.0.0 -
再起動します:
astro dev kill && astro dev start
関連スキル
- setting-up-astro-project
- authoring-dags
- testing-dags
コメント
Markdown 対応