Skip to content

Commit b464c71

Browse files
committed
propagate custom-dns flag to all run containers
1 parent 33242ad commit b464c71

File tree

17 files changed

+90
-59
lines changed

17 files changed

+90
-59
lines changed

docker/localnet/nym-binaries-localnet.Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ FROM rust:1.91.1 AS builder
2020

2121
RUN apt update && apt install -y \
2222
iproute2 \
23+
netcat-openbsd \
2324
net-tools \
2425
wireguard-tools \
2526
golang-go \

tools/internal/localnet-orchestrator/src/cli/down.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pub(crate) struct Args {
1111
}
1212

1313
pub(crate) async fn execute(args: Args) -> anyhow::Result<()> {
14-
LocalnetOrchestrator::new(args.common)
14+
LocalnetOrchestrator::new(&args.common)
1515
.await?
1616
.stop_localnet()
1717
.await

tools/internal/localnet-orchestrator/src/cli/initialise_contracts.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ pub(crate) struct Args {
5252
}
5353

5454
pub(crate) async fn execute(args: Args) -> anyhow::Result<()> {
55-
let mut orchestrator = LocalnetOrchestrator::new(args.common).await?;
55+
let mut orchestrator = LocalnetOrchestrator::new(&args.common).await?;
5656

5757
if orchestrator.state != LocalnetState::RunningNyxd {
5858
bail!(

tools/internal/localnet-orchestrator/src/cli/initialise_nym_api.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub(crate) struct Args {
3232
}
3333

3434
pub(crate) async fn execute(args: Args) -> anyhow::Result<()> {
35-
let mut orchestrator = LocalnetOrchestrator::new(args.common).await?;
35+
let mut orchestrator = LocalnetOrchestrator::new(&args.common).await?;
3636

3737
if orchestrator.state != LocalnetState::DeployedNymContracts {
3838
bail!(
@@ -45,6 +45,7 @@ pub(crate) async fn execute(args: Args) -> anyhow::Result<()> {
4545
.initialise_nym_api(nym_api::Config {
4646
cosmwasm_optimizer_image: args.cosmwasm_optimizer_image,
4747
monorepo_root: args.monorepo_root,
48+
custom_dns: args.common.custom_dns,
4849
allow_cached_build: args.allow_cached_build,
4950
})
5051
.await?;

tools/internal/localnet-orchestrator/src/cli/initialise_nym_nodes.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ pub(crate) struct Args {
1919
#[clap(long)]
2020
monorepo_root: Option<PathBuf>,
2121

22-
/// Specify custom dns to be used by the nym-node containers
23-
#[clap(long)]
24-
custom_dns: Option<String>,
25-
2622
/// Specify whether internal service providers should run in open proxy mode
2723
#[clap(long)]
2824
open_proxy: bool,
@@ -32,7 +28,7 @@ pub(crate) struct Args {
3228
}
3329

3430
pub(crate) async fn execute(args: Args) -> anyhow::Result<()> {
35-
let mut orchestrator = LocalnetOrchestrator::new(args.common).await?;
31+
let mut orchestrator = LocalnetOrchestrator::new(&args.common).await?;
3632

3733
if orchestrator.state != LocalnetState::RunningNymApi {
3834
bail!(
@@ -44,7 +40,7 @@ pub(crate) async fn execute(args: Args) -> anyhow::Result<()> {
4440
orchestrator
4541
.initialise_nym_nodes(nym_nodes::Config {
4642
monorepo_root: args.monorepo_root,
47-
custom_dns: args.custom_dns,
43+
custom_dns: args.common.custom_dns,
4844
open_proxy: args.open_proxy,
4945
})
5046
.await?;

tools/internal/localnet-orchestrator/src/cli/initialise_nyxd.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub(crate) struct Args {
2929
}
3030

3131
pub(crate) async fn execute(args: Args) -> anyhow::Result<()> {
32-
let mut orchestrator = LocalnetOrchestrator::new(args.common).await?;
32+
let mut orchestrator = LocalnetOrchestrator::new(&args.common).await?;
3333
if orchestrator.state != LocalnetState::Uninitialised {
3434
bail!(
3535
"can't initialise nyxd as it appears to have already been initialised. the localnet is in {} state.",
@@ -41,6 +41,7 @@ pub(crate) async fn execute(args: Args) -> anyhow::Result<()> {
4141
.initialise_nyxd(nyxd::Config {
4242
nyxd_repo: args.nyxd_repo,
4343
nyxd_dockerfile_path: args.nyxd_dockerfile_path,
44+
custom_dns: args.common.custom_dns,
4445
nyxd_tag: args.nyxd_tag,
4546
})
4647
.await?;

tools/internal/localnet-orchestrator/src/cli/purge.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub(crate) struct Args {
2626
}
2727

2828
pub(crate) async fn execute(args: Args) -> anyhow::Result<()> {
29-
LocalnetOrchestrator::new(args.common)
29+
LocalnetOrchestrator::new(&args.common)
3030
.await?
3131
.purge_localnet(purge::Config {
3232
remove_images: args.remove_images,

tools/internal/localnet-orchestrator/src/cli/rebuild_binaries_image.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub(crate) struct Args {
2222
}
2323

2424
pub(crate) async fn execute(args: Args) -> anyhow::Result<()> {
25-
let orchestrator = LocalnetOrchestrator::new(args.common).await?;
25+
let orchestrator = LocalnetOrchestrator::new(&args.common).await?;
2626

2727
orchestrator
2828
.rebuild_binaries_image(rebuild_binaries_image::Config {

tools/internal/localnet-orchestrator/src/cli/run_gateway_probe_test.rs

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,25 @@ pub(crate) struct Args {
1616
/// If not provided, it is going to get assumed that the current directory is the monorepo root
1717
#[clap(long)]
1818
monorepo_root: Option<PathBuf>,
19+
20+
/// additional, optional flags to pass when starting the gateway probe
21+
/// e.g. "--ignore-egress-epoch-role --netstack-args='...'"
22+
#[clap(long)]
23+
probe_args: Option<String>,
1924
}
2025

2126
pub(crate) async fn execute(args: Args) -> anyhow::Result<()> {
22-
let orchestrator = LocalnetOrchestrator::new(args.common).await?;
23-
if orchestrator.state != LocalnetState::RunningNymNodes {
24-
bail!(
25-
"can't test the gateway probe as the localnet does not appear to be running. the localnet is in {} state.",
26-
orchestrator.state
27-
)
28-
}
27+
let orchestrator = LocalnetOrchestrator::new(&args.common).await?;
28+
// if orchestrator.state != LocalnetState::RunningNymNodes {
29+
// bail!(
30+
// "can't test the gateway probe as the localnet does not appear to be running. the localnet is in {} state.",
31+
// orchestrator.state
32+
// )
33+
// }
2934

30-
orchestrator.run_gateway_probe(args.monorepo_root).await?;
35+
orchestrator
36+
.run_gateway_probe(args.monorepo_root, args.probe_args)
37+
.await?;
3138

3239
Ok(())
3340
}

tools/internal/localnet-orchestrator/src/cli/up.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,13 @@ pub(crate) struct Args {
5656
#[clap(long, conflicts_with = "reproducible_builds")]
5757
allow_cached_build: bool,
5858

59-
/// Specify custom dns to be used by the nym-node containers
60-
#[clap(long)]
61-
custom_dns: Option<String>,
62-
6359
/// Specify whether internal service providers should run in open proxy mode
6460
#[clap(long)]
6561
open_proxy: bool,
6662
}
6763

6864
pub(crate) async fn execute(args: Args) -> anyhow::Result<()> {
69-
let mut orchestrator = LocalnetOrchestrator::new(args.common).await?;
65+
let mut orchestrator = LocalnetOrchestrator::new(&args.common).await?;
7066

7167
// TODO: allow non-fresh state
7268
if orchestrator.state != LocalnetState::Uninitialised {
@@ -78,6 +74,7 @@ pub(crate) async fn execute(args: Args) -> anyhow::Result<()> {
7874
nyxd_setup: nyxd::Config {
7975
nyxd_repo: args.nyxd_repo,
8076
nyxd_dockerfile_path: args.nyxd_dockerfile_path,
77+
custom_dns: args.common.custom_dns.clone(),
8178
nyxd_tag: args.nyxd_tag,
8279
},
8380
contracts_setup: cosmwasm_contracts::Config {
@@ -91,11 +88,12 @@ pub(crate) async fn execute(args: Args) -> anyhow::Result<()> {
9188
nym_api_setup: nym_api::Config {
9289
cosmwasm_optimizer_image: args.cosmwasm_optimizer_image,
9390
monorepo_root: args.monorepo_root.clone(),
91+
custom_dns: args.common.custom_dns.clone(),
9492
allow_cached_build: args.allow_cached_build,
9593
},
9694
nym_nodes_setup: nym_nodes::Config {
9795
monorepo_root: args.monorepo_root,
98-
custom_dns: args.custom_dns,
96+
custom_dns: args.common.custom_dns,
9997
open_proxy: args.open_proxy,
10098
},
10199
})

0 commit comments

Comments
 (0)