bugfix: adds bucket name configuration into the .env file

This commit is contained in:
Tomasz Dłuski
2020-09-05 13:58:45 +02:00
parent bddbec77f1
commit eebc9d0c46
2 changed files with 10 additions and 2 deletions

View File

@@ -6,6 +6,7 @@ from minio.error import ResponseError
accessID = os.environ.get('AWS_ACCESS_KEY_ID')
accessSecret = os.environ.get('AWS_SECRET_ACCESS_KEY')
minioUrl = os.environ.get('MLFLOW_S3_ENDPOINT_URL')
bucketName = os.environ.get('AWS_BUCKET_NAME')
if accessID == None:
print('[!] AWS_ACCESS_KEY_ID environemnt variable is empty! run \'source .env\' to load it from the .env file')
@@ -19,6 +20,11 @@ if minioUrl == None:
print('[!] MLFLOW_S3_ENDPOINT_URL environemnt variable is empty! run \'source .env\' to load it from the .env file')
exit(1)
if bucketName == None:
print('[!] AWS_BUCKET_NAME environemnt variable is empty! run \'source .env\' to load it from the .env file')
exit(1)
minioUrlHostWithPort = minioUrl.split('//')[1]
print('[*] minio url: ',minioUrlHostWithPort)
@@ -29,4 +35,4 @@ s3Client = Minio(
secure=False
)
s3Client.make_bucket('mlflow')
s3Client.make_bucket(bucketName)