diff --git a/create_bucket.py b/create_bucket.py index 27e15b8..e42fab4 100644 --- a/create_bucket.py +++ b/create_bucket.py @@ -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') \ No newline at end of file +s3Client.make_bucket(bucketName) \ No newline at end of file diff --git a/run_create_bucket.sh b/run_create_bucket.sh index fdd9dfb..585f97a 100644 --- a/run_create_bucket.sh +++ b/run_create_bucket.sh @@ -1,4 +1,6 @@ #!/bin/bash -source .env + +set -o allexport; source .env; set +o allexport + pip install Minio python ./create_bucket.py \ No newline at end of file