Skip to content

Commit

Permalink
fcos-*: modify ports to prevent conflict with dumnati
Browse files Browse the repository at this point in the history
Signed-off-by: Allen Bai <[email protected]>
  • Loading branch information
Allen Bai committed Jul 15, 2020
1 parent 8d0e88d commit d470688
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 2 additions & 2 deletions fcos-graph-builder/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fn main() -> Fallible<()> {
.data(gb_service.clone())
.route("/v1/graph", web::get().to(gb_serve_graph))
})
.bind((IpAddr::from(Ipv4Addr::UNSPECIFIED), 8080))?
.bind((IpAddr::from(Ipv4Addr::UNSPECIFIED), 5050))?
.run();

// Graph-builder status service.
Expand All @@ -83,7 +83,7 @@ fn main() -> Fallible<()> {
.data(gb_status.clone())
.route("/metrics", web::get().to(metrics::serve_metrics))
})
.bind((IpAddr::from(Ipv4Addr::UNSPECIFIED), 9080))?
.bind((IpAddr::from(Ipv4Addr::UNSPECIFIED), 6060))?
.run();

sys.run()?;
Expand Down
4 changes: 2 additions & 2 deletions fcos-policy-engine/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ fn main() -> Fallible<()> {
.data(pe_service.clone())
.route("/v1/graph", web::get().to(pe_serve_graph))
})
.bind((IpAddr::from(Ipv4Addr::UNSPECIFIED), 8081))?
.bind((IpAddr::from(Ipv4Addr::UNSPECIFIED), 5051))?
.run();

// Policy-engine status service.
Expand All @@ -73,7 +73,7 @@ fn main() -> Fallible<()> {
.data(pe_status.clone())
.route("/metrics", web::get().to(metrics::serve_metrics))
})
.bind((IpAddr::from(Ipv4Addr::UNSPECIFIED), 9081))?
.bind((IpAddr::from(Ipv4Addr::UNSPECIFIED), 6061))?
.run();

sys.run()?;
Expand Down
10 changes: 4 additions & 6 deletions fcos-policy-engine/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,20 @@ use std::time::Duration;
/// Default timeout for HTTP requests (30 minutes).
const DEFAULT_HTTP_REQ_TIMEOUT: Duration = Duration::from_secs(30 * 60);
/// Default address of fcos-graph-builder, which is the same as fcos-policy-builer
const DEFAULT_GB_ADDR: &str = "http://127.0.0.1:8080/v1/graph";
const DEFAULT_GB_ADDR: &str = "http://127.0.0.1:5050/v1/graph";

/// Return a request builder with base URL and parameters set.
fn new_request(
method: reqwest::Method,
url: reqwest::Url,
) -> Fallible<reqwest::RequestBuilder> {
fn new_request(method: reqwest::Method, url: reqwest::Url) -> Fallible<reqwest::RequestBuilder> {
let client = reqwest::ClientBuilder::new()
.timeout(DEFAULT_HTTP_REQ_TIMEOUT)
.build()?;
let builder = client.request(method, url);
Ok(builder)
}

/// Fetch the graph from the fcos-graph-builder instance with the query specified.
pub(crate) fn fetch_graph_from_gb(
query: String
query: String,
) -> impl Future<Output = Result<graph::Graph, Error>> {
async move {
let mut target = reqwest::Url::parse(DEFAULT_GB_ADDR)?;
Expand Down

0 comments on commit d470688

Please sign in to comment.