You've already forked DataMate
2
Makefile
2
Makefile
@@ -209,7 +209,7 @@ endif
|
|||||||
.PHONY: uninstall
|
.PHONY: uninstall
|
||||||
uninstall:
|
uninstall:
|
||||||
ifeq ($(origin INSTALLER), undefined)
|
ifeq ($(origin INSTALLER), undefined)
|
||||||
$(call prompt-uninstaller,milvus-$$INSTALLER-uninstall label-studio-$$INSTALLER-uninstall datamate-$$INSTALLER-uninstall)
|
$(call prompt-uninstaller,milvus-$$INSTALLER-uninstall datamate-$$INSTALLER-uninstall)
|
||||||
else
|
else
|
||||||
@echo "Delete volumes? (This will remove all data)"; \
|
@echo "Delete volumes? (This will remove all data)"; \
|
||||||
echo "1. Yes - Delete volumes"; \
|
echo "1. Yes - Delete volumes"; \
|
||||||
|
|||||||
@@ -248,4 +248,8 @@ public class CleaningTaskService {
|
|||||||
public void stopTask(String taskId) {
|
public void stopTask(String taskId) {
|
||||||
taskScheduler.stopTask(taskId);
|
taskScheduler.stopTask(taskId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<OperatorInstanceDto> getInstanceByTemplateId(String templateId) {
|
||||||
|
return operatorInstanceRepo.findInstanceByInstanceId(templateId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.datamate.cleaning.application;
|
|||||||
|
|
||||||
import com.datamate.cleaning.domain.repository.CleaningTemplateRepository;
|
import com.datamate.cleaning.domain.repository.CleaningTemplateRepository;
|
||||||
import com.datamate.cleaning.domain.repository.OperatorInstanceRepository;
|
import com.datamate.cleaning.domain.repository.OperatorInstanceRepository;
|
||||||
|
import com.datamate.cleaning.infrastructure.validator.CleanTaskValidator;
|
||||||
import com.datamate.cleaning.interfaces.dto.*;
|
import com.datamate.cleaning.interfaces.dto.*;
|
||||||
import com.datamate.cleaning.domain.model.entity.TemplateWithInstance;
|
import com.datamate.cleaning.domain.model.entity.TemplateWithInstance;
|
||||||
import com.datamate.operator.domain.repository.OperatorViewRepository;
|
import com.datamate.operator.domain.repository.OperatorViewRepository;
|
||||||
@@ -28,6 +29,8 @@ public class CleaningTemplateService {
|
|||||||
|
|
||||||
private final OperatorViewRepository operatorViewRepo;
|
private final OperatorViewRepository operatorViewRepo;
|
||||||
|
|
||||||
|
private final CleanTaskValidator cleanTaskValidator;
|
||||||
|
|
||||||
public List<CleaningTemplateDto> getTemplates(String keywords) {
|
public List<CleaningTemplateDto> getTemplates(String keywords) {
|
||||||
List<OperatorDto> allOperators =
|
List<OperatorDto> allOperators =
|
||||||
operatorViewRepo.findOperatorsByCriteria(null, null, null, null, null);
|
operatorViewRepo.findOperatorsByCriteria(null, null, null, null, null);
|
||||||
@@ -59,6 +62,7 @@ public class CleaningTemplateService {
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
public CleaningTemplateDto createTemplate(CreateCleaningTemplateRequest request) {
|
public CleaningTemplateDto createTemplate(CreateCleaningTemplateRequest request) {
|
||||||
|
cleanTaskValidator.checkInputAndOutput(request.getInstance());
|
||||||
CleaningTemplateDto template = new CleaningTemplateDto();
|
CleaningTemplateDto template = new CleaningTemplateDto();
|
||||||
String templateId = UUID.randomUUID().toString();
|
String templateId = UUID.randomUUID().toString();
|
||||||
template.setId(templateId);
|
template.setId(templateId);
|
||||||
|
|||||||
@@ -13,4 +13,6 @@ public interface OperatorInstanceRepository extends IRepository<OperatorInstance
|
|||||||
void deleteByInstanceId(String instanceId);
|
void deleteByInstanceId(String instanceId);
|
||||||
|
|
||||||
List<OperatorDto> findOperatorByInstanceId(String instanceId);
|
List<OperatorDto> findOperatorByInstanceId(String instanceId);
|
||||||
|
|
||||||
|
List<OperatorInstanceDto> findInstanceByInstanceId(String instanceId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.datamate.common.infrastructure.exception.SystemErrorCode;
|
|||||||
import com.datamate.operator.domain.model.OperatorView;
|
import com.datamate.operator.domain.model.OperatorView;
|
||||||
import com.datamate.operator.interfaces.dto.OperatorDto;
|
import com.datamate.operator.interfaces.dto.OperatorDto;
|
||||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||||
|
import com.fasterxml.jackson.core.type.TypeReference;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
import org.mapstruct.Mapper;
|
import org.mapstruct.Mapper;
|
||||||
import org.mapstruct.Mapping;
|
import org.mapstruct.Mapping;
|
||||||
@@ -23,20 +24,39 @@ import java.util.Map;
|
|||||||
public interface OperatorInstanceConverter {
|
public interface OperatorInstanceConverter {
|
||||||
OperatorInstanceConverter INSTANCE = Mappers.getMapper(OperatorInstanceConverter.class);
|
OperatorInstanceConverter INSTANCE = Mappers.getMapper(OperatorInstanceConverter.class);
|
||||||
|
|
||||||
|
ObjectMapper OBJECT_MAPPER = new ObjectMapper();
|
||||||
|
|
||||||
@Mapping(target = "settingsOverride", source = "overrides", qualifiedByName = "mapToString")
|
@Mapping(target = "settingsOverride", source = "overrides", qualifiedByName = "mapToString")
|
||||||
@Mapping(target = "operatorId", source = "id")
|
@Mapping(target = "operatorId", source = "id")
|
||||||
OperatorInstance fromDtoToEntity(OperatorInstanceDto instance);
|
OperatorInstance fromDtoToEntity(OperatorInstanceDto instance);
|
||||||
|
|
||||||
|
@Mapping(target = "overrides", source = "settingsOverride", qualifiedByName = "stringToMap")
|
||||||
|
@Mapping(target = "id", source = "operatorId")
|
||||||
|
OperatorInstanceDto fromEntityToDto(OperatorInstance instance);
|
||||||
|
|
||||||
|
List<OperatorInstanceDto> fromEntityToDtoList(List<OperatorInstance> instance);
|
||||||
|
|
||||||
@Named("mapToString")
|
@Named("mapToString")
|
||||||
static String mapToString(Map<String, Object> objects) {
|
static String mapToString(Map<String, Object> objects) {
|
||||||
ObjectMapper objectMapper = new ObjectMapper();
|
|
||||||
try {
|
try {
|
||||||
return objectMapper.writeValueAsString(objects);
|
return OBJECT_MAPPER.writeValueAsString(objects);
|
||||||
} catch (JsonProcessingException e) {
|
} catch (JsonProcessingException e) {
|
||||||
throw BusinessException.of(SystemErrorCode.UNKNOWN_ERROR);
|
throw BusinessException.of(SystemErrorCode.UNKNOWN_ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Named("stringToMap")
|
||||||
|
static Map<String, Object> stringToMap(String json) {
|
||||||
|
if (json == null) {
|
||||||
|
return Collections.emptyMap();
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return OBJECT_MAPPER.readValue(json, new TypeReference<>() {});
|
||||||
|
} catch (JsonProcessingException e) {
|
||||||
|
throw BusinessException.of(SystemErrorCode.UNKNOWN_ERROR);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Mapping(target = "categories", source = "categories", qualifiedByName = "stringToList")
|
@Mapping(target = "categories", source = "categories", qualifiedByName = "stringToList")
|
||||||
OperatorDto fromEntityToDto(OperatorView operator);
|
OperatorDto fromEntityToDto(OperatorView operator);
|
||||||
|
|
||||||
|
|||||||
@@ -42,4 +42,12 @@ public class OperatorInstanceRepositoryImpl extends CrudRepository<OperatorInsta
|
|||||||
public List<OperatorDto> findOperatorByInstanceId(String instanceId) {
|
public List<OperatorDto> findOperatorByInstanceId(String instanceId) {
|
||||||
return OperatorInstanceConverter.INSTANCE.fromEntityToDto(mapper.findOperatorByInstanceId(instanceId));
|
return OperatorInstanceConverter.INSTANCE.fromEntityToDto(mapper.findOperatorByInstanceId(instanceId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<OperatorInstanceDto> findInstanceByInstanceId(String instanceId) {
|
||||||
|
LambdaQueryWrapper<OperatorInstance> lambdaWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaWrapper.eq(OperatorInstance::getInstanceId, instanceId)
|
||||||
|
.orderByAsc(OperatorInstance::getOpIndex);
|
||||||
|
return OperatorInstanceConverter.INSTANCE.fromEntityToDtoList(mapper.selectList(lambdaWrapper));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ public class CreateCleaningTaskRequest {
|
|||||||
|
|
||||||
private String destDatasetType;
|
private String destDatasetType;
|
||||||
|
|
||||||
|
private String templateId;
|
||||||
|
|
||||||
private List<OperatorInstanceDto> instance = new ArrayList<>();
|
private List<OperatorInstanceDto> instance = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,10 @@
|
|||||||
package com.datamate.cleaning.interfaces.rest;
|
package com.datamate.cleaning.interfaces.rest;
|
||||||
|
|
||||||
import com.datamate.cleaning.application.CleaningTaskService;
|
import com.datamate.cleaning.application.CleaningTaskService;
|
||||||
import com.datamate.cleaning.interfaces.dto.CleaningResultDto;
|
import com.datamate.cleaning.interfaces.dto.*;
|
||||||
import com.datamate.cleaning.interfaces.dto.CleaningTaskDto;
|
|
||||||
import com.datamate.cleaning.interfaces.dto.CleaningTaskLog;
|
|
||||||
import com.datamate.cleaning.interfaces.dto.CreateCleaningTaskRequest;
|
|
||||||
import com.datamate.common.interfaces.PagedResponse;
|
import com.datamate.common.interfaces.PagedResponse;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -31,6 +29,9 @@ public class CleaningTaskController {
|
|||||||
|
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public CleaningTaskDto cleaningTasksPost(@RequestBody CreateCleaningTaskRequest request) {
|
public CleaningTaskDto cleaningTasksPost(@RequestBody CreateCleaningTaskRequest request) {
|
||||||
|
if (request.getInstance().isEmpty() && StringUtils.isNotBlank(request.getTemplateId())) {
|
||||||
|
request.setInstance(cleaningTaskService.getInstanceByTemplateId(request.getTemplateId()));
|
||||||
|
}
|
||||||
return cleaningTaskService.createTask(request);
|
return cleaningTaskService.createTask(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,6 +58,13 @@ public class CleaningTaskController {
|
|||||||
return taskId;
|
return taskId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@DeleteMapping
|
||||||
|
public void cleaningTasksDelete(@RequestParam List<String> taskIds) {
|
||||||
|
for (String taskId : taskIds) {
|
||||||
|
cleaningTaskService.deleteTask(taskId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/{taskId}/result")
|
@GetMapping("/{taskId}/result")
|
||||||
public List<CleaningResultDto> cleaningTasksTaskIdGetResult(@PathVariable("taskId") String taskId) {
|
public List<CleaningResultDto> cleaningTasksTaskIdGetResult(@PathVariable("taskId") String taskId) {
|
||||||
return cleaningTaskService.getTaskResults(taskId);
|
return cleaningTaskService.getTaskResults(taskId);
|
||||||
|
|||||||
@@ -102,261 +102,261 @@ spec:
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
containers:
|
containers:
|
||||||
{{- $replicaCount := int .Values.replicaCount }}
|
{{- $replicaCount := int .Values.replicaCount }}
|
||||||
{{- $peerPort := int .Values.containerPorts.peer }}
|
{{- $peerPort := int .Values.containerPorts.peer }}
|
||||||
{{- $etcdFullname := include "common.names.fullname" . }}
|
{{- $etcdFullname := include "common.names.fullname" . }}
|
||||||
{{- $releaseNamespace := .Release.Namespace }}
|
{{- $releaseNamespace := .Release.Namespace }}
|
||||||
{{- $etcdHeadlessServiceName := (printf "%s-%s" $etcdFullname "headless" | trunc 63 | trimSuffix "-") }}
|
{{- $etcdHeadlessServiceName := (printf "%s-%s" $etcdFullname "headless" | trunc 63 | trimSuffix "-") }}
|
||||||
{{- $clusterDomain := .Values.clusterDomain }}
|
{{- $clusterDomain := .Values.clusterDomain }}
|
||||||
{{- $etcdPeerProtocol := include "etcd.peerProtocol" . }}
|
{{- $etcdPeerProtocol := include "etcd.peerProtocol" . }}
|
||||||
{{- $etcdClientProtocol := include "etcd.clientProtocol" . }}
|
{{- $etcdClientProtocol := include "etcd.clientProtocol" . }}
|
||||||
- name: etcd
|
- name: etcd
|
||||||
image: {{ include "etcd.image" . }}
|
image: {{ include "etcd.image" . }}
|
||||||
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||||
{{- if .Values.containerSecurityContext.enabled }}
|
{{- if .Values.containerSecurityContext.enabled }}
|
||||||
securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }}
|
securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 14 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.diagnosticMode.enabled }}
|
||||||
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 14 }}
|
||||||
|
{{- else if .Values.command }}
|
||||||
|
command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 14 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.diagnosticMode.enabled }}
|
||||||
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 14 }}
|
||||||
|
{{- else if .Values.args }}
|
||||||
|
args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 14 }}
|
||||||
|
{{- end }}
|
||||||
|
env:
|
||||||
|
- name: BITNAMI_DEBUG
|
||||||
|
value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }}
|
||||||
|
- name: MY_POD_IP
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: status.podIP
|
||||||
|
- name: MY_POD_NAME
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: metadata.name
|
||||||
|
- name: MY_STS_NAME
|
||||||
|
value: {{ include "common.names.fullname" . | quote }}
|
||||||
|
- name: ETCDCTL_API
|
||||||
|
value: "3"
|
||||||
|
- name: ETCD_ON_K8S
|
||||||
|
value: "yes"
|
||||||
|
- name: ETCD_START_FROM_SNAPSHOT
|
||||||
|
value: {{ ternary "yes" "no" .Values.startFromSnapshot.enabled | quote }}
|
||||||
|
- name: ETCD_DISASTER_RECOVERY
|
||||||
|
value: {{ ternary "yes" "no" .Values.disasterRecovery.enabled | quote }}
|
||||||
|
- name: ETCD_NAME
|
||||||
|
value: "$(MY_POD_NAME)"
|
||||||
|
- name: ETCD_DATA_DIR
|
||||||
|
value: "/bitnami/etcd/data"
|
||||||
|
- name: ETCD_LOG_LEVEL
|
||||||
|
value: {{ ternary "debug" .Values.logLevel .Values.image.debug | quote }}
|
||||||
|
- name: ALLOW_NONE_AUTHENTICATION
|
||||||
|
value: {{ ternary "yes" "no" (and (not (or .Values.auth.rbac.create .Values.auth.rbac.enabled)) .Values.auth.rbac.allowNoneAuthentication) | quote }}
|
||||||
|
{{- if or .Values.auth.rbac.create .Values.auth.rbac.enabled }}
|
||||||
|
- name: ETCD_ROOT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ include "etcd.secretName" . }}
|
||||||
|
key: {{ include "etcd.secretPasswordKey" . }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.diagnosticMode.enabled }}
|
{{- if .Values.auth.token.enabled }}
|
||||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 14 }}
|
- name: ETCD_AUTH_TOKEN
|
||||||
{{- else if .Values.command }}
|
{{- if eq .Values.auth.token.type "jwt" }}
|
||||||
command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 14 }}
|
value: {{ printf "jwt,priv-key=/opt/bitnami/etcd/certs/token/%s,sign-method=%s,ttl=%s" .Values.auth.token.privateKey.filename .Values.auth.token.signMethod .Values.auth.token.ttl | quote }}
|
||||||
|
{{- else if eq .Values.auth.token.type "simple" }}
|
||||||
|
value: "simple"
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.diagnosticMode.enabled }}
|
# 警告:以下 Env Vars 依赖 StatefulSet 命名 (headless service 和 ordered names)
|
||||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 14 }}
|
# 在 Deployment 中如果不修改副本数为 1,这些配置会导致集群发现失败。
|
||||||
{{- else if .Values.args }}
|
- name: ETCD_ADVERTISE_CLIENT_URLS
|
||||||
args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 14 }}
|
value: "{{ $etcdClientProtocol }}://$(MY_POD_NAME).{{ $etcdHeadlessServiceName }}.{{ .Release.Namespace }}.svc.{{ $clusterDomain }}:{{ .Values.containerPorts.client }},{{ $etcdClientProtocol }}://{{ $etcdFullname }}.{{ .Release.Namespace }}.svc.{{ $clusterDomain }}:{{ coalesce .Values.service.ports.client .Values.service.port }}"
|
||||||
|
- name: ETCD_LISTEN_CLIENT_URLS
|
||||||
|
value: "{{ $etcdClientProtocol }}://0.0.0.0:{{ .Values.containerPorts.client }}"
|
||||||
|
- name: ETCD_INITIAL_ADVERTISE_PEER_URLS
|
||||||
|
value: "{{ $etcdPeerProtocol }}://$(MY_POD_NAME).{{ $etcdHeadlessServiceName }}.{{ .Release.Namespace }}.svc.{{ $clusterDomain }}:{{ .Values.containerPorts.peer }}"
|
||||||
|
- name: ETCD_LISTEN_PEER_URLS
|
||||||
|
value: "{{ $etcdPeerProtocol }}://0.0.0.0:{{ .Values.containerPorts.peer }}"
|
||||||
|
{{- if .Values.autoCompactionMode }}
|
||||||
|
- name: ETCD_AUTO_COMPACTION_MODE
|
||||||
|
value: {{ .Values.autoCompactionMode | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
env:
|
{{- if .Values.autoCompactionRetention }}
|
||||||
- name: BITNAMI_DEBUG
|
- name: ETCD_AUTO_COMPACTION_RETENTION
|
||||||
value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }}
|
value: {{ .Values.autoCompactionRetention | quote }}
|
||||||
- name: MY_POD_IP
|
{{- end }}
|
||||||
valueFrom:
|
{{- if .Values.maxProcs }}
|
||||||
fieldRef:
|
- name: GOMAXPROCS
|
||||||
fieldPath: status.podIP
|
value: {{ .Values.maxProcs }}
|
||||||
- name: MY_POD_NAME
|
{{- end }}
|
||||||
valueFrom:
|
{{- if gt $replicaCount 1 }}
|
||||||
fieldRef:
|
- name: ETCD_INITIAL_CLUSTER_TOKEN
|
||||||
fieldPath: metadata.name
|
value: "etcd-cluster-k8s"
|
||||||
- name: MY_STS_NAME
|
- name: ETCD_INITIAL_CLUSTER_STATE
|
||||||
value: {{ include "common.names.fullname" . | quote }}
|
value: {{ default (ternary "new" "existing" .Release.IsInstall) .Values.initialClusterState | quote }}
|
||||||
- name: ETCDCTL_API
|
{{- $initialCluster := list }}
|
||||||
value: "3"
|
{{- range $e, $i := until $replicaCount }}
|
||||||
- name: ETCD_ON_K8S
|
{{- $initialCluster = append $initialCluster (printf "%s-%d=%s://%s-%d.%s.%s.svc.%s:%d" $etcdFullname $i $etcdPeerProtocol $etcdFullname $i $etcdHeadlessServiceName $releaseNamespace $clusterDomain $peerPort) }}
|
||||||
value: "yes"
|
{{- end }}
|
||||||
- name: ETCD_START_FROM_SNAPSHOT
|
- name: ETCD_INITIAL_CLUSTER
|
||||||
value: {{ ternary "yes" "no" .Values.startFromSnapshot.enabled | quote }}
|
value: {{ join "," $initialCluster | quote }}
|
||||||
- name: ETCD_DISASTER_RECOVERY
|
{{- end }}
|
||||||
value: {{ ternary "yes" "no" .Values.disasterRecovery.enabled | quote }}
|
- name: ETCD_CLUSTER_DOMAIN
|
||||||
- name: ETCD_NAME
|
value: {{ printf "%s.%s.svc.%s" $etcdHeadlessServiceName $releaseNamespace $clusterDomain | quote }}
|
||||||
value: "$(MY_POD_NAME)"
|
{{- if and .Values.auth.client.secureTransport .Values.auth.client.useAutoTLS }}
|
||||||
- name: ETCD_DATA_DIR
|
- name: ETCD_AUTO_TLS
|
||||||
value: "/bitnami/etcd/data"
|
value: "true"
|
||||||
- name: ETCD_LOG_LEVEL
|
{{- else if .Values.auth.client.secureTransport }}
|
||||||
value: {{ ternary "debug" .Values.logLevel .Values.image.debug | quote }}
|
- name: ETCD_CERT_FILE
|
||||||
- name: ALLOW_NONE_AUTHENTICATION
|
value: "/opt/bitnami/etcd/certs/client/{{ .Values.auth.client.certFilename }}"
|
||||||
value: {{ ternary "yes" "no" (and (not (or .Values.auth.rbac.create .Values.auth.rbac.enabled)) .Values.auth.rbac.allowNoneAuthentication) | quote }}
|
- name: ETCD_KEY_FILE
|
||||||
{{- if or .Values.auth.rbac.create .Values.auth.rbac.enabled }}
|
value: "/opt/bitnami/etcd/certs/client/{{ .Values.auth.client.certKeyFilename }}"
|
||||||
- name: ETCD_ROOT_PASSWORD
|
{{- if .Values.auth.client.enableAuthentication }}
|
||||||
valueFrom:
|
- name: ETCD_CLIENT_CERT_AUTH
|
||||||
secretKeyRef:
|
value: "true"
|
||||||
name: {{ include "etcd.secretName" . }}
|
- name: ETCD_TRUSTED_CA_FILE
|
||||||
key: {{ include "etcd.secretPasswordKey" . }}
|
value: "/opt/bitnami/etcd/certs/client/{{ .Values.auth.client.caFilename | default "ca.crt" }}"
|
||||||
{{- end }}
|
{{- else if .Values.auth.client.caFilename }}
|
||||||
{{- if .Values.auth.token.enabled }}
|
- name: ETCD_TRUSTED_CA_FILE
|
||||||
- name: ETCD_AUTH_TOKEN
|
value: "/opt/bitnami/etcd/certs/client/{{ .Values.auth.client.caFilename | default "ca.crt" }}"
|
||||||
{{- if eq .Values.auth.token.type "jwt" }}
|
{{- end }}
|
||||||
value: {{ printf "jwt,priv-key=/opt/bitnami/etcd/certs/token/%s,sign-method=%s,ttl=%s" .Values.auth.token.privateKey.filename .Values.auth.token.signMethod .Values.auth.token.ttl | quote }}
|
{{- end }}
|
||||||
{{- else if eq .Values.auth.token.type "simple" }}
|
{{- if and .Values.auth.peer.secureTransport .Values.auth.peer.useAutoTLS }}
|
||||||
value: "simple"
|
- name: ETCD_PEER_AUTO_TLS
|
||||||
{{- end }}
|
value: "true"
|
||||||
{{- end }}
|
{{- else if .Values.auth.peer.secureTransport }}
|
||||||
# 警告:以下 Env Vars 依赖 StatefulSet 命名 (headless service 和 ordered names)
|
- name: ETCD_PEER_CERT_FILE
|
||||||
# 在 Deployment 中如果不修改副本数为 1,这些配置会导致集群发现失败。
|
value: "/opt/bitnami/etcd/certs/peer/{{ .Values.auth.peer.certFilename }}"
|
||||||
- name: ETCD_ADVERTISE_CLIENT_URLS
|
- name: ETCD_PEER_KEY_FILE
|
||||||
value: "{{ $etcdClientProtocol }}://$(MY_POD_NAME).{{ $etcdHeadlessServiceName }}.{{ .Release.Namespace }}.svc.{{ $clusterDomain }}:{{ .Values.containerPorts.client }},{{ $etcdClientProtocol }}://{{ $etcdFullname }}.{{ .Release.Namespace }}.svc.{{ $clusterDomain }}:{{ coalesce .Values.service.ports.client .Values.service.port }}"
|
value: "/opt/bitnami/etcd/certs/peer/{{ .Values.auth.peer.certKeyFilename }}"
|
||||||
- name: ETCD_LISTEN_CLIENT_URLS
|
{{- if .Values.auth.peer.enableAuthentication }}
|
||||||
value: "{{ $etcdClientProtocol }}://0.0.0.0:{{ .Values.containerPorts.client }}"
|
- name: ETCD_PEER_CLIENT_CERT_AUTH
|
||||||
- name: ETCD_INITIAL_ADVERTISE_PEER_URLS
|
value: "true"
|
||||||
value: "{{ $etcdPeerProtocol }}://$(MY_POD_NAME).{{ $etcdHeadlessServiceName }}.{{ .Release.Namespace }}.svc.{{ $clusterDomain }}:{{ .Values.containerPorts.peer }}"
|
- name: ETCD_PEER_TRUSTED_CA_FILE
|
||||||
- name: ETCD_LISTEN_PEER_URLS
|
value: "/opt/bitnami/etcd/certs/peer/{{ .Values.auth.peer.caFilename | default "ca.crt" }}"
|
||||||
value: "{{ $etcdPeerProtocol }}://0.0.0.0:{{ .Values.containerPorts.peer }}"
|
{{- else if .Values.auth.peer.caFilename }}
|
||||||
{{- if .Values.autoCompactionMode }}
|
- name: ETCD_PEER_TRUSTED_CA_FILE
|
||||||
- name: ETCD_AUTO_COMPACTION_MODE
|
value: "/opt/bitnami/etcd/certs/peer/{{ .Values.auth.peer.caFilename | default "ca.crt" }}"
|
||||||
value: {{ .Values.autoCompactionMode | quote }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.autoCompactionRetention }}
|
{{- if .Values.startFromSnapshot.enabled }}
|
||||||
- name: ETCD_AUTO_COMPACTION_RETENTION
|
- name: ETCD_INIT_SNAPSHOT_FILENAME
|
||||||
value: {{ .Values.autoCompactionRetention | quote }}
|
value: {{ .Values.startFromSnapshot.snapshotFilename | quote }}
|
||||||
{{- end }}
|
- name: ETCD_INIT_SNAPSHOTS_DIR
|
||||||
{{- if .Values.maxProcs }}
|
value: {{ ternary "/snapshots" "/init-snapshot" (and .Values.disasterRecovery.enabled (not .Values.disasterRecovery.pvc.existingClaim)) | quote }}
|
||||||
- name: GOMAXPROCS
|
{{- end }}
|
||||||
value: {{ .Values.maxProcs }}
|
{{- if .Values.extraEnvVars }}
|
||||||
{{- end }}
|
{{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 14 }}
|
||||||
{{- if gt $replicaCount 1 }}
|
{{- end }}
|
||||||
- name: ETCD_INITIAL_CLUSTER_TOKEN
|
envFrom:
|
||||||
value: "etcd-cluster-k8s"
|
{{- if .Values.extraEnvVarsCM }}
|
||||||
- name: ETCD_INITIAL_CLUSTER_STATE
|
- configMapRef:
|
||||||
value: {{ default (ternary "new" "existing" .Release.IsInstall) .Values.initialClusterState | quote }}
|
name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsCM "context" $) }}
|
||||||
{{- $initialCluster := list }}
|
{{- end }}
|
||||||
{{- range $e, $i := until $replicaCount }}
|
{{- if .Values.extraEnvVarsSecret }}
|
||||||
{{- $initialCluster = append $initialCluster (printf "%s-%d=%s://%s-%d.%s.%s.svc.%s:%d" $etcdFullname $i $etcdPeerProtocol $etcdFullname $i $etcdHeadlessServiceName $releaseNamespace $clusterDomain $peerPort) }}
|
- secretRef:
|
||||||
{{- end }}
|
name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }}
|
||||||
- name: ETCD_INITIAL_CLUSTER
|
{{- end }}
|
||||||
value: {{ join "," $initialCluster | quote }}
|
ports:
|
||||||
{{- end }}
|
- name: client
|
||||||
- name: ETCD_CLUSTER_DOMAIN
|
containerPort: {{ .Values.containerPorts.client }}
|
||||||
value: {{ printf "%s.%s.svc.%s" $etcdHeadlessServiceName $releaseNamespace $clusterDomain | quote }}
|
protocol: TCP
|
||||||
{{- if and .Values.auth.client.secureTransport .Values.auth.client.useAutoTLS }}
|
- name: peer
|
||||||
- name: ETCD_AUTO_TLS
|
containerPort: {{ .Values.containerPorts.peer }}
|
||||||
value: "true"
|
protocol: TCP
|
||||||
{{- else if .Values.auth.client.secureTransport }}
|
{{- if not .Values.diagnosticMode.enabled }}
|
||||||
- name: ETCD_CERT_FILE
|
{{- if .Values.customLivenessProbe }}
|
||||||
value: "/opt/bitnami/etcd/certs/client/{{ .Values.auth.client.certFilename }}"
|
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 14 }}
|
||||||
- name: ETCD_KEY_FILE
|
{{- else if .Values.livenessProbe.enabled }}
|
||||||
value: "/opt/bitnami/etcd/certs/client/{{ .Values.auth.client.certKeyFilename }}"
|
livenessProbe:
|
||||||
{{- if .Values.auth.client.enableAuthentication }}
|
exec:
|
||||||
- name: ETCD_CLIENT_CERT_AUTH
|
command:
|
||||||
value: "true"
|
- /opt/bitnami/scripts/etcd/healthcheck.sh
|
||||||
- name: ETCD_TRUSTED_CA_FILE
|
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
|
||||||
value: "/opt/bitnami/etcd/certs/client/{{ .Values.auth.client.caFilename | default "ca.crt" }}"
|
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
|
||||||
{{- else if .Values.auth.client.caFilename }}
|
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
|
||||||
- name: ETCD_TRUSTED_CA_FILE
|
successThreshold: {{ .Values.livenessProbe.successThreshold }}
|
||||||
value: "/opt/bitnami/etcd/certs/client/{{ .Values.auth.client.caFilename | default "ca.crt" }}"
|
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- if .Values.customReadinessProbe }}
|
||||||
{{- if and .Values.auth.peer.secureTransport .Values.auth.peer.useAutoTLS }}
|
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 14 }}
|
||||||
- name: ETCD_PEER_AUTO_TLS
|
{{- else if .Values.readinessProbe.enabled }}
|
||||||
value: "true"
|
readinessProbe:
|
||||||
{{- else if .Values.auth.peer.secureTransport }}
|
exec:
|
||||||
- name: ETCD_PEER_CERT_FILE
|
command:
|
||||||
value: "/opt/bitnami/etcd/certs/peer/{{ .Values.auth.peer.certFilename }}"
|
- /opt/bitnami/scripts/etcd/healthcheck.sh
|
||||||
- name: ETCD_PEER_KEY_FILE
|
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
|
||||||
value: "/opt/bitnami/etcd/certs/peer/{{ .Values.auth.peer.certKeyFilename }}"
|
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
|
||||||
{{- if .Values.auth.peer.enableAuthentication }}
|
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
|
||||||
- name: ETCD_PEER_CLIENT_CERT_AUTH
|
successThreshold: {{ .Values.readinessProbe.successThreshold }}
|
||||||
value: "true"
|
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
|
||||||
- name: ETCD_PEER_TRUSTED_CA_FILE
|
{{- end }}
|
||||||
value: "/opt/bitnami/etcd/certs/peer/{{ .Values.auth.peer.caFilename | default "ca.crt" }}"
|
{{- if .Values.customStartupProbe }}
|
||||||
{{- else if .Values.auth.peer.caFilename }}
|
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 14 }}
|
||||||
- name: ETCD_PEER_TRUSTED_CA_FILE
|
{{- else if .Values.startupProbe.enabled }}
|
||||||
value: "/opt/bitnami/etcd/certs/peer/{{ .Values.auth.peer.caFilename | default "ca.crt" }}"
|
startupProbe:
|
||||||
{{- end }}
|
exec:
|
||||||
{{- end }}
|
command:
|
||||||
{{- if .Values.startFromSnapshot.enabled }}
|
- /opt/bitnami/scripts/etcd/healthcheck.sh
|
||||||
- name: ETCD_INIT_SNAPSHOT_FILENAME
|
initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }}
|
||||||
value: {{ .Values.startFromSnapshot.snapshotFilename | quote }}
|
periodSeconds: {{ .Values.startupProbe.periodSeconds }}
|
||||||
- name: ETCD_INIT_SNAPSHOTS_DIR
|
timeoutSeconds: {{ .Values.startupProbe.timeoutSeconds }}
|
||||||
value: {{ ternary "/snapshots" "/init-snapshot" (and .Values.disasterRecovery.enabled (not .Values.disasterRecovery.pvc.existingClaim)) | quote }}
|
successThreshold: {{ .Values.startupProbe.successThreshold }}
|
||||||
{{- end }}
|
failureThreshold: {{ .Values.startupProbe.failureThreshold }}
|
||||||
{{- if .Values.extraEnvVars }}
|
{{- end }}
|
||||||
{{- include "common.tplvalues.render" (dict "value" .Values.extraEnvVars "context" $) | nindent 14 }}
|
{{- if .Values.lifecycleHooks }}
|
||||||
{{- end }}
|
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 14 }}
|
||||||
envFrom:
|
{{- else if and (gt $replicaCount 1) .Values.removeMemberOnContainerTermination }}
|
||||||
{{- if .Values.extraEnvVarsCM }}
|
lifecycle:
|
||||||
- configMapRef:
|
preStop:
|
||||||
name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsCM "context" $) }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.extraEnvVarsSecret }}
|
|
||||||
- secretRef:
|
|
||||||
name: {{ include "common.tplvalues.render" (dict "value" .Values.extraEnvVarsSecret "context" $) }}
|
|
||||||
{{- end }}
|
|
||||||
ports:
|
|
||||||
- name: client
|
|
||||||
containerPort: {{ .Values.containerPorts.client }}
|
|
||||||
protocol: TCP
|
|
||||||
- name: peer
|
|
||||||
containerPort: {{ .Values.containerPorts.peer }}
|
|
||||||
protocol: TCP
|
|
||||||
{{- if not .Values.diagnosticMode.enabled }}
|
|
||||||
{{- if .Values.customLivenessProbe }}
|
|
||||||
livenessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customLivenessProbe "context" $) | nindent 14 }}
|
|
||||||
{{- else if .Values.livenessProbe.enabled }}
|
|
||||||
livenessProbe:
|
|
||||||
exec:
|
exec:
|
||||||
command:
|
command:
|
||||||
- /opt/bitnami/scripts/etcd/healthcheck.sh
|
- /opt/bitnami/scripts/etcd/prestop.sh
|
||||||
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
|
{{- end }}
|
||||||
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
|
{{- end }}
|
||||||
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
|
{{- if .Values.resources }}
|
||||||
successThreshold: {{ .Values.livenessProbe.successThreshold }}
|
resources: {{- include "common.tplvalues.render" (dict "value" .Values.resources "context" $) | nindent 14 }}
|
||||||
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
|
{{- end }}
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /bitnami/etcd
|
||||||
|
{{- if and (eq .Values.auth.token.enabled true) (eq .Values.auth.token.type "jwt") }}
|
||||||
|
- name: etcd-jwt-token
|
||||||
|
mountPath: /opt/bitnami/etcd/certs/token/
|
||||||
|
readOnly: true
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.customReadinessProbe }}
|
{{- if or (and .Values.startFromSnapshot.enabled (not .Values.disasterRecovery.enabled)) (and .Values.disasterRecovery.enabled .Values.startFromSnapshot.enabled .Values.disasterRecovery.pvc.existingClaim) }}
|
||||||
readinessProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 14 }}
|
- name: init-snapshot-volume
|
||||||
{{- else if .Values.readinessProbe.enabled }}
|
mountPath: /init-snapshot
|
||||||
readinessProbe:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /opt/bitnami/scripts/etcd/healthcheck.sh
|
|
||||||
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
|
|
||||||
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
|
|
||||||
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
|
|
||||||
successThreshold: {{ .Values.readinessProbe.successThreshold }}
|
|
||||||
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.customStartupProbe }}
|
{{- if or .Values.disasterRecovery.enabled (and .Values.disasterRecovery.enabled .Values.startFromSnapshot.enabled) }}
|
||||||
startupProbe: {{- include "common.tplvalues.render" (dict "value" .Values.customStartupProbe "context" $) | nindent 14 }}
|
- name: snapshot-volume
|
||||||
{{- else if .Values.startupProbe.enabled }}
|
mountPath: /snapshots
|
||||||
startupProbe:
|
{{- if .Values.disasterRecovery.pvc.subPath }}
|
||||||
exec:
|
subPath: {{ .Values.disasterRecovery.pvc.subPath }}
|
||||||
command:
|
{{- end }}
|
||||||
- /opt/bitnami/scripts/etcd/healthcheck.sh
|
|
||||||
initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }}
|
|
||||||
periodSeconds: {{ .Values.startupProbe.periodSeconds }}
|
|
||||||
timeoutSeconds: {{ .Values.startupProbe.timeoutSeconds }}
|
|
||||||
successThreshold: {{ .Values.startupProbe.successThreshold }}
|
|
||||||
failureThreshold: {{ .Values.startupProbe.failureThreshold }}
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.lifecycleHooks }}
|
{{- if or .Values.configuration .Values.existingConfigmap }}
|
||||||
lifecycle: {{- include "common.tplvalues.render" (dict "value" .Values.lifecycleHooks "context" $) | nindent 14 }}
|
- name: etcd-config
|
||||||
{{- else if and (gt $replicaCount 1) .Values.removeMemberOnContainerTermination }}
|
mountPath: /opt/bitnami/etcd/conf/
|
||||||
lifecycle:
|
|
||||||
preStop:
|
|
||||||
exec:
|
|
||||||
command:
|
|
||||||
- /opt/bitnami/scripts/etcd/prestop.sh
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if or .Values.auth.client.enableAuthentication (and .Values.auth.client.secureTransport (not .Values.auth.client.useAutoTLS )) }}
|
||||||
|
- name: etcd-client-certs
|
||||||
|
mountPath: /opt/bitnami/etcd/certs/client/
|
||||||
|
readOnly: true
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.resources }}
|
{{- if or .Values.auth.peer.enableAuthentication (and .Values.auth.peer.secureTransport (not .Values.auth.peer.useAutoTLS )) }}
|
||||||
resources: {{- include "common.tplvalues.render" (dict "value" .Values.resources "context" $) | nindent 14 }}
|
- name: etcd-peer-certs
|
||||||
|
mountPath: /opt/bitnami/etcd/certs/peer/
|
||||||
|
readOnly: true
|
||||||
|
{{- end }}
|
||||||
|
{{- if .Values.extraVolumeMounts }}
|
||||||
|
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
volumeMounts:
|
|
||||||
- name: data
|
|
||||||
mountPath: /bitnami/etcd
|
|
||||||
{{- if and (eq .Values.auth.token.enabled true) (eq .Values.auth.token.type "jwt") }}
|
|
||||||
- name: etcd-jwt-token
|
|
||||||
mountPath: /opt/bitnami/etcd/certs/token/
|
|
||||||
readOnly: true
|
|
||||||
{{- end }}
|
|
||||||
{{- if or (and .Values.startFromSnapshot.enabled (not .Values.disasterRecovery.enabled)) (and .Values.disasterRecovery.enabled .Values.startFromSnapshot.enabled .Values.disasterRecovery.pvc.existingClaim) }}
|
|
||||||
- name: init-snapshot-volume
|
|
||||||
mountPath: /init-snapshot
|
|
||||||
{{- end }}
|
|
||||||
{{- if or .Values.disasterRecovery.enabled (and .Values.disasterRecovery.enabled .Values.startFromSnapshot.enabled) }}
|
|
||||||
- name: snapshot-volume
|
|
||||||
mountPath: /snapshots
|
|
||||||
{{- if .Values.disasterRecovery.pvc.subPath }}
|
|
||||||
subPath: {{ .Values.disasterRecovery.pvc.subPath }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if or .Values.configuration .Values.existingConfigmap }}
|
|
||||||
- name: etcd-config
|
|
||||||
mountPath: /opt/bitnami/etcd/conf/
|
|
||||||
{{- end }}
|
|
||||||
{{- if or .Values.auth.client.enableAuthentication (and .Values.auth.client.secureTransport (not .Values.auth.client.useAutoTLS )) }}
|
|
||||||
- name: etcd-client-certs
|
|
||||||
mountPath: /opt/bitnami/etcd/certs/client/
|
|
||||||
readOnly: true
|
|
||||||
{{- end }}
|
|
||||||
{{- if or .Values.auth.peer.enableAuthentication (and .Values.auth.peer.secureTransport (not .Values.auth.peer.useAutoTLS )) }}
|
|
||||||
- name: etcd-peer-certs
|
|
||||||
mountPath: /opt/bitnami/etcd/certs/peer/
|
|
||||||
readOnly: true
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.extraVolumeMounts }}
|
|
||||||
{{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- if .Values.sidecars }}
|
{{- if .Values.sidecars }}
|
||||||
{{- include "common.tplvalues.render" (dict "value" .Values.sidecars "context" $) | nindent 8 }}
|
{{- include "common.tplvalues.render" (dict "value" .Values.sidecars "context" $) | nindent 10 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
volumes:
|
volumes:
|
||||||
{{- if and (eq .Values.auth.token.enabled true) (eq .Values.auth.token.type "jwt") }}
|
{{- if and (eq .Values.auth.token.enabled true) (eq .Values.auth.token.type "jwt") }}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ spec:
|
|||||||
- {{ . | quote }}
|
- {{ . | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
persistentVolumeReclaimPolicy: Delete
|
persistentVolumeReclaimPolicy: Delete
|
||||||
storageClassName: {{ include "common.storage.class" (dict "persistence" .Values.persistence "global" .Values.global) }}
|
{{ include "common.storage.class" (dict "persistence" .Values.persistence "global" .Values.global) }}
|
||||||
local: # local类型
|
local: # local类型
|
||||||
path: {{ .Values.persistence.storagePath | default "/opt/milvus/data" }}/etcd
|
path: {{ .Values.persistence.storagePath | default "/opt/milvus/data" }}/etcd
|
||||||
claimRef:
|
claimRef:
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ export default function CleansingTaskCreate() {
|
|||||||
...item.defaultParams,
|
...item.defaultParams,
|
||||||
...item.overrides,
|
...item.overrides,
|
||||||
},
|
},
|
||||||
|
inputs: item.inputs,
|
||||||
|
outputs: item.outputs,
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
navigate("/data/cleansing?view=task");
|
navigate("/data/cleansing?view=task");
|
||||||
|
|||||||
@@ -44,6 +44,8 @@ export default function CleansingTemplateCreate() {
|
|||||||
...item.defaultParams,
|
...item.defaultParams,
|
||||||
...item.overrides,
|
...item.overrides,
|
||||||
},
|
},
|
||||||
|
inputs: item.inputs,
|
||||||
|
outputs: item.outputs,
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ export default function FileTable({result, fetchTaskResult}) {
|
|||||||
onFilter: (value: string, record: any) =>
|
onFilter: (value: string, record: any) =>
|
||||||
record.srcName.toLowerCase().includes(value.toLowerCase()),
|
record.srcName.toLowerCase().includes(value.toLowerCase()),
|
||||||
render: (text: string) => (
|
render: (text: string) => (
|
||||||
<span className="font-mono text-sm">{text?.replace(/\.[^/.]+$/, "")}</span>
|
<span>{text?.replace(/\.[^/.]+$/, "")}</span>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -45,6 +45,13 @@ export default function TemplateList() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const templateColumns = [
|
const templateColumns = [
|
||||||
|
{
|
||||||
|
title: "模板ID",
|
||||||
|
dataIndex: "id",
|
||||||
|
key: "id",
|
||||||
|
fixed: "left",
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: "模板名称",
|
title: "模板名称",
|
||||||
dataIndex: "name",
|
dataIndex: "name",
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ INSERT IGNORE INTO t_operator
|
|||||||
VALUES ('TextFormatter', 'TXT文本抽取', '抽取TXT中的文本。', '1.0.0', 'text', 'text', null, null, '', false),
|
VALUES ('TextFormatter', 'TXT文本抽取', '抽取TXT中的文本。', '1.0.0', 'text', 'text', null, null, '', false),
|
||||||
('UnstructuredFormatter', 'Unstructured文本抽取', '基于Unstructured抽取非结构化文件的文本,目前支持PowerPoint演示文稿、Word文档以及Excel工作簿。', '1.0.0', 'text', 'text', null, null, '', false),
|
('UnstructuredFormatter', 'Unstructured文本抽取', '基于Unstructured抽取非结构化文件的文本,目前支持PowerPoint演示文稿、Word文档以及Excel工作簿。', '1.0.0', 'text', 'text', null, null, '', false),
|
||||||
('MineruFormatter', 'MinerU PDF文本抽取', '基于MinerU API,抽取PDF中的文本。', '1.0.0', 'text', 'text', null, null, '', false),
|
('MineruFormatter', 'MinerU PDF文本抽取', '基于MinerU API,抽取PDF中的文本。', '1.0.0', 'text', 'text', null, null, '', false),
|
||||||
('FileExporter', '落盘算子', '将文件保存到本地目录。', '1.0.0', 'all', 'all', null, null, '', false),
|
('FileExporter', '落盘算子', '将文件保存到本地目录。', '1.0.0', 'multimodal', 'multimodal', null, null, '', false),
|
||||||
('FileWithHighRepeatPhraseRateFilter', '文档词重复率检查', '去除重复词过多的文档。', '1.0.0', 'text', 'text', null, '{"repeatPhraseRatio": {"name": "文档词重复率", "description": "某个词的统计数/文档总词数 > 设定值,该文档被去除。", "type": "slider", "defaultVal": 0.5, "min": 0, "max": 1, "step": 0.1}, "hitStopwords": {"name": "去除停用词", "description": "统计重复词时,选择是否要去除停用词。", "type": "switch", "defaultVal": false, "required": true, "checkedLabel": "去除", "unCheckedLabel": "不去除"}}', '', 'false'),
|
('FileWithHighRepeatPhraseRateFilter', '文档词重复率检查', '去除重复词过多的文档。', '1.0.0', 'text', 'text', null, '{"repeatPhraseRatio": {"name": "文档词重复率", "description": "某个词的统计数/文档总词数 > 设定值,该文档被去除。", "type": "slider", "defaultVal": 0.5, "min": 0, "max": 1, "step": 0.1}, "hitStopwords": {"name": "去除停用词", "description": "统计重复词时,选择是否要去除停用词。", "type": "switch", "defaultVal": false, "required": true, "checkedLabel": "去除", "unCheckedLabel": "不去除"}}', '', 'false'),
|
||||||
('FileWithHighRepeatWordRateFilter', '文档字重复率检查', '去除重复字过多的文档。', '1.0.0', 'text', 'text', null, '{"repeatWordRatio": {"name": "文档字重复率", "description": "某个字的统计数/文档总字数 > 设定值,该文档被去除。", "type": "slider", "defaultVal": 0.5, "min": 0, "max": 1, "step": 0.1}}', '', 'false'),
|
('FileWithHighRepeatWordRateFilter', '文档字重复率检查', '去除重复字过多的文档。', '1.0.0', 'text', 'text', null, '{"repeatWordRatio": {"name": "文档字重复率", "description": "某个字的统计数/文档总字数 > 设定值,该文档被去除。", "type": "slider", "defaultVal": 0.5, "min": 0, "max": 1, "step": 0.1}}', '', 'false'),
|
||||||
('FileWithHighSpecialCharRateFilter', '文档特殊字符率检查', '去除特殊字符过多的文档。', '1.0.0', 'text', 'text', null, '{"specialCharRatio": {"name": "文档特殊字符率", "description": "特殊字符的统计数/文档总字数 > 设定值,该文档被去除。", "type": "slider", "defaultVal": 0.3, "min": 0, "max": 1, "step": 0.1}}', '', 'false'),
|
('FileWithHighSpecialCharRateFilter', '文档特殊字符率检查', '去除特殊字符过多的文档。', '1.0.0', 'text', 'text', null, '{"specialCharRatio": {"name": "文档特殊字符率", "description": "特殊字符的统计数/文档总字数 > 设定值,该文档被去除。", "type": "slider", "defaultVal": 0.3, "min": 0, "max": 1, "step": 0.1}}', '', 'false'),
|
||||||
|
|||||||
Reference in New Issue
Block a user