Skip to content

Commit cbdb8dc

Browse files
thomasywangfacebook-github-bot
authored andcommitted
Remove proxy
Summary: The proxy was previously used since the simulator and the python were run in separate processes. Since both are now run in the same process we no longer need a proxy Differential Revision: D77941641
1 parent 8226c52 commit cbdb8dc

File tree

15 files changed

+155
-652
lines changed

15 files changed

+155
-652
lines changed

controller/src/lib.rs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,20 +1552,13 @@ mod tests {
15521552
#[tokio::test]
15531553
async fn test_sim_supervision_failure() {
15541554
// Start system actor.
1555-
let system_addr = ChannelAddr::any(ChannelTransport::Unix);
1556-
let proxy_addr = ChannelAddr::any(ChannelTransport::Unix);
1557-
simnet::start(
1558-
ChannelAddr::any(ChannelTransport::Unix),
1559-
proxy_addr.clone(),
1560-
1000,
1561-
)
1562-
.unwrap();
1555+
simnet::start();
15631556
simnet::simnet_handle()
15641557
.unwrap()
15651558
.set_training_script_state(simnet::TrainingScriptState::Waiting);
15661559

15671560
let system_sim_addr =
1568-
ChannelAddr::Sim(SimAddr::new(system_addr, proxy_addr.clone()).unwrap());
1561+
ChannelAddr::any(ChannelTransport::Sim(Box::new(ChannelTransport::Unix)));
15691562
// Set very long supervision_update_timeout
15701563
let server_handle = System::serve(
15711564
system_sim_addr.clone(),
@@ -1581,9 +1574,8 @@ mod tests {
15811574
// Bootstrap the controller
15821575
let controller_id = id!(controller[0].root);
15831576
let proc_id = id!(world[0]);
1584-
let controller_proc_listen_addr = ChannelAddr::Sim(
1585-
SimAddr::new(ChannelAddr::any(ChannelTransport::Unix), proxy_addr).unwrap(),
1586-
);
1577+
let controller_proc_listen_addr =
1578+
ChannelAddr::any(ChannelTransport::Sim(Box::new(ChannelTransport::Unix)));
15871579

15881580
let (_, actor_ref) = ControllerActor::bootstrap(
15891581
controller_id.clone(),

hyperactor/src/channel.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ pub enum ChannelTransport {
236236
Local,
237237

238238
/// Sim is a simulated channel for testing.
239-
Sim(/*proxy address:*/ ChannelAddr),
239+
Sim(/*simulated transport:*/ Box<ChannelTransport>),
240240

241241
/// Transport over unix domain socket.
242242
Unix,
@@ -368,7 +368,7 @@ impl ChannelAddr {
368368
Self::MetaTls(hostname, 0)
369369
}
370370
ChannelTransport::Local => Self::Local(0),
371-
ChannelTransport::Sim(proxy) => sim::any(proxy),
371+
ChannelTransport::Sim(transport) => sim::any(*transport),
372372
// This works because the file will be deleted but we know we have a unique file by this point.
373373
ChannelTransport::Unix => Self::Unix(net::unix::SocketAddr::from_str("").unwrap()),
374374
}
@@ -380,7 +380,7 @@ impl ChannelAddr {
380380
Self::Tcp(_) => ChannelTransport::Tcp,
381381
Self::MetaTls(_, _) => ChannelTransport::MetaTls,
382382
Self::Local(_) => ChannelTransport::Local,
383-
Self::Sim(addr) => ChannelTransport::Sim(addr.proxy().clone()),
383+
Self::Sim(addr) => ChannelTransport::Sim(Box::new(addr.transport())),
384384
Self::Unix(_) => ChannelTransport::Unix,
385385
}
386386
}
@@ -637,10 +637,9 @@ mod tests {
637637
}
638638

639639
for (raw, parsed) in cases_ok.iter().zip(src_ok.clone()).map(|(a, _)| {
640-
let proxy_str = "unix!@proxy_a";
641640
(
642-
format!("sim!{},{}", a.0, &proxy_str),
643-
ChannelAddr::Sim(SimAddr::new(a.1.clone(), proxy_str.parse().unwrap()).unwrap()),
641+
format!("sim!{}", a.0),
642+
ChannelAddr::Sim(SimAddr::new(a.1.clone()).unwrap()),
644643
)
645644
}) {
646645
assert_eq!(raw.parse::<ChannelAddr>().unwrap(), parsed);

0 commit comments

Comments
 (0)