Skip to content

Commit

Permalink
remove mongodb related code
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Varner committed Feb 22, 2022
1 parent 6bc2d7a commit b0252d5
Show file tree
Hide file tree
Showing 47 changed files with 14 additions and 3,582 deletions.
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
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
--sdist
--wheel
--outdir dist/
stac_fastapi/mongo
stac_fastapi/elasticsearch
- name: Publish distribution to PyPI
# if: startsWith(github.ref, 'refs/tags')
uses: pypa/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
--sdist
--wheel
--outdir dist/
stac_fastapi/mongo
stac_fastapi/elasticsearch
- name: Publish distribution to Test PyPI
# if: startsWith(github.ref, 'refs/tags')
uses: pypa/[email protected]
Expand Down
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
20 changes: 0 additions & 20 deletions Dockerfile.mongo

This file was deleted.

34 changes: 1 addition & 33 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,56 +11,28 @@ run_es = docker-compose -f docker-compose.elasticsearch.yml \
-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

.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

.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

.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
11 changes: 4 additions & 7 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```

------
#### 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 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
2 changes: 1 addition & 1 deletion stac_fastapi/elasticsearch/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Requirements

The Mongo backend requires **mongodb**.
The Elasticsearch backend requires **elasticsearch**.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""mongo extensions modifications."""
"""elasticsearch extensions modifications."""

from .query import Operator, QueryableTypes, QueryExtension

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
"""stac_fastapi.mongo.models module."""
"""stac_fastapi.elasticsearch.models module."""
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
"""common error checks."""

## todo: create this client for Elasticsearch

# import attr
# from pymongo import MongoClient

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def test_create_collection_already_exists(
data = load_test_data("test_collection.json")
es_transactions.create_collection(data, request=MockStarletteRequest)

# change id to avoid mongo duplicate key error
# change id to avoid elasticsearch duplicate key error
data["_id"] = str(uuid.uuid4())

with pytest.raises(ConflictError):
Expand Down
3 changes: 0 additions & 3 deletions stac_fastapi/mongo/README.md

This file was deleted.

3 changes: 0 additions & 3 deletions stac_fastapi/mongo/pytest.ini

This file was deleted.

2 changes: 0 additions & 2 deletions stac_fastapi/mongo/setup.cfg

This file was deleted.

58 changes: 0 additions & 58 deletions stac_fastapi/mongo/setup.py

This file was deleted.

1 change: 0 additions & 1 deletion stac_fastapi/mongo/stac_fastapi/mongo/__init__.py

This file was deleted.

Loading

0 comments on commit b0252d5

Please sign in to comment.