A zero-dependency Apollo configuration launcher for Python applications
Project description
Apollo Launcher
这是一个简单的 Python 工具,用于在应用启动前从 Apollo 配置中心拉取配置,并将其注入到环境变量中。
功能
- 从 Apollo 拉取配置 (支持命名空间)
- 将配置注入到环境变量
- 启动目标应用 (使用
execvp替换进程,保留 PID)
安装
pip install .
# 或者
pip install tec-do-apollo-env-launcher
使用方法
在启动命令前加上 apollo-launcher 即可:
# 假设原命令是 python app.py
apollo-launcher python app.py
或者使用 python -m 方式 (模块名为 apollo_launcher):
python -m apollo_launcher.main python app.py
环境变量配置
工具依赖以下环境变量:
APOLLO_URL: Apollo 配置中心地址 (必需)APOLLO_APP_ID: 应用 ID (必需)CLUSTER_NAME: 集群名称 (默认:default)APOLLO_NAMESPACE: 命名空间 (默认:application)
示例
export APOLLO_URL=http://apollo-dev.example.com
export APOLLO_APP_ID=my-service
export CLUSTER_NAME=dev
apollo-launcher uvicorn main:app --host 0.0.0.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tec_do_apollo_env_launcher-0.0.2.tar.gz.
File metadata
- Download URL: tec_do_apollo_env_launcher-0.0.2.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
240a77d77d8e5669fa1dbb8339904cb910ad4c48dfc2c18cd7e9461ae69f41cd
|
|
| MD5 |
f50dfde89a51a1b4aaebada0d1f260f4
|
|
| BLAKE2b-256 |
0e3743879d62d467909b335135fa245a8ddd78c4f98a4197e63f2b62442793dc
|
File details
Details for the file tec_do_apollo_env_launcher-0.0.2-py3-none-any.whl.
File metadata
- Download URL: tec_do_apollo_env_launcher-0.0.2-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d803ef903f988a39c07ab62a7d8ccf506d363ab7607f6c1dca6d838e47d06ce7
|
|
| MD5 |
682e0be83ce7aeb3832e8b01c3ae5620
|
|
| BLAKE2b-256 |
a6bdf639b86887870545a870bd31f34fe33271414b487c794061d14c70427016
|