Spaces:
Paused
Paused
:pencil: [Config] Rename app to api, and track envs.json in github workflows
Browse files- .github/workflows/sync_to_hf_space.yml +1 -1
- apis/data_proxy_api.py +2 -2
- configs/envs.json +2 -2
- configs/envs.py +1 -1
.github/workflows/sync_to_hf_space.yml
CHANGED
|
@@ -2,7 +2,7 @@ name: Sync to Hugging Face hub
|
|
| 2 |
on:
|
| 3 |
push:
|
| 4 |
paths:
|
| 5 |
-
- "configs/
|
| 6 |
- "Dockerfile"
|
| 7 |
- ".github/workflows/sync_to_hf_space.yml"
|
| 8 |
- "requirements.txt"
|
|
|
|
| 2 |
on:
|
| 3 |
push:
|
| 4 |
paths:
|
| 5 |
+
- "configs/envs.json"
|
| 6 |
- "Dockerfile"
|
| 7 |
- ".github/workflows/sync_to_hf_space.yml"
|
| 8 |
- "requirements.txt"
|
apis/data_proxy_api.py
CHANGED
|
@@ -9,7 +9,7 @@ from tclogger import logger
|
|
| 9 |
from typing import Optional
|
| 10 |
|
| 11 |
from apis.arg_parser import ArgParser
|
| 12 |
-
from configs.envs import
|
| 13 |
|
| 14 |
|
| 15 |
class DataProxyAPI:
|
|
@@ -78,7 +78,7 @@ class DataProxyAPI:
|
|
| 78 |
|
| 79 |
|
| 80 |
if __name__ == "__main__":
|
| 81 |
-
app_envs =
|
| 82 |
app = DataProxyAPI(app_envs).app
|
| 83 |
app_args = ArgParser(app_envs).args
|
| 84 |
if app_args.reload:
|
|
|
|
| 9 |
from typing import Optional
|
| 10 |
|
| 11 |
from apis.arg_parser import ArgParser
|
| 12 |
+
from configs.envs import DATA_PROXY_API_ENVS, CACHE_ROOT
|
| 13 |
|
| 14 |
|
| 15 |
class DataProxyAPI:
|
|
|
|
| 78 |
|
| 79 |
|
| 80 |
if __name__ == "__main__":
|
| 81 |
+
app_envs = DATA_PROXY_API_ENVS
|
| 82 |
app = DataProxyAPI(app_envs).app
|
| 83 |
app_args = ArgParser(app_envs).args
|
| 84 |
if app_args.reload:
|
configs/envs.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
-
"
|
| 3 |
-
"app_name": "Data Proxy
|
| 4 |
"host": "0.0.0.0",
|
| 5 |
"port": 22001,
|
| 6 |
"version": "0.1.1"
|
|
|
|
| 1 |
{
|
| 2 |
+
"data_proxy_api": {
|
| 3 |
+
"app_name": "Data Proxy API",
|
| 4 |
"host": "0.0.0.0",
|
| 5 |
"port": 22001,
|
| 6 |
"version": "0.1.1"
|
configs/envs.py
CHANGED
|
@@ -4,5 +4,5 @@ from tclogger import OSEnver
|
|
| 4 |
configs_root = Path(__file__).parents[1] / "configs"
|
| 5 |
envs_path = configs_root / "envs.json"
|
| 6 |
ENVS_ENVER = OSEnver(envs_path)
|
| 7 |
-
|
| 8 |
CACHE_ROOT = Path(__file__).parents[1] / ENVS_ENVER["cache_root"]
|
|
|
|
| 4 |
configs_root = Path(__file__).parents[1] / "configs"
|
| 5 |
envs_path = configs_root / "envs.json"
|
| 6 |
ENVS_ENVER = OSEnver(envs_path)
|
| 7 |
+
DATA_PROXY_API_ENVS = ENVS_ENVER["data_proxy_api"]
|
| 8 |
CACHE_ROOT = Path(__file__).parents[1] / ENVS_ENVER["cache_root"]
|