关于 managing-astro-local-env
这项技能通过 Astro CLI 管理本地 Airflow 环境,涵盖环境启停、状态检查、日志、容器访问、故障排查和 Airflow 升级。
主要功能
- 01启动、停止和重启 Airflow
- 02检查环境状态
- 03查看组件日志
- 04访问容器并运行 Airflow CLI
- 05排查常见配置问题
- 06测试并更改 Airflow 版本
适用场景
- 01启动本地 Airflow 环境
- 02检查 scheduler 或 webserver 日志
- 03排查 DAG 未显示的问题
- 04测试 Airflow 版本兼容性
安装
复制下面的命令,在终端中运行。
$
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
访问容器 Shell
# 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