Skip to content

Commit

Permalink
fix: explicitly specify ceramic-one network as local
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielc committed Nov 1, 2023
1 parent 56fdae2 commit 83cb089
Show file tree
Hide file tree
Showing 14 changed files with 148 additions and 16 deletions.
12 changes: 12 additions & 0 deletions operator/src/network/ceramic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,18 @@ impl RustIpfsConfig {
value: Some("/data/ipfs".to_owned()),
..Default::default()
},
EnvVar {
name: "CERAMIC_ONE_NETWORK".to_owned(),
value: Some("local".to_owned()),
..Default::default()
},
EnvVar {
name: "CERAMIC_ONE_LOCAL_NETWORK_ID".to_owned(),
// We can use a hard coded value since nodes from other networks should not be
// able to connect.
value: Some("0".to_owned()),
..Default::default()
},
]),
image: Some(self.image.to_owned()),
image_pull_policy: Some(self.image_pull_policy.to_owned()),
Expand Down
56 changes: 40 additions & 16 deletions operator/src/network/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1774,7 +1774,7 @@ mod tests {
stub.ceramics[0].stateful_set.patch(expect![[r#"
--- original
+++ modified
@@ -137,34 +137,8 @@
@@ -137,42 +137,8 @@
]
},
{
Expand Down Expand Up @@ -1802,6 +1802,14 @@ mod tests {
- {
- "name": "CERAMIC_ONE_STORE_DIR",
- "value": "/data/ipfs"
- },
- {
- "name": "CERAMIC_ONE_NETWORK",
- "value": "local"
- },
- {
- "name": "CERAMIC_ONE_LOCAL_NETWORK_ID",
- "value": "0"
- }
- ],
- "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest",
Expand All @@ -1811,7 +1819,7 @@ mod tests {
"name": "ipfs",
"ports": [
{
@@ -199,6 +173,11 @@
@@ -207,6 +173,11 @@
{
"mountPath": "/data/ipfs",
"name": "ipfs-data"
Expand All @@ -1823,7 +1831,7 @@ mod tests {
}
]
}
@@ -307,6 +286,13 @@
@@ -315,6 +286,13 @@
"persistentVolumeClaim": {
"claimName": "ipfs-data"
}
Expand Down Expand Up @@ -1891,7 +1899,7 @@ mod tests {
stub.ceramics[0].stateful_set.patch(expect![[r#"
--- original
+++ modified
@@ -137,34 +137,8 @@
@@ -137,42 +137,8 @@
]
},
{
Expand Down Expand Up @@ -1919,6 +1927,14 @@ mod tests {
- {
- "name": "CERAMIC_ONE_STORE_DIR",
- "value": "/data/ipfs"
- },
- {
- "name": "CERAMIC_ONE_NETWORK",
- "value": "local"
- },
- {
- "name": "CERAMIC_ONE_LOCAL_NETWORK_ID",
- "value": "0"
- }
- ],
- "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest",
Expand All @@ -1928,7 +1944,7 @@ mod tests {
"name": "ipfs",
"ports": [
{
@@ -185,14 +159,14 @@
@@ -193,14 +159,14 @@
],
"resources": {
"limits": {
Expand All @@ -1949,7 +1965,7 @@ mod tests {
}
},
"volumeMounts": [
@@ -199,6 +173,11 @@
@@ -207,6 +173,11 @@
{
"mountPath": "/data/ipfs",
"name": "ipfs-data"
Expand All @@ -1961,7 +1977,7 @@ mod tests {
}
]
}
@@ -307,6 +286,13 @@
@@ -315,6 +286,13 @@
"persistentVolumeClaim": {
"claimName": "ipfs-data"
}
Expand Down Expand Up @@ -2027,7 +2043,7 @@ mod tests {
stub.ceramics[0].stateful_set.patch(expect![[r#"
--- original
+++ modified
@@ -137,34 +137,8 @@
@@ -137,42 +137,8 @@
]
},
{
Expand Down Expand Up @@ -2055,6 +2071,14 @@ mod tests {
- {
- "name": "CERAMIC_ONE_STORE_DIR",
- "value": "/data/ipfs"
- },
- {
- "name": "CERAMIC_ONE_NETWORK",
- "value": "local"
- },
- {
- "name": "CERAMIC_ONE_LOCAL_NETWORK_ID",
- "value": "0"
- }
- ],
- "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest",
Expand All @@ -2064,7 +2088,7 @@ mod tests {
"name": "ipfs",
"ports": [
{
@@ -199,6 +173,16 @@
@@ -207,6 +173,16 @@
{
"mountPath": "/data/ipfs",
"name": "ipfs-data"
Expand All @@ -2081,7 +2105,7 @@ mod tests {
}
]
}
@@ -307,6 +291,13 @@
@@ -315,6 +291,13 @@
"persistentVolumeClaim": {
"claimName": "ipfs-data"
}
Expand Down Expand Up @@ -2146,16 +2170,16 @@ mod tests {
stub.ceramics[0].stateful_set.patch(expect![[r#"
--- original
+++ modified
@@ -163,7 +163,7 @@
"value": "/data/ipfs"
@@ -171,7 +171,7 @@
"value": "0"
}
],
- "image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest",
+ "image": "ipfs/ipfs:rust",
"imagePullPolicy": "Always",
"name": "ipfs",
"ports": [
@@ -185,14 +185,14 @@
@@ -193,14 +193,14 @@
],
"resources": {
"limits": {
Expand Down Expand Up @@ -2503,7 +2527,7 @@ mod tests {
}
},
"volumeMounts": [
@@ -262,14 +262,14 @@
@@ -270,14 +270,14 @@
"name": "init-ceramic-config",
"resources": {
"limits": {
Expand Down Expand Up @@ -2701,7 +2725,7 @@ mod tests {
},
{
"name": "CERAMIC_SQLITE_PATH",
@@ -222,19 +222,19 @@
@@ -230,19 +230,19 @@
},
{
"name": "CERAMIC_NETWORK",
Expand Down Expand Up @@ -2761,7 +2785,7 @@ mod tests {
"livenessProbe": {
"httpGet": {
"path": "/api/v0/node/healthcheck",
@@ -257,8 +257,8 @@
@@ -265,8 +265,8 @@
"value": "2"
}
],
Expand Down
8 changes: 8 additions & 0 deletions operator/src/network/testdata/ceramic_ss_1
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ Request {
{
"name": "CERAMIC_ONE_STORE_DIR",
"value": "/data/ipfs"
},
{
"name": "CERAMIC_ONE_NETWORK",
"value": "local"
},
{
"name": "CERAMIC_ONE_LOCAL_NETWORK_ID",
"value": "0"
}
],
"image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest",
Expand Down
8 changes: 8 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_0
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ Request {
{
"name": "CERAMIC_ONE_STORE_DIR",
"value": "/data/ipfs"
},
{
"name": "CERAMIC_ONE_NETWORK",
"value": "local"
},
{
"name": "CERAMIC_ONE_LOCAL_NETWORK_ID",
"value": "0"
}
],
"image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest",
Expand Down
8 changes: 8 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_1
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ Request {
{
"name": "CERAMIC_ONE_STORE_DIR",
"value": "/data/ipfs"
},
{
"name": "CERAMIC_ONE_NETWORK",
"value": "local"
},
{
"name": "CERAMIC_ONE_LOCAL_NETWORK_ID",
"value": "0"
}
],
"image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest",
Expand Down
8 changes: 8 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_2
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ Request {
{
"name": "CERAMIC_ONE_STORE_DIR",
"value": "/data/ipfs"
},
{
"name": "CERAMIC_ONE_NETWORK",
"value": "local"
},
{
"name": "CERAMIC_ONE_LOCAL_NETWORK_ID",
"value": "0"
}
],
"image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest",
Expand Down
8 changes: 8 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_3
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ Request {
{
"name": "CERAMIC_ONE_STORE_DIR",
"value": "/data/ipfs"
},
{
"name": "CERAMIC_ONE_NETWORK",
"value": "local"
},
{
"name": "CERAMIC_ONE_LOCAL_NETWORK_ID",
"value": "0"
}
],
"image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest",
Expand Down
8 changes: 8 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_4
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ Request {
{
"name": "CERAMIC_ONE_STORE_DIR",
"value": "/data/ipfs"
},
{
"name": "CERAMIC_ONE_NETWORK",
"value": "local"
},
{
"name": "CERAMIC_ONE_LOCAL_NETWORK_ID",
"value": "0"
}
],
"image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest",
Expand Down
8 changes: 8 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_5
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ Request {
{
"name": "CERAMIC_ONE_STORE_DIR",
"value": "/data/ipfs"
},
{
"name": "CERAMIC_ONE_NETWORK",
"value": "local"
},
{
"name": "CERAMIC_ONE_LOCAL_NETWORK_ID",
"value": "0"
}
],
"image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest",
Expand Down
8 changes: 8 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_6
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ Request {
{
"name": "CERAMIC_ONE_STORE_DIR",
"value": "/data/ipfs"
},
{
"name": "CERAMIC_ONE_NETWORK",
"value": "local"
},
{
"name": "CERAMIC_ONE_LOCAL_NETWORK_ID",
"value": "0"
}
],
"image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest",
Expand Down
8 changes: 8 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_7
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ Request {
{
"name": "CERAMIC_ONE_STORE_DIR",
"value": "/data/ipfs"
},
{
"name": "CERAMIC_ONE_NETWORK",
"value": "local"
},
{
"name": "CERAMIC_ONE_LOCAL_NETWORK_ID",
"value": "0"
}
],
"image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest",
Expand Down
8 changes: 8 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_8
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ Request {
{
"name": "CERAMIC_ONE_STORE_DIR",
"value": "/data/ipfs"
},
{
"name": "CERAMIC_ONE_NETWORK",
"value": "local"
},
{
"name": "CERAMIC_ONE_LOCAL_NETWORK_ID",
"value": "0"
}
],
"image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest",
Expand Down
8 changes: 8 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_9
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ Request {
{
"name": "CERAMIC_ONE_STORE_DIR",
"value": "/data/ipfs"
},
{
"name": "CERAMIC_ONE_NETWORK",
"value": "local"
},
{
"name": "CERAMIC_ONE_LOCAL_NETWORK_ID",
"value": "0"
}
],
"image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,14 @@ Request {
{
"name": "CERAMIC_ONE_STORE_DIR",
"value": "/data/ipfs"
},
{
"name": "CERAMIC_ONE_NETWORK",
"value": "local"
},
{
"name": "CERAMIC_ONE_LOCAL_NETWORK_ID",
"value": "0"
}
],
"image": "public.ecr.aws/r5b3e0r5/3box/ceramic-one:latest",
Expand Down

0 comments on commit 83cb089

Please sign in to comment.