Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose the flight-sql port #206

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions common/src/peer_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ pub struct CeramicPeerInfo {
pub ipfs_rpc_addr: String,
/// Ceramic API address of the peer.
pub ceramic_addr: String,
/// Flight SQL API address of the peer.
pub flight_addr: String,
/// Set of p2p addresses of the peer.
/// Each address contains the /p2p/<peer_id> protocol.
pub p2p_addrs: Vec<String>,
Expand Down
16 changes: 15 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 Expand Up @@ -251,6 +258,13 @@ impl CeramicInfo {
self.stateful_set, self.service
)
}
/// Determine the Flight SQL address of a Ceramic peer
pub fn flight_addr(&self, ns: &str, peer: i32) -> String {
format!(
"http://{}-{peer}.{}.{ns}.svc.cluster.local:{CERAMIC_ONE_FLIGHT_SQL_PORT}",
self.stateful_set, self.service
)
}
}

impl From<&CeramicInfo> for IpfsInfo {
Expand Down
156 changes: 112 additions & 44 deletions operator/src/network/controller.rs

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion operator/src/network/ipfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::{
};

use super::{
controller::{CERAMIC_ONE_IPFS_PORT, CERAMIC_ONE_SWARM_PORT},
controller::{CERAMIC_ONE_FLIGHT_SQL_PORT, CERAMIC_ONE_IPFS_PORT, CERAMIC_ONE_SWARM_PORT},
debug_mode_security_context,
};

Expand Down Expand Up @@ -243,6 +243,12 @@ impl RustIpfsConfig {
protocol: Some("TCP".to_owned()),
..Default::default()
},
ContainerPort {
container_port: CERAMIC_ONE_FLIGHT_SQL_PORT,
name: Some("flight".to_owned()),
protocol: Some("TCP".to_owned()),
..Default::default()
},
ContainerPort {
container_port: 9465,
name: Some("metrics".to_owned()),
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_go_svc_1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ Request {
"port": 5101,
"protocol": "TCP"
},
{
"name": "flight",
"port": 5102,
"protocol": "TCP"
},
{
"name": "swarm-tcp",
"port": 4101,
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_ss_1
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ Request {
"name": "rpc",
"protocol": "TCP"
},
{
"containerPort": 5102,
"name": "flight",
"protocol": "TCP"
},
{
"containerPort": 9465,
"name": "metrics",
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_0
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ Request {
"name": "rpc",
"protocol": "TCP"
},
{
"containerPort": 5102,
"name": "flight",
"protocol": "TCP"
},
{
"containerPort": 9465,
"name": "metrics",
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_1
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ Request {
"name": "rpc",
"protocol": "TCP"
},
{
"containerPort": 5102,
"name": "flight",
"protocol": "TCP"
},
{
"containerPort": 9465,
"name": "metrics",
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_2
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ Request {
"name": "rpc",
"protocol": "TCP"
},
{
"containerPort": 5102,
"name": "flight",
"protocol": "TCP"
},
{
"containerPort": 9465,
"name": "metrics",
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_3
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ Request {
"name": "rpc",
"protocol": "TCP"
},
{
"containerPort": 5102,
"name": "flight",
"protocol": "TCP"
},
{
"containerPort": 9465,
"name": "metrics",
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_4
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ Request {
"name": "rpc",
"protocol": "TCP"
},
{
"containerPort": 5102,
"name": "flight",
"protocol": "TCP"
},
{
"containerPort": 9465,
"name": "metrics",
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_5
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ Request {
"name": "rpc",
"protocol": "TCP"
},
{
"containerPort": 5102,
"name": "flight",
"protocol": "TCP"
},
{
"containerPort": 9465,
"name": "metrics",
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_6
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ Request {
"name": "rpc",
"protocol": "TCP"
},
{
"containerPort": 5102,
"name": "flight",
"protocol": "TCP"
},
{
"containerPort": 9465,
"name": "metrics",
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_7
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ Request {
"name": "rpc",
"protocol": "TCP"
},
{
"containerPort": 5102,
"name": "flight",
"protocol": "TCP"
},
{
"containerPort": 9465,
"name": "metrics",
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_8
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ Request {
"name": "rpc",
"protocol": "TCP"
},
{
"containerPort": 5102,
"name": "flight",
"protocol": "TCP"
},
{
"containerPort": 9465,
"name": "metrics",
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_ss_weighted_9
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,11 @@ Request {
"name": "rpc",
"protocol": "TCP"
},
{
"containerPort": 5102,
"name": "flight",
"protocol": "TCP"
},
{
"containerPort": 9465,
"name": "metrics",
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_svc_1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ Request {
"port": 5101,
"protocol": "TCP"
},
{
"name": "flight",
"port": 5102,
"protocol": "TCP"
},
{
"name": "swarm-tcp",
"port": 4101,
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_svc_weighted_0
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ Request {
"port": 5101,
"protocol": "TCP"
},
{
"name": "flight",
"port": 5102,
"protocol": "TCP"
},
{
"name": "swarm-tcp",
"port": 4101,
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_svc_weighted_1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ Request {
"port": 5101,
"protocol": "TCP"
},
{
"name": "flight",
"port": 5102,
"protocol": "TCP"
},
{
"name": "swarm-tcp",
"port": 4101,
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_svc_weighted_2
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ Request {
"port": 5101,
"protocol": "TCP"
},
{
"name": "flight",
"port": 5102,
"protocol": "TCP"
},
{
"name": "swarm-tcp",
"port": 4101,
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_svc_weighted_3
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ Request {
"port": 5101,
"protocol": "TCP"
},
{
"name": "flight",
"port": 5102,
"protocol": "TCP"
},
{
"name": "swarm-tcp",
"port": 4101,
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_svc_weighted_4
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ Request {
"port": 5101,
"protocol": "TCP"
},
{
"name": "flight",
"port": 5102,
"protocol": "TCP"
},
{
"name": "swarm-tcp",
"port": 4101,
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_svc_weighted_5
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ Request {
"port": 5101,
"protocol": "TCP"
},
{
"name": "flight",
"port": 5102,
"protocol": "TCP"
},
{
"name": "swarm-tcp",
"port": 4101,
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_svc_weighted_6
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ Request {
"port": 5101,
"protocol": "TCP"
},
{
"name": "flight",
"port": 5102,
"protocol": "TCP"
},
{
"name": "swarm-tcp",
"port": 4101,
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_svc_weighted_7
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ Request {
"port": 5101,
"protocol": "TCP"
},
{
"name": "flight",
"port": 5102,
"protocol": "TCP"
},
{
"name": "swarm-tcp",
"port": 4101,
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_svc_weighted_8
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ Request {
"port": 5101,
"protocol": "TCP"
},
{
"name": "flight",
"port": 5102,
"protocol": "TCP"
},
{
"name": "swarm-tcp",
"port": 4101,
Expand Down
5 changes: 5 additions & 0 deletions operator/src/network/testdata/ceramic_svc_weighted_9
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ Request {
"port": 5101,
"protocol": "TCP"
},
{
"name": "flight",
"port": 5102,
"protocol": "TCP"
},
{
"name": "swarm-tcp",
"port": 4101,
Expand Down
Loading
Loading