-docker run --network="host" --rm -v `pwd`:/tmp remote-data-broker bash -c "cd src && go test -v ./... > out && cat out && cat out | go-junit-report -set-exit-code > /tmp/report.xml"
This is a project for remote data managers that are responsible for data transfers between local storage and a distributed data management solution.
Remote Data Broker is a low-level service within the NDIP data management solution responsible for serving files to
other NDIP components using the HTTP protocol. It is primarily used when files are not available locally and need to be
transferred from another location. Additionally, it provides the capability to delete remote files.
## Getting started
## Architecture
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
The broker consists of two main components:
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
1.**Server** – Handles HTTP requests and serves files directly or redirects them to the client via RabbitMQ.
2.**Client** (optional) – Listens to a RabbitMQ (RMQ) queue and processes requests in cases where the broker runs on a
machine restricted by firewall rules from accepting inbound HTTP connections.
## File Access Modes
- If the request is processed by the client, it is assumed to have direct access to the files.
- If the request is processed by the server, access is managed in two ways, depending of a query parameter in the request:
- As the user running the service.
- On behalf of another user via an OIDC token provided in the HTTP request.
For the latter, we use the [oidc-run-as-user](https://code.ornl.gov/ndip/ssh-oidc) utility.
## Configuration
Both the server and client are configured using a JSON file. See the example configuration file [here](conf.sample.json).
## Running the Service
The service is containerized using Docker. To build the image, run:
```bash
docker build -f dockerfiles/Dockerfile -t rdb .
```
To run the service, use:
```bash
docker run -it-p 9000:9000 -v <path to config file>:/config.json rdb /remote-data-broker -config /config.json
```
## REST API
After you start a docker container (see above), you can access the REST API documentation at the address:
http://localhost:9000/swagger/
In NDIP, the Remote Data Broker is used internally by Rucio, via an extra [protocol](https://code.ornl.gov/ndip/rucio-protocols) so there is no need to directly interact with it.