From 1d2be0e190f35df1b0484e3b76ffc0b1919ef401 Mon Sep 17 00:00:00 2001 From: MicaiahReid Date: Wed, 14 Jun 2023 11:53:54 -0400 Subject: [PATCH 1/4] add separate pods for bitcoind/chain-coordinator --- templates/bitcoind-pod.template.yaml | 33 ++++++++++++ templates/chain-coordinator-pod.template.yaml | 54 +++++++++++++++++++ 2 files changed, 87 insertions(+) create mode 100644 templates/bitcoind-pod.template.yaml create mode 100644 templates/chain-coordinator-pod.template.yaml diff --git a/templates/bitcoind-pod.template.yaml b/templates/bitcoind-pod.template.yaml new file mode 100644 index 0000000..7ab10c3 --- /dev/null +++ b/templates/bitcoind-pod.template.yaml @@ -0,0 +1,33 @@ +apiVersion: v1 +kind: Pod +metadata: + labels: + name: bitcoind + service: bitcoind-chain-coordinator + name: bitcoind + namespace: "{namespace}" +spec: + containers: + - command: + - /usr/local/bin/bitcoind + - -conf=/etc/bitcoin/bitcoin.conf + - -nodebuglogfile + - -pid=/run/bitcoind.pid + image: quay.io/hirosystems/bitcoind:devnet-v3 + imagePullPolicy: IfNotPresent + name: bitcoind-container + ports: + - containerPort: 18444 + name: p2p + protocol: TCP + - containerPort: 18443 + name: rpc + protocol: TCP + volumeMounts: + - mountPath: /etc/bitcoin + name: bitcoind-conf-volume + readOnly: true + volumes: + - configMap: + name: bitcoind-conf + name: bitcoind-conf-volume \ No newline at end of file diff --git a/templates/chain-coordinator-pod.template.yaml b/templates/chain-coordinator-pod.template.yaml new file mode 100644 index 0000000..79f7838 --- /dev/null +++ b/templates/chain-coordinator-pod.template.yaml @@ -0,0 +1,54 @@ +apiVersion: v1 +kind: Pod +metadata: + labels: + name: chain-coordinator + service: bitcoind-chain-coordinator + name: chain-coordinator + namespace: "{namespace}" +spec: + containers: + - command: + - ./stacks-network + - --namespace=$(NAMESPACE) + - --manifest-path=/etc/stacks-network/project/Clarinet.toml + - --deployment-plan-path=/etc/stacks-network/project/deployments/default.devnet-plan.yaml + - --project-root-path=/etc/stacks-network/project/ + env: + - name: NAMESPACE + valueFrom: + configMapKeyRef: + name: namespace-conf + key: NAMESPACE + image: stacks-network-orchestrator + imagePullPolicy: Never + name: chain-coordinator-container + ports: + - containerPort: 20445 + name: coordinator-in + protocol: TCP + - containerPort: 20446 + name: coordinator-con + protocol: TCP + volumeMounts: + - mountPath: /etc/stacks-network/project + name: project-manifest-conf-volume + - mountPath: /etc/stacks-network/project/settings + name: devnet-conf-volume + - mountPath: /etc/stacks-network/project/deployments + name: deployment-plan-conf-volume + - mountPath: /etc/stacks-network/project/contracts + name: project-dir-conf-volume + volumes: + - configMap: + name: project-manifest-conf + name: project-manifest-conf-volume + - configMap: + name: devnet-conf + name: devnet-conf-volume + - configMap: + name: deployment-plan-conf + name: deployment-plan-conf-volume + - configMap: + name: project-dir-conf + name: project-dir-conf-volume \ No newline at end of file From 068aa9a8e6ee17d480cf4b8f8e4141278e34325c Mon Sep 17 00:00:00 2001 From: MicaiahReid Date: Wed, 14 Jun 2023 16:44:23 -0400 Subject: [PATCH 2/4] add fallback_to_follower flag to stx config --- src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.rs b/src/lib.rs index 529c5b1..9216f24 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -672,6 +672,7 @@ impl StacksDevnetApiK8sManager { wait_time_for_blocks = 0 wait_time_for_microblocks = {} microblock_frequency = 1000 + fallback_to_follower = false [connection_options] # inv_sync_interval = 10 From 15bba607119e86bef5beaefc7492d12e724233e0 Mon Sep 17 00:00:00 2001 From: MicaiahReid Date: Wed, 14 Jun 2023 16:44:49 -0400 Subject: [PATCH 3/4] change stacks node image --- templates/stacks-node-pod.template.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/stacks-node-pod.template.yaml b/templates/stacks-node-pod.template.yaml index e49706f..253ed7c 100644 --- a/templates/stacks-node-pod.template.yaml +++ b/templates/stacks-node-pod.template.yaml @@ -17,9 +17,11 @@ spec: - name: BLOCKSTACK_USE_TEST_GENESIS_CHAINSTATE value: "1" - name: STACKS_LOG_DEBUG - value: "0" - image: quay.io/hirosystems/stacks-node:devnet-v3 - imagePullPolicy: IfNotPresent + value: "1" + image: stacks-node-mine + imagePullPolicy: Never + # image: quay.io/hirosystems/stacks-node:devnet-v3 + # imagePullPolicy: IfNotPresent name: stacks-node-container ports: - containerPort: 20444 From fc9731c47a94ca8da4bc8db2f1ecee9fdc2af256 Mon Sep 17 00:00:00 2001 From: MicaiahReid Date: Thu, 22 Jun 2023 10:25:55 -0400 Subject: [PATCH 4/4] remove sleep --- src/lib.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9216f24..d8e9d4e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,8 +15,7 @@ use resources::{ StacksDevnetResource, }; use serde::{de::DeserializeOwned, Deserialize, Serialize}; -use std::thread::sleep; -use std::{collections::BTreeMap, str::FromStr, time::Duration}; +use std::{collections::BTreeMap, str::FromStr}; use strum::IntoEnumIterator; use tower::BoxError; @@ -171,10 +170,8 @@ impl StacksDevnetApiK8sManager { }); } } - self.deploy_bitcoin_node_pod(&config).await?; - - sleep(Duration::from_secs(5)); + self.deploy_bitcoin_node_pod(&config).await?; self.deploy_stacks_node_pod(&config).await?; if !config.disable_stacks_api {