Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add --provisioner-address arg to both runtimes #433

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ members = [
"common",
"deployer",
"gateway",
"next",
"proto",
"provisioner",
"service"
Expand Down
5 changes: 3 additions & 2 deletions runtimes/legacy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
5 changes: 5 additions & 0 deletions runtimes/legacy/src/args.rs
Original file line number Diff line number Diff line change
@@ -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,
}
4 changes: 2 additions & 2 deletions runtimes/legacy/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -59,7 +59,7 @@ async fn load_service(
so_path: PathBuf,
factory: &mut dyn Factory,
logger: Logger,
) -> shuttle_next::error::Result<LoadedService> {
) -> shuttle_legacy::error::Result<LoadedService> {
let loader = Loader::from_so_file(so_path)?;

Ok(loader.load(factory, addr, logger).await?)
Expand Down
5 changes: 3 additions & 2 deletions runtimes/next/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "*"
Expand Down
9 changes: 9 additions & 0 deletions runtimes/next/src/args.rs
Original file line number Diff line number Diff line change
@@ -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,
}
2 changes: 2 additions & 0 deletions runtimes/next/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
pub mod args;

use std::fs::File;
use std::io::{Read, Write};
use std::os::unix::prelude::RawFd;
Expand Down
9 changes: 5 additions & 4 deletions runtimes/next/src/main.rs
Original file line number Diff line number Diff line change
@@ -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();
Expand Down