From d43500f85e3df349067335eaef818a7a1706696c Mon Sep 17 00:00:00 2001 From: Alexander Koptelov Date: Thu, 16 Nov 2023 17:02:39 +0300 Subject: [PATCH] Start test only after all P2Ps are ready --- openmina-discovery/Chart.lock | 10 +++++----- openmina-discovery/Chart.yaml | 8 ++++---- openmina-discovery/scripts/wait.sh | 3 +++ openmina-discovery/templates/test-job.yaml | 10 ++++++++++ openmina-discovery/values.yaml | 6 +++--- 5 files changed, 25 insertions(+), 12 deletions(-) create mode 100644 openmina-discovery/scripts/wait.sh diff --git a/openmina-discovery/Chart.lock b/openmina-discovery/Chart.lock index a29527f..8d19064 100644 --- a/openmina-discovery/Chart.lock +++ b/openmina-discovery/Chart.lock @@ -1,12 +1,12 @@ dependencies: - name: ocaml-test-node repository: file://../ocaml-test-node - version: 0.0.2 + version: 0.0.3 - name: ocaml-test-node repository: file://../ocaml-test-node - version: 0.0.2 + version: 0.0.3 - name: rust-test-node repository: file://../rust-test-node - version: 0.0.1 -digest: sha256:5ad99b514c4ba2afa14e99d3643705f5f3d939abd6253ad4f5a3cb793a2d50c3 -generated: "2023-11-16T12:49:09.832980503+03:00" + version: 0.0.2 +digest: sha256:f148e6afe2ee14ca4b11d16b27cda5007bd729a5e85a171aca025d0f33ff7a3c +generated: "2023-11-16T16:36:52.585039263+03:00" diff --git a/openmina-discovery/Chart.yaml b/openmina-discovery/Chart.yaml index cd729df..881f178 100644 --- a/openmina-discovery/Chart.yaml +++ b/openmina-discovery/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.0.3 +version: 0.0.4 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to @@ -28,12 +28,12 @@ dependencies: - name: ocaml-test-node repository: file://../ocaml-test-node alias: seed - version: ">=0.0.2" + version: ">=0.0.3" - name: ocaml-test-node alias: ocaml repository: file://../ocaml-test-node - version: ">=0.0.2" + version: ">=0.0.3" - name: rust-test-node alias: rust repository: file://../rust-test-node - version: ">=0.0.0" + version: ">=0.0.2" diff --git a/openmina-discovery/scripts/wait.sh b/openmina-discovery/scripts/wait.sh new file mode 100644 index 0000000..ea1c396 --- /dev/null +++ b/openmina-discovery/scripts/wait.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +kubectl wait --for=condition=available --timeout=5m deployment $(for app in $*; do echo "$INSTANCE-$app"; done) diff --git a/openmina-discovery/templates/test-job.yaml b/openmina-discovery/templates/test-job.yaml index 6c3af9a..c26b371 100644 --- a/openmina-discovery/templates/test-job.yaml +++ b/openmina-discovery/templates/test-job.yaml @@ -8,6 +8,16 @@ spec: spec: serviceAccount: {{ default "default" .Values.serviceAccount }} restartPolicy: OnFailure + initContainers: + - name: wait + image: alpine/k8s:1.28.0 + command: [ "sh", "/scripts/wait.sh", {{ .Values.nodes | quote }} ] + volumeMounts: + - name: scripts + mountPath: /scripts + env: + - name: INSTANCE + value: {{ .Release.Name }} containers: - name: main image: alpine/k8s:1.28.0 diff --git a/openmina-discovery/values.yaml b/openmina-discovery/values.yaml index 2fa06c9..545ca41 100644 --- a/openmina-discovery/values.yaml +++ b/openmina-discovery/values.yaml @@ -1,4 +1,6 @@ nodes: seed ocaml rust +global: + readinessProbe: P2PSocket seed: daemonJson: @@ -15,11 +17,9 @@ ocaml: daemonJson: local: path: /var/lib/coda/berkeley.json - seedWaitTimeout: 20 + seedWaitTimeout: 5 rust: peers: - name: seed peerId: 12D3KooWBT8pyJAfWJhdeGYAtKvcaUmm78ExyZ6uo6BEimYNVat1 - probes: - readiness: false