-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add cron job to clean duckdb index cache (#2016)
* add cron job to clean duckdb index cache * fix action * give more time to expire cache folder
- Loading branch information
1 parent
58bd71d
commit f1ccb72
Showing
6 changed files
with
84 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
chart/templates/cron-jobs/clean-duckdb-index-cache/_container.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright 2023 The HuggingFace Authors. | ||
|
||
{{- define "containerCleanDuckdbIndexCache" -}} | ||
- name: "{{ include "name" . }}-clean-duckdb-cache" | ||
image: {{ include "jobs.cacheMaintenance.image" . }} | ||
imagePullPolicy: {{ .Values.images.pullPolicy }} | ||
volumeMounts: | ||
{{ include "volumeMountDuckDBIndexRW" . | nindent 2 }} | ||
securityContext: | ||
allowPrivilegeEscalation: false | ||
resources: {{ toYaml .Values.cleanDuckdbIndexCache.resources | nindent 4 }} | ||
env: | ||
{{ include "envCache" . | nindent 2 }} | ||
{{ include "envQueue" . | nindent 2 }} | ||
{{ include "envCommon" . | nindent 2 }} | ||
- name: CACHE_MAINTENANCE_ACTION | ||
value: {{ .Values.cleanDuckdbIndexCache.action | quote }} | ||
- name: LOG_LEVEL | ||
value: {{ .Values.cleanDuckdbIndexCache.log.level | quote }} | ||
- name: DIRECTORY_CLEANING_CACHE_DIRECTORY | ||
value: {{ .Values.duckDBIndex.cacheDirectory | quote }} | ||
- name: DIRECTORY_CLEANING_SUBFOLDER_PATTERN | ||
value: {{ .Values.cleanDuckdbIndexCache.subfolderPattern | quote }} | ||
- name: DIRECTORY_CLEANING_EXPIRED_TIME_INTERVAL_SECONDS | ||
value: {{ .Values.cleanDuckdbIndexCache.expiredTimeIntervalSeconds | quote }} | ||
{{- end -}} |
27 changes: 27 additions & 0 deletions
27
chart/templates/cron-jobs/clean-duckdb-index-cache/job.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright 2022 The HuggingFace Authors. | ||
|
||
{{- if and .Values.images.jobs.cacheMaintenance .Values.cleanDuckdbIndexCache.enabled }} | ||
apiVersion: batch/v1 | ||
kind: CronJob | ||
metadata: | ||
labels: {{ include "labels.cleanDuckdbIndexCache" . | nindent 4 }} | ||
name: "{{ include "name" . }}-job-clean-duckdb-cache" | ||
namespace: {{ .Release.Namespace }} | ||
spec: | ||
schedule: {{ .Values.cleanDuckdbIndexCache.schedule | quote }} | ||
jobTemplate: | ||
spec: | ||
ttlSecondsAfterFinished: 3600 | ||
template: | ||
spec: | ||
restartPolicy: OnFailure | ||
{{- include "dnsConfig" . | nindent 10 }} | ||
{{- include "image.imagePullSecrets" . | nindent 6 }} | ||
nodeSelector: {{ toYaml .Values.cleanDuckdbIndexCache.nodeSelector | nindent 12 }} | ||
tolerations: {{ toYaml .Values.cleanDuckdbIndexCache.tolerations | nindent 12 }} | ||
containers: {{ include "containerCleanDuckdbIndexCache" . | nindent 12 }} | ||
securityContext: {{ include "securityContext" . | nindent 12 }} | ||
initContainers: {{ include "initContainerDuckDBIndex" . | nindent 12 }} | ||
volumes: {{ include "volumeDuckDBIndex" . | nindent 12 }} | ||
{{- end}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters