Skip to content

deployment: add http server port to the deployment file #8056

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

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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/apollo_deployments/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ workspace = true

[dependencies]
apollo_config.workspace = true
apollo_http_server.workspace = true
apollo_infra_utils.workspace = true
apollo_monitoring_endpoint.workspace = true
apollo_node.workspace = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
},
"anti_affinity": false,
"ports": {
"HttpServer": 8080,
"MonitoringEndpoint": 8082
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
},
"anti_affinity": false,
"ports": {
"HttpServer": 8080,
"MonitoringEndpoint": 8082
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
},
"anti_affinity": false,
"ports": {
"HttpServer": 8080,
"MonitoringEndpoint": 8082
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
},
"anti_affinity": false,
"ports": {
"HttpServer": 8080,
"MonitoringEndpoint": 8082
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
},
"anti_affinity": false,
"ports": {
"HttpServer": 8080,
"MonitoringEndpoint": 8082
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
},
"anti_affinity": false,
"ports": {
"HttpServer": 8080,
"MonitoringEndpoint": 8082
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
},
"anti_affinity": false,
"ports": {
"HttpServer": 8080,
"MonitoringEndpoint": 8082
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
},
"anti_affinity": false,
"ports": {
"HttpServer": 8080,
"MonitoringEndpoint": 8082
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
},
"anti_affinity": false,
"ports": {
"HttpServer": 8080,
"MonitoringEndpoint": 8082
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"external_secret": null,
"anti_affinity": false,
"ports": {
"HttpServer": 8080,
"MonitoringEndpoint": 8082
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@
"external_secret": null,
"anti_affinity": false,
"ports": {
"HttpServer": 8080,
"MonitoringEndpoint": 8082
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"external_secret": null,
"anti_affinity": false,
"ports": {
"HttpServer": 8080,
"MonitoringEndpoint": 8082
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
},
"anti_affinity": false,
"ports": {
"HttpServer": 8080,
"MonitoringEndpoint": 8082
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
},
"anti_affinity": false,
"ports": {
"HttpServer": 8080,
"MonitoringEndpoint": 8082
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
},
"anti_affinity": false,
"ports": {
"HttpServer": 8080,
"MonitoringEndpoint": 8082
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
},
"anti_affinity": false,
"ports": {
"HttpServer": 8080,
"MonitoringEndpoint": 8082
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
},
"anti_affinity": false,
"ports": {
"HttpServer": 8080,
"MonitoringEndpoint": 8082
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
},
"anti_affinity": false,
"ports": {
"HttpServer": 8080,
"MonitoringEndpoint": 8082
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
},
"anti_affinity": false,
"ports": {
"HttpServer": 8080,
"MonitoringEndpoint": 8082
}
},
Expand Down
3 changes: 2 additions & 1 deletion crates/apollo_deployments/src/deployment_definitions.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::path::PathBuf;

use apollo_http_server::config::HTTP_SERVER_PORT;
use apollo_monitoring_endpoint::config::MONITORING_ENDPOINT_DEFAULT_PORT;
use serde::Serialize;
use strum::EnumIter;
Expand Down Expand Up @@ -122,7 +123,7 @@ impl ServicePort {
ServicePort::MempoolP2p => 0,
ServicePort::SierraCompiler => 0,
ServicePort::StateSync => 0,
ServicePort::HttpServer => 0,
ServicePort::HttpServer => HTTP_SERVER_PORT,
ServicePort::MonitoringEndpoint => MONITORING_ENDPOINT_DEFAULT_PORT,
}
}
Expand Down
6 changes: 4 additions & 2 deletions crates/apollo_deployments/src/deployments/consolidated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,10 @@ impl ServiceNameInner for ConsolidatedNodeServiceName {
ServicePort::MonitoringEndpoint => {
service_ports.insert(ServicePort::MonitoringEndpoint);
}
ServicePort::HttpServer
| ServicePort::Batcher
ServicePort::HttpServer => {
service_ports.insert(ServicePort::HttpServer);
}
ServicePort::Batcher
| ServicePort::Mempool
| ServicePort::ClassManager
| ServicePort::Gateway
Expand Down
6 changes: 4 additions & 2 deletions crates/apollo_deployments/src/deployments/distributed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,10 @@ impl ServiceNameInner for DistributedNodeServiceName {
ServicePort::MonitoringEndpoint => {
service_ports.insert(ServicePort::MonitoringEndpoint);
}
ServicePort::HttpServer
| ServicePort::Batcher
ServicePort::HttpServer => {
service_ports.insert(ServicePort::HttpServer);
}
ServicePort::Batcher
| ServicePort::ClassManager
| ServicePort::L1EndpointMonitor
| ServicePort::L1GasPriceProvider
Expand Down
6 changes: 4 additions & 2 deletions crates/apollo_deployments/src/deployments/hybrid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,10 @@ impl ServiceNameInner for HybridNodeServiceName {
ServicePort::MonitoringEndpoint => {
service_ports.insert(ServicePort::MonitoringEndpoint);
}
ServicePort::HttpServer
| ServicePort::Batcher
ServicePort::HttpServer => {
service_ports.insert(ServicePort::HttpServer);
}
ServicePort::Batcher
| ServicePort::ClassManager
| ServicePort::L1EndpointMonitor
| ServicePort::L1GasPriceProvider
Expand Down
4 changes: 2 additions & 2 deletions crates/apollo_deployments/src/k8s.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use apollo_http_server::config::HTTP_SERVER_PORT;
use serde::{Serialize, Serializer};

use crate::deployment::P2PCommunicationType;
Expand All @@ -7,7 +8,6 @@ use crate::deployment_definitions::Environment;
const INTERNAL_ONLY_P2P_COMMUNICATION: bool = true;

const INGRESS_ROUTE: &str = "/gateway";
const INGRESS_PORT: u16 = 8080;

#[derive(Clone, Copy, Debug, PartialEq, Serialize)]
pub enum Controller {
Expand Down Expand Up @@ -105,7 +105,7 @@ pub(crate) fn get_ingress(ingress_params: IngressParams, internal: bool) -> Opti
Some(Ingress::new(
ingress_params,
internal,
vec![IngressRule::new(String::from(INGRESS_ROUTE), INGRESS_PORT, None)],
vec![IngressRule::new(String::from(INGRESS_ROUTE), HTTP_SERVER_PORT, None)],
))
}

Expand Down
4 changes: 3 additions & 1 deletion crates/apollo_http_server/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ use apollo_config::{ParamPath, ParamPrivacyInput, SerializedParam};
use serde::{Deserialize, Serialize};
use validator::Validate;

pub const HTTP_SERVER_PORT: u16 = 8080;

/// The http server connection related configuration.
#[derive(Clone, Debug, Serialize, Deserialize, Validate, PartialEq)]
pub struct HttpServerConfig {
Expand All @@ -24,6 +26,6 @@ impl SerializeConfig for HttpServerConfig {

impl Default for HttpServerConfig {
fn default() -> Self {
Self { ip: IpAddr::from(Ipv4Addr::UNSPECIFIED), port: 8080 }
Self { ip: IpAddr::from(Ipv4Addr::UNSPECIFIED), port: HTTP_SERVER_PORT }
}
}
Loading