Skip to content

Commit

Permalink
Upgrade Elasticsearch infrastructure for CI and development (#5143)
Browse files Browse the repository at this point in the history
* Upgrade infrastructure dependencies

* Update README.md

* Fix image name

* Add run command

* Update README.md
  • Loading branch information
Sergio Revilla authored Sep 29, 2022
1 parent c323dcc commit d835dba
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci_check_translations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-18.04
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.0-amd64
image: docker.elastic.co/elasticsearch/elasticsearch:7.11.2-amd64
ports:
- 9200/tcp
options: -e="discovery.type=single-node" --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_e2e_puppeteer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
suite-dir: ['regression_suites', 'suite1', 'suite2']
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.0-amd64
image: docker.elastic.co/elasticsearch/elasticsearch:7.11.2-amd64
ports:
- 9200/tcp
options: -e="discovery.type=single-node" --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
services:
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch-oss:7.10.0-amd64
image: docker.elastic.co/elasticsearch/elasticsearch:7.11.2-amd64
ports:
- 9200/tcp
options: -e="discovery.type=single-node" --health-cmd="curl http://localhost:9200/_cluster/health" --health-interval=10s --health-timeout=5s --health-retries=10
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Read the [user guide](https://uwazi.readthedocs.io/en/latest/)
Before anything else you will need to install the application dependencies:

- **NodeJs >= 16.17.0** For ease of update, use nvm: https://github.com/creationix/nvm.
- **ElasticSearch 7.10.0** https://www.elastic.co/downloads/past-releases/elasticsearch-7-10-0 Please note that ElasticSearch requires java. Follow the instructions to install the package manually, you also probably need to disable ml module in the ElasticSearch config file:
- **ElasticSearch 7.11.2** https://www.elastic.co/downloads/past-releases/elasticsearch-7-11-2 Please note that ElasticSearch requires java. Follow the instructions to install the package manually, you also probably need to disable ml module in the ElasticSearch config file:
`xpack.ml.enabled: false`
- **ICU Analysis Plugin (recommended)** [installation](https://www.elastic.co/guide/en/elasticsearch/plugins/current/analysis-icu.html#analysis-icu) Adds support for number sorting in texts and solves other language sorting nuances. This option is activated by setting the env var USE_ELASTIC_ICU=true before running the server (defaults to false/unset).
- **MongoDB 4.2** https://docs.mongodb.com/v4.2/installation/ . If you have a previous version installed, please follow instructions on how to [upgrade here](https://docs.mongodb.com/manual/release-notes/4.2-upgrade-standalone/).
Expand Down Expand Up @@ -87,10 +87,10 @@ $ yarn install

### Docker

Infrastructure dependencies (ElasticSearch, ICU Analysis Plugin, MongoDB, Redis and Minio (S3 storage) can be installed via Docker Compose. ElasticSearch container will claim 2Gb of memory so be sure your Docker Engine is alloted at least 3Gb of memory (for Mac and Windows users).
Infrastructure dependencies (ElasticSearch, ICU Analysis Plugin, MongoDB, Redis and Minio (S3 storage) can be installed and run via Docker Compose. ElasticSearch container will claim 2Gb of memory so be sure your Docker Engine is alloted at least 3Gb of memory (for Mac and Windows users).

```shell
$ docker-compose up -d
$ ./run start
```

### Development Run
Expand Down
6 changes: 5 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ services:
elasticsearch:
build:
context: .
dockerfile: elastic-icu-7.10.1.Dockerfile
dockerfile: elastic-icu-7.11.2.Dockerfile
container_name: uwazi-elasticsearch
ports:
- "9200:9200"
environment:
Expand All @@ -14,17 +15,20 @@ services:
- cluster.routing.allocation.disk.threshold_enabled=false
mongo:
image: "mongo:4.2"
container_name: uwazi-mongo
ports:
- "27017:27017"
redis:
image: "redis:5.0.14"
container_name: uwazi-redis
command: redis-server
ports:
- "6379:6379"
environment:
- REDIS_REPLICATION_MODE=master
minio:
image: minio/minio
container_name: uwazi-s3
ports:
- "9000:9000"
- "9001:9001"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
FROM elasticsearch:7.10.1
FROM elasticsearch:7.11.2
RUN /usr/share/elasticsearch/bin/elasticsearch-plugin install analysis-icu
23 changes: 23 additions & 0 deletions run
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

set -eo pipefail

function start {
docker-compose up --build -d "${@}"
}

function mongo {
docker exec -it uwazi-mongo mongo localhost/uwazi_development
}

function stop {
docker-compose stop
}


function help {
printf "%s <task> \n\nTasks:\n" "${0}"
compgen -A function | grep -v "^_" | cat -n
}

USER_ID=$(id -u) GROUP_ID=$(id -g) "${@:-help}"

0 comments on commit d835dba

Please sign in to comment.