Skip to content

Commit

Permalink
feat: expose the flight-sql port
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielc committed Dec 17, 2024
1 parent 24ed857 commit 1f4d79f
Show file tree
Hide file tree
Showing 30 changed files with 233 additions and 36 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CARGO = CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse RUSTFLAGS="--cfg tokio_unstab
all: build check-fmt check-clippy test

.PHONY: test
test: update
test:
# Test with default features
${CARGO} test --locked
# Test with all features
Expand All @@ -20,7 +20,7 @@ check-fmt:
update:
${CARGO} update

.PHONY: check-clippy
.PHONY: check-clippy
check-clippy:
# Check with default features
${CARGO} clippy --workspace
Expand Down
9 changes: 8 additions & 1 deletion operator/src/network/ceramic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ use crate::{
};

use super::{
controller::CERAMIC_ONE_SWARM_PORT, debug_mode_security_context,
controller::{CERAMIC_ONE_FLIGHT_SQL_PORT, CERAMIC_ONE_SWARM_PORT},
debug_mode_security_context,
storage::PersistentStorageConfig,
};

Expand Down Expand Up @@ -124,6 +125,12 @@ pub fn service_spec() -> ServiceSpec {
protocol: Some("TCP".to_owned()),
..Default::default()
},
ServicePort {
port: CERAMIC_ONE_FLIGHT_SQL_PORT,
name: Some("flight".to_owned()),
protocol: Some("TCP".to_owned()),
..Default::default()
},
ServicePort {
port: CERAMIC_ONE_SWARM_PORT,
name: Some("swarm-tcp".to_owned()),
Expand Down
118 changes: 86 additions & 32 deletions operator/src/network/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ pub const PEERS_CONFIG_MAP_NAME: &str = "keramik-peers";

pub const CERAMIC_ONE_SWARM_PORT: i32 = 4101;
pub const CERAMIC_ONE_IPFS_PORT: i32 = 5101;
pub const CERAMIC_ONE_FLIGHT_SQL_PORT: i32 = 5102;
pub const CERAMIC_SERVICE_API_PORT: i32 = 7007;
pub const CERAMIC_POSTGRES_SECRET_NAME: &str = "ceramic-postgres-auth";

Expand Down Expand Up @@ -2322,7 +2323,19 @@ mod tests {
"name": "ipfs",
"ports": [
{
@@ -282,14 +240,14 @@
@@ -275,11 +233,6 @@
"protocol": "TCP"
},
{
- "containerPort": 5102,
- "name": "flight",
- "protocol": "TCP"
- },
- {
"containerPort": 9465,
"name": "metrics",
"protocol": "TCP"
@@ -287,14 +240,14 @@
],
"resources": {
"limits": {
Expand All @@ -2341,7 +2354,7 @@ mod tests {
}
},
"volumeMounts": [
@@ -296,6 +254,11 @@
@@ -301,6 +254,11 @@
{
"mountPath": "/data/ipfs",
"name": "ipfs-data"
Expand All @@ -2353,7 +2366,7 @@ mod tests {
}
]
}
@@ -435,6 +398,13 @@
@@ -440,6 +398,13 @@
"persistentVolumeClaim": {
"claimName": "postgres-data"
}
Expand Down Expand Up @@ -2478,7 +2491,19 @@ mod tests {
"name": "ipfs",
"ports": [
{
@@ -282,14 +240,14 @@
@@ -275,11 +233,6 @@
"protocol": "TCP"
},
{
- "containerPort": 5102,
- "name": "flight",
- "protocol": "TCP"
- },
- {
"containerPort": 9465,
"name": "metrics",
"protocol": "TCP"
@@ -287,14 +240,14 @@
],
"resources": {
"limits": {
Expand All @@ -2499,7 +2524,7 @@ mod tests {
}
},
"volumeMounts": [
@@ -296,6 +254,11 @@
@@ -301,6 +254,11 @@
{
"mountPath": "/data/ipfs",
"name": "ipfs-data"
Expand All @@ -2511,7 +2536,7 @@ mod tests {
}
]
}
@@ -435,6 +398,13 @@
@@ -440,6 +398,13 @@
"persistentVolumeClaim": {
"claimName": "postgres-data"
}
Expand All @@ -2525,7 +2550,7 @@ mod tests {
}
]
}
@@ -474,7 +444,7 @@
@@ -479,7 +444,7 @@
],
"resources": {
"requests": {
Expand Down Expand Up @@ -2639,7 +2664,19 @@ mod tests {
"name": "ipfs",
"ports": [
{
@@ -282,14 +240,14 @@
@@ -275,11 +233,6 @@
"protocol": "TCP"
},
{
- "containerPort": 5102,
- "name": "flight",
- "protocol": "TCP"
- },
- {
"containerPort": 9465,
"name": "metrics",
"protocol": "TCP"
@@ -287,14 +240,14 @@
],
"resources": {
"limits": {
Expand All @@ -2658,7 +2695,7 @@ mod tests {
}
},
"volumeMounts": [
@@ -296,6 +254,16 @@
@@ -301,6 +254,16 @@
{
"mountPath": "/data/ipfs",
"name": "ipfs-data"
Expand All @@ -2675,7 +2712,7 @@ mod tests {
}
]
}
@@ -435,6 +403,13 @@
@@ -440,6 +403,13 @@
"persistentVolumeClaim": {
"claimName": "postgres-data"
}
Expand Down Expand Up @@ -2782,7 +2819,7 @@ mod tests {
"imagePullPolicy": "Always",
"name": "ipfs",
"ports": [
@@ -282,14 +294,14 @@
@@ -287,14 +299,14 @@
],
"resources": {
"limits": {
Expand All @@ -2803,7 +2840,7 @@ mod tests {
}
},
"volumeMounts": [
@@ -474,9 +486,10 @@
@@ -479,9 +491,10 @@
],
"resources": {
"requests": {
Expand Down Expand Up @@ -3032,7 +3069,7 @@ mod tests {
stub.cas_ipfs_stateful_set.patch(expect![[r#"
--- original
+++ modified
@@ -99,14 +99,14 @@
@@ -104,14 +104,14 @@
],
"resources": {
"limits": {
Expand All @@ -3053,7 +3090,7 @@ mod tests {
}
},
"volumeMounts": [
@@ -140,9 +140,10 @@
@@ -145,9 +145,10 @@
],
"resources": {
"requests": {
Expand Down Expand Up @@ -3210,7 +3247,7 @@ mod tests {
}
},
"volumeMounts": [
@@ -381,14 +381,14 @@
@@ -386,14 +386,14 @@
"name": "init-ceramic-config",
"resources": {
"limits": {
Expand All @@ -3231,7 +3268,7 @@ mod tests {
}
},
"volumeMounts": [
@@ -457,7 +457,7 @@
@@ -462,7 +462,7 @@
],
"resources": {
"requests": {
Expand Down Expand Up @@ -3432,7 +3469,7 @@ mod tests {
},
{
"name": "CERAMIC_ONE_P2P_KEY_DIR",
@@ -319,7 +315,7 @@
@@ -324,7 +320,7 @@
},
{
"name": "CAS_API_URL",
Expand All @@ -3441,7 +3478,7 @@ mod tests {
},
{
"name": "CERAMIC_CORS_ALLOWED_ORIGINS",
@@ -335,11 +331,7 @@
@@ -340,11 +336,7 @@
},
{
"name": "CERAMIC_NETWORK",
Expand All @@ -3454,7 +3491,7 @@ mod tests {
},
{
"name": "CERAMIC_SQLITE_PATH",
@@ -351,7 +343,7 @@
@@ -356,7 +348,7 @@
},
{
"name": "ETH_RPC_URL",
Expand Down Expand Up @@ -3499,7 +3536,7 @@ mod tests {
"livenessProbe": {
"httpGet": {
"path": "/api/v0/node/healthcheck",
@@ -377,7 +377,7 @@
@@ -382,7 +382,7 @@
}
],
"image": "ceramicnetwork/composedb-cli:latest",
Expand Down Expand Up @@ -3914,7 +3951,7 @@ mod tests {
}
],
"image": "ceramicnetwork/composedb:develop",
@@ -374,6 +378,10 @@
@@ -379,6 +383,10 @@
"name": "ceramic-postgres-auth"
}
}
Expand Down Expand Up @@ -4151,7 +4188,7 @@ mod tests {
stub.ceramics[0].stateful_set.patch(expect![[r#"
--- original
+++ modified
@@ -476,7 +476,8 @@
@@ -481,7 +481,8 @@
"requests": {
"storage": "10Gi"
}
Expand Down Expand Up @@ -4244,7 +4281,19 @@ mod tests {
"name": "ipfs",
"ports": [
{
@@ -282,14 +240,14 @@
@@ -275,11 +233,6 @@
"protocol": "TCP"
},
{
- "containerPort": 5102,
- "name": "flight",
- "protocol": "TCP"
- },
- {
"containerPort": 9465,
"name": "metrics",
"protocol": "TCP"
@@ -287,14 +240,14 @@
],
"resources": {
"limits": {
Expand All @@ -4263,7 +4312,7 @@ mod tests {
}
},
"volumeMounts": [
@@ -296,6 +254,11 @@
@@ -301,6 +254,11 @@
{
"mountPath": "/data/ipfs",
"name": "ipfs-data"
Expand All @@ -4275,7 +4324,7 @@ mod tests {
}
]
}
@@ -435,6 +398,13 @@
@@ -440,6 +398,13 @@
"persistentVolumeClaim": {
"claimName": "postgres-data"
}
Expand All @@ -4289,7 +4338,7 @@ mod tests {
}
]
}
@@ -476,7 +446,8 @@
@@ -481,7 +446,8 @@
"requests": {
"storage": "10Gi"
}
Expand Down Expand Up @@ -4574,7 +4623,7 @@ mod tests {
"name": "RUST_LOG",
"value": "info,ceramic_one=debug,multipart=error"
}
@@ -278,6 +298,11 @@
@@ -283,6 +303,11 @@
"containerPort": 9465,
"name": "metrics",
"protocol": "TCP"
Expand All @@ -4586,7 +4635,7 @@ mod tests {
}
],
"resources": {
@@ -292,6 +317,13 @@
@@ -297,6 +322,13 @@
"memory": "1Gi"
}
},
Expand All @@ -4600,7 +4649,7 @@ mod tests {
"volumeMounts": [
{
"mountPath": "/data/ipfs",
@@ -354,6 +386,10 @@
@@ -359,6 +391,10 @@
"value": "http://ganache:8545"
},
{
Expand All @@ -4626,7 +4675,7 @@ mod tests {
"name": "RUST_LOG",
"value": "info,ceramic_one=debug,multipart=error"
}
@@ -95,6 +99,11 @@
@@ -100,6 +104,11 @@
"containerPort": 9465,
"name": "metrics",
"protocol": "TCP"
Expand All @@ -4638,7 +4687,7 @@ mod tests {
}
],
"resources": {
@@ -109,6 +118,13 @@
@@ -114,6 +123,13 @@
"memory": "1Gi"
}
},
Expand Down Expand Up @@ -4842,7 +4891,7 @@ mod tests {
stub.ceramics[0].stateful_set.patch(expect![[r#"
--- original
+++ modified
@@ -401,6 +401,99 @@
@@ -406,6 +406,104 @@
"name": "ceramic-init"
}
]
Expand Down Expand Up @@ -4916,6 +4965,11 @@ mod tests {
+ "protocol": "TCP"
+ },
+ {
+ "containerPort": 5102,
+ "name": "flight",
+ "protocol": "TCP"
+ },
+ {
+ "containerPort": 9465,
+ "name": "metrics",
+ "protocol": "TCP"
Expand Down
Loading

0 comments on commit 1f4d79f

Please sign in to comment.