README.md 1.51 KB
Newer Older
Bastien Gounon's avatar
Bastien Gounon committed
1

Bastien Gounon's avatar
Bastien Gounon committed
2 3
# Server side
## Using binary executable
Bastien Gounon's avatar
Bastien Gounon committed
4
Download the binary, make it executable and provide parameters \
Bastien Gounon's avatar
Bastien Gounon committed
5 6
Example: `./xcache-flusher -port 8080 -cachedir /tmp/testdir01,/tmp/testdir02 -token mysecretpassword` \
Help available with `./xcache-flusher -h`
Bastien Gounon's avatar
Bastien Gounon committed
7 8 9

Server will listen on port 8080

Bastien Gounon's avatar
Bastien Gounon committed
10
## Using Docker container
Bastien Gounon's avatar
Bastien Gounon committed
11 12 13
When running you must specify environment variables for configuration:
- `FLUSHER_DIR`: comma-separated list of directories to flush
- (opt) `FLUSHER_PORT`: port on which to listen, default 8080. Using default and redirecting a different host port via Docker is preferrable.
Bastien Gounon's avatar
Bastien Gounon committed
14
- (opt) `FLUSHER_TOKEN`: string used to authenticate client requests
Bastien Gounon's avatar
Bastien Gounon committed
15

Bastien Gounon's avatar
Bastien Gounon committed
16
### Example: 
Bastien Gounon's avatar
Bastien Gounon committed
17 18 19 20
```
docker run -p 54321:8080 --env FLUSHER_DIR=/xcache/data,/xcache/metadata --env FLUSHER_TOKEN=mysecretpassword -v /path/to/data:/xcache gitlab-registry.in2p3.fr/bastien.gounon/xcache-flusher
```

Bastien Gounon's avatar
Bastien Gounon committed
21
### Docker-compose example:
Bastien Gounon's avatar
Bastien Gounon committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
```
version: '3'

services:
  xcache-flusher:
    image: gitlab-registry.in2p3.fr/bastien.gounon/xcache-flusher
    restart: always
    volumes:
      - /tmp/xcache:/xcache
    environment:
      - FLUSHER_DIR=/xcache/data,/xcache/metadata
      - FLUSHER_TOKEN=mysecretpassword
    ports:
      - 54321:8080
```

Bastien Gounon's avatar
Bastien Gounon committed
38
# Client side
Bastien Gounon's avatar
Bastien Gounon committed
39
Client just needs to call the DELETE HTTP operation on the server URL with method `flush`. Optionnally provide authentication token in the URL. \
Bastien Gounon's avatar
Bastien Gounon committed
40
example:
Bastien Gounon's avatar
Bastien Gounon committed
41
  * with authentication: `curl -X DELETE http://127.0.0.1:8080/flush\?token\=mysecretpassword`
Bastien Gounon's avatar
Bastien Gounon committed
42
  * without authentication: `curl -X DELETE http://127.0.0.1:8080/flush`