Added ability to store CNN models
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-07-28 20:19:52 +02:00
parent fe965706b5
commit 284dfce735
12 changed files with 224 additions and 67 deletions

View File

@ -1,4 +1,4 @@
#!/usr/bin/env python3
from .require_decorators import json_required
from .error_handlers import register_all_error_handlers
from .storage import storage
from .storage import storage, ensure_buckets

View File

@ -1,3 +1,18 @@
from flask import current_app
from flask_minio import Minio
from minio.error import BucketAlreadyExists, BucketAlreadyOwnedByYou
storage = Minio()
storage = Minio()
def ensure_buckets():
for bucket_name in [current_app.config['MINIO_SVM_BUCKET_NAME'],
current_app.config['MINIO_CNN_BUCKET_NAME']]:
try:
storage.connection.make_bucket(bucket_name)
except BucketAlreadyOwnedByYou:
pass
except BucketAlreadyExists:
pass
# Everything else should be raised