Skip to content

Commit 2f7341d

Browse files
authored
refactor: Reorganize datamate-python (#34)
refactor: Reorganize datamate-python (previously label-studio-adapter) into a DDD style structure.
1 parent 0614157 commit 2f7341d

79 files changed

Lines changed: 1078 additions & 1578 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
services:
2+
3+
app:
4+
stdin_open: true
5+
tty: true
6+
image: heartexlabs/label-studio:latest
7+
restart: unless-stopped
8+
user: root
9+
expose:
10+
- "8000"
11+
ports:
12+
- "8000:8000"
13+
depends_on:
14+
- db
15+
environment:
16+
- DJANGO_DB=default
17+
- POSTGRE_NAME=postgres
18+
- POSTGRE_USER=postgres
19+
- POSTGRE_PASSWORD=
20+
- POSTGRE_PORT=5432
21+
- POSTGRE_HOST=db
22+
- LABEL_STUDIO_HOST=${LABEL_STUDIO_HOST:-}
23+
- LOCAL_FILES_SERVING_ENABLED=true
24+
- LOCAL_FILES_DOCUMENT_ROOT=/label-studio/local
25+
- USE_USERNAME_FOR_LOGIN=true
26+
- LABEL_STUDIO_USERNAME=admin@huawei.com
27+
- LABEL_STUDIO_PASSWORD=admin1234
28+
- LABEL_STUDIO_ENABLE_LEGACY_API_TOKEN=true
29+
- LABEL_STUDIO_USER_TOKEN=abc123abc123
30+
- LOG_LEVEL=INFO
31+
volumes:
32+
- label-studio-data:/label-studio/data:rw
33+
- dataset_volume:/label-studio/local:rw
34+
command: label-studio-uwsgi
35+
36+
db:
37+
image: pgautoupgrade/pgautoupgrade:13-alpine
38+
hostname: db
39+
restart: unless-stopped
40+
environment:
41+
- POSTGRES_HOST_AUTH_METHOD=trust
42+
- POSTGRES_USER=postgres
43+
volumes:
44+
- label-studio-db:/var/lib/postgresql/data
45+
46+
volumes:
47+
label-studio-data:
48+
label-studio-db:
49+
dataset_volume:
50+
name: datamate-dataset-volume

runtime/datamate-python/.env.example

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -66,37 +66,6 @@ MYSQL_USER=label_studio_user
6666
MYSQL_PASSWORD=user_password
6767
MYSQL_DATABASE=label_studio_adapter
6868

69-
# =========================
70-
# Label Studio 数据库配置 (PostgreSQL)
71-
# =========================
72-
# 仅在使用 docker-compose.label-studio.yml 启动 Label Studio 时需要配置
73-
POSTGRES_HOST=label-studio-db
74-
POSTGRES_PORT=5432
75-
POSTGRES_USER=labelstudio
76-
POSTGRES_PASSWORD=labelstudio@4321
77-
POSTGRES_DATABASE=labelstudio
78-
79-
# =========================
80-
# SQLite 数据库配置(兜底选项)
81-
# =========================
82-
# 优先级3:如果没有配置 MySQL/PostgreSQL,将使用 SQLite
83-
SQLITE_PATH=./data/labelstudio_adapter.db
84-
85-
# =========================
86-
# 可选:直接指定数据库 URL
87-
# =========================
88-
# 如果设置了此项,将覆盖上面的 MySQL/PostgreSQL/SQLite 配置
89-
# DATABASE_URL=postgresql+asyncpg://user:password@host:port/database
90-
91-
# =========================
92-
# 安全配置
93-
# =========================
94-
# 密钥(生产环境务必修改)
95-
SECRET_KEY=your-secret-key-change-this-in-production
96-
97-
# Token 过期时间(分钟)
98-
ACCESS_TOKEN_EXPIRE_MINUTES=30
99-
10069
# =========================
10170
# CORS 配置
10271
# =========================

runtime/datamate-python/app/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

runtime/datamate-python/app/api/__init__.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

runtime/datamate-python/app/api/project/__init__.py

Lines changed: 0 additions & 11 deletions
This file was deleted.

runtime/datamate-python/app/api/project/create.py

Lines changed: 0 additions & 130 deletions
This file was deleted.

runtime/datamate-python/app/api/project/delete.py

Lines changed: 0 additions & 106 deletions
This file was deleted.

0 commit comments

Comments
 (0)