From b2429b3272c0c1c29a81bff67b8417fcfd2869c7 Mon Sep 17 00:00:00 2001 From: Mohsin Zaidi <2236875+smrz2001@users.noreply.github.com> Date: Thu, 11 Jul 2024 13:26:44 -0400 Subject: [PATCH] fix: use same c1 p2p key dir as store dir (#201) --- operator/src/network/controller.rs | 100 +++++++++++------- operator/src/network/ipfs.rs | 5 + operator/src/network/testdata/ceramic_ss_1 | 4 + .../network/testdata/ceramic_ss_weighted_0 | 4 + .../network/testdata/ceramic_ss_weighted_1 | 4 + .../network/testdata/ceramic_ss_weighted_2 | 4 + .../network/testdata/ceramic_ss_weighted_3 | 4 + .../network/testdata/ceramic_ss_weighted_4 | 4 + .../network/testdata/ceramic_ss_weighted_5 | 4 + .../network/testdata/ceramic_ss_weighted_6 | 4 + .../network/testdata/ceramic_ss_weighted_7 | 4 + .../network/testdata/ceramic_ss_weighted_8 | 4 + .../network/testdata/ceramic_ss_weighted_9 | 4 + .../default_stubs/cas_ipfs_stateful_set | 4 + .../default_stubs/ceramic_stateful_set | 4 + 15 files changed, 117 insertions(+), 40 deletions(-) diff --git a/operator/src/network/controller.rs b/operator/src/network/controller.rs index 4850a3a..71b5f9b 100644 --- a/operator/src/network/controller.rs +++ b/operator/src/network/controller.rs @@ -2269,7 +2269,7 @@ mod tests { stub.ceramics[0].stateful_set.patch(expect![[r#" --- original +++ modified - @@ -218,46 +218,8 @@ + @@ -218,50 +218,8 @@ ] }, { @@ -2299,6 +2299,10 @@ mod tests { - "value": "local" - }, - { + - "name": "CERAMIC_ONE_P2P_KEY_DIR", + - "value": "/data/ipfs" + - }, + - { - "name": "CERAMIC_ONE_STORE_DIR", - "value": "/data/ipfs" - }, @@ -2318,7 +2322,7 @@ mod tests { "name": "ipfs", "ports": [ { - @@ -278,14 +240,14 @@ + @@ -282,14 +240,14 @@ ], "resources": { "limits": { @@ -2337,7 +2341,7 @@ mod tests { } }, "volumeMounts": [ - @@ -292,6 +254,11 @@ + @@ -296,6 +254,11 @@ { "mountPath": "/data/ipfs", "name": "ipfs-data" @@ -2349,7 +2353,7 @@ mod tests { } ] } - @@ -431,6 +398,13 @@ + @@ -435,6 +398,13 @@ "persistentVolumeClaim": { "claimName": "postgres-data" } @@ -2421,7 +2425,7 @@ mod tests { stub.ceramics[0].stateful_set.patch(expect![[r#" --- original +++ modified - @@ -218,46 +218,8 @@ + @@ -218,50 +218,8 @@ ] }, { @@ -2451,6 +2455,10 @@ mod tests { - "value": "local" - }, - { + - "name": "CERAMIC_ONE_P2P_KEY_DIR", + - "value": "/data/ipfs" + - }, + - { - "name": "CERAMIC_ONE_STORE_DIR", - "value": "/data/ipfs" - }, @@ -2470,7 +2478,7 @@ mod tests { "name": "ipfs", "ports": [ { - @@ -278,14 +240,14 @@ + @@ -282,14 +240,14 @@ ], "resources": { "limits": { @@ -2491,7 +2499,7 @@ mod tests { } }, "volumeMounts": [ - @@ -292,6 +254,11 @@ + @@ -296,6 +254,11 @@ { "mountPath": "/data/ipfs", "name": "ipfs-data" @@ -2503,7 +2511,7 @@ mod tests { } ] } - @@ -431,6 +398,13 @@ + @@ -435,6 +398,13 @@ "persistentVolumeClaim": { "claimName": "postgres-data" } @@ -2517,7 +2525,7 @@ mod tests { } ] } - @@ -470,7 +444,7 @@ + @@ -474,7 +444,7 @@ ], "resources": { "requests": { @@ -2578,7 +2586,7 @@ mod tests { stub.ceramics[0].stateful_set.patch(expect![[r#" --- original +++ modified - @@ -218,46 +218,8 @@ + @@ -218,50 +218,8 @@ ] }, { @@ -2608,6 +2616,10 @@ mod tests { - "value": "local" - }, - { + - "name": "CERAMIC_ONE_P2P_KEY_DIR", + - "value": "/data/ipfs" + - }, + - { - "name": "CERAMIC_ONE_STORE_DIR", - "value": "/data/ipfs" - }, @@ -2627,7 +2639,7 @@ mod tests { "name": "ipfs", "ports": [ { - @@ -278,14 +240,14 @@ + @@ -282,14 +240,14 @@ ], "resources": { "limits": { @@ -2646,7 +2658,7 @@ mod tests { } }, "volumeMounts": [ - @@ -292,6 +254,16 @@ + @@ -296,6 +254,16 @@ { "mountPath": "/data/ipfs", "name": "ipfs-data" @@ -2663,7 +2675,7 @@ mod tests { } ] } - @@ -431,6 +403,13 @@ + @@ -435,6 +403,13 @@ "persistentVolumeClaim": { "claimName": "postgres-data" } @@ -2749,7 +2761,7 @@ mod tests { "name": "CERAMIC_ONE_METRICS_BIND_ADDRESS", "value": "0.0.0.0:9465" }, - @@ -252,11 +256,19 @@ + @@ -256,11 +260,19 @@ "value": "/ip4/0.0.0.0/tcp/4101" }, { @@ -2770,7 +2782,7 @@ mod tests { "imagePullPolicy": "Always", "name": "ipfs", "ports": [ - @@ -278,14 +290,14 @@ + @@ -282,14 +294,14 @@ ], "resources": { "limits": { @@ -2791,7 +2803,7 @@ mod tests { } }, "volumeMounts": [ - @@ -470,9 +482,10 @@ + @@ -474,9 +486,10 @@ ], "resources": { "requests": { @@ -3020,7 +3032,7 @@ mod tests { stub.cas_ipfs_stateful_set.patch(expect![[r#" --- original +++ modified - @@ -95,14 +95,14 @@ + @@ -99,14 +99,14 @@ ], "resources": { "limits": { @@ -3041,7 +3053,7 @@ mod tests { } }, "volumeMounts": [ - @@ -136,9 +136,10 @@ + @@ -140,9 +140,10 @@ ], "resources": { "requests": { @@ -3198,7 +3210,7 @@ mod tests { } }, "volumeMounts": [ - @@ -377,14 +377,14 @@ + @@ -381,14 +381,14 @@ "name": "init-ceramic-config", "resources": { "limits": { @@ -3219,7 +3231,7 @@ mod tests { } }, "volumeMounts": [ - @@ -453,7 +453,7 @@ + @@ -457,7 +457,7 @@ ], "resources": { "requests": { @@ -3419,8 +3431,8 @@ mod tests { + "value": "dev-unstable" }, { - "name": "CERAMIC_ONE_STORE_DIR", - @@ -315,7 +311,7 @@ + "name": "CERAMIC_ONE_P2P_KEY_DIR", + @@ -319,7 +315,7 @@ }, { "name": "CAS_API_URL", @@ -3429,7 +3441,7 @@ mod tests { }, { "name": "CERAMIC_CORS_ALLOWED_ORIGINS", - @@ -331,11 +327,7 @@ + @@ -335,11 +331,7 @@ }, { "name": "CERAMIC_NETWORK", @@ -3442,7 +3454,7 @@ mod tests { }, { "name": "CERAMIC_SQLITE_PATH", - @@ -347,7 +339,7 @@ + @@ -351,7 +343,7 @@ }, { "name": "ETH_RPC_URL", @@ -3487,7 +3499,7 @@ mod tests { "livenessProbe": { "httpGet": { "path": "/api/v0/node/healthcheck", - @@ -373,7 +373,7 @@ + @@ -377,7 +377,7 @@ } ], "image": "ceramicnetwork/composedb-cli:latest", @@ -3902,7 +3914,7 @@ mod tests { } ], "image": "ceramicnetwork/composedb:latest", - @@ -370,6 +374,10 @@ + @@ -374,6 +378,10 @@ "name": "ceramic-postgres-auth" } } @@ -4139,7 +4151,7 @@ mod tests { stub.ceramics[0].stateful_set.patch(expect![[r#" --- original +++ modified - @@ -472,7 +472,8 @@ + @@ -476,7 +476,8 @@ "requests": { "storage": "10Gi" } @@ -4179,7 +4191,7 @@ mod tests { stub.ceramics[0].stateful_set.patch(expect![[r#" --- original +++ modified - @@ -218,46 +218,8 @@ + @@ -218,50 +218,8 @@ ] }, { @@ -4209,6 +4221,10 @@ mod tests { - "value": "local" - }, - { + - "name": "CERAMIC_ONE_P2P_KEY_DIR", + - "value": "/data/ipfs" + - }, + - { - "name": "CERAMIC_ONE_STORE_DIR", - "value": "/data/ipfs" - }, @@ -4228,7 +4244,7 @@ mod tests { "name": "ipfs", "ports": [ { - @@ -278,14 +240,14 @@ + @@ -282,14 +240,14 @@ ], "resources": { "limits": { @@ -4247,7 +4263,7 @@ mod tests { } }, "volumeMounts": [ - @@ -292,6 +254,11 @@ + @@ -296,6 +254,11 @@ { "mountPath": "/data/ipfs", "name": "ipfs-data" @@ -4259,7 +4275,7 @@ mod tests { } ] } - @@ -431,6 +398,13 @@ + @@ -435,6 +398,13 @@ "persistentVolumeClaim": { "claimName": "postgres-data" } @@ -4273,7 +4289,7 @@ mod tests { } ] } - @@ -472,7 +446,8 @@ + @@ -476,7 +446,8 @@ "requests": { "storage": "10Gi" } @@ -4547,7 +4563,7 @@ mod tests { "volumeMounts": [ { "mountPath": "/config", - @@ -252,6 +268,10 @@ + @@ -256,6 +272,10 @@ "value": "/ip4/0.0.0.0/tcp/4101" }, { @@ -4558,7 +4574,7 @@ mod tests { "name": "RUST_LOG", "value": "info,ceramic_one=debug,multipart=error" } - @@ -274,6 +294,11 @@ + @@ -278,6 +298,11 @@ "containerPort": 9465, "name": "metrics", "protocol": "TCP" @@ -4570,7 +4586,7 @@ mod tests { } ], "resources": { - @@ -288,6 +313,13 @@ + @@ -292,6 +317,13 @@ "memory": "1Gi" } }, @@ -4584,7 +4600,7 @@ mod tests { "volumeMounts": [ { "mountPath": "/data/ipfs", - @@ -350,6 +382,10 @@ + @@ -354,6 +386,10 @@ "value": "http://ganache:8545" }, { @@ -4599,7 +4615,7 @@ mod tests { stub.cas_ipfs_stateful_set.patch(expect![[r#" --- original +++ modified - @@ -69,6 +69,10 @@ + @@ -73,6 +73,10 @@ "value": "/ip4/0.0.0.0/tcp/4101" }, { @@ -4610,7 +4626,7 @@ mod tests { "name": "RUST_LOG", "value": "info,ceramic_one=debug,multipart=error" } - @@ -91,6 +95,11 @@ + @@ -95,6 +99,11 @@ "containerPort": 9465, "name": "metrics", "protocol": "TCP" @@ -4622,7 +4638,7 @@ mod tests { } ], "resources": { - @@ -105,6 +114,13 @@ + @@ -109,6 +118,13 @@ "memory": "1Gi" } }, @@ -4826,7 +4842,7 @@ mod tests { stub.ceramics[0].stateful_set.patch(expect![[r#" --- original +++ modified - @@ -397,6 +397,95 @@ + @@ -401,6 +401,99 @@ "name": "ceramic-init" } ] @@ -4869,6 +4885,10 @@ mod tests { + "value": "local" + }, + { + + "name": "CERAMIC_ONE_P2P_KEY_DIR", + + "value": "/data/ipfs" + + }, + + { + "name": "CERAMIC_ONE_STORE_DIR", + "value": "/data/ipfs" + }, diff --git a/operator/src/network/ipfs.rs b/operator/src/network/ipfs.rs index 82af8e9..beab490 100644 --- a/operator/src/network/ipfs.rs +++ b/operator/src/network/ipfs.rs @@ -192,6 +192,11 @@ impl RustIpfsConfig { value: Some(IPFS_STORE_DIR.to_owned()), ..Default::default() }, + EnvVar { + name: "CERAMIC_ONE_P2P_KEY_DIR".to_owned(), + value: Some(IPFS_STORE_DIR.to_owned()), + ..Default::default() + }, EnvVar { name: "CERAMIC_ONE_NETWORK".to_owned(), value: Some(net_config.network_type.name().to_owned()), diff --git a/operator/src/network/testdata/ceramic_ss_1 b/operator/src/network/testdata/ceramic_ss_1 index aa29ec1..0ac2c80 100644 --- a/operator/src/network/testdata/ceramic_ss_1 +++ b/operator/src/network/testdata/ceramic_ss_1 @@ -243,6 +243,10 @@ Request { "name": "CERAMIC_ONE_NETWORK", "value": "local" }, + { + "name": "CERAMIC_ONE_P2P_KEY_DIR", + "value": "/data/ipfs" + }, { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" diff --git a/operator/src/network/testdata/ceramic_ss_weighted_0 b/operator/src/network/testdata/ceramic_ss_weighted_0 index 8cc42df..ee9141a 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_0 +++ b/operator/src/network/testdata/ceramic_ss_weighted_0 @@ -243,6 +243,10 @@ Request { "name": "CERAMIC_ONE_NETWORK", "value": "local" }, + { + "name": "CERAMIC_ONE_P2P_KEY_DIR", + "value": "/data/ipfs" + }, { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" diff --git a/operator/src/network/testdata/ceramic_ss_weighted_1 b/operator/src/network/testdata/ceramic_ss_weighted_1 index 9ba7986..142d499 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_1 +++ b/operator/src/network/testdata/ceramic_ss_weighted_1 @@ -243,6 +243,10 @@ Request { "name": "CERAMIC_ONE_NETWORK", "value": "local" }, + { + "name": "CERAMIC_ONE_P2P_KEY_DIR", + "value": "/data/ipfs" + }, { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" diff --git a/operator/src/network/testdata/ceramic_ss_weighted_2 b/operator/src/network/testdata/ceramic_ss_weighted_2 index 9fda600..f1752aa 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_2 +++ b/operator/src/network/testdata/ceramic_ss_weighted_2 @@ -243,6 +243,10 @@ Request { "name": "CERAMIC_ONE_NETWORK", "value": "local" }, + { + "name": "CERAMIC_ONE_P2P_KEY_DIR", + "value": "/data/ipfs" + }, { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" diff --git a/operator/src/network/testdata/ceramic_ss_weighted_3 b/operator/src/network/testdata/ceramic_ss_weighted_3 index 688cc72..4faee5c 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_3 +++ b/operator/src/network/testdata/ceramic_ss_weighted_3 @@ -243,6 +243,10 @@ Request { "name": "CERAMIC_ONE_NETWORK", "value": "local" }, + { + "name": "CERAMIC_ONE_P2P_KEY_DIR", + "value": "/data/ipfs" + }, { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" diff --git a/operator/src/network/testdata/ceramic_ss_weighted_4 b/operator/src/network/testdata/ceramic_ss_weighted_4 index 6e2ff27..061f1b5 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_4 +++ b/operator/src/network/testdata/ceramic_ss_weighted_4 @@ -243,6 +243,10 @@ Request { "name": "CERAMIC_ONE_NETWORK", "value": "local" }, + { + "name": "CERAMIC_ONE_P2P_KEY_DIR", + "value": "/data/ipfs" + }, { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" diff --git a/operator/src/network/testdata/ceramic_ss_weighted_5 b/operator/src/network/testdata/ceramic_ss_weighted_5 index 3fa2e01..d54053c 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_5 +++ b/operator/src/network/testdata/ceramic_ss_weighted_5 @@ -243,6 +243,10 @@ Request { "name": "CERAMIC_ONE_NETWORK", "value": "local" }, + { + "name": "CERAMIC_ONE_P2P_KEY_DIR", + "value": "/data/ipfs" + }, { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" diff --git a/operator/src/network/testdata/ceramic_ss_weighted_6 b/operator/src/network/testdata/ceramic_ss_weighted_6 index 12fbd68..3481330 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_6 +++ b/operator/src/network/testdata/ceramic_ss_weighted_6 @@ -243,6 +243,10 @@ Request { "name": "CERAMIC_ONE_NETWORK", "value": "local" }, + { + "name": "CERAMIC_ONE_P2P_KEY_DIR", + "value": "/data/ipfs" + }, { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" diff --git a/operator/src/network/testdata/ceramic_ss_weighted_7 b/operator/src/network/testdata/ceramic_ss_weighted_7 index 1bd6720..7701851 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_7 +++ b/operator/src/network/testdata/ceramic_ss_weighted_7 @@ -243,6 +243,10 @@ Request { "name": "CERAMIC_ONE_NETWORK", "value": "local" }, + { + "name": "CERAMIC_ONE_P2P_KEY_DIR", + "value": "/data/ipfs" + }, { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" diff --git a/operator/src/network/testdata/ceramic_ss_weighted_8 b/operator/src/network/testdata/ceramic_ss_weighted_8 index 5097349..60f730f 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_8 +++ b/operator/src/network/testdata/ceramic_ss_weighted_8 @@ -243,6 +243,10 @@ Request { "name": "CERAMIC_ONE_NETWORK", "value": "local" }, + { + "name": "CERAMIC_ONE_P2P_KEY_DIR", + "value": "/data/ipfs" + }, { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" diff --git a/operator/src/network/testdata/ceramic_ss_weighted_9 b/operator/src/network/testdata/ceramic_ss_weighted_9 index 52b5fb1..2f398a6 100644 --- a/operator/src/network/testdata/ceramic_ss_weighted_9 +++ b/operator/src/network/testdata/ceramic_ss_weighted_9 @@ -243,6 +243,10 @@ Request { "name": "CERAMIC_ONE_NETWORK", "value": "local" }, + { + "name": "CERAMIC_ONE_P2P_KEY_DIR", + "value": "/data/ipfs" + }, { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" diff --git a/operator/src/network/testdata/default_stubs/cas_ipfs_stateful_set b/operator/src/network/testdata/default_stubs/cas_ipfs_stateful_set index c70dbf3..349aaeb 100644 --- a/operator/src/network/testdata/default_stubs/cas_ipfs_stateful_set +++ b/operator/src/network/testdata/default_stubs/cas_ipfs_stateful_set @@ -60,6 +60,10 @@ Request { "name": "CERAMIC_ONE_NETWORK", "value": "local" }, + { + "name": "CERAMIC_ONE_P2P_KEY_DIR", + "value": "/data/ipfs" + }, { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs" diff --git a/operator/src/network/testdata/default_stubs/ceramic_stateful_set b/operator/src/network/testdata/default_stubs/ceramic_stateful_set index a312d46..e52ae70 100644 --- a/operator/src/network/testdata/default_stubs/ceramic_stateful_set +++ b/operator/src/network/testdata/default_stubs/ceramic_stateful_set @@ -243,6 +243,10 @@ Request { "name": "CERAMIC_ONE_NETWORK", "value": "local" }, + { + "name": "CERAMIC_ONE_P2P_KEY_DIR", + "value": "/data/ipfs" + }, { "name": "CERAMIC_ONE_STORE_DIR", "value": "/data/ipfs"