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

updated readme with catalogue etc. #27

Merged
merged 3 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,35 @@ This is the Rust re-implementation of Samply.Spot.
## Local setup
Spot can be run locally with the provided [docker-compose](./docker-compose.yml) which requires a running beam installation. This can be done by cloning the [beam repository](https://github.com/samply/beam) and running `./dev/beamdev demo`

Spot can also be run from command line stating command line parameters, like so:
```bash
cargo run -- --beam-proxy-url http://localhost:8081 --beam-app-id app1.proxy1.broker --beam-secret App1Secret --cors-origin any --bind-addr 127.0.0.1:8055 --catalogue-url https://raw.githubusercontent.com/samply/lens/main/packages/demo/public/catalogues/catalogue-dktk.json
```

The following environment variables are mandatory for the usage of Spot.
```
--beam-proxy-url <BEAM_PROXY_URL>
URL of the Beam Proxy, e.g. https://proxy1.broker.samply.de [env: BEAM_PROXY_URL=]
--beam-app-id <BEAM_APP_ID>
Beam AppId of this application, e.g. spot.proxy1.broker.samply.de [env: BEAM_APP_ID=]
--beam-secret <BEAM_SECRET>
Credentials to use on the Beam Proxy [env: BEAM_SECRET=]
--cors-origin <CORS_ORIGIN>
Where to allow cross-origin resourse sharing from [env: CORS_ORIGIN=]
```

Optional environment variables:
```
--project <PROJECT>
Optional project name used by focus [env: PROJECT=]
--catalogue-url <CATALOGUE_URL>
URL to catalogue.json file, if not stated, /catalogue endpoint is disabled [env: CATALOGUE_URL=]
--prism-url <PRISM_URL>
URL to prism, if catalogue-url is not stated, this is never used [env: PRISM_URL=] [default: http://localhost:8066]
--bind-addr <BIND_ADDR>
The socket address this server will bind to [env: BIND_ADDR=] [default: 0.0.0.0:8055]
```

## API

### /beam
Expand Down Expand Up @@ -38,14 +67,25 @@ Date: Mon, 15 Mai 2023 13:00:00 GMT
```

#### GET
The get endpoint takes an beam task id in the path.
The get endpoint takes a beam task id in the path.

``` shell
curl http://localhost:8100/beam/<some-uuid>
```

See the example [call](./docs/listen-for-beam-results.sh)

### /catalogue

#### GET

``` shell
curl http://localhost:8100/catalogue
```

Returns JSON catalogue of search criteria and the expected number of results in sites configured in Samply/Prism.
enola-dkfz marked this conversation as resolved.
Show resolved Hide resolved


## License

This code is licensed under the Apache License 2.0. For details, please see [LICENSE](./LICENSE)
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pub struct Config {
#[clap(long, env)]
pub beam_secret: String,

/// Credentials to use on the Beam Proxy
/// Where to allow cross-origin resourse sharing from
#[clap(long, env, value_parser = parse_cors)]
pub cors_origin: AllowOrigin,

Expand Down
Loading