README.md 1008 octets
Newer Older
Imran Tierce's avatar
Imran Tierce a validé
## Run the server

```sh
cargo run
# or cargo run -- --help
```

`--release` is good but not necessary.

## Run the slave

```sh
cargo run --release --bin slave
# or cargo run --release --bin slave -- --help
```

We add the `--release` to make the slave fast.

Imran Tierce's avatar
Imran Tierce a validé
## Build the docker images

Before building:

```sh
cargo vendor
```
itytophile's avatar
itytophile a validé

Imran Tierce's avatar
Imran Tierce a validé
Then:

```sh
docker build -f docker/Dockerfile.slave -t itytophile/slave .
```

```sh
docker build -f docker/Dockerfile.server -t itytophile/server .
```

## Why other Dockerfiles for CI?

Because using cargo vendor within a runner is not easy. The CI has to update crates.io index for each build.

itytophile's avatar
itytophile a validé
## Monitoring

Imran Tierce's avatar
Imran Tierce a validé
Initialize the swarm:

```
docker swarm init
```

Install [websocket-client](https://pypi.org/project/websocket-client/) for Python. Yeah there is not an image for the monitor.

itytophile's avatar
itytophile a validé
After creating the swarm:
itytophile's avatar
itytophile a validé

```sh
itytophile's avatar
itytophile a validé
docker stack deploy --compose-file docker-compose.yml stackhash
itytophile's avatar
itytophile a validé
python docker/monitor.py
```
itytophile's avatar
itytophile a validé

To delete the stack:

```sh
docker stack rm stackhash
```