Skip to content

Commit

Permalink
Merge pull request #28 from samply/fix/target-rename
Browse files Browse the repository at this point in the history
renamed target to target-app
  • Loading branch information
enola-dkfz authored Nov 19, 2024
2 parents f033a07 + b5e8ae2 commit 4e5932e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,22 @@ license = "Apache-2.0"
[dependencies]
axum = "0.7"
base64 = "0.22.1"
reqwest = { version = "0.12", default_features = false, features = ["json", "default-tls", "stream"] }
reqwest = { version = "0.12", default-features = false, features = ["json", "default-tls", "stream"] }
serde = { version = "1.0.152", features = ["serde_derive"] }
serde_json = "1.0.96"
thiserror = "2.0.3"
rand = { default-features = false, version = "0.8.5" }
chrono = "0.4.31"
tokio = { version = "1.25.0", default_features = false, features = ["signal", "rt-multi-thread", "macros"] }
tokio = { version = "1.25.0", default-features = false, features = ["signal", "rt-multi-thread", "macros"] }
beam-lib = { git = "https://github.com/samply/beam", branch = "develop", features = ["http-util"] }
tower-http = { version = "0.6", features = ["cors"] }
async-sse = "5.1.0"
anyhow = "1"
futures-util = { version = "0.3", features = ["io"] }

# Logging
tracing = { version = "0.1.37", default_features = false }
tracing-subscriber = { version = "0.3.11", default_features = false, features = ["env-filter", "fmt"] }
tracing = { version = "0.1.37", default-features = false }
tracing-subscriber = { version = "0.3.11", default-features = false, features = ["env-filter", "fmt"] }

# Global variables
once_cell = "1.18"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ To run a standalone Prism, you need at least one running [Samply.Beam.Proxy](htt
You can compile and run this application via Cargo.:

```bash
cargo run -- --beam-proxy-url http://localhost:8082 --beam-app-id-long app2.proxy2.broker --api-key App1Secret --bind-addr 127.0.0.1:8066 --sites proxy1 --cors-origin any --project bbmri --target app1
cargo run -- --beam-proxy-url http://localhost:8082 --beam-app-id-long app2.proxy2.broker --api-key App1Secret --bind-addr 127.0.0.1:8066 --sites proxy1 --cors-origin any --project bbmri --target-app app1
```

## Configuration
Expand All @@ -37,8 +37,8 @@ The following environment variables are mandatory for the usage of Prism.
```
--wait-count <WAIT_COUNT>
Wait for results count [env: WAIT_COUNT=] [default: 32]
--target <TARGET>
Target_application_name [env: TARGET=] [default: focus]
--target-app <TARGET_APP>
Target application name [env: TARGET_APP=] [default: focus]
--bind-addr <BIND_ADDR>
The socket address this server will bind to [env: BIND_ADDR=] [default: 0.0.0.0:8080]
```
Expand Down
4 changes: 2 additions & 2 deletions src/beam.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use beam_lib::{AppId, MsgId, RawString, TaskRequest};
use uuid::Uuid;

pub fn create_beam_task(target_sites: Vec<String>) -> TaskRequest<RawString> {
let target = &CONFIG.target;
let target_app = &CONFIG.target_app;
let id = MsgId::new();
let proxy_id = &CONFIG.beam_app_id_long.proxy_id();
let query_encoded: String = BASE64.encode(
Expand All @@ -20,7 +20,7 @@ pub fn create_beam_task(target_sites: Vec<String>) -> TaskRequest<RawString> {
.1;
let to = target_sites
.iter()
.map(|site| AppId::new_unchecked(format!("{target}.{site}.{broker_id}")))
.map(|site| AppId::new_unchecked(format!("{target_app}.{site}.{broker_id}")))
.collect();
let metadata = {
serde_json::json!({
Expand Down
6 changes: 3 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ struct CliArgs {

/// Target_application_name
#[clap(long, env, value_parser, default_value = "focus")]
target: String,
target_app: String,
}

#[derive(Debug)]
Expand All @@ -76,7 +76,7 @@ pub(crate) struct Config {
pub project: String,
pub bind_addr: SocketAddr,
pub query_unencoded: String,
pub target: String,
pub target_app: String,
}

impl Config {
Expand All @@ -92,7 +92,7 @@ impl Config {
project: cli_args.project,
bind_addr: cli_args.bind_addr,
query_unencoded: get_query_unencoded(),
target: cli_args.target,
target_app: cli_args.target_app,
};
Ok(config)
}
Expand Down

0 comments on commit 4e5932e

Please sign in to comment.