https://github.com/asfhyp3/asf-stac

A repository containing code related to the creation and hosting of STAC catalogs by the ASF tools team.

https://github.com/asfhyp3/asf-stac

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.4%) to scientific vocabulary
Last synced: 9 months ago · JSON representation

Repository

A repository containing code related to the creation and hosting of STAC catalogs by the ASF tools team.

Basic Info
  • Host: GitHub
  • Owner: ASFHyP3
  • License: bsd-3-clause
  • Language: Python
  • Default Branch: develop
  • Homepage:
  • Size: 832 KB
Statistics
  • Stars: 6
  • Watchers: 8
  • Forks: 1
  • Open Issues: 11
  • Releases: 11
Created over 3 years ago · Last pushed 11 months ago
Metadata Files
Readme Changelog License Codeowners

README.md

asf-stac

Creation and hosting of STAC catalogs by the ASF Tools team.

Production API: https://stac.asf.alaska.edu * Swagger UI: https://stac.asf.alaska.edu/api.html * STAC Browser: https://radiantearth.github.io/stac-browser/#/external/stac.asf.alaska.edu/

Test API: https://stac-test.asf.alaska.edu * Swagger UI: https://stac-test.asf.alaska.edu/api.html * STAC Browser: https://radiantearth.github.io/stac-browser/#/external/stac-test.asf.alaska.edu/

Developer setup

Clone the repository, create the environment, and install the developer dependencies:

``` git clone git@github.com:ASFHyP3/asf-stac.git cd asf-stac

conda env create -f environment.yml conda activate asf-stac ```

If you ever see the following warning from gdal...

Warning 1: PROJ: proj_create_from_database: Open of /home/.../miniconda3/envs/asf-stac/share/proj failed

...you can run the following command and then re-activate your Conda environment:

conda env config vars set PROJ_LIB=${CONDA_PREFIX}/share/proj

Requirements for connecting to the database

The database only accepts connections from within the ASF Full VPN or from clients with the client security group attached. See the ingress rules for the database security group in the database CloudFormation template.

The database host and database user credentials are available via the AWS Secrets Manager console in the AWS account where the CloudFormation stack was deployed.

Creating and ingesting the coherence dataset

We must create and ingest the coherence dataset after running a new STAC API deployment. We must also re-create and re-ingest the dataset after making changes to how the STAC items are structured.

Fetch the list of S3 objects:

cd collections/sentinel-1-global-coherence/ ./list-coherence-objects wc -l coherence-s3-objects.txt

Confirm that the number of lines is 1033388 (one per object).

Next, create the dataset:

python create_coherence_items.py coherence-s3-objects.txt wc -l sentinel-1-global-coherence.ndjson

Again, confirm that the number of lines is the same as in the previous step.

Finally, ingest the dataset:

cd ../../ make pypgstac-load db_host=<host> db_admin_password=<password> table=items ndjson_file=collections/sentinel-1-global-coherence/sentinel-1-global-coherence.ndjson

Creating and ingesting the HAND dataset

We must create and ingest the HAND dataset after running a new STAC API deployment. We must also re-create and re-ingest the dataset after making changes to how the STAC items are structured.

Fetch the list of S3 objects:

cd collections/glo-30-hand/ ./list-hand-objects wc -l hand-s3-objects.txt

Confirm that the number of lines is 26450 (one per object).

Next, create the dataset:

python create_hand_items.py hand-s3-objects.txt wc -l glo-30-hand.ndjson

Again, confirm that the number of lines is the same as in the previous step.

Finally, ingest the dataset:

cd ../../ make pypgstac-load db_host=<host> db_admin_password=<password> table=items ndjson_file=collections/glo-30-hand/glo-30-hand.ndjson

Manually connecting to the database

We shouldn't need to manually connect to the database during normal operations, but we can if we need to (e.g. for debugging purposes).

Confirm that you have PostgreSQL installed, then run:

make psql db_host=<host> db_user=<user> db_password=<password>

Running the API locally

You can run the STAC API frontend locally and it will automatically connect to the AWS-hosted database. We shouldn't need to run the API locally during normal operations, but we can if we need to (e.g. for debugging purposes).

The local API provides access to the Transaction extension (which provides create/update/delete endpoints), while the publicly available API does not. We shouldn't need access to the Transaction endpoints during normal operations, but they may be useful for making one-off edits in a sandbox or test deployment.

Run:

make run-api db_host=<host> db_admin_password=<password>

You can also append an enabled_extensions=<list> argument, where <list> is the list of extensions that gets passed to the pgstac app via the ENABLED_EXTENSIONS environment variable, as described in the docstring for the module.

You should see something like Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit) in the output; you can query the API at that URL.

You can confirm that the Transaction extension is enabled by opening the local API URL in a web browser and appending /api.html to open the Swagger UI. You should see various create/update/delete endpoints under the "Transaction Extension" heading. These endpoints should not appear in the Swagger UI for the publicly available API.

Upgrading the database

The initial AWS deployment creates a Postgres database, installs the PostGIS extension, and then installs PgSTAC. Follow these steps to upgrade the database:

  1. Run the following command to list the Postgres versions supported by Amazon RDS: aws rds describe-db-engine-versions --engine postgres Identify the entry that corresponds to the current version of the database. Then identify the newest available version from the list of valid upgrade targets for the current version. This will be the new version for the database.

  2. Change the Postgres version specified in the database CloudFormation template to the new version.

  3. Next, refer to the tables shown here to determine which version of the PostGIS extension is supported by the new Postgres version.

  4. Change the PostGIS version specified in the install/upgrade script.

  5. Deploy to AWS.

PgSTAC upgrades are handled automatically: the deployment pipeline migrates the database to the installed version of pypgstac. See https://stac-utils.github.io/pgstac/pypgstac for more information about migrations.

Owner

  • Name: HyP3
  • Login: ASFHyP3
  • Kind: organization
  • Location: Fairbanks, AK

Alaska Satellite Facility's Hybrid Pluggable Processing Pipeline

GitHub Events

Total
  • Create event: 96
  • Release event: 3
  • Issues event: 4
  • Delete event: 99
  • Issue comment event: 38
  • Push event: 125
  • Pull request review comment event: 11
  • Pull request event: 177
  • Pull request review event: 78
Last Year
  • Create event: 96
  • Release event: 3
  • Issues event: 4
  • Delete event: 99
  • Issue comment event: 38
  • Push event: 125
  • Pull request review comment event: 11
  • Pull request event: 177
  • Pull request review event: 78

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 3
  • Total pull requests: 71
  • Average time to close issues: 3 months
  • Average time to close pull requests: 9 days
  • Total issue authors: 2
  • Total pull request authors: 4
  • Average comments per issue: 0.67
  • Average comments per pull request: 0.32
  • Merged pull requests: 45
  • Bot issues: 1
  • Bot pull requests: 61
Past Year
  • Issues: 3
  • Pull requests: 71
  • Average time to close issues: 3 months
  • Average time to close pull requests: 9 days
  • Issue authors: 2
  • Pull request authors: 4
  • Average comments per issue: 0.67
  • Average comments per pull request: 0.32
  • Merged pull requests: 45
  • Bot issues: 1
  • Bot pull requests: 61
Top Authors
Issue Authors
  • jtherrmann (2)
  • dependabot[bot] (2)
Pull Request Authors
  • dependabot[bot] (259)
  • jtherrmann (10)
  • AndrewPlayer3 (2)
  • tools-bot (1)
  • asjohnston-asf (1)
  • jhkennedy (1)
Top Labels
Issue Labels
bumpless (2) patch (2) Jira Bug (2)
Pull Request Labels
bumpless (264) patch (153) minor (89) major (19) tools-bot (1)

Dependencies

.github/actions/deploy-stac/action.yml actions
  • actions/setup-python v4 composite
  • aws-actions/configure-aws-credentials v1 composite
.github/workflows/changelog.yml actions
.github/workflows/create-jira-issue.yml actions
.github/workflows/deploy-stac-prod.yml actions
  • ./.github/actions/deploy-stac * composite
  • actions/checkout v4 composite
.github/workflows/deploy-stac-test.yml actions
  • ./.github/actions/deploy-stac * composite
  • actions/checkout v4 composite
.github/workflows/labeled-pr.yml actions
.github/workflows/release.yml actions
.github/workflows/static-analysis.yml actions
  • actions/checkout v4 composite
  • actions/setup-python v4 composite
.github/workflows/tests.yml actions
  • actions/checkout v4 composite
  • mamba-org/setup-micromamba v1 composite
lib/asf-stac-util/setup.py pypi
requirements-apps-api.txt pypi
  • mangum ==0.17.0
  • stac-fastapi.api ==2.4.8
  • stac-fastapi.extensions ==2.4.8
  • stac-fastapi.pgstac ==2.4.10
  • stac-fastapi.types ==2.4.8
requirements-run-codebuild.txt pypi
  • boto3 ==1.28.52
requirements.txt pypi
  • boto3 ==1.28.52
  • cfn-lint ==0.80.2
  • flake8 ==6.1.0
  • pypgstac ==0.7.10
  • pystac ==1.8.3
  • pytest ==7.4.2
  • requests ==2.31.0
  • shapely ==2.0.1
  • tqdm ==4.66.1
  • uvicorn ==0.23.2
environment.yml pypi