Skip to content

Commit 94ed7d3

Browse files
andrewjcgfacebook-github-bot
authored andcommitted
Move to monarch_hyperactor crate
Summary: I'm actually not 100% the best crate for this, but I'm moving to allow grabbing a dep onto pyo3 and some other crates w/o polluting hyperactor_mesh. Reviewed By: highker Differential Revision: D78366881
1 parent 40b2db0 commit 94ed7d3

File tree

10 files changed

+38
-36
lines changed

10 files changed

+38
-36
lines changed

hyperactor_mesh/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ path = "test/process_allocator_cleanup/process_allocator_cleanup.rs"
2525

2626
[dependencies]
2727
anyhow = "1.0.98"
28-
async-once-cell = "0.4.2"
2928
async-trait = "0.1.86"
3029
bincode = "1.3.3"
3130
bitmaps = "3.2.1"
@@ -50,7 +49,6 @@ serde_bytes = "0.11"
5049
serde_json = { version = "1.0.140", features = ["alloc", "float_roundtrip", "unbounded_depth"] }
5150
signal-hook = "0.3"
5251
signal-hook-tokio = { version = "0.3", features = ["futures-v0_3"] }
53-
tempfile = "3.15"
5452
thiserror = "2.0.12"
5553
tokio = { version = "1.45.0", features = ["full", "test-util", "tracing"] }
5654
tokio-stream = { version = "0.1.17", features = ["fs", "io-util", "net", "signal", "sync", "time"] }
@@ -59,7 +57,6 @@ tracing = { version = "0.1.41", features = ["attributes", "valuable"] }
5957
tracing-subscriber = { version = "0.3.19", features = ["chrono", "env-filter", "json", "local-time", "parking_lot", "registry"] }
6058

6159
[dev-dependencies]
62-
dir-diff = "0.3"
6360
maplit = "1.0"
6461
timed_test = { version = "0.0.0", path = "../timed_test" }
6562

hyperactor_mesh/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ pub mod actor_mesh;
1616
pub mod alloc;
1717
mod assign;
1818
pub mod bootstrap;
19-
pub mod code_sync;
2019
pub mod comm;
2120
pub mod connect;
2221
pub mod logging;

hyperactor_mesh/src/reference.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,7 @@ impl<A: RemoteActor> ActorMeshRef<A> {
9393
/// typed reference. This is usually invoked to provide a guarantee
9494
/// that an externally-provided mesh ID (e.g., through a command
9595
/// line argument) is a valid reference.
96-
pub(crate) fn attest(
97-
mesh_id: ActorMeshId,
98-
root: Shape,
99-
comm_actor_ref: ActorRef<CommActor>,
100-
) -> Self {
96+
pub fn attest(mesh_id: ActorMeshId, root: Shape, comm_actor_ref: ActorRef<CommActor>) -> Self {
10197
Self {
10298
mesh_id,
10399
root,

monarch_extension/src/code_sync.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ use futures::TryFutureExt;
1515
use futures::future::try_join_all;
1616
use hyperactor_mesh::Mesh;
1717
use hyperactor_mesh::RootActorMesh;
18-
use hyperactor_mesh::code_sync::WorkspaceLocation;
19-
use hyperactor_mesh::code_sync::manager::CodeSyncManager;
20-
use hyperactor_mesh::code_sync::manager::CodeSyncManagerParams;
21-
use hyperactor_mesh::code_sync::manager::WorkspaceConfig;
22-
use hyperactor_mesh::code_sync::manager::WorkspaceShape;
23-
use hyperactor_mesh::code_sync::manager::code_sync_mesh;
2418
use hyperactor_mesh::shared_cell::SharedCell;
19+
use monarch_hyperactor::code_sync::WorkspaceLocation;
20+
use monarch_hyperactor::code_sync::manager::CodeSyncManager;
21+
use monarch_hyperactor::code_sync::manager::CodeSyncManagerParams;
22+
use monarch_hyperactor::code_sync::manager::WorkspaceConfig;
23+
use monarch_hyperactor::code_sync::manager::WorkspaceShape;
24+
use monarch_hyperactor::code_sync::manager::code_sync_mesh;
2525
use monarch_hyperactor::proc_mesh::PyProcMesh;
2626
use monarch_hyperactor::runtime::signal_safe_block_on;
2727
use pyo3::Bound;

monarch_hyperactor/Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,30 @@ license = "BSD-3-Clause"
99

1010
[dependencies]
1111
anyhow = "1.0.98"
12+
async-once-cell = "0.4.2"
1213
async-trait = "0.1.86"
1314
bincode = "1.3.3"
1415
clap = { version = "4.5.38", features = ["derive", "env", "string", "unicode", "wrap_help"] }
1516
erased-serde = "0.3.27"
1617
fbinit = { version = "0.2.0", git = "https://github.com/facebookexperimental/rust-shed.git", branch = "main" }
18+
futures = { version = "0.3.30", features = ["async-await", "compat"] }
19+
futures-util = { version = "0.3.30", features = ["compat"] }
1720
hyperactor = { version = "0.0.0", path = "../hyperactor" }
1821
hyperactor_mesh = { version = "0.0.0", path = "../hyperactor_mesh" }
1922
hyperactor_multiprocess = { version = "0.0.0", path = "../hyperactor_multiprocess" }
2023
hyperactor_telemetry = { version = "0.0.0", path = "../hyperactor_telemetry" }
2124
inventory = "0.3.8"
2225
monarch_types = { version = "0.0.0", path = "../monarch_types" }
2326
ndslice = { version = "0.0.0", path = "../ndslice" }
27+
nix = { version = "0.29.0", features = ["dir", "event", "hostname", "inotify", "ioctl", "mman", "mount", "net", "poll", "ptrace", "reboot", "resource", "sched", "signal", "term", "time", "user", "zerocopy"] }
2428
pyo3 = { version = "0.24", features = ["anyhow", "multiple-pymethods"] }
2529
pyo3-async-runtimes = { version = "0.24", features = ["attributes", "tokio-runtime"] }
2630
serde = { version = "1.0.185", features = ["derive", "rc"] }
2731
serde_bytes = "0.11"
32+
tempfile = "3.15"
2833
thiserror = "2.0.12"
2934
tokio = { version = "1.45.0", features = ["full", "test-util", "tracing"] }
3035
tracing = { version = "0.1.41", features = ["attributes", "valuable"] }
36+
37+
[dev-dependencies]
38+
dir-diff = "0.3"

hyperactor_mesh/src/code_sync/manager.rs renamed to monarch_hyperactor/src/code_sync/manager.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ use hyperactor::Named;
2828
use hyperactor::PortRef;
2929
use hyperactor::Unbind;
3030
use hyperactor::forward;
31+
use hyperactor_mesh::RootActorMesh;
32+
use hyperactor_mesh::SlicedActorMesh;
33+
use hyperactor_mesh::actor_mesh::ActorMesh;
34+
use hyperactor_mesh::connect::Connect;
35+
use hyperactor_mesh::connect::accept;
36+
use hyperactor_mesh::reference::ActorMeshId;
37+
use hyperactor_mesh::reference::ActorMeshRef;
38+
use hyperactor_mesh::reference::ProcMeshId;
39+
use hyperactor_mesh::sel;
3140
use ndslice::Selection;
3241
use ndslice::Shape;
3342
use ndslice::ShapeError;
@@ -36,21 +45,12 @@ use serde::Serialize;
3645
use tokio::net::TcpListener;
3746
use tokio::net::TcpStream;
3847

39-
use crate::RootActorMesh;
40-
use crate::SlicedActorMesh;
41-
use crate::actor_mesh::ActorMesh;
4248
use crate::code_sync::WorkspaceLocation;
4349
use crate::code_sync::rsync::RsyncActor;
4450
use crate::code_sync::rsync::RsyncDaemon;
4551
use crate::code_sync::rsync::RsyncMessage;
4652
use crate::code_sync::rsync::RsyncParams;
4753
use crate::code_sync::rsync::RsyncResult;
48-
use crate::connect::Connect;
49-
use crate::connect::accept;
50-
use crate::reference::ActorMeshId;
51-
use crate::reference::ActorMeshRef;
52-
use crate::reference::ProcMeshId;
53-
use crate::sel;
5454

5555
#[derive(Clone, Serialize, Deserialize, Debug)]
5656
pub enum Method {
@@ -310,15 +310,15 @@ pub async fn code_sync_mesh(
310310
#[cfg(test)]
311311
mod tests {
312312
use anyhow::anyhow;
313+
use hyperactor_mesh::alloc::AllocSpec;
314+
use hyperactor_mesh::alloc::Allocator;
315+
use hyperactor_mesh::alloc::local::LocalAllocator;
316+
use hyperactor_mesh::proc_mesh::ProcMesh;
313317
use ndslice::shape;
314318
use tempfile::TempDir;
315319
use tokio::fs;
316320

317321
use super::*;
318-
use crate::alloc::AllocSpec;
319-
use crate::alloc::Allocator;
320-
use crate::alloc::local::LocalAllocator;
321-
use crate::proc_mesh::ProcMesh;
322322

323323
#[test]
324324
fn test_workspace_shape_owners() {

hyperactor_mesh/src/code_sync/rsync.rs renamed to monarch_hyperactor/src/code_sync/rsync.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ use hyperactor::PortRef;
3131
use hyperactor::Unbind;
3232
use hyperactor::clock::Clock;
3333
use hyperactor::clock::RealClock;
34+
use hyperactor_mesh::actor_mesh::ActorMesh;
35+
use hyperactor_mesh::connect::Connect;
36+
use hyperactor_mesh::connect::accept;
37+
use hyperactor_mesh::sel;
3438
use ndslice::Selection;
3539
use nix::sys::signal;
3640
use nix::sys::signal::Signal;
@@ -44,11 +48,7 @@ use tokio::net::TcpStream;
4448
use tokio::process::Child;
4549
use tokio::process::Command;
4650

47-
use crate::actor_mesh::ActorMesh;
4851
use crate::code_sync::WorkspaceLocation;
49-
use crate::connect::Connect;
50-
use crate::connect::accept;
51-
use crate::sel;
5252

5353
/// Represents a single file change from rsync
5454
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
@@ -398,16 +398,16 @@ where
398398
mod tests {
399399
use anyhow::Result;
400400
use anyhow::anyhow;
401+
use hyperactor_mesh::alloc::AllocSpec;
402+
use hyperactor_mesh::alloc::Allocator;
403+
use hyperactor_mesh::alloc::local::LocalAllocator;
404+
use hyperactor_mesh::proc_mesh::ProcMesh;
401405
use ndslice::shape;
402406
use tempfile::TempDir;
403407
use tokio::fs;
404408
use tokio::net::TcpListener;
405409

406410
use super::*;
407-
use crate::alloc::AllocSpec;
408-
use crate::alloc::Allocator;
409-
use crate::alloc::local::LocalAllocator;
410-
use crate::proc_mesh::ProcMesh;
411411

412412
#[tokio::test]
413413
async fn test_simple() -> Result<()> {

monarch_hyperactor/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@
77
*/
88

99
#![allow(unsafe_op_in_unsafe_fn)]
10+
#![feature(exit_status_error)]
1011

1112
pub mod actor;
1213
pub mod actor_mesh;
1314
pub mod alloc;
1415
pub mod bootstrap;
1516
pub mod channel;
17+
pub mod code_sync;
1618
pub mod config;
1719
pub mod local_state_broker;
1820
pub mod mailbox;

0 commit comments

Comments
 (0)