Skip to content

Commit 1372b87

Browse files
committed
fix: Chain bucket init commands to catch errors
Chain the commands involved in creating a MinIO bucket run as part of the 'model-bucket-init' service in the 'docker-compose-mlflow.yml' file to correctly catch errors and trigger service restarts. Previously, if the first command (i.e. adding a MinIO host) failed, the second one would still run, overwriting the error code and preventing the service from restarting. Using the '&&' operator to chain the commands ensures that the second command will only run if the first one is successful and that the error code is correctly propagated, allowing Docker to retry in the event of a failure. Note that the MinIO client commands can fail due to a variety of reasons, such as network issues (some of which might be transient), the MinIO Server not being ready, or incorrect credentials. Signed-off-by: Phoevos Kalemkeris <[email protected]>
1 parent 941da91 commit 1372b87

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docker-compose-mlflow.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ services:
5555
- MINIO_PASSWORD=$AWS_SECRET_ACCESS_KEY
5656
entrypoint: >
5757
/bin/sh -c "
58-
/usr/bin/mc config host add cms_minio http://minio:9000 $${MINIO_USERNAME} $${MINIO_PASSWORD};
59-
if ! /usr/bin/mc ls cms_minio/cms-model-bucket 2>/dev/null; then
58+
/usr/bin/mc config host add cms_minio http://minio:9000 $${MINIO_USERNAME} $${MINIO_PASSWORD}
59+
&& if ! /usr/bin/mc ls cms_minio/cms-model-bucket 2>/dev/null; then
6060
/usr/bin/mc mb cms_minio/cms-model-bucket;
6161
fi
6262
"

0 commit comments

Comments
 (0)