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

Local and Remote Development Setup; Initial Data Validation Use Case; Basic Database Migrations #25

Merged
merged 6 commits into from
Feb 6, 2024

Conversation

akuny
Copy link
Contributor

@akuny akuny commented Jan 31, 2024

There are thee areas of change accounted for in this PR:

  • Local and Remote Development Setup
    • Configure Docker containers for local development
    • Add sample.env and update README to include instructions on dev setup
    • Remote dev environment on cloud.gov is a work in progress in terms of actually running the application logic, but the necessary services are all set up
  • Initial data validation use case
    • Implement a (very) simple use case for data validation leveraging the task queue and storage services: provide the bare minimum framework necessary to inspect GIS data
  • Basic database migrations
    • Incorporate alembic for handling migrations

Working on dev deploy

Working on dev deployment

Fix typo

Try Procfile

Still working on dev deployment

Trying a new approach to dev deploy

Update imports in app context

ga

Revert

Add alembic to handle migrations

Fix alembic hookup to db

Formatting

Format alembic files

Trying to set up hot reloading

Tweak docker configuration

Add container and image names back to compose.yml

Fix alembic migrations

Working on Minio integration for local dev

Continue trying to get boto3 to connect to minio

Successfully test s3 interface

Successfully test s3 interface

Remove artifact

First data handling use case

Tweak message to user

Remove artifact

Add test case for new use case

Test example validation function

Add types to validation function

Format and add comments to Dockerfile

Refactor filename logic

Tweak fake/mock filename

Revert to previous storage handling method

Make small refinements to temp file handling

Change way task is initiated

Update Dockerfile so that root user no longer runs app and queue

Remove extraneous code

Update ingest use rcase to print out filename

Housekeeping re contracts for application services

Use data class for download result instead of anonymous tuple

Clean up docker files

Add example env file and update readme to let user know they need to set it up
@akuny akuny requested a review from danielnaab January 31, 2024 17:51
Copy link
Contributor

@danielnaab danielnaab left a comment

Choose a reason for hiding this comment

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

This looks good - I had a couple comments. Also, I didn't go deep on the Alembic migrations, as I assume they're pretty stock.

scripts/format.py Outdated Show resolved Hide resolved
ctx.logger.error("Data submission with that filename does not exist")
return

download_result: DownloadResult = ctx.storage.download_temp(filename)
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't necessary at all, but a custom context manager for the temp directory might be nice here, so you could use the with keyword and avoid the manual cleanup cleanup_temp_dir step.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll add an issue to refactor this.

S3_ENDPOINT = os.getenv("S3_ENDPOINT")
S3_ACCESS_KEY = os.getenv("S3_ACCESS_KEY")
S3_SECRET_ACCESS_KEY = os.getenv("S3_SECRET_ACCESS_KEY")
S3_REGION = os.getenv("S3_REGION")
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if this is maybe a bit redundant with the app context. Perhaps it could be merged into this module?

@akuny akuny merged commit 4888761 into main Feb 6, 2024
1 check passed
@akuny akuny deleted the task-queue-integration branch February 6, 2024 16:16
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