Skip to content

Commit

Permalink
update dev env for es 6.4
Browse files Browse the repository at this point in the history
 mn/#3-support-latest-elasticsearch-dsl-6
  • Loading branch information
codekiln committed Jul 10, 2023
1 parent 2459e02 commit 6b7e1c7
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 27 deletions.
28 changes: 28 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,31 @@ selfcheck: ## check that the Makefile is well-formed

pylintrc: ## check that the Makefile is well-formed
edx_lint write pylintrc

nuke:
@echo "Removing containers, networks, and data... 🧨"
@echo
docker compose down -v

es-health-local-api:
@echo "Assuming you've got docker up, getting health of elasticsearch... 📄"
@echo
curl 'localhost:9200/_cat/health?format=json&pretty=true'

es-list-indexes-local-api:
@echo "Assuming you've got docker up, getting elasticsearch indexes via API call... 📄"
curl 'localhost:9200/_cat/indices?format=json&pretty=true'

es-print-java-env:
@echo "printing runtime value of ES_JAVA_OPTS"
docker-compose run --rm elastic printenv ES_JAVA_OPTS

up:
@echo "Bringing up elastic 6 in docker 🚀"
docker compose up -d --remove-orphans

down:
@echo "Destroying local containers, but keeping data volumes intact... 😴"
docker compose down


63 changes: 37 additions & 26 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ version: '2.1'

services:
elastic:
image: docker.elastic.co/elasticsearch/elasticsearch:6.0.1
# arm64v8 is for Apple M1
image: webhippie/elasticsearch:6.4
ports:
- 9200:9200
- 9300:9300
Expand All @@ -23,31 +24,41 @@ services:
interval: 10s
timeout: 10s
retries: 10
db:
image: postgres
restart: always
ports:
- "5432:5432"
environment:
POSTGRES_USER: "pguser"
POSTGRES_PASSWORD: "pgpass"
POSTGRES_DB: "pgdb"
volumes:
# for normal elasticsearch:
# - elasticsearch:/usr/share/elasticsearch/data
# for webhippie/elasticsearch:
- elasticsearch:/var/lib/elasticsearch

# uncomment to get kibana, which can be useful for analyzing index contents
# this is currently not a required part of testing infrastructure, just left here for convenience
# kibana:
# image: docker.elastic.co/kibana/kibana:6.0.1
# depends_on:
# elastic:
# condition: service_healthy
# links:
# - elastic
# commented out because right now we're not using postgres for tests
# comment back in if we need it for multiprocessing tests
# db:
# image: postgres
# restart: always
# ports:
# - 5601:5601
# - "5432:5432"
# environment:
# - "ELASTICSEARCH_URL=http://elastic:9200"
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost:5601"]
# interval: 10s
# timeout: 10s
# retries: 10
# POSTGRES_USER: "pguser"
# POSTGRES_PASSWORD: "pgpass"
# POSTGRES_DB: "pgdb"

# uncomment to get kibana, which can be useful for analyzing index contents
# this is currently not a required part of testing infrastructure, just left here for convenience
kibana:
image: docker.elastic.co/kibana/kibana:6.4.3
depends_on:
elastic:
condition: service_healthy
links:
- elastic
ports:
- 5601:5601
environment:
- "ELASTICSEARCH_URL=http://elastic:9200"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5601"]
interval: 10s
timeout: 10s
retries: 10
volumes:
elasticsearch:
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def get_version(*file_paths):
license='MIT',
include_package_data=True,
install_requires=[
"Django>=1.8", "elasticsearch-dsl>=6.4.0<7.0.0", "texttable>=1.2.1",
"Django>=1.8", "elasticsearch-dsl>=6.4.0,<7.0.0", "texttable>=1.2.1",
"multiprocessing-logging>=0.2.6"
],
zip_safe=False,
Expand Down

0 comments on commit 6b7e1c7

Please sign in to comment.