I am trying to deploy MLflow on Cloud Run. The Cloud Run Service needs to be connected to CloudSQL. I am trying to establish the connection by running CloudSQL proxy in the same docker container and connecting ML flow with the same. In the logs I am able to see that the CloudSQL proxy is able to connect to the Cloud SQL instance but logs for Mlflow server are not there, nor I am able to access MLflow via UI.
On deploying it on Cloud Run, I am getting this error:
Here is my Dockerfile:
FROM python:3.8-slim-buster
WORKDIR /app
RUN apt-get update && apt-get install -y bash && apt-get install -y wget gnupg2 && \
wget https://dl.google.com/cloudsql/cloud_sql_proxy.linux.amd64 -O cloud_sql_proxy && \
chmod +x cloud_sql_proxy && \
pip install mlflow pymysql
FROM gcr.io/cloudsql-docker/gce-proxy:1.22.0
# Copy the service account JSON file to the container
COPY ./<path-to-credential-file> .
# Expose the default Cloud SQL port
EXPOSE 5000
ENV INSTANCE_CONNECTION_NAME=<instance-connection-name>
ENV MYSQL_USER=<username>
ENV MYSQL_PASSWORD=<password>
ENV MYSQL_DATABASE=<database_name>
# Start the Cloud SQL proxy
CMD ["/cloud_sql_proxy", "-instances=$INSTANCE_CONNECTION_NAME=tcp:0.0.0.0:3306", "-credential_file=<credential-file>", "-dir=/cloudsql & mlflow server \
--default-artifact-root gs://<gcs-bucket-uri> \
--host 0.0.0.0 --port 5000 \
--backend-store-uri mysql+pymysql://$MYSQL_USER:$MYSQL_PASSWORD@localhost:3306/$MYSQL_DATABASE?unix_socket=/cloudsql/$INSTANCE_CONNECTION_NAME"]
The user-provided container failed to start and listen on the port defined provided by the PORT=8080 environment variable. Logs for this revision might contain more information.```