Set MinIO credentials correctly from config before checking them#177
Conversation
AgatheZ
left a comment
There was a problem hiding this comment.
As discussed, credentials are fetched from the .env file. However thanks for updating the check_minio_credentials that was buggy
| os.environ['MLFLOW_TRACKING_URI'] = self.config['server']['MLFLOW_TRACKING_URI'] | ||
| os.environ['MLFLOW_S3_ENDPOINT_URL'] = self.config['server']['MLFLOW_S3_ENDPOINT_URL'] | ||
|
|
||
| os.environ['AWS_ACCESS_KEY_ID'] = self.config['minio']['AWS_ACCESS_KEY_ID'] |
There was a problem hiding this comment.
Not needed, credentials are fetched from the .env file, not the config file
| os.environ['MLFLOW_S3_ENDPOINT_URL'] = self.config['server']['MLFLOW_S3_ENDPOINT_URL'] | ||
|
|
||
| os.environ['AWS_ACCESS_KEY_ID'] = self.config['minio']['AWS_ACCESS_KEY_ID'] | ||
| os.environ['AWS_SECRET_ACCESS_KEY'] = self.config['minio']['AWS_SECRET_ACCESS_KEY'] |
| def check_minio_credentials(self): | ||
| self.auth = boto3.session.Session().get_credentials() | ||
| if self.auth is None: | ||
| logger.debug('Minio credentials NOT found') |
c186fb1 to
052cace
Compare
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Hey @AgatheZ - just clearing out some old PRs. This one seems mostly useful fixing incorrect logic in check_minio_credentials(). Since this PR is quite old I've rebased on main and resolved conflicts. Seems like the only thing that was missing to accept this PR was to remove sourcing AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY from the config file as it's already done from the env - I've done this, so should be straightforward to review and close this PR. |
|
Agreed, I've changed to placeholders in default.env and also in the readme that was using a similar nomenclature. Will rotate prod credentials soon. |
AgatheZ
left a comment
There was a problem hiding this comment.
Looks good to me now, thanks
Closes #176