diff --git a/Cargo.lock b/Cargo.lock index c97d70c0a..da0b4fa99 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5379,20 +5379,6 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "shuttle-next" -version = "0.1.0" -dependencies = [ - "async-trait", - "clap 4.0.18", - "shuttle-common", - "shuttle-service", - "thiserror", - "tokio", - "tracing", - "tracing-subscriber", -] - [[package]] name = "shuttle-proto" version = "0.7.0" diff --git a/Cargo.toml b/Cargo.toml index 242c6b9d4..eae7bbd14 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,6 @@ members = [ "common", "deployer", "gateway", - "next", "proto", "provisioner", "service" diff --git a/runtimes/legacy/Cargo.toml b/runtimes/legacy/Cargo.toml index 57419bcbf..20f0833a3 100644 --- a/runtimes/legacy/Cargo.toml +++ b/runtimes/legacy/Cargo.toml @@ -10,15 +10,16 @@ async-trait = "0.1.58" clap ={ version = "4.0.18", features = ["derive"] } thiserror = "1.0.37" tokio = { version = "=1.20.1", features = ["full"] } +tonic = "0.8.0" tracing = "0.1.37" tracing-subscriber = { version = "0.3.16", features = ["env-filter"] } [dependencies.shuttle-common] version = "0.7.0" -path = "../common" +path = "../../common" [dependencies.shuttle-service] version = "0.7.0" default-features = false features = ["loader"] -path = "../service" +path = "../../service" diff --git a/runtimes/legacy/src/args.rs b/runtimes/legacy/src/args.rs index e435a3b2b..f35e2b96c 100644 --- a/runtimes/legacy/src/args.rs +++ b/runtimes/legacy/src/args.rs @@ -1,8 +1,13 @@ use clap::Parser; +use tonic::transport::Endpoint; #[derive(Parser, Debug)] pub struct Args { /// Uri to the `.so` file to load #[arg(long, short)] pub file_path: String, + + /// Address to reach provisioner at + #[clap(long, default_value = "localhost:5000")] + pub provisioner_address: Endpoint, } diff --git a/runtimes/legacy/src/main.rs b/runtimes/legacy/src/main.rs index a29754bc9..07c308d32 100644 --- a/runtimes/legacy/src/main.rs +++ b/runtimes/legacy/src/main.rs @@ -3,7 +3,7 @@ use std::{collections::BTreeMap, net::SocketAddr, path::PathBuf, str::FromStr}; use async_trait::async_trait; use clap::Parser; use shuttle_common::{database, LogItem}; -use shuttle_next::args::Args; +use shuttle_legacy::args::Args; use shuttle_service::{ loader::{LoadedService, Loader}, Factory, Logger, ServiceName, @@ -59,7 +59,7 @@ async fn load_service( so_path: PathBuf, factory: &mut dyn Factory, logger: Logger, -) -> shuttle_next::error::Result { +) -> shuttle_legacy::error::Result { let loader = Loader::from_so_file(so_path)?; Ok(loader.load(factory, addr, logger).await?) diff --git a/runtimes/next/Cargo.toml b/runtimes/next/Cargo.toml index 69e96b2fb..924cbad3c 100644 --- a/runtimes/next/Cargo.toml +++ b/runtimes/next/Cargo.toml @@ -6,12 +6,13 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [[bin]] -name = "shuttle-runtime" +name = "shuttle-next" [dependencies] async-trait = "0.1.58" - +clap ={ version = "4.0.18", features = ["derive"] } tokio = { version = "1.20.1", features = [ "full" ] } +tonic = "0.8.0" cap-std = "*" wasmtime = "*" diff --git a/runtimes/next/src/args.rs b/runtimes/next/src/args.rs new file mode 100644 index 000000000..2a2455e3a --- /dev/null +++ b/runtimes/next/src/args.rs @@ -0,0 +1,9 @@ +use clap::Parser; +use tonic::transport::Endpoint; + +#[derive(Parser, Debug)] +pub struct Args { + /// Address to reach provisioner at + #[clap(long, default_value = "localhost:5000")] + pub provisioner_address: Endpoint, +} diff --git a/runtimes/next/src/lib.rs b/runtimes/next/src/lib.rs index d806b4a98..cce82eb43 100644 --- a/runtimes/next/src/lib.rs +++ b/runtimes/next/src/lib.rs @@ -1,3 +1,5 @@ +pub mod args; + use std::fs::File; use std::io::{Read, Write}; use std::os::unix::prelude::RawFd; diff --git a/runtimes/next/src/main.rs b/runtimes/next/src/main.rs index f98d69e11..62a00847d 100644 --- a/runtimes/next/src/main.rs +++ b/runtimes/next/src/main.rs @@ -1,12 +1,13 @@ +use clap::Parser; +use serenity::prelude::*; +use shuttle_next::{args::Args, Bot}; use std::env; use std::io; -use serenity::prelude::*; - -use shuttle_runtime::Bot; - #[tokio::main] async fn main() -> io::Result<()> { + let _args = Args::parse(); + let intents = GatewayIntents::GUILD_MESSAGES | GatewayIntents::MESSAGE_CONTENT; let token = env::var("DISCORD_TOKEN").unwrap();