最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

docker - How to deploy a Streamlit + MLFlow app in Azure? - Stack Overflow

programmeradmin2浏览0评论

I want to deploy a Two-container app in Azure.

My app is like this:

  1. MLFlow container for the latest model.

  2. Streamlit App gets the latest model to deliver predictions.

If it was only one container, it would work. But MLFlow needs its own container. So I created a docker compose. It works fine locally (with the compose below), but I just can't deploy it on Azure.

This is the docker-compose:

services:
  mlflow:
    build:
      context: ./mlflow-server
    ports:
      - "5000:5000"
    command: mlflow server --host 0.0.0.0 --port 5000

  streamlit:
    build:
      context: .
    ports:
      - "8501:8501"
    depends_on:
      - mlflow
    environment:
      - MLFLOW_SERVER_URL=http://mlflow:5000

I pushed both containers to Azure Container Registry. First, I tried creating a Web App using the "multi-container" option, and I tried to modify the docker-compose to map the MLFlow so Streamlit can read it. Unsuccessful. I can run mlflow alone, which does not depend on anything.

I also tried to create two container instance, but then I don't know how to connect streamlit to mlflow.

Here's what I tried also to make them connect:

version: '3'

services:
  mlflow:
    image: crispdm.azurecr.io/crispdm-mlflow:v1
    ports:
      - "5000:5000"

  streamlit:
    image: crispdm.azurecr.io/crispdm-streamlit:v1
    ports:
      - "8501:8501"
    depends_on:
      - mlflow
    environment:
      - MLFLOW_SERVER_URL=/

No success... I need some help, please.

I want to deploy a Two-container app in Azure.

My app is like this:

  1. MLFlow container for the latest model.

  2. Streamlit App gets the latest model to deliver predictions.

If it was only one container, it would work. But MLFlow needs its own container. So I created a docker compose. It works fine locally (with the compose below), but I just can't deploy it on Azure.

This is the docker-compose:

services:
  mlflow:
    build:
      context: ./mlflow-server
    ports:
      - "5000:5000"
    command: mlflow server --host 0.0.0.0 --port 5000

  streamlit:
    build:
      context: .
    ports:
      - "8501:8501"
    depends_on:
      - mlflow
    environment:
      - MLFLOW_SERVER_URL=http://mlflow:5000

I pushed both containers to Azure Container Registry. First, I tried creating a Web App using the "multi-container" option, and I tried to modify the docker-compose to map the MLFlow so Streamlit can read it. Unsuccessful. I can run mlflow alone, which does not depend on anything.

I also tried to create two container instance, but then I don't know how to connect streamlit to mlflow.

Here's what I tried also to make them connect:

version: '3'

services:
  mlflow:
    image: crispdm.azurecr.io/crispdm-mlflow:v1
    ports:
      - "5000:5000"

  streamlit:
    image: crispdm.azurecr.io/crispdm-streamlit:v1
    ports:
      - "8501:8501"
    depends_on:
      - mlflow
    environment:
      - MLFLOW_SERVER_URL=https://st-mlflow-g0h5eveufagrfads.canadacentral-01.azurewebsites/

No success... I need some help, please.

Share Improve this question asked Mar 17 at 23:56 gurezendegurezende 2411 silver badge10 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I was finally able to deploy the app...but I am not sure if that's the right way to do it... but just so you know, this works.

  1. I created an instance of the MLFlow container. Then I got the Public IP generated from that.

  2. I went back to my local code and I added that URL from the MLFlow container running on Azure to the streamlit code as the "Tracking URI".

  3. Then I created another docker container and redeployed it as version 2.

  4. On Azure, I have created a new instance of the v2 streamlit app.

  5. It worked.

It is not an HTTPS, though...no clue how to make that become a secure URL... well, keep learning.

Cheers.

发布评论

评论列表(0)

  1. 暂无评论