-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transition to pgstac backing (#1210)
* Begin transitioning to pgstac backing * Working collections endpoint * Working collections endpoint * Enable item read endpoints * Remove support for tiling; begin implementing /search * Use only pgstac * Reorganize commands around pgstac usage * Clean up dev environment for pgstac usage * Organize and clean up code * Search endpoint functional * Fix search links * Add collection type and serialization * Use model for items * Update item service to use search endpoint * Enable transactions * In situ * Fix json formatting, add transaction endpoints * Rename scriptrunner to pypgstac * Fix path * Lint * Lint * Fix pypgstac container paths * Add pre-commit and properly lint * Add sort functionality. * Fix temporal extent logic * Organize link updating * Fix feature links on search * Update links without code duplication * Organize link creation into queries to keep logic simple * Add rootlink in link updating functions * Add joplin data ingest * Added stac hierarchy model * Add hierarchy definition to service configuration * Format joplin data for ingest as example dataset * Working children and browseable structure * Remove references to NAIP outside of tests * Update documentation; add pgstac ADR * Fix validator errors * Revert timeinterval->temporal change * Enable more permissive cors headers * Lint * Appease scapegoat * Lint tests * Lint * Lint build.sbt * Remove unused dep check: it doesn't work * Fix docker build step * Thank you, github * Remove flyway references * Appease the fickle style gods Co-authored-by: Vijay Lulla <vijaylulla@gmail.com>
- Loading branch information
1 parent
e157a6a
commit 71dcdbd
Showing
167 changed files
with
4,752 additions
and
7,575 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,4 +142,7 @@ main.bundle.js.map | |
data/* | ||
|
||
# copilot related artifacts | ||
copilot/ | ||
copilot/ | ||
|
||
# metals | ||
**/metals.sbt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
repos: | ||
- repo: https://github.com/psf/black | ||
rev: 22.3.0 | ||
hooks: | ||
- id: black | ||
language_version: python3 | ||
args: ["--safe"] | ||
|
||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
language_version: python3 | ||
|
||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 4.0.1 | ||
hooks: | ||
- id: flake8 | ||
language_version: python3 | ||
|
||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v0.960 | ||
hooks: | ||
- id: mypy | ||
exclude: ^tests/ | ||
args: [--strict] | ||
additional_dependencies: ["pydantic", "types-jsonschema", "types-setuptools", "types-requests"] | ||
|
||
- repo: https://github.com/koalaman/shellcheck-precommit | ||
rev: v0.8.0 | ||
hooks: | ||
- id: shellcheck | ||
args: ["--severity=warning"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM hseeberger/scala-sbt:8u222_1.3.5_2.13.1 | ||
|
||
RUN \ | ||
addgroup --system franklin \ | ||
&& adduser --system --disabled-login --disabled-password \ | ||
--home /var/lib/franklin \ | ||
--shell /sbin/nologin \ | ||
--ingroup franklin \ | ||
-u 1000 \ | ||
franklin | ||
|
||
USER franklin | ||
WORKDIR /opt/src | ||
|
||
|
||
CMD ["./sbt", '"project application"', '"run serve --db-host=pgstac"'] |
12 changes: 12 additions & 0 deletions
12
application/src/main/scala/com/azavea/franklin/api/FranklinJsonPrinter.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.azavea.franklin.api | ||
|
||
import io.circe.Printer | ||
import sttp.tapir.json.circe._ | ||
|
||
// This custom json printing implementation for tapir is based | ||
// on https://tapir.softwaremill.com/en/latest/endpoint/json.html#circe | ||
object FranklinJsonPrinter extends TapirJsonCirce { | ||
// NOTE: the contents of this object should be imported for *tapir endpoints* rather than | ||
// http4s services. e.g. SearchEndpoints.scala but not SearchService.scala | ||
override def jsonPrinter: Printer = Printer.spaces2.copy(dropNullValues = true) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
application/src/main/scala/com/azavea/franklin/api/endpoints/CatalogEndpoints.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.azavea.franklin.api.endpoints | ||
|
||
import cats.effect.Concurrent | ||
import com.azavea.franklin.api.FranklinJsonPrinter._ | ||
import com.azavea.franklin.api.schemas._ | ||
import com.azavea.franklin.datamodel.{Catalog, CollectionsResponse} | ||
import com.azavea.franklin.error.NotFound | ||
import io.circe._ | ||
import sttp.capabilities.fs2.Fs2Streams | ||
import sttp.model.StatusCode | ||
import sttp.model.StatusCode.{NotFound => NF} | ||
import sttp.tapir._ | ||
import sttp.tapir.generic.auto._ | ||
|
||
import java.util.UUID | ||
|
||
class CatalogEndpoints[F[_]: Concurrent]( | ||
pathPrefix: Option[String] | ||
) { | ||
|
||
val basePath = baseFor(pathPrefix, "catalogs") | ||
|
||
val base = endpoint.in(basePath) | ||
|
||
val catalogUnique: Endpoint[List[String], NotFound, Catalog, Fs2Streams[F]] = | ||
base.get | ||
.in(paths) | ||
.out(jsonBody[Catalog]) | ||
.errorOut(oneOf(statusMapping(NF, jsonBody[NotFound].description("not found")))) | ||
.description("A single catalog") | ||
.name("catalogUnique") | ||
|
||
val endpoints = List(catalogUnique) | ||
} |
Oops, something went wrong.