Skip to content

remove mongodb related code #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,6 @@ jobs:
timeout-minutes: 10

services:
mongo_db_service:
image: mongo:3.6
env:
MONGO_INITDB_ROOT_USERNAME: dev
MONGO_INITDB_ROOT_PASSWORD: stac
ports:
- 27018:27017

elasticsearch_db_service:
image: docker.elastic.co/elasticsearch/elasticsearch:7.14.2
Expand Down Expand Up @@ -48,23 +41,9 @@ jobs:
run: |
python -m pip install --upgrade pipenv wheel

- name: Install mongo stac-fastapi
run: |
pip install ./stac_fastapi/mongo[dev,server]

- name: Install elasticsearch stac-fastapi
run: |
pip install ./stac_fastapi/elasticsearch[dev,server]

- name: Run test suite
run: |
cd stac_fastapi/mongo && pipenv run pytest -svvv
env:
ENVIRONMENT: testing
MONGO_USER: dev
MONGO_PASS: stac
MONGO_PORT: 27018
MONGO_HOST: localhost

- name: Run test suite
run: |
Expand Down
38 changes: 0 additions & 38 deletions .github/workflows/publish-to-pypi.yml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/publish-to-test-pypi.yml

This file was deleted.

3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,6 @@ dmypy.json
# Pyre type checker
.pyre/

# mongo db data
/mongo_data

/esdata

# Virtualenv
Expand Down
File renamed without changes.
20 changes: 0 additions & 20 deletions Dockerfile.mongo

This file was deleted.

52 changes: 10 additions & 42 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,64 +3,36 @@ APP_HOST ?= 0.0.0.0
APP_PORT ?= 8080
EXTERNAL_APP_PORT ?= ${APP_PORT}

run_es = docker-compose -f docker-compose.elasticsearch.yml \
run \
-p ${EXTERNAL_APP_PORT}:${APP_PORT} \
-e PY_IGNORE_IMPORTMISMATCH=1 \
-e APP_HOST=${APP_HOST} \
-e APP_PORT=${APP_PORT} \
app-elasticsearch

run_mongo = docker-compose -f docker-compose.mongo.yml \
run \
-p ${EXTERNAL_APP_PORT}:${APP_PORT} \
-e PY_IGNORE_IMPORTMISMATCH=1 \
-e APP_HOST=${APP_HOST} \
-e APP_PORT=${APP_PORT} \
app-mongo
run_es = docker-compose \
run \
-p ${EXTERNAL_APP_PORT}:${APP_PORT} \
-e PY_IGNORE_IMPORTMISMATCH=1 \
-e APP_HOST=${APP_HOST} \
-e APP_PORT=${APP_PORT} \
app-elasticsearch

.PHONY: es-image
es-image:
docker-compose -f docker-compose.elasticsearch.yml build

.PHONY: mongo-image
mongo-image:
docker-compose -f docker-compose.mongo.yml build
docker-compose build

.PHONY: docker-run-es
docker-run-es: es-image
$(run_es)

.PHONY: docker-run-mongo
docker-run-mongo: mongo-image
$(run_mongo)

.PHONY: docker-shell-es
docker-shell-es:
$(run_es) /bin/bash

.PHONY: docker-shell-mongo
docker-shell-mongo:
$(run_mongo) /bin/bash

.PHONY: test-es
test-es:
$(run_es) /bin/bash -c 'export && ./scripts/wait-for-it.sh elasticsearch:9200 && cd /app/stac_fastapi/elasticsearch/tests/ && pytest'

.PHONY: test-mongo
test-mongo:
$(run_mongo) /bin/bash -c 'export && cd /app/stac_fastapi/mongo/tests/ && pytest'

.PHONY: run-es-database
run-es-database:
docker-compose -f docker-compose.elasticsearch.yml run --rm elasticsearch

.PHONY: run-mongo-database
run-mongo-database:
docker-compose -f docker-compose.mongo.yml run --rm mongo_db
docker-compose run --rm elasticsearch

.PHONY: test
test: test-elasticsearch test-mongo
test: test-elasticsearch

.PHONY: pybase-install
pybase-install:
Expand All @@ -73,10 +45,6 @@ pybase-install:
es-install: pybase-install
pip install -e ./stac_fastapi/elasticsearch[dev,server]

.PHONY: mongo-install
mongo-install: pybase-install
pip install -e ./stac_fastapi/mongo[dev,server]

.PHONY: docs-image
docs-image:
docker-compose -f docker-compose.docs.yml \
Expand Down
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
# stac-fastapi-nosql
# stac-fastapi-elasticsearch

Elasticsearch and mongodb backends for stac-fastapi.
Elasticsearch backend for stac-fastapi.

**WIP** This backend is not yet stable (notice no releases yet), so use the pgstac backend instead.

------
#### Running API on localhost:8083

```docker-compose -f docker-compose.mongo.yml up``` **or**

```docker-compose -f docker-compose.elasticsearch.yml up```
```docker-compose up```

------
#### Testing


```make test-mongo``` **or**

```make test-es```
46 changes: 0 additions & 46 deletions docker-compose.mongo.yml

This file was deleted.

2 changes: 1 addition & 1 deletion docker-compose.elasticsearch.yml → docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
restart: always
build:
context: .
dockerfile: Dockerfile.elasticsearch
dockerfile: Dockerfile
platform: linux/amd64
environment:
- APP_HOST=0.0.0.0
Expand Down
2 changes: 1 addition & 1 deletion scripts/publish
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SUBPACKAGE_DIRS=(
"stac_fastapi/api"
"stac_fastapi/sqlalchemy"
"stac_fastapi/pgstac"
"stac_fastapi/mongo"
"stac_fastapi/elasticsearch"
)

function usage() {
Expand Down
Loading