Skip to content

Commit

Permalink
Merge pull request #27 from samply/catalogue-extender
Browse files Browse the repository at this point in the history
updated readme with catalogue etc.
  • Loading branch information
enola-dkfz committed Apr 8, 2024
2 parents 3a32d34 + 6619b99 commit c89e860
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
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 along with metadata fetched from Samply.Prism (see [Prism's repository](https://github.com/samply/prism) for a list of metadata fields).


## 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

0 comments on commit c89e860

Please sign in to comment.