-
Notifications
You must be signed in to change notification settings - Fork 92
feat(helm): Add garbage collector deployment with retention period configuration. #1817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8cbc0ad
268ab46
55ab307
abb0ea2
36542c1
c3f1f31
19c3b25
f16b822
1c830e7
6f2f9b2
5fcb562
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,11 @@ data: | |
| storage: | ||
| directory: "/var/data/archives" | ||
| type: "fs" | ||
| {{- if .Values.clpConfig.archive_output.retention_period }} | ||
| retention_period: {{ .Values.clpConfig.archive_output.retention_period | int }} | ||
| {{- else }} | ||
| retention_period: null | ||
| {{- end }} | ||
| target_archive_size: {{ .Values.clpConfig.archive_output.target_archive_size | int }} | ||
| target_dictionaries_size: {{ .Values.clpConfig.archive_output.target_dictionaries_size | ||
| | int }} | ||
|
|
@@ -26,6 +31,11 @@ data: | |
| compression_worker: | ||
| logging_level: {{ .Values.clpConfig.compression_worker.logging_level | quote }} | ||
| data_directory: "/var/data" | ||
| garbage_collector: | ||
| logging_level: {{ .Values.clpConfig.garbage_collector.logging_level | quote }} | ||
| sweep_interval: | ||
| archive: {{ .Values.clpConfig.garbage_collector.sweep_interval.archive | int }} | ||
| search_result: {{ .Values.clpConfig.garbage_collector.sweep_interval.search_result | int }} | ||
|
Comment on lines
+34
to
+38
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for sweep_interval in the codebase
echo "=== Searching for sweep_interval in Python files ==="
find . -type f -name "*.py" | xargs grep -n "sweep_interval" 2>/dev/null | head -30
echo -e "\n=== Searching for sweep_interval in YAML files ==="
find . -type f -name "values.yaml" -o -name "*.yaml" | xargs grep -A 3 -B 3 "sweep_interval" 2>/dev/null | head -50
echo -e "\n=== Checking configmap.yaml for context around sweep_interval ==="
find . -path "*/templates/configmap.yaml" | xargs cat 2>/dev/null | head -100
echo -e "\n=== Searching for retention_period to see comparison pattern ==="
find . -type f \( -name "*.yaml" -o -name "*.yml" \) | xargs grep -A 3 -B 3 "retention_period" 2>/dev/null | head -50Repository: y-scope/clp Length of output: 12720 Consider adding conditional rendering for sweep_interval consistency. The If sweeping should be disableable via null (like |
||
| database: | ||
| auto_commit: false | ||
| compress: true | ||
|
|
@@ -68,6 +78,11 @@ data: | |
| db_name: {{ .Values.clpConfig.results_cache.db_name | quote }} | ||
| host: {{ include "clp.fullname" . }}-results-cache | ||
| port: 27017 | ||
| {{- if .Values.clpConfig.results_cache.retention_period }} | ||
| retention_period: {{ .Values.clpConfig.results_cache.retention_period | int }} | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| {{- else }} | ||
| retention_period: null | ||
| {{- end }} | ||
| stream_collection_name: {{ .Values.clpConfig.results_cache.stream_collection_name | quote }} | ||
| stream_output: | ||
| storage: | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,109 @@ | ||||||
| {{- if or .Values.clpConfig.archive_output.retention_period .Values.clpConfig.results_cache.retention_period }} | ||||||
| apiVersion: "apps/v1" | ||||||
| kind: "Deployment" | ||||||
| metadata: | ||||||
| name: {{ include "clp.fullname" . }}-garbage-collector | ||||||
| labels: | ||||||
| {{- include "clp.labels" . | nindent 4 }} | ||||||
| app.kubernetes.io/component: "garbage-collector" | ||||||
| spec: | ||||||
| replicas: 1 | ||||||
| selector: | ||||||
| matchLabels: | ||||||
| {{- include "clp.selectorLabels" . | nindent 6 }} | ||||||
| app.kubernetes.io/component: "garbage-collector" | ||||||
| template: | ||||||
| metadata: | ||||||
| labels: | ||||||
| {{- include "clp.labels" . | nindent 8 }} | ||||||
| app.kubernetes.io/component: "garbage-collector" | ||||||
| spec: | ||||||
| serviceAccountName: {{ include "clp.fullname" . }}-job-watcher | ||||||
| terminationGracePeriodSeconds: 10 | ||||||
| securityContext: | ||||||
| runAsUser: {{ .Values.securityContext.firstParty.uid }} | ||||||
| runAsGroup: {{ .Values.securityContext.firstParty.gid }} | ||||||
| fsGroup: {{ .Values.securityContext.firstParty.gid }} | ||||||
| initContainers: | ||||||
| - {{- include "clp.waitFor" (dict | ||||||
| "root" . | ||||||
| "type" "job" | ||||||
| "name" "db-table-creator" | ||||||
| ) | nindent 10 }} | ||||||
| - {{- include "clp.waitFor" (dict | ||||||
| "root" . | ||||||
| "type" "job" | ||||||
| "name" "results-cache-indices-creator" | ||||||
| ) | nindent 10 }} | ||||||
| containers: | ||||||
| - name: "garbage-collector" | ||||||
| image: "{{ include "clp.image.ref" . }}" | ||||||
| imagePullPolicy: "{{ .Values.image.clpPackage.pullPolicy }}" | ||||||
| env: | ||||||
| - name: "CLP_DB_PASS" | ||||||
| valueFrom: | ||||||
| secretKeyRef: | ||||||
| name: {{ include "clp.fullname" . }}-database | ||||||
| key: "password" | ||||||
| - name: "CLP_DB_USER" | ||||||
| valueFrom: | ||||||
| secretKeyRef: | ||||||
| name: {{ include "clp.fullname" . }}-database | ||||||
| key: "username" | ||||||
| - name: "CLP_HOME" | ||||||
| value: "/opt/clp" | ||||||
| - name: "CLP_LOGGING_LEVEL" | ||||||
| value: {{ .Values.clpConfig.garbage_collector.logging_level | quote }} | ||||||
| - name: "CLP_LOGS_DIR" | ||||||
| value: "/var/log/garbage_collector" | ||||||
| - name: "PYTHONPATH" | ||||||
| value: "/opt/clp/lib/python3/site-packages" | ||||||
| volumeMounts: | ||||||
| - name: "config" | ||||||
| mountPath: "/etc/clp-config.yaml" | ||||||
| subPath: "clp-config.yaml" | ||||||
| readOnly: true | ||||||
| - name: "tmp" | ||||||
| mountPath: "/var/log" | ||||||
|
Comment on lines
+66
to
+67
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the archive_garbage_collector.py, called by garbage collector, writes to clp/components/job-orchestration/job_orchestration/garbage_collector/archive_garbage_collector.py Line 205 in c7c2ffc
which:
@coderabbitai create an issue to track the request of letting archive_garbage_collector.py write to some other directory than
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: Length of output: 2576 🏁 Script executed: Length of output: 6361 🏁 Script executed: Length of output: 42 @junhaoliao I've created issue #1823 to track this request: #1823 The issue documents all three problems you identified:
The issue includes backlinks to this PR and comment, references the affected code locations, and outlines the required changes for both the Python code and Docker Compose orchestration. I've assigned it to you for tracking. 🧠 Learnings used |
||||||
| - name: {{ include "clp.volumeName" (dict | ||||||
| "component_category" "garbage-collector" | ||||||
| "name" "logs" | ||||||
| ) | quote }} | ||||||
| mountPath: "/var/log/garbage_collector" | ||||||
| - name: {{ include "clp.volumeName" (dict | ||||||
| "component_category" "shared-data" | ||||||
| "name" "archives" | ||||||
| ) | quote }} | ||||||
| mountPath: "/var/data/archives" | ||||||
| - name: {{ include "clp.volumeName" (dict | ||||||
| "component_category" "shared-data" | ||||||
| "name" "streams" | ||||||
| ) | quote }} | ||||||
| mountPath: "/var/data/streams" | ||||||
| command: [ | ||||||
| "python3", "-u", | ||||||
| "-m", "job_orchestration.garbage_collector.garbage_collector", | ||||||
| "--config", "/etc/clp-config.yaml" | ||||||
| ] | ||||||
| volumes: | ||||||
| - {{- include "clp.pvcVolume" (dict | ||||||
| "root" . | ||||||
| "component_category" "garbage-collector" | ||||||
| "name" "logs" | ||||||
| ) | nindent 10 }} | ||||||
| - {{- include "clp.pvcVolume" (dict | ||||||
| "root" . | ||||||
| "component_category" "shared-data" | ||||||
| "name" "archives" | ||||||
| ) | nindent 10 }} | ||||||
| - {{- include "clp.pvcVolume" (dict | ||||||
| "root" . | ||||||
| "component_category" "shared-data" | ||||||
| "name" "streams" | ||||||
| ) | nindent 10 }} | ||||||
| - name: "config" | ||||||
| configMap: | ||||||
| name: {{ include "clp.fullname" . }}-config | ||||||
| - name: "tmp" | ||||||
| emptyDir: {} | ||||||
| {{- end }} | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| {{- if or .Values.clpConfig.archive_output.retention_period .Values.clpConfig.results_cache.retention_period }} | ||
| {{- include "clp.createLocalPv" (dict | ||
| "root" . | ||
| "component_category" "garbage-collector" | ||
| "name" "logs" | ||
| "nodeRole" "control-plane" | ||
| "capacity" "5Gi" | ||
| "accessModes" (list "ReadWriteOnce") | ||
| "hostPath" (printf "%s/garbage_collector" .Values.clpConfig.logs_directory) | ||
| ) }} | ||
| {{- end }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| {{- if or .Values.clpConfig.archive_output.retention_period .Values.clpConfig.results_cache.retention_period }} | ||
| {{- include "clp.createPvc" (dict | ||
| "root" . | ||
| "component_category" "garbage-collector" | ||
| "name" "logs" | ||
| "capacity" "5Gi" | ||
| "accessModes" (list "ReadWriteOnce") | ||
| ) }} | ||
| {{- end }} |
Uh oh!
There was an error while loading. Please reload this page.