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

Workflows discovery and build stac fixes #125

Merged
merged 4 commits into from
Mar 20, 2024
Merged
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
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,6 @@ See [terraform-getting-started](https://developer.hashicorp.com/terraform/tutori

See [getting-started-install](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html)

### Poetry

See [poetry-landing-page](https://pypi.org/project/poetry/)

```bash
pip install poetry
```

## Deployment

This project uses Terraform modules to deploy Apache Airflow and related AWS resources using Amazon's managed Airflow provider.
Expand Down
2 changes: 1 addition & 1 deletion docker_tasks/build_stac/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ boto3
pystac==1.4.0
python-cmr
rasterio==1.3.0
rio-stac==0.7.0
rio-stac>=0.8.0
shapely
smart-open==6.3.0
pydantic==1.10.7
Expand Down
8 changes: 3 additions & 5 deletions docker_tasks/build_stac/utils/stac.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
from pystac.utils import datetime_to_str
from rasterio.session import AWSSession
from rio_stac import stac

from . import events, regex, role
from rio_stac.stac import PROJECTION_EXT_VERSION, RASTER_EXT_VERSION


PROJECTION_EXT_VERSION = "v1.1.0"
RASTER_EXT_VERSION = "v1.1.0"
from . import events, regex, role


def get_sts_session():
Expand Down Expand Up @@ -132,7 +130,7 @@ def generate_stac(event: events.RegexEvent) -> pystac.Item:

minx, miny, maxx, maxy = zip(*bboxes)
bbox = [min(minx), min(miny), max(maxx), max(maxy)]

create_item_response = create_item(
item_id=event.item_id,
bbox=bbox,
Expand Down
6,695 changes: 0 additions & 6,695 deletions poetry.lock

This file was deleted.

51 changes: 0 additions & 51 deletions pyproject.toml

This file was deleted.

3 changes: 2 additions & 1 deletion workflows_api/runtime/src/airflow_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import boto3
import requests
import json
from fastapi import HTTPException

try:
Expand Down Expand Up @@ -56,7 +57,7 @@ def trigger_discover(input: Dict) -> Dict:
)

unique_key = str(uuid4())
raw_data = f"dags trigger veda_discover --conf '{input.json()}' -r {unique_key}"
raw_data = f"dags trigger veda_discover --conf '{json.dumps(input)}' -r {unique_key}"
mwaa_response = requests.post(
mwaa_webserver_hostname,
headers={
Expand Down
2 changes: 1 addition & 1 deletion workflows_api/runtime/src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async def publish_dataset(
workflow_runs = []
for discovery in dataset.discovery_items:
discovery.collection = dataset.collection
response = await start_discovery_workflow_execution(discovery)
response = await start_discovery_workflow_execution(discovery.dict())
workflow_runs.append(response.id)
if workflow_runs:
return_dict["message"] += f" {len(workflow_runs)} workflows initiated." # type: ignore
Expand Down