Skip to content
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

Remove backend packages #450

Closed
wants to merge 21 commits into from
Closed
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
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
docker-compose.yml
**/__pycache__
*.pyc
*.pyo
Expand Down
144 changes: 3 additions & 141 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,6 @@ jobs:
python-version: ["3.8", "3.9", "3.10", "3.11"]
timeout-minutes: 10

services:
db_service:
image: ghcr.io/stac-utils/pgstac:v0.6.12
env:
POSTGRES_USER: username
POSTGRES_PASSWORD: password
POSTGRES_DB: postgis
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
PGUSER: username
PGPASSWORD: password
PGDATABASE: postgis
ALLOW_IP_RANGE: 0.0.0.0/0
# Set health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 10s
--health-retries 10
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432

steps:
- name: Check out repository code
uses: actions/checkout@v3
Expand All @@ -56,131 +33,16 @@ jobs:
run: |
python -m pip install --upgrade pipenv wheel

- name: Install types
run: |
pip install ./stac_fastapi/types[dev]

- name: Install core api
run: |
pip install ./stac_fastapi/api[dev]

- name: Install Extensions
- name: Install core package
run: |
pip install ./stac_fastapi/extensions[dev]

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

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

- name: Run migration
run: |
cd stac_fastapi/sqlalchemy && alembic upgrade head
env:
POSTGRES_USER: username
POSTGRES_PASS: password
POSTGRES_DBNAME: postgis
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432

- name: Run test suite
run: |
cd stac_fastapi/api && pipenv run pytest -svvv
env:
ENVIRONMENT: testing
pip install .[dev]

- name: Run test suite
run: |
cd stac_fastapi/types && pipenv run pytest -svvv
pipenv run pytest -svvv
env:
ENVIRONMENT: testing

- name: Run test suite
run: |
cd stac_fastapi/sqlalchemy && pipenv run pytest -svvv
env:
ENVIRONMENT: testing
POSTGRES_USER: username
POSTGRES_PASS: password
POSTGRES_DBNAME: postgis
POSTGRES_HOST_READER: localhost
POSTGRES_HOST_WRITER: localhost
POSTGRES_PORT: 5432

- name: Run test suite
run: |
cd stac_fastapi/pgstac && pipenv run pytest -svvv
env:
ENVIRONMENT: testing
POSTGRES_USER: username
POSTGRES_PASS: password
POSTGRES_DBNAME: postgis
POSTGRES_HOST_READER: localhost
POSTGRES_HOST_WRITER: localhost
POSTGRES_PORT: 5432

validate:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
backend: ["sqlalchemy", "pgstac"]
services:
pgstac:
image: ghcr.io/stac-utils/pgstac:v0.6.11
env:
POSTGRES_USER: username
POSTGRES_PASSWORD: password
POSTGRES_DB: postgis
PGUSER: username
PGPASSWORD: password
PGDATABASE: postgis
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
cache: pip
cache-dependency-path: stac_fastapi/pgstac/setup.cfg
- name: Install stac-fastapi and stac-api-validator
run: pip install ./stac_fastapi/api ./stac_fastapi/types ./stac_fastapi/${{ matrix.backend }}[server] stac-api-validator==0.4.1
- name: Run migration
if: ${{ matrix.backend == 'sqlalchemy' }}
run: cd stac_fastapi/sqlalchemy && alembic upgrade head
env:
POSTGRES_USER: username
POSTGRES_PASS: password
POSTGRES_DBNAME: postgis
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
- name: Load data and validate
run: python -m stac_fastapi.${{ matrix.backend }}.app & ./scripts/wait-for-it.sh localhost:8080 && python ./scripts/ingest_joplin.py http://localhost:8080 && ./scripts/validate http://localhost:8080
env:
POSTGRES_USER: username
POSTGRES_PASS: password
POSTGRES_DBNAME: postgis
POSTGRES_HOST_READER: localhost
POSTGRES_HOST_WRITER: localhost
POSTGRES_PORT: 5432
PGUSER: username
PGPASSWORD: password
PGHOST: localhost
PGDATABASE: postgis
APP_HOST: 0.0.0.0
APP_PORT: 8080

test-docs:
runs-on: ubuntu-latest
steps:
Expand Down
14 changes: 1 addition & 13 deletions .github/workflows/deploy_mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -e \
stac_fastapi/api \
stac_fastapi/types \
stac_fastapi/extensions \
stac_fastapi/sqlalchemy
python -m pip install -e .
python -m pip install mkdocs mkdocs-material pdocs

- name: update API docs
Expand All @@ -42,14 +38,6 @@ jobs:
--exclude_source \
--overwrite \
stac_fastapi
env:
POSTGRES_USER: username
POSTGRES_PASS: password
POSTGRES_DBNAME: postgis
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
POSTGRES_HOST_READER: localhost
POSTGRES_HOST_WRITER: localhost

- name: Deploy docs
run: mkdocs gh-deploy --force
109 changes: 53 additions & 56 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,57 +1,54 @@
repos:
- repo: https://github.com/PyCQA/isort
rev: 5.8.0
hooks:
- id: isort
language_version: python3.8
-
repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
args: ['--safe']
language_version: python3.8
-
repo: https://github.com/pycqa/flake8
rev: 3.9.0
hooks:
- id: flake8
language_version: python3.8
args: [
# E501 let black handle all line length decisions
# W503 black conflicts with "line break before operator" rule
# E203 black conflicts with "whitespace before ':'" rule
'--ignore=E501,W503,E203,C901']
-
repo: https://github.com/chewse/pre-commit-mirrors-pydocstyle
# 2.1.1
rev: v2.1.1
hooks:
- id: pydocstyle
language_version: python3.8
exclude: '.*(test|alembic|scripts).*'
args: [
# Check for docstring presence only
'--select=D1',

]
# Don't require docstrings for tests
# '--match=(?!test).*\.py']
# -
# repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.770
# hooks:
# - id: mypy
# language_version: python3.8
# args: [--no-strict-optional, --ignore-missing-imports]
-
repo: https://github.com/PyCQA/pydocstyle
rev: 6.0.0
hooks:
- id: pydocstyle
language_version: python3.8
exclude: '.*(test|alembic|scripts).*'
#args: [
# Don't require docstrings for tests
#'--match=(?!test|alembic|scripts).*\.py',
#]
- repo: https://github.com/PyCQA/isort
rev: 5.8.0
hooks:
- id: isort
language_version: python3.8
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
args: ["--safe"]
language_version: python3.8
- repo: https://github.com/pycqa/flake8
rev: 3.9.0
hooks:
- id: flake8
language_version: python3.8
args: [
# E501 let black handle all line length decisions
# W503 black conflicts with "line break before operator" rule
# E203 black conflicts with "whitespace before ':'" rule
"--ignore=E501,W503,E203,C901",
]
- repo: https://github.com/chewse/pre-commit-mirrors-pydocstyle
# 2.1.1
rev: v2.1.1
hooks:
- id: pydocstyle
language_version: python3.8
exclude: ".*(test|alembic|scripts).*"
args:
[
# Check for docstring presence only
"--select=D1",
]
# Don't require docstrings for tests
# '--match=(?!test).*\.py']
# -
# repo: https://github.com/pre-commit/mirrors-mypy
# rev: v0.770
# hooks:
# - id: mypy
# language_version: python3.8
# args: [--no-strict-optional, --ignore-missing-imports]
- repo: https://github.com/PyCQA/pydocstyle
rev: 6.0.0
hooks:
- id: pydocstyle
language_version: python3.8
exclude: ".*(test|alembic|scripts).*"
#args: [
# Don't require docstrings for tests
#'--match=(?!test|alembic|scripts).*\.py',
#]
11 changes: 5 additions & 6 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@

### Removed

* The SQLAlchemy and PgSTAC backend implementations have been moved to their own repos
([stac-utils/stac-fastapi-sqlalchemy](https://github.com/stac-utils/stac-fastapi-sqlalchemy)
and [stac-utils/stac-fastapi-pgstac](https://github.com/stac-utils/stac-fastapi-pgstac), respectively).
These backends will be distributed and versioned separately going forward.
([#450](https://github.com/stac-utils/stac-fastapi/pull/450))
* Incorrect context STAC extension url from the landing page ([#508](https://github.com/stac-utils/stac-fastapi/pull/508))

### Fixed
Expand Down Expand Up @@ -58,12 +63,6 @@

## [2.4.1] - 2022-08-05

### Added

### Changed

### Removed

### Fixed

* `ciso8601` fails to build in some environments, instead use `pyiso8601` to parse datetimes.
Expand Down
25 changes: 7 additions & 18 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,12 @@
FROM python:3.8-slim as base
FROM python:3.8-slim

# Any python libraries that require system libraries to be installed will likely
# need the following packages in order to build
RUN apt-get update && \
apt-get -y upgrade && \
apt-get install -y build-essential git && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# build-essential is required to build a wheel for ciso8601
RUN apt update && apt install -y build-essential

ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
RUN python -m pip install --upgrade pip

FROM base as builder
COPY . /opt/src

WORKDIR /app
WORKDIR /opt/src

COPY . /app

RUN pip install -e ./stac_fastapi/types[dev] && \
pip install -e ./stac_fastapi/api[dev] && \
pip install -e ./stac_fastapi/extensions[dev] && \
pip install -e ./stac_fastapi/sqlalchemy[dev,server] && \
pip install -e ./stac_fastapi/pgstac[dev,server]
RUN python -m pip install .[dev,docs]
25 changes: 0 additions & 25 deletions Dockerfile.docs

This file was deleted.

Loading