我的最终目的是从Api进行实验。
实验来自: https://github.com/mlflow/mlflow/tree/master/examples/tensorflow/tf2 但是在我的自定义git中将文件导出到克隆的位置,如下图->
我的docker compose中有2张图像: 树项目:
|_app/
| |_Dockerfile
|
|_mlflow/
| |_Dockerfile
|
|_docker-compose.yml
app / Dockerfile
FROM continuumio/anaconda3
ENV APP_HOME ./
WORKDIR ${APP_HOME}
RUN conda config --append channels conda-forge
RUN conda install --quiet --yes \
'mlflow' \
'psycopg2' \
'tensorflow'
RUN pip install pylint
RUN pwd;ls \
&& git clone https://github.com/MChrys/QuickSign.git
RUN pwd;ls \
&& cd QuickSign \
&& pwd;ls
COPY . .
#RUN conda install jupyter
#CMD jupyter notebook --ip=0.0.0.0 --port=8888 --allow-root --no-browser
CMD cd QuickSign && mlflow run .
mlflow / Dockerfile
FROM python:3.7.0
RUN pip install mlflow
RUN mkdir /mlflow/
CMD mlflow server \
--backend-store-uri /mlflow \
--host 0.0.0.0
docker-compose.yml
version: '3'
services:
notebook:
build:
context: ./app
ports:
- "8888:8888"
depends_on:
- mlflow
environment:
MLFLOW_TRACKING_URI: 'http://mlflow:5000'
mlflow:
build:
context: ./mlflow
expose:
- "5000"
ports:
- "5000:5000"
当我docker-compose up
获得的图像时:
notebook_1_74059cdc20ce | response = requests.request(**kwargs)
notebook_1_74059cdc20ce | File "/opt/conda/lib/python3.7/site-packages/requests/api.py", line 60, in request
notebook_1_74059cdc20ce | return session.request(method=method, url=url, **kwargs)
notebook_1_74059cdc20ce | File "/opt/conda/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
notebook_1_74059cdc20ce | resp = self.send(prep, **send_kwargs)
notebook_1_74059cdc20ce | File "/opt/conda/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
notebook_1_74059cdc20ce | r = adapter.send(request, **kwargs)
notebook_1_74059cdc20ce | File "/opt/conda/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
notebook_1_74059cdc20ce | raise ConnectionError(e, request=request)
notebook_1_74059cdc20ce | requests.exceptions.ConnectionError: HTTPConnectionPool(host='mlflow', port=5000): Max retries exceeded with url: /api/2.0/mlflow/runs/create (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd5db4edc50>: Failed to establish a new connection: [Errno 111] Connection refused'))
问题看起来像我运行了一个在服务器映像中找不到的项目,就像我在应用程序映像中运行该项目一样,但是我不知道如何弄清楚我必须从未来的烧瓶中触发实验应用
答案 0 :(得分:0)
似乎无法从应用程序访问服务器。我假设docker-compose.yml被应用程序中运行的项目所使用,因此试图通过MLFLOW_TRACKING_URI:'http://mlflow:5000'与mlflow服务器联系。 http://mlflow:5000是您设置的域吗?应该从哪里到达?
答案 1 :(得分:0)
问题来自Windows的docker,我无法在其上使工作的docker组成,但是当我在具有ubuntu的虚拟机上运行它时,构建它没有问题。