Skip to content

Commit 6c2df64

Browse files
committed
makefile fixes
1 parent 3cd75ec commit 6c2df64

File tree

4 files changed

+23
-14
lines changed

4 files changed

+23
-14
lines changed

Dockerfile.deploy.os

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WORKDIR /app
1313
COPY . /app
1414

1515
RUN pip install --no-cache-dir -e ./stac_fastapi/core
16-
RUN pip install --no-cache-dir ./stac_fastapi/elasticsearch[server]
16+
RUN pip install --no-cache-dir ./stac_fastapi/opensearch[server]
1717

1818
EXPOSE 8080
1919

Makefile

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#!make
22
APP_HOST ?= 0.0.0.0
3-
ES_APP_PORT ?= 8080
43
EXTERNAL_APP_PORT ?= ${APP_PORT}
54

65
ES_APP_PORT ?= 8080
76
ES_HOST ?= docker.for.mac.localhost
87
ES_PORT ?= 9200
98

109
OS_APP_PORT ?= 8082
11-
ES_HOST ?= docker.for.mac.localhost
10+
OS_HOST ?= docker.for.mac.localhost
1211
OS_PORT ?= 9202
1312

1413
run_es = docker-compose \
@@ -29,11 +28,11 @@ run_os = docker-compose \
2928

3029
.PHONY: image-deploy-es
3130
image-deploy-es:
32-
docker build -f Dockerfile.deploy.es -t stac-fastapi-elasticsearch:latest .
31+
docker build -f Dockerfile.dev.es -t stac-fastapi-elasticsearch:latest .
3332

3433
.PHONY: image-deploy-os
3534
image-deploy-os:
36-
docker build -f Dockerfile.deploy.os -t stac-fastapi-opensearch:latest .
35+
docker build -f Dockerfile.dev.os -t stac-fastapi-opensearch:latest .
3736

3837
.PHONY: run-deploy-locally
3938
run-deploy-locally:
@@ -53,33 +52,33 @@ docker-run-es: image-dev
5352
$(run_es)
5453

5554
.PHONY: docker-run-os
56-
docker-run-es: image-dev
55+
docker-run-os: image-dev
5756
$(run_os)
5857

5958
.PHONY: docker-shell-es
60-
docker-shell:
59+
docker-shell-es:
6160
$(run_es) /bin/bash
6261

6362
.PHONY: docker-shell-os
64-
docker-shell:
63+
docker-shell-os:
6564
$(run_os) /bin/bash
6665

6766
.PHONY: test-elasticsearch
68-
test:
69-
-$(run_es) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh elasticsearch:9200 && cd /app/stac_fastapi/elasticsearch/tests/ && pytest'
67+
test-elasticsearch:
68+
-$(run_es) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh elasticsearch:9200 && cd stac_fastapi/tests/ && pytest'
7069
docker-compose down
7170

7271
.PHONY: test-opensearch
7372
test-opensearch:
74-
-$(run_os) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh opensearch:9202 && cd /app/stac_fastapi/opensearch/tests/ && pytest'
73+
-$(run_os) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh opensearch:9202 && cd stac_fastapi/tests/ && pytest'
7574
docker-compose down
7675

7776
.PHONY: test
7877
test:
79-
-$(run_es) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh elasticsearch:9200 && cd /app/stac_fastapi/elasticsearch/tests/ && pytest'
78+
-$(run_es) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh elasticsearch:9200 && cd stac_fastapi/tests/ && pytest'
8079
docker-compose down
8180

82-
-$(run_os) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh opensearch:9202 && cd /app/stac_fastapi/opensearch/tests/ && pytest'
81+
-$(run_os) /bin/bash -c 'export && ./scripts/wait-for-it-es.sh opensearch:9202 && cd stac_fastapi/tests/ && pytest'
8382
docker-compose down
8483

8584
.PHONY: run-database-es

stac_fastapi/opensearch/setup.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,8 @@
4848
packages=find_namespace_packages(),
4949
zip_safe=False,
5050
install_requires=install_requires,
51+
extras_require=extra_reqs,
52+
entry_points={
53+
"console_scripts": ["stac-fastapi-opensearch=stac_fastapi.opensearch.app:run"]
54+
},
5155
)

stac_fastapi/tests/resources/test_item.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,17 @@
1414

1515
from stac_fastapi.core.core import CoreClient
1616
from stac_fastapi.core.datetime_utils import now_to_rfc3339_str
17-
from stac_fastapi.elasticsearch.database_logic import DatabaseLogic
17+
18+
# from stac_fastapi.core.base_database_logic import BaseDatabaseLogic
1819
from stac_fastapi.types.core import LandingPageMixin
1920

2021
from ..conftest import create_item, refresh_indices
2122

23+
if os.getenv("BACKEND", "elasticsearch").lower() == "opensearch":
24+
from stac_fastapi.opensearch.database_logic import DatabaseLogic
25+
else:
26+
from stac_fastapi.elasticsearch.database_logic import DatabaseLogic
27+
2228

2329
def rfc3339_str_to_datetime(s: str) -> datetime:
2430
return ciso8601.parse_rfc3339(s)

0 commit comments

Comments
 (0)