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

Add ingest.sh script. #164

Merged
merged 1 commit into from
Nov 7, 2024
Merged

Add ingest.sh script. #164

merged 1 commit into from
Nov 7, 2024

Conversation

pantierra
Copy link
Contributor

@pantierra pantierra commented Nov 4, 2024

Data Management (data ingestion in a first step) is a common requirement for several of our eoapi-k8s deployments and projects.

From my perspective we should think about data on eoAPI as "content" and not so much as "configuration". While configuration should be in code and part of the reproducible deployment, content should me managable by an admin user. At some point we probably want to think about building some auth-supported API to allow management, eventually even connecting it to some user interface.

This PR consists in a first simple step to add very basic ingestion as a bash script ingest.sh and the related make ingest command, it:

  • looks for a kubernetes the eoAPI raster pod in the namespaces eoapi and default
  • it installs pypgstac on it
  • it uploads collection.json and items.json from the current directory (can be overridden with the environment variables EOAPI_COLLECTIONS_FILE and EOAPI_ITEMS_FILE.
  • it pypgstac loads the collection and items into the pySTAC postgresql database.

Related to EOEPCA/data-access#107

fyi, @j08lue, @emmanuelmathot, @zacharyDez

@pantierra
Copy link
Contributor Author

pantierra commented Nov 4, 2024

I've explored this topic further, and it seems that the most effective way to implement an API is by using the stac-fastapi-pgstac endpoints that support the STAC API Transactions extension. Currently, securing these endpoints is a challenge, with most people resorting to either an API Gateway or developing a custom version of stac-fastapi-pgstac. We might want to consider enhancing stac-fastapi-pgstac to include this functionality, potentially leveraging the STAC API Authentication extension.

In the meantime, the ingest.sh script and command will simplify the ingestion process.

Copy link
Member

@j08lue j08lue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will leave running the script to others.

It looks nicely laid out and documented and is providing at least a basic mechanism for data ingestion, which is a battery we have to include, IMO.

docs/manage-data.md Outdated Show resolved Hide resolved
Copy link
Contributor

@ciaransweet ciaransweet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks great to me, a real step in to making this easier

Just a few comments that I think will waterproof this

docs/manage-data.md Outdated Show resolved Hide resolved
docs/manage-data.md Outdated Show resolved Hide resolved
ingest.sh Show resolved Hide resolved
@pantierra pantierra force-pushed the feature/basic-ingestion branch from bfb84a4 to fc47b05 Compare November 7, 2024 13:51
@pantierra pantierra force-pushed the feature/basic-ingestion branch from fc47b05 to 217fdd4 Compare November 7, 2024 13:55
Copy link
Contributor

@ciaransweet ciaransweet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@pantierra
Copy link
Contributor Author

Many thanks for your reviews! ❤️

@pantierra pantierra merged commit 9604353 into main Nov 7, 2024
3 checks passed
@pantierra pantierra deleted the feature/basic-ingestion branch November 7, 2024 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants