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

Allow data sources to be synced from the UI #379

Merged
merged 72 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
c207e50
Check permissions before showing create button
mihow Apr 19, 2024
0b07f23
New project section for data storage details
mihow Apr 19, 2024
1e5111f
Add data source details to each Deployment form
mihow Apr 20, 2024
496234e
Interface and endpoint to sync a deployment source files
mihow Apr 20, 2024
8f12053
Temporary method to support multiple types of jobs
mihow Apr 20, 2024
4221b89
Show "Queued" after sync button is pressed
mihow Apr 20, 2024
1010be9
Update translation strings
mihow Apr 20, 2024
5804536
Quick method to generate presigned URLs for non-public buckets
mihow Apr 25, 2024
69f972b
Merge branch 'main' of github.com:RolnickLab/ami-platform into AMI-27…
mihow Apr 25, 2024
30e0852
Make presigned urls optional. still need to cache.
mihow Apr 26, 2024
fa17dbe
Move ML processing job to new job type class
mihow Apr 26, 2024
5807867
Add local S3 server for testing
mihow Apr 28, 2024
9c5ec7a
Add more storage tests, remove version pins for type checkers
mihow May 3, 2024
b67264d
Ensure minio is running for the app
mihow May 3, 2024
afc2750
Increase default processing limit for jobs
May 7, 2024
d64ceb1
Cache presigned URLs
May 7, 2024
f703648
Allow S3 access keys to be passed from the UI
mihow May 8, 2024
fdcb4a3
Remove unused param
mihow May 8, 2024
b394e3c
Update form labels & config
mihow May 8, 2024
5feb7cd
Enable button to test storage connection
mihow May 8, 2024
ab15032
Disable URL validation for S3 endpoints to support "minio:9000"
mihow May 14, 2024
2c9396c
Merge github.com:rolnicklab/ami-platform into AMI-278-Allow-data-sour…
May 20, 2024
bbec1ae
Fix env vars for MINIO tests
May 20, 2024
88bc9f1
Make MinIO test settings optional
May 20, 2024
b5484b5
Increase number of projects shown on front page for demo
mihow May 22, 2024
5b6a152
Merge branch 'main' into AMI-278-Allow-data-sources-to-be-synced-from…
mihow Jun 4, 2024
1a22448
Merge branch 'main' of github.com:RolnickLab/ami-platform into AMI-27…
mihow Jun 5, 2024
27d1f8e
Merge branch 'main' of github.com:RolnickLab/ami-platform into AMI-27…
mihow Jun 10, 2024
1e2750c
Merge branch 'main' into AMI-278-Allow-data-sources-to-be-synced-from…
annavik Jun 12, 2024
38f4bcb
Format code
annavik Jun 12, 2024
4c68bc5
Merge branch 'main' into AMI-278-Allow-data-sources-to-be-synced-from…
mihow Jun 14, 2024
5652fd0
Merge branch 'main' into AMI-278-Allow-data-sources-to-be-synced-from…
mihow Jun 19, 2024
ddce715
Adjust dialog size for all entity types
annavik Jun 19, 2024
8374492
Add description field to form section
annavik Jun 19, 2024
fe440b9
Update form section structure for deployment details
annavik Jun 19, 2024
89c1531
Update interface for checking connection status
annavik Jun 19, 2024
e54e550
Tweak form labels and skip description field
annavik Jun 19, 2024
e984066
Update UI for syncing storage
annavik Jun 19, 2024
254b240
Format last checked timestamp
annavik Jun 20, 2024
28fe22b
Cleanup strings
annavik Jun 20, 2024
4625d0f
Update UI for editing secret strings
annavik Jun 20, 2024
b9759bd
Rework how S3 connection tests are made
mihow Jul 2, 2024
d1b6793
Add support for testing S3 subdir paths, cleanup path utils, add tests
mihow Jul 3, 2024
2df5410
Remove old functions
mihow Jul 3, 2024
112c92e
Return additional data with the test connection response
mihow Jul 3, 2024
0fb7007
Return the URL of the first file found
mihow Jul 3, 2024
0aca7dc
Limit number of files checked when using regex pattern
mihow Jul 3, 2024
765359a
Comment about tracking stats in the directory generator
mihow Jul 3, 2024
eaa7ab3
Merge branch 'main' into AMI-278-Allow-data-sources-to-be-synced-from…
annavik Jul 8, 2024
5c0b987
Update connection status to consider params
annavik Jul 8, 2024
01a8feb
Fix issues related to using MinIO for local S3 storage
mihow Jul 10, 2024
4c4dd29
Update connection status with more info
annavik Jul 10, 2024
1f5e32d
Fix storage tests, standarize filter methods & used dedicated test bu…
mihow Jul 10, 2024
561b766
Keep track of actual num files checked when listing S3 keys
mihow Jul 11, 2024
e9b5312
Fix quirks related to no-name files. Add more filters.
mihow Jul 11, 2024
3cc1d54
Move error handling for missing files to backend
mihow Jul 11, 2024
8596eaa
Fix return value for new list_files function
mihow Jul 11, 2024
0f420c4
Update connection status UI using a wizard layout
annavik Jul 12, 2024
125cf65
Disable "Sync now" if connection is not successful and show job tooltip
annavik Jul 12, 2024
485cccb
Make sub directory required in the deployment case
annavik Jul 12, 2024
80a2c69
Rename hook syncStorage-> testStorageConnection + tweak error handling
annavik Jul 12, 2024
a1ad326
Helper method for admins to move source images
mihow Jul 23, 2024
837847f
Merge branch 'AMI-278-Allow-data-sources-to-be-synced-from-the-UI' of…
mihow Jul 23, 2024
ef11e72
Add method for checking all capture subdirs
mihow Jul 23, 2024
38e1236
Make auditing subdirs much faster
mihow Jul 23, 2024
06b79f1
Fix issues related to the "job type"
mihow Jul 24, 2024
2c6e653
Update stage name and status for data sync jobs
mihow Jul 24, 2024
3e1ae5f
Ensure deployment cache is updated after syncing
mihow Jul 24, 2024
e4d41d0
Add job type to UI
mihow Jul 24, 2024
096f965
Merge github.com:RolnickLab/ami into AMI-278-Allow-data-sources-to-be…
mihow Jul 24, 2024
5197490
Update test credentials for local minio
mihow Jul 25, 2024
6a84f2a
Add docs about using Minio storage locally
mihow Jul 25, 2024
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: 8 additions & 0 deletions .envs/.local/.django
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,11 @@ NEW_RELIC_CONFIG_FILE=newrelic.ini
NEW_RELIC_ENVIRONMENT=development

DJANGO_CSRF_TRUSTED_ORIGINS=http://localhost:3000,

MINIO_ENDPOINT=http://minio:9000
MINIO_ROOT_USER=amistorage
MINIO_ROOT_PASSWORD=amistorage
MINIO_DEFAULT_BUCKET=ami
MINIO_STORAGE_USE_HTTPS=False
MINIO_TEST_BUCKET=ami-test
MINIO_BROWSER_REDIRECT_URL=http://minio:9001
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,26 @@ The following details how to deploy this application.
### Docker

See detailed [cookiecutter-django Docker documentation](http://cookiecutter-django.readthedocs.io/en/latest/deployment-with-docker.html).


## Project Data Storage

Each project manages its own external data storage where the AMI Platform will index and process images. This is most typically a public or private S3 bucket at a cloud provider that is not AWS. For example
the Swift object storage service at Compute Canada or a university's own storage service.

To test the S3 storage backend locally, Minio is configured to run as part of the docker compose stack.

To configure a project connect to the Minio service, you can use the following config:

```
Endpoint URL: http://minio:9000
Access key: amistorage
Secret access key: amistorage
Public base URL: http://localhost:9000/ami/
Bucket: ami
```

- Open the Minio web interface at http://localhost:9001 and login with the access key and secret access key.
- Upload some test images to a subfolder in the `ami` bucket (one subfolder per deployment)
- Give the bucket or folder anonymous access using the "Anonymous access" button in the Minio web interface.
- You _can_ test private buckets and presigned URLs, but you will need to add an entry to your local /etc/hosts file to map the `minio` hostname to localhost.
5 changes: 5 additions & 0 deletions ami/jobs/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class JobAdmin(AdminBase):
"started_at",
"finished_at",
"duration",
"get_job_type_display",
)

@admin.action()
Expand All @@ -27,6 +28,10 @@ def enqueue_jobs(self, request: HttpRequest, queryset: QuerySet[Job]) -> None:
job.enqueue()
self.message_user(request, f"Queued {queryset.count()} job(s).")

@admin.display(description="Job Type")
def get_job_type_display(self, obj: Job) -> str:
return obj.job_type().name

actions = [enqueue_jobs]

exclude = (
Expand Down
Loading