Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
2 changes: 2 additions & 0 deletions deployment/helm/datamate/charts/database/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,5 @@ nodeSelector: {}
tolerations: []

affinity: {}

initContainers: []
58 changes: 0 additions & 58 deletions deployment/helm/datamate/charts/frontend/templates/configmap.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ spec:
template:
metadata:
annotations:
checksum/nginx: {{ include (print .Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
13 changes: 13 additions & 0 deletions deployment/helm/datamate/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions runtime/ops/filter/img_similar_images_cleaner/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 # 默认图片压缩尺寸
Expand All @@ -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 # 图片压缩尺寸
Expand Down Expand Up @@ -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]设为空
Expand Down
Loading