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 Azure Functions for creating images and animations #115

Merged
merged 12 commits into from
Aug 16, 2022

Conversation

lossyrob
Copy link
Contributor

@lossyrob lossyrob commented Aug 5, 2022

Description

This PR adds an Azure Functions app that provides Function endpoints that produce images and animated gifs from images produced through mosaicing tiles from the tile server.

This is based on the Azure Functions work in PlanetaryComputerDataCatalog. The animation endpoint is lightly refactored from that codebase, and the image endpoint is based on the techniques used there.

How Has This Been Tested?

Functions have been deployed to the staging environment manually. Tested through hitting the endpoints manually with Thunder Client, and through the development of https://github.com/microsoft/planetary-computer-teams-background

@lossyrob lossyrob requested a review from mmcfarland August 5, 2022 05:25
pcfuncs/README.md Outdated Show resolved Hide resolved
pcfuncs/funclib/models.py Outdated Show resolved Hide resolved
Copy link
Member

@mmcfarland mmcfarland left a comment

Choose a reason for hiding this comment

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

Looks good! Tested out the animation endpoint in the local dev env successfully.

MAX_TILE_COUNT = 16

MAX_FRAMES = 24
MAX_CONCURRENCY = 10
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this is not overridable by the settings; fwiw, I currently have staging set to 15 and have dialed it up over twice that to get better performance. Do you think it's too disruptive to put a higher max?

Copy link
Contributor Author

@lossyrob lossyrob Aug 16, 2022

Choose a reason for hiding this comment

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

I'll make it part of the settings so that we can play around with it.

Edit: Perhaps it makes sense not to limit us for what we put in the settings, and have that be a default with no validation rule.

def get(cls) -> "AnimationSettings":
import os

logger.info(f"DEBUG: {os.environ.get('ANIMATION_CONTAINER_ACCOUNT_KEY')}")
Copy link
Member

Choose a reason for hiding this comment

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

Prod looks to be set up to use a managed identity but consider dropping this to prevent accidental credential leaks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch, thanks

@lossyrob lossyrob merged commit bb4ac9d into main Aug 16, 2022
@lossyrob lossyrob deleted the feature/rde/functions branch August 16, 2022 16:02
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.

2 participants