diff --git a/deployment/helm/datamate/charts/database/templates/deployment.yaml b/deployment/helm/datamate/charts/database/templates/deployment.yaml index 4c2e6701..f7ce5b2c 100644 --- a/deployment/helm/datamate/charts/database/templates/deployment.yaml +++ b/deployment/helm/datamate/charts/database/templates/deployment.yaml @@ -32,6 +32,15 @@ spec: securityContext: {{- toYaml . | nindent 8 }} {{- end }} + {{- with .Values.initContainers }} + initContainers: + {{- $root := $ }} + {{- range . }} + {{- $defaultImage := dict "image" (include "database.image" $root) }} + {{- $containerConfig := merge (deepCopy .) $defaultImage }} + - {{ toYaml $containerConfig | nindent 10 | trim }} + {{- end }} + {{- end }} containers: - name: {{ .Chart.Name }} {{- with .Values.securityContext }} diff --git a/deployment/helm/datamate/charts/database/values.yaml b/deployment/helm/datamate/charts/database/values.yaml index b798c270..6bfcd3d9 100644 --- a/deployment/helm/datamate/charts/database/values.yaml +++ b/deployment/helm/datamate/charts/database/values.yaml @@ -106,3 +106,5 @@ nodeSelector: {} tolerations: [] affinity: {} + +initContainers: [] \ No newline at end of file diff --git a/deployment/helm/datamate/charts/frontend/templates/configmap.yaml b/deployment/helm/datamate/charts/frontend/templates/configmap.yaml deleted file mode 100644 index 09d33e9b..00000000 --- a/deployment/helm/datamate/charts/frontend/templates/configmap.yaml +++ /dev/null @@ -1,58 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: datamate-nginx-conf -data: - backend.conf: | - server { - listen 80; - server_name 0.0.0.0; - - access_log /var/log/datamate/frontend/access.log main; - error_log /var/log/datamate/frontend/error.log notice; - - client_max_body_size 1024M; - - add_header Set-Cookie "NEXT_LOCALE=zh"; - - location /api/ { - proxy_pass http://datamate-gateway:8080/api/; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } - - location /chat { - proxy_pass http://datamate-gateway:8080/chat; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - - proxy_intercept_errors on; - error_page 500 501 502 503 504 =200 @static_fallback; - } - - location /_next { - proxy_pass http://datamate-gateway:8080/_next; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } - - location /deer-flow-backend { - proxy_pass http://datamate-gateway:8080/deer-flow-backend; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } - - location @static_fallback { - root /opt/frontend; - try_files $uri $uri/ /index.html; - } - - location / { - root /opt/frontend; - try_files $uri $uri/ /index.html; - } - } \ No newline at end of file diff --git a/deployment/helm/datamate/charts/frontend/templates/deployment.yaml b/deployment/helm/datamate/charts/frontend/templates/deployment.yaml index 6ca81ab1..6f9ff351 100644 --- a/deployment/helm/datamate/charts/frontend/templates/deployment.yaml +++ b/deployment/helm/datamate/charts/frontend/templates/deployment.yaml @@ -14,7 +14,6 @@ spec: template: metadata: annotations: - checksum/nginx: {{ include (print .Template.BasePath "/configmap.yaml") . | sha256sum }} {{- with .Values.podAnnotations }} {{- toYaml . | nindent 8 }} {{- end }} diff --git a/deployment/helm/datamate/values.yaml b/deployment/helm/datamate/values.yaml index 852ad3a5..a3caa8dd 100644 --- a/deployment/helm/datamate/values.yaml +++ b/deployment/helm/datamate/values.yaml @@ -68,6 +68,19 @@ operatorVolume: &operatorVolume claimName: datamate-operator-pvc database: + initContainers: + - name: init-chown + imagePullPolicy: IfNotPresent + command: + - sh + - -c + - "chown -R 999:999 /var/log/datamate/database && chmod 750 /var/log/datamate/database" + securityContext: + runAsUser: 0 + volumeMounts: + - name: log-volume + mountPath: /var/log/datamate/database + subPath: database env: - name: POSTGRES_USER value: postgres diff --git a/runtime/ops/filter/img_similar_images_cleaner/process.py b/runtime/ops/filter/img_similar_images_cleaner/process.py index 1aaea841..a6869cfd 100644 --- a/runtime/ops/filter/img_similar_images_cleaner/process.py +++ b/runtime/ops/filter/img_similar_images_cleaner/process.py @@ -49,7 +49,6 @@ class ImgSimilarImagesCleaner(Filter): """去除相似图片的插件""" DEFAULT_SIMILAR_THRESHOLD = 0.8 # 默认相似度阈值 - DEFAULT_TASK_UUID = "uuid" # 默认任务UUID DEFAULT_ORB_RATIO = 0.8 # 默认特征点距离比率 DEFAULT_MIX_SIMILARITY = 0.75 # 默认相似度算法阈值 DEFAULT_IMG_RESIZE = 200 # 默认图片压缩尺寸 @@ -59,7 +58,7 @@ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.similar_threshold = kwargs.get("similarThreshold", self.DEFAULT_SIMILAR_THRESHOLD) # 默认相似度阈值为0.8 # task_uuid为标识该数据集的唯一标志 - self.task_uuid = kwargs.get("uuid", self.DEFAULT_TASK_UUID) + self.task_uuid = kwargs.get("uuid", "") self.orb_ratio = self.DEFAULT_ORB_RATIO # 特征点距离的比率,该数值为经验值 self.mix_similarity = self.DEFAULT_MIX_SIMILARITY # 选择相似度算法的阈值,该数值为经验值 self.img_resize = self.DEFAULT_IMG_RESIZE # 图片压缩尺寸 @@ -230,6 +229,7 @@ def execute(self, sample: Dict[str, Any]) -> Dict[str, Any]: self.read_file_first(sample) file_name = sample[self.filename_key] img_bytes = sample[self.data_key] + self.task_uuid = sample.get("instance_id") if not self.task_uuid else self.task_uuid data = bytes_to_numpy(img_bytes) if img_bytes else np.array([]) similar_images = self.filter_similar_images(data, file_name) # 若相似图片,sample[self.data_key]设为空