Skip to content

Commit a804b4e

Browse files
authored
Fix/clean (#298)
* 增加 VERSION 参数 * 修改cpu和memory默认值 * 增加空值处理 * 增加空值处理
1 parent 2138dc8 commit a804b4e

4 files changed

Lines changed: 17 additions & 9 deletions

File tree

deployment/docker/datamate/docker-compose.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ services:
55

66
datamate-backend:
77
container_name: datamate-backend
8-
image: ${REGISTRY:-}datamate-backend
8+
image: ${REGISTRY:-}datamate-backend:${VERSION:-latest}
99
restart: on-failure
1010
privileged: true
1111
environment:
@@ -23,7 +23,7 @@ services:
2323

2424
datamate-backend-python:
2525
container_name: datamate-backend-python
26-
image: ${REGISTRY:-}datamate-backend-python
26+
image: ${REGISTRY:-}datamate-backend-python:${VERSION:-latest}
2727
restart: on-failure
2828
privileged: true
2929
environment:
@@ -41,7 +41,7 @@ services:
4141

4242
datamate-gateway:
4343
container_name: datamate-gateway
44-
image: ${REGISTRY:-}datamate-gateway
44+
image: ${REGISTRY:-}datamate-gateway:${VERSION:-latest}
4545
restart: on-failure
4646
privileged: true
4747
ports:
@@ -53,7 +53,7 @@ services:
5353

5454
datamate-frontend:
5555
container_name: datamate-frontend
56-
image: ${REGISTRY:-}datamate-frontend
56+
image: ${REGISTRY:-}datamate-frontend:${VERSION:-latest}
5757
restart: on-failure
5858
ports:
5959
- "30000:3000"
@@ -66,7 +66,7 @@ services:
6666

6767
datamate-database:
6868
container_name: datamate-database
69-
image: ${REGISTRY:-}datamate-database
69+
image: ${REGISTRY:-}datamate-database:${VERSION:-latest}
7070
restart: on-failure
7171
environment:
7272
- POSTGRES_USER=postgres
@@ -80,7 +80,7 @@ services:
8080

8181
datamate-runtime:
8282
container_name: datamate-runtime
83-
image: ${REGISTRY:-}datamate-runtime
83+
image: ${REGISTRY:-}datamate-runtime:${VERSION:-latest}
8484
restart: on-failure
8585
environment:
8686
RAY_DEDUP_LOGS: "0"

runtime/ops/examples/test_operator/metadata.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ metrics:
2020
- name: '吞吐量'
2121
metric: '20 images/sec'
2222
runtime:
23-
memory: 10MB
24-
cpu: 1000m
23+
memory: 10485760
24+
cpu: 0.05
2525
gpu: 0.1
2626
npu: 0.1
2727
settings:
-12.5 KB
Binary file not shown.

runtime/python-executor/datamate/core/base_op.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,15 @@ def __call__(self, sample: Dict[str, Any], **kwargs):
205205
sample["execute_status"] = execute_status
206206
# 加载文件成功执行信息到数据库
207207
if self.is_last_op:
208-
self.save_file_and_db(sample)
208+
# 文件无内容会被过滤
209+
if sample[self.text_key] == "" and sample[self.data_key] == b"":
210+
task_info = TaskInfoPersistence()
211+
sample[self.filesize_key] = "0"
212+
sample[self.filetype_key] = ""
213+
task_info.update_task_result(sample)
214+
return sample
215+
else:
216+
self.save_file_and_db(sample)
209217
return sample
210218

211219
def execute(self, sample: Dict[str, Any]) -> Dict[str, Any]:

0 commit comments

Comments
 (0)