Skip to content

Commit aa43970

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 21e99bc commit aa43970

File tree

17 files changed

+158
-678
lines changed

17 files changed

+158
-678
lines changed

controller/src/lib.rs

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,6 @@ mod tests {
624624
use hyperactor::RefClient;
625625
use hyperactor::channel;
626626
use hyperactor::channel::ChannelTransport;
627-
use hyperactor::channel::sim::SimAddr;
628627
use hyperactor::clock::Clock;
629628
use hyperactor::clock::RealClock;
630629
use hyperactor::data::Named;
@@ -1559,20 +1558,13 @@ mod tests {
15591558
#[tokio::test]
15601559
async fn test_sim_supervision_failure() {
15611560
// Start system actor.
1562-
let system_addr = ChannelAddr::any(ChannelTransport::Unix);
1563-
let proxy_addr = ChannelAddr::any(ChannelTransport::Unix);
1564-
simnet::start(
1565-
ChannelAddr::any(ChannelTransport::Unix),
1566-
proxy_addr.clone(),
1567-
1000,
1568-
)
1569-
.unwrap();
1561+
simnet::start();
15701562
simnet::simnet_handle()
15711563
.unwrap()
15721564
.set_training_script_state(simnet::TrainingScriptState::Waiting);
15731565

15741566
let system_sim_addr =
1575-
ChannelAddr::Sim(SimAddr::new(system_addr, proxy_addr.clone()).unwrap());
1567+
ChannelAddr::any(ChannelTransport::Sim(Box::new(ChannelTransport::Unix)));
15761568
// Set very long supervision_update_timeout
15771569
let server_handle = System::serve(
15781570
system_sim_addr.clone(),
@@ -1588,9 +1580,8 @@ mod tests {
15881580
// Bootstrap the controller
15891581
let controller_id = id!(controller[0].root);
15901582
let proc_id = id!(world[0]);
1591-
let controller_proc_listen_addr = ChannelAddr::Sim(
1592-
SimAddr::new(ChannelAddr::any(ChannelTransport::Unix), proxy_addr).unwrap(),
1593-
);
1583+
let controller_proc_listen_addr =
1584+
ChannelAddr::any(ChannelTransport::Sim(Box::new(ChannelTransport::Unix)));
15941585

15951586
let (_, actor_ref) = ControllerActor::bootstrap(
15961587
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)