Documentation

This commit is contained in:
allegroai 2019-08-08 02:08:39 +03:00
parent 70708ecdcc
commit 639d72c5d6

View File

@ -47,6 +47,7 @@ For Windows, we recommend installing our pre-built Docker image on a Linux virtu
Make sure port 8080/8081/8008 are available for the `trains-server` services Make sure port 8080/8081/8008 are available for the `trains-server` services
Increase vm.max_map_count for `ElasticSearch` docker Increase vm.max_map_count for `ElasticSearch` docker
```bash ```bash
echo "vm.max_map_count=262144" > /tmp/99-trains.conf echo "vm.max_map_count=262144" > /tmp/99-trains.conf
sudo mv /tmp/99-trains.conf /etc/sysctl.d/99-trains.conf sudo mv /tmp/99-trains.conf /etc/sysctl.d/99-trains.conf
@ -56,6 +57,7 @@ For Windows, we recommend installing our pre-built Docker image on a Linux virtu
``` ```
1. Create local directories for the databases and storage. 1. Create local directories for the databases and storage.
```bash ```bash
sudo mkdir -p /opt/trains/data/elastic sudo mkdir -p /opt/trains/data/elastic
sudo mkdir -p /opt/trains/data/mongo/db sudo mkdir -p /opt/trains/data/mongo/db
@ -66,24 +68,26 @@ For Windows, we recommend installing our pre-built Docker image on a Linux virtu
Linux Linux
```bash ```bash
sudo chown -R 1000:1000 /opt/trains $ sudo chown -R 1000:1000 /opt/trains
``` ```
Mac OS X Mac OS X
```bash ```bash
sudo chown -R $(whoami):staff /opt/trains $ sudo chown -R $(whoami):staff /opt/trains
``` ```
1. Clone the [trains-server](https://github.com/allegroai/trains-server) repository and change directories to the new **trains-server** directory. 1. Clone the [trains-server](https://github.com/allegroai/trains-server) repository and change directories to the new **trains-server** directory.
git clone https://github.com/allegroai/trains-server.git ```bash
cd trains-server $ git clone https://github.com/allegroai/trains-server.git
$ cd trains-server
```
1. Launch the Docker containers <a name="launch-docker"></a> 1. Launch the Docker containers <a name="launch-docker"></a>
* Automatically with docker-compose (details: [Linux/Ubuntu](docs/faq.md#ubuntu), [OS X](docs/faq.md#mac-osx)) * Automatically with docker-compose (details: [Linux/Ubuntu](docs/faq.md#ubuntu), [OS X](docs/faq.md#mac-osx))
```bash ```bash
docker-compose up $ docker-compose up
``` ```
* Manually * Manually
@ -158,8 +162,8 @@ To restart the **trains-server**, you must first stop and remove the containers,
1. Restarting docker-compose containers. 1. Restarting docker-compose containers.
docker-compose down $ docker-compose down
docker-compose up $ docker-compose up
1. Manually restarting dockers [instructions](docs/manual_docker.md). 1. Manually restarting dockers [instructions](docs/manual_docker.md).
@ -196,13 +200,15 @@ When we release a new version and include a new pre-built Docker image for it, u
* Using Docker-Compose * Using Docker-Compose
```bash ```bash
docker-compose down $ docker-compose down
``` ```
* Manual Docker launching * Manual Docker launching
sudo docker stop <docker-name> ```bash
sudo docker rm -v <docker-name> $ sudo docker stop <docker-name>
$ sudo docker rm -v <docker-name>
```
The Docker names are (see [Launching Docker Containers](#launch-docker)): The Docker names are (see [Launching Docker Containers](#launch-docker)):
@ -216,22 +222,27 @@ When we release a new version and include a new pre-built Docker image for it, u
For example, if your data directory is `/opt/trains`, use the following command: For example, if your data directory is `/opt/trains`, use the following command:
sudo tar czvf ~/trains_backup.tgz /opt/trains/data ```bash
$ sudo tar czvf ~/trains_backup.tgz /opt/trains/data
```
This backups all data to an archive in your home directory. This backups all data to an archive in your home directory.
To restore this example backup, use the following command: To restore this example backup, use the following command:
```bash
sudo rm -R /opt/trains/data $ sudo rm -R /opt/trains/data
sudo tar -xzf ~/trains_backup.tgz -C /opt/trains/data $ sudo tar -xzf ~/trains_backup.tgz -C /opt/trains/data
```
3. Pull the new **trains-server** docker image using the following command: 3. Pull the new **trains-server** docker image using the following command:
sudo docker pull allegroai/trains:latest ```bash
$ sudo docker pull allegroai/trains:latest
```
If you wish to pull a different version, replace `latest` with the required version number, for example: If you wish to pull a different version, replace `latest` with the required version number, for example:
```bash
sudo docker pull allegroai/trains:0.10.1 $ sudo docker pull allegroai/trains:0.10.1
```
4. Launch the newly released Docker image (see [Launching Docker Containers](#launch-docker)). 4. Launch the newly released Docker image (see [Launching Docker Containers](#launch-docker)).