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

chore: update ceramic one swarm port to 4101 and rpc port to 5101 #194

Merged
merged 3 commits into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
7 changes: 5 additions & 2 deletions operator/src/network/ceramic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ use crate::{
utils::override_and_sort_env_vars,
};

use super::{debug_mode_security_context, storage::PersistentStorageConfig};
use super::{
controller::CERAMIC_SERVICE_SWARM_PORT, debug_mode_security_context,
storage::PersistentStorageConfig,
};

pub fn config_maps(
info: &CeramicInfo,
Expand Down Expand Up @@ -121,7 +124,7 @@ pub fn service_spec() -> ServiceSpec {
..Default::default()
},
ServicePort {
port: 4001,
port: CERAMIC_SERVICE_SWARM_PORT,
name: Some("swarm-tcp".to_owned()),
protocol: Some("TCP".to_owned()),
..Default::default()
Expand Down
33 changes: 17 additions & 16 deletions operator/src/network/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ use crate::{
/// network.
pub const PEERS_CONFIG_MAP_NAME: &str = "keramik-peers";

pub const CERAMIC_SERVICE_IPFS_PORT: i32 = 5001;
pub const CERAMIC_SERVICE_SWARM_PORT: i32 = 4101;
pub const CERAMIC_SERVICE_IPFS_PORT: i32 = 5101;
pub const CERAMIC_SERVICE_API_PORT: i32 = 7007;
pub const CERAMIC_POSTGRES_SECRET_NAME: &str = "ceramic-postgres-auth";

Expand Down Expand Up @@ -2275,7 +2276,7 @@ mod tests {
- "env": [
- {
- "name": "CERAMIC_ONE_BIND_ADDRESS",
- "value": "0.0.0.0:5001"
- "value": "0.0.0.0:5101"
- },
- {
- "name": "CERAMIC_ONE_KADEMLIA_PARALLELISM",
Expand Down Expand Up @@ -2303,7 +2304,7 @@ mod tests {
- },
- {
- "name": "CERAMIC_ONE_SWARM_ADDRESSES",
- "value": "/ip4/0.0.0.0/tcp/4001"
- "value": "/ip4/0.0.0.0/tcp/4101"
- },
- {
- "name": "RUST_LOG",
Expand Down Expand Up @@ -2427,7 +2428,7 @@ mod tests {
- "env": [
- {
- "name": "CERAMIC_ONE_BIND_ADDRESS",
- "value": "0.0.0.0:5001"
- "value": "0.0.0.0:5101"
- },
- {
- "name": "CERAMIC_ONE_KADEMLIA_PARALLELISM",
Expand Down Expand Up @@ -2455,7 +2456,7 @@ mod tests {
- },
- {
- "name": "CERAMIC_ONE_SWARM_ADDRESSES",
- "value": "/ip4/0.0.0.0/tcp/4001"
- "value": "/ip4/0.0.0.0/tcp/4101"
- },
- {
- "name": "RUST_LOG",
Expand Down Expand Up @@ -2584,7 +2585,7 @@ mod tests {
- "env": [
- {
- "name": "CERAMIC_ONE_BIND_ADDRESS",
- "value": "0.0.0.0:5001"
- "value": "0.0.0.0:5101"
- },
- {
- "name": "CERAMIC_ONE_KADEMLIA_PARALLELISM",
Expand Down Expand Up @@ -2612,7 +2613,7 @@ mod tests {
- },
- {
- "name": "CERAMIC_ONE_SWARM_ADDRESSES",
- "value": "/ip4/0.0.0.0/tcp/4001"
- "value": "/ip4/0.0.0.0/tcp/4101"
- },
- {
- "name": "RUST_LOG",
Expand Down Expand Up @@ -2749,7 +2750,7 @@ mod tests {
"value": "0.0.0.0:9465"
},
@@ -252,11 +256,19 @@
"value": "/ip4/0.0.0.0/tcp/4001"
"value": "/ip4/0.0.0.0/tcp/4101"
},
{
+ "name": "ENV_KEY_A",
Expand Down Expand Up @@ -4185,7 +4186,7 @@ mod tests {
- "env": [
- {
- "name": "CERAMIC_ONE_BIND_ADDRESS",
- "value": "0.0.0.0:5001"
- "value": "0.0.0.0:5101"
- },
- {
- "name": "CERAMIC_ONE_KADEMLIA_PARALLELISM",
Expand Down Expand Up @@ -4213,7 +4214,7 @@ mod tests {
- },
- {
- "name": "CERAMIC_ONE_SWARM_ADDRESSES",
- "value": "/ip4/0.0.0.0/tcp/4001"
- "value": "/ip4/0.0.0.0/tcp/4101"
- },
- {
- "name": "RUST_LOG",
Expand Down Expand Up @@ -4547,7 +4548,7 @@ mod tests {
{
"mountPath": "/config",
@@ -252,6 +268,10 @@
"value": "/ip4/0.0.0.0/tcp/4001"
"value": "/ip4/0.0.0.0/tcp/4101"
},
{
+ "name": "CERAMIC_ONE_TOKIO_CONSOLE",
Expand Down Expand Up @@ -4599,7 +4600,7 @@ mod tests {
--- original
+++ modified
@@ -69,6 +69,10 @@
"value": "/ip4/0.0.0.0/tcp/4001"
"value": "/ip4/0.0.0.0/tcp/4101"
},
{
+ "name": "CERAMIC_ONE_TOKIO_CONSOLE",
Expand Down Expand Up @@ -4752,7 +4753,7 @@ mod tests {
+ "env": [
+ {
+ "name": "CERAMIC_ONE_BIND_ADDRESS",
+ "value": "0.0.0.0:5001"
+ "value": "0.0.0.0:5101"
+ },
+ {
+ "name": "CERAMIC_ONE_KADEMLIA_PARALLELISM",
Expand Down Expand Up @@ -4780,7 +4781,7 @@ mod tests {
+ },
+ {
+ "name": "CERAMIC_ONE_SWARM_ADDRESSES",
+ "value": "/ip4/0.0.0.0/tcp/4001"
+ "value": "/ip4/0.0.0.0/tcp/4101"
+ },
+ {
+ "name": "RUST_LOG",
Expand All @@ -4792,12 +4793,12 @@ mod tests {
+ "name": "ipfs-migration",
+ "ports": [
+ {
+ "containerPort": 4001,
+ "containerPort": 4101,
+ "name": "swarm-tcp",
+ "protocol": "TCP"
+ },
+ {
+ "containerPort": 5001,
+ "containerPort": 5101,
+ "name": "rpc",
+ "protocol": "TCP"
+ },
Expand Down
18 changes: 10 additions & 8 deletions operator/src/network/ipfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use k8s_openapi::{
const IPFS_CONTAINER_NAME: &str = "ipfs";
const IPFS_STORE_DIR: &str = "/data/ipfs";
pub const IPFS_DATA_PV_CLAIM: &str = "ipfs-data";
const IPFS_SERVICE_PORT: i32 = 5001;

use crate::{
network::{
Expand All @@ -22,7 +21,10 @@ use crate::{
utils::override_and_sort_env_vars,
};

use super::debug_mode_security_context;
use super::{
controller::{CERAMIC_SERVICE_IPFS_PORT, CERAMIC_SERVICE_SWARM_PORT},
debug_mode_security_context,
};

/// Unique identifying information about this IPFS spec.
#[derive(Debug, Clone)]
Expand Down Expand Up @@ -172,7 +174,7 @@ impl RustIpfsConfig {
},
EnvVar {
name: "CERAMIC_ONE_BIND_ADDRESS".to_owned(),
value: Some(format!("0.0.0.0:{IPFS_SERVICE_PORT}")),
value: Some(format!("0.0.0.0:{CERAMIC_SERVICE_IPFS_PORT}")),
..Default::default()
},
EnvVar {
Expand All @@ -182,7 +184,7 @@ impl RustIpfsConfig {
},
EnvVar {
name: "CERAMIC_ONE_SWARM_ADDRESSES".to_owned(),
value: Some("/ip4/0.0.0.0/tcp/4001".to_owned()),
value: Some(format!("/ip4/0.0.0.0/tcp/{CERAMIC_SERVICE_SWARM_PORT}")),
..Default::default()
},
EnvVar {
Expand Down Expand Up @@ -225,13 +227,13 @@ impl RustIpfsConfig {
// Construct the set of ports
let mut ports = vec![
ContainerPort {
container_port: 4001,
container_port: CERAMIC_SERVICE_SWARM_PORT,
name: Some("swarm-tcp".to_owned()),
protocol: Some("TCP".to_owned()),
..Default::default()
},
ContainerPort {
container_port: IPFS_SERVICE_PORT,
container_port: CERAMIC_SERVICE_IPFS_PORT,
name: Some("rpc".to_owned()),
protocol: Some("TCP".to_owned()),
..Default::default()
Expand Down Expand Up @@ -415,13 +417,13 @@ ipfs config --json Swarm.ResourceMgr.MaxFileDescriptors 500000
name: IPFS_CONTAINER_NAME.to_owned(),
ports: Some(vec![
ContainerPort {
container_port: 4001,
container_port: CERAMIC_SERVICE_SWARM_PORT,
name: Some("swarm-tcp".to_owned()),
protocol: Some("TCP".to_owned()),
..Default::default()
},
ContainerPort {
container_port: IPFS_SERVICE_PORT,
container_port: CERAMIC_SERVICE_IPFS_PORT,
name: Some("rpc".to_owned()),
protocol: Some("TCP".to_owned()),
..Default::default()
Expand Down
8 changes: 4 additions & 4 deletions operator/src/network/testdata/ceramic_go_ss_1
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Request {
},
{
"name": "CERAMIC_IPFS_HOST",
"value": "http://localhost:5001"
"value": "http://localhost:5101"
},
{
"name": "CERAMIC_LOG_LEVEL",
Expand Down Expand Up @@ -223,12 +223,12 @@ Request {
"name": "ipfs",
"ports": [
{
"containerPort": 4001,
"containerPort": 4101,
"name": "swarm-tcp",
"protocol": "TCP"
},
{
"containerPort": 5001,
"containerPort": 5101,
"name": "rpc",
"protocol": "TCP"
},
Expand Down Expand Up @@ -290,7 +290,7 @@ Request {
},
{
"name": "CERAMIC_IPFS_HOST",
"value": "http://localhost:5001"
"value": "http://localhost:5101"
},
{
"name": "CERAMIC_LOG_LEVEL",
Expand Down
4 changes: 2 additions & 2 deletions operator/src/network/testdata/ceramic_go_svc_1
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ Request {
},
{
"name": "ipfs",
"port": 5001,
"port": 5101,
"protocol": "TCP"
},
{
"name": "swarm-tcp",
"port": 4001,
"port": 4101,
"protocol": "TCP"
}
],
Expand Down
12 changes: 6 additions & 6 deletions operator/src/network/testdata/ceramic_ss_1
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Request {
},
{
"name": "CERAMIC_IPFS_HOST",
"value": "http://localhost:5001"
"value": "http://localhost:5101"
},
{
"name": "CERAMIC_LOG_LEVEL",
Expand Down Expand Up @@ -221,7 +221,7 @@ Request {
"env": [
{
"name": "CERAMIC_ONE_BIND_ADDRESS",
"value": "0.0.0.0:5001"
"value": "0.0.0.0:5101"
},
{
"name": "CERAMIC_ONE_KADEMLIA_PARALLELISM",
Expand Down Expand Up @@ -249,7 +249,7 @@ Request {
},
{
"name": "CERAMIC_ONE_SWARM_ADDRESSES",
"value": "/ip4/0.0.0.0/tcp/4001"
"value": "/ip4/0.0.0.0/tcp/4101"
},
{
"name": "RUST_LOG",
Expand All @@ -261,12 +261,12 @@ Request {
"name": "ipfs",
"ports": [
{
"containerPort": 4001,
"containerPort": 4101,
"name": "swarm-tcp",
"protocol": "TCP"
},
{
"containerPort": 5001,
"containerPort": 5101,
"name": "rpc",
"protocol": "TCP"
},
Expand Down Expand Up @@ -323,7 +323,7 @@ Request {
},
{
"name": "CERAMIC_IPFS_HOST",
"value": "http://localhost:5001"
"value": "http://localhost:5101"
},
{
"name": "CERAMIC_LOG_LEVEL",
Expand Down
12 changes: 6 additions & 6 deletions operator/src/network/testdata/ceramic_ss_weighted_0
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Request {
},
{
"name": "CERAMIC_IPFS_HOST",
"value": "http://localhost:5001"
"value": "http://localhost:5101"
},
{
"name": "CERAMIC_LOG_LEVEL",
Expand Down Expand Up @@ -221,7 +221,7 @@ Request {
"env": [
{
"name": "CERAMIC_ONE_BIND_ADDRESS",
"value": "0.0.0.0:5001"
"value": "0.0.0.0:5101"
},
{
"name": "CERAMIC_ONE_KADEMLIA_PARALLELISM",
Expand Down Expand Up @@ -249,7 +249,7 @@ Request {
},
{
"name": "CERAMIC_ONE_SWARM_ADDRESSES",
"value": "/ip4/0.0.0.0/tcp/4001"
"value": "/ip4/0.0.0.0/tcp/4101"
},
{
"name": "RUST_LOG",
Expand All @@ -261,12 +261,12 @@ Request {
"name": "ipfs",
"ports": [
{
"containerPort": 4001,
"containerPort": 4101,
"name": "swarm-tcp",
"protocol": "TCP"
},
{
"containerPort": 5001,
"containerPort": 5101,
"name": "rpc",
"protocol": "TCP"
},
Expand Down Expand Up @@ -323,7 +323,7 @@ Request {
},
{
"name": "CERAMIC_IPFS_HOST",
"value": "http://localhost:5001"
"value": "http://localhost:5101"
},
{
"name": "CERAMIC_LOG_LEVEL",
Expand Down
Loading
Loading