From d70b87d2bb3a8f668cc12235992f2d0f57ce3c52 Mon Sep 17 00:00:00 2001 From: gmega Date: Wed, 22 Jan 2025 10:31:08 -0300 Subject: [PATCH] fix: production values for Argo workflows and RBAC --- k8s/argo-workflows/codex-workflows-rbac.yaml | 11 +++++++ .../deluge-benchmark-workflow.yaml | 20 +++++++---- k8s/clusters/devnet/deluge-chart-values.yaml | 33 +++++++++++++++++++ 3 files changed, 57 insertions(+), 7 deletions(-) create mode 100644 k8s/clusters/devnet/deluge-chart-values.yaml diff --git a/k8s/argo-workflows/codex-workflows-rbac.yaml b/k8s/argo-workflows/codex-workflows-rbac.yaml index 73fbaf5..eb55e22 100644 --- a/k8s/argo-workflows/codex-workflows-rbac.yaml +++ b/k8s/argo-workflows/codex-workflows-rbac.yaml @@ -30,6 +30,17 @@ rules: resources: [ "jobs" ] verbs: [ "*" ] --- +# This role already exists with the default Argo installer, but it might be missing, so we add it here as well. +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: executor + namespace: argo +rules: + - apiGroups: [ "argoproj.io" ] + resources: [ "workflowtaskresults" ] + verbs: [ "create", "patch" ] +--- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: diff --git a/k8s/argo-workflows/deluge-benchmark-workflow.yaml b/k8s/argo-workflows/deluge-benchmark-workflow.yaml index 5264599..04cd9da 100644 --- a/k8s/argo-workflows/deluge-benchmark-workflow.yaml +++ b/k8s/argo-workflows/deluge-benchmark-workflow.yaml @@ -16,7 +16,7 @@ spec: - name: constrained__networkSize_seeders value: "[[2, 1], [8, [1, 2, 4]], [16, [1, 2, 4, 8]], [32, [1, 2, 4, 8, 16]]]" - name: minikubeEnv - value: "true" + value: "false" - name: maxExperimentDuration value: 144h @@ -79,11 +79,11 @@ spec: command: ["sh", "-c"] source: | if [ "{{workflow.parameters.minikubeEnv}}" == "true"]; then - echo "codexstorage/bittorrent-benchmarks-workflows:latest" > /tmp/image.txt - echo "Always" > /tmp/imagePullPolicy.txt - else echo "bittorrent-benchmarks-workflows:minikube" > /tmp/image.txt echo "Never" > /tmp/imagePullPolicy.txt + else + echo "codexstorage/bittorrent-benchmarks-workflows:latest" > /tmp/image.txt + echo "Always" > /tmp/imagePullPolicy.txt fi outputs: parameters: @@ -237,15 +237,21 @@ spec: imagePullPolicy: '{{inputs.parameters.imagePullPolicy}}' command: [ "/bin/bash" ] source: | + set -e + + if [[ "{{workflow.parameters.minikubeEnv}}" == "false" ]]; then + echo "Using devnet cluster values for deploy." + VALUE_FILE=(-f "./k8s/clusters/devnet/deluge-chart-values.yaml") + fi + helm install e{{inputs.parameters.runId}} ./k8s/charts/deluge\ - --namespace codex-benchmarks\ + --namespace codex-benchmarks "${VALUE_FILE[@]}"\ --set experiment.groupId=g{{inputs.parameters.groupId}}\ --set experiment.repetitions={{inputs.parameters.repetitions}}\ --set experiment.fileSize={{inputs.parameters.fileSize}}\ --set experiment.networkSize={{inputs.parameters.networkSize}}\ --set experiment.seeders={{inputs.parameters.seeders}}\ - --set experiment.seederSets={{inputs.parameters.seederSets}}\ - --set deployment.minikubeEnv={{workflow.parameters.minikubeEnv}} + --set experiment.seederSets={{inputs.parameters.seederSets}} - name: wait-for-experiment inputs: diff --git a/k8s/clusters/devnet/deluge-chart-values.yaml b/k8s/clusters/devnet/deluge-chart-values.yaml new file mode 100644 index 0000000..01615db --- /dev/null +++ b/k8s/clusters/devnet/deluge-chart-values.yaml @@ -0,0 +1,33 @@ +experiment: + networkSize: 5 + fileSize: "100MB" + seeders: 1 + seederSets: 1 + repetitions: 2 + + # Experiments are ran as part of groups which may entail several invocations for this Helm chart. + # We therefore identify both the experiment within a group, and the group itself. + + # Identifies the experiment within the group. If left empty, defaults to the release name. + id: "" + # Identifies the experiment group. Needs to be defined by the user. + groupId: "" + + testRunner: true + +deployment: + appName: "" + + # If false, Deluge nodes will not be allowed to run on the same node. + allowColocation: false + minikubeEnv: false + + # Labels for setting deluge node affinity towards a node pool. + delugeNodePool: + workload-type: "benchmarks" + + trackerNodePool: + workload-type: "benchmarks" + + runnerNodePool: + workload-type: "benchmarks"