Update README.md

This commit is contained in:
Allegro AI 2019-11-09 23:54:59 +02:00 committed by GitHub
parent 6d4c974045
commit 6b902f85f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -60,17 +60,12 @@ Latest docker images can be found [here](https://hub.docker.com/r/allegroai/trai
1. Setup Docker (docker-compose installation details: [Ubuntu](docs/faq.md#ubuntu) / [macOS](docs/faq.md#mac-osx)) 1. Setup Docker (docker-compose installation details: [Ubuntu](docs/faq.md#ubuntu) / [macOS](docs/faq.md#mac-osx))
<details> <details>
<summary>Make sure port 8080/8081/8008 are available for the `trains-server` services.</summary> <summary>Make sure ports 8080/8081/8008 are available for the TRAINS-server services:</summary>
For example, to see if port `8080` is in use: For example, to see if port `8080` is in use:
- Linux
```bash ```bash
$ netstat -natp | grep :8080 | grep LISTEN $ sudo lsof -Pn -i4 | grep :8080 | grep LISTEN
```
- macOS
```bash
$ lsof -Pn -i4 | grep :8080 | grep LISTEN
``` ```
</details> </details>
@ -132,7 +127,7 @@ Latest docker images can be found [here](https://hub.docker.com/r/allegroai/trai
* API server on port `8008` * API server on port `8008`
* File server on port `8081` * File server on port `8081`
**\* If something went wrong along the way, check our FAQ: [Docker Setup](docs/docker_setup.md), [Ubuntu Support](docs/faq.md#ubuntu), [macOS Support](docs/faq.md#mac-osx)** **\* If something went wrong along the way, check our FAQ: [Docker Setup](docs/docker_setup.md#setup-docker), [Ubuntu Support](docs/faq.md#ubuntu), [macOS Support](docs/faq.md#mac-osx)**
## Optional Configuration ## Optional Configuration
@ -241,71 +236,41 @@ We are constantly updating, improving and adding to the **trains-server**.
New releases will include new pre-built Docker images. New releases will include new pre-built Docker images.
When we release a new version and include a new pre-built Docker image for it, upgrade as follows: When we release a new version and include a new pre-built Docker image for it, upgrade as follows:
* Upgrading your docker-compose installation
* Shut down the docker containers * Shut down the docker containers
```bash ```bash
$ docker-compose down $ docker-compose down
``` ```
* We highly recommend backing up your data directory before upgrading * We highly recommend backing up your data directory before upgrading.
(see **Step ii** in the Manual Docker upgrade)
* Spin up the docker containers, it will automatically pull the latest trains-server build Assuming your data directory is `/opt/trains`, to archive all data into `~/trains_backup.tgz` execute:
```bash
$ docker-compose up
```
* In case of a docker error: "... The container name "/trains-???" is already in use by ..."
Try removing deprecated images with:
```bash
$ docker rm -f $(docker ps -a -q)
```
* Manual Docker upgrade
1. Shut down and remove each of your Docker instances using the following commands:
```bash
$ sudo docker stop <docker-name>
$ sudo docker rm -v <docker-name>
```
The Docker names are (see [Launching Docker Containers](#launch-docker)):
* `trains-elastic`
* `trains-mongo`
* `trains-redis`
* `trains-fileserver`
* `trains-apiserver`
* `trains-webserver`
2. We highly recommend backing up your data directory!. A simple way to do that is using `tar`:
For example, if your data directory is `/opt/trains`, use the following command:
```bash ```bash
$ sudo tar czvf ~/trains_backup.tgz /opt/trains/data $ sudo tar czvf ~/trains_backup.tgz /opt/trains/data
``` ```
This backups all data to an archive in your home directory.
To restore this example backup, use the following command: <details>
<summary>Restore instructions:</summary>
To restore this example backup, execute:
```bash ```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
``` ```
</details>
3. Pull the new **trains-server** docker image using the following command: * Download the latest `docker-compose.yml` file, either [manually](https://raw.githubusercontent.com/allegroai/trains-server/master/docker-compose.yml) or execute:
```bash ```bash
$ sudo docker pull allegroai/trains:latest $ curl https://raw.githubusercontent.com/allegroai/trains-server/master/docker-compose.yml -o docker-compose.yml
``` ```
If you wish to pull a different version, replace `latest` with the required version number, for example: * Spin up the docker containers, it will automatically pull the latest trains-server build
```bash ```bash
$ sudo docker pull allegroai/trains:0.11.0 $ docker-compose up -f docker-compose.yml
``` ```
4. Launch the newly released Docker image (see [Launching Docker Containers](#launch-docker)). **\* If something went wrong along the way, check our FAQ: [Docker Upgrade](docs/docker_setup.md#common-docker-upgrade-errors)**
## Community & Support ## Community & Support