File tree Expand file tree Collapse file tree 7 files changed +56
-15
lines changed
stac_fastapi/elasticsearch
stac_fastapi/elasticsearch Expand file tree Collapse file tree 7 files changed +56
-15
lines changed Original file line number Diff line number Diff line change
1
+ version : 2
2
+ updates :
3
+ - package-ecosystem : github-actions
4
+ directory : " /"
5
+ schedule :
6
+ interval : daily
7
+ - package-ecosystem : pip
8
+ directory : " /.github/workflows"
9
+ schedule :
10
+ interval : daily
11
+ - package-ecosystem : pip
12
+ directory : " /stac_fastapi/elasticsearch"
13
+ schedule :
14
+ interval : daily
Original file line number Diff line number Diff line change 12
12
13
13
services :
14
14
15
- elasticsearch_db_service :
16
- image : docker.elastic.co/elasticsearch/elasticsearch:7.14.2
15
+ elasticsearch_7_svc :
16
+ image : docker.elastic.co/elasticsearch/elasticsearch:7.17.1
17
17
env :
18
18
node.name : es01
19
19
cluster.name : stac-cluster
23
23
ES_JAVA_OPTS : -Xms512m -Xmx512m
24
24
ports :
25
25
- 9200:9200
26
-
26
+
27
+ elasticsearch_8_svc :
28
+ image : docker.elastic.co/elasticsearch/elasticsearch:8.1.0
29
+ env :
30
+ node.name : es01
31
+ cluster.name : stac-cluster
32
+ discovery.type : single-node
33
+ network.host : 0.0.0.0
34
+ http.port : 9400
35
+ ES_JAVA_OPTS : -Xms512m -Xmx512m
36
+ ports :
37
+ - 9400:9400
38
+
27
39
steps :
28
40
- name : Check out repository code
29
41
uses : actions/checkout@v2
@@ -45,12 +57,22 @@ jobs:
45
57
run : |
46
58
pip install ./stac_fastapi/elasticsearch[dev,server]
47
59
48
- - name : Run test suite
60
+ - name : Run test suite against Elasticsearch 7.x
49
61
run : |
50
62
cd stac_fastapi/elasticsearch && pipenv run pytest -svvv
51
63
env :
52
64
ENVIRONMENT : testing
53
65
ES_USER : dev
54
66
ES_PASS : stac
55
67
ES_PORT : 9200
68
+ ES_HOST : 172.17.0.1
69
+
70
+ - name : Run test suite against Elasticsearch 8.x
71
+ run : |
72
+ cd stac_fastapi/elasticsearch && pipenv run pytest -svvv
73
+ env :
74
+ ENVIRONMENT : testing
75
+ ES_USER : dev
76
+ ES_PASS : stac
77
+ ES_PORT : 9400
56
78
ES_HOST : 172.17.0.1
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ docker-shell:
26
26
.PHONY : test
27
27
test :
28
28
$(run_es ) /bin/bash -c ' export && ./scripts/wait-for-it-es.sh elasticsearch:9200 && cd /app/stac_fastapi/elasticsearch/tests/ && pytest'
29
+ # docker-compose down
29
30
30
31
.PHONY : run-database
31
32
run-database :
Original file line number Diff line number Diff line change @@ -33,6 +33,13 @@ docker-compose build
33
33
docker-compose up
34
34
` ` `
35
35
36
+ By default, docker-compose uses Elasticsearch 8.x. If you wish to use a different version, put the following in a
37
+ file named ` .env` in the same directory you run docker-compose from:
38
+
39
+ ` ` ` shell
40
+ ELASTICSEARCH_VERSION=7.17.1
41
+ ` ` `
42
+
36
43
To create a new Collection:
37
44
38
45
` ` ` shell
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ services:
32
32
33
33
elasticsearch :
34
34
container_name : es-container
35
- image : docker.elastic.co/elasticsearch/elasticsearch:7.14.2
35
+ image : docker.elastic.co/elasticsearch/elasticsearch:${ELASTICSEARCH_VERSION:-8.1.0}
36
36
environment :
37
37
node.name : es01
38
38
cluster.name : stac-cluster
@@ -41,8 +41,4 @@ services:
41
41
http.port : 9200
42
42
ES_JAVA_OPTS : -Xms512m -Xmx512m
43
43
ports :
44
- - 9200:9200
45
-
46
- networks :
47
- default :
48
- name : stac-fastapi-es-network
44
+ - " 9200:9200"
Original file line number Diff line number Diff line change 13
13
"stac-fastapi.api==2.3.0" ,
14
14
"stac-fastapi.extensions==2.3.0" ,
15
15
"fastapi-utils" ,
16
- "elasticsearch[async]" ,
17
- "elasticsearch-dsl" ,
16
+ "elasticsearch[async]==7.17.1 " ,
17
+ "elasticsearch-dsl==7.4.0 " ,
18
18
"pystac[validation]" ,
19
19
"uvicorn" ,
20
20
]
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ class ElasticsearchSettings(ApiSettings):
22
22
@property
23
23
def create_client (self ):
24
24
"""Create es client."""
25
- # try:
26
- client = Elasticsearch ([{"host" : str (DOMAIN ), "port" : str (PORT )}])
27
- return client
25
+ return Elasticsearch (
26
+ [{"host" : str (DOMAIN ), "port" : str (PORT )}],
27
+ headers = {"accept" : "application/vnd.elasticsearch+json; compatible-with=7" },
28
+ )
You can’t perform that action at this time.
0 commit comments