feat: add optional data removal with adjusted quotas

This commit is contained in:
gmega 2025-04-22 11:52:45 -03:00
parent cd77b20a82
commit 4cbb401d12
No known key found for this signature in database
GPG Key ID: 6290D34EAD824B18
6 changed files with 19 additions and 2 deletions

View File

@ -74,6 +74,7 @@ class CodexExperimentConfig(
)
download_metric_unit_bytes: int = 1
remove_data: bool = False
def build(self) -> CodexDisseminationExperiment:
node_specs = (
@ -90,6 +91,7 @@ class CodexExperimentConfig(
CodexNode(
codex_api_url=parse_url(f"http://{str(node.address)}:{node.api_port}"),
agent=agents[i],
remove_data=self.remove_data,
)
for i, node in enumerate(node_specs)
]

View File

@ -4,6 +4,9 @@ codex_experiment:
seeders: ${SEEDERS}
file_size: ${FILE_SIZE}
repetitions: ${REPETITIONS}
# Should we delete the data at the end of each experiment (slower, uses less space), or we just
# leave it there (faster, uses more space)?
remove_data: ${REMOVE_DATA}
# No need for cooldown as Codex takes forever to remove files, so there's plenty of time to log stuff. :-)
logging_cooldown: 0

View File

@ -2,6 +2,7 @@ codex_experiment:
seeders: 1
file_size: 52428800
repetitions: 3
remove_data: true
nodes:
- name: codex-1

View File

@ -9,8 +9,13 @@ Expand the name of the chart.
{{- mul $sizeNum (index $size $sizeUnit) -}}
{{- end -}}
{{- define "codex.quota" }}
{{- div (mul (include "filesize.bytes" .) 13) 10 -}}
{{- define "experiment.count" -}}
{{- mul .Values.experiment.seederSets .Values.experiment.repetitions -}}
{{- end -}}
{{- define "codex.quota" -}}
{{- $mulFactor := .Values.experiment.removeData | ternary 1 (include "experiment.count" .) -}}
{{- div (mul (mul (include "filesize.bytes" .) $mulFactor) 13) 10 -}}
{{- end -}}
{{- define "experiment.groupId" -}}

View File

@ -36,6 +36,8 @@ spec:
value: {{ .Values.experiment.repetitions | quote }}
- name: SEEDER_SETS
value: {{ .Values.experiment.seederSets | quote }}
- name: REMOVE_DATA
value: {{ .Values.experiment.removeData | quote }}
- name: FILE_SIZE
value: {{ include "filesize.bytes" . | quote }}
- name: CODEX_STATEFULSET

View File

@ -21,6 +21,10 @@ experiment:
# If set to false, does not deploy a test runner (useful if you just want the network).
testRunner: true
# If set to false, does not delete the data at the end of each experiment. This is faster
# than deleting it, but requires more space.
removeData: true
deployment:
appName: ""