系统信息操作系统平台和发布: Windows 10 MLflow安装:使用pip MLflow版本:版本1.24.0 **Python版本:Python3.9.7 **
请描述我创建了一个带有后端/工件存储、mlflow服务器和nginx以添加身份验证层的坞-组合系统的问题。
...
mlflow:
restart: always
build: .
environment:
- AWS_ACCESS_KEY_ID=${MINIO_USR}
- AWS_SECRET_ACCESS_KEY=${MINIO_PASS}
expose:
- '5000'
networks:
- frontend
- backend
depends_on:
- storage
image: 'mlflow:Dockerfile'
container_name: mlflow_server_nginx
nginx:
restart: always
build: ./nginx
container_name: mlflow_nginx
ports:
- 5043:443
links:
- mlflow:mlflow
volumes:
- 'path/to/nginx/auth:/etc/nginx/conf.d'
- 'path/to/nginx/nginx.conf:/etc/nginx/nginx.conf:ro'
networks:
- frontend
depends_on:
- mlflow我通过htpasswd创建了用户/密码,并使用openssl和my-mlflow.com . CA服务器名称创建了自定义SSL CA(..pem/..key)。
当构建了停靠组合系统时,我可以通过我的浏览器访问mlflow UI。但是,当我尝试使用python尝试不同的方法创建一个新的实验时,我会得到下一个错误:执行代码1:
# Setting the requried environment variables
os.environ['MLFLOW_S3_ENDPOINT_URL'] = 'https://localhost:9000'
os.environ['AWS_ACCESS_KEY_ID'] = 'user'
os.environ['AWS_SECRET_ACCESS_KEY'] = 'password'
# Set username and password for added authentication
#os.environ['MLFLOW_TRACKING_URI '] = 'https://localhost:5043/'
#os.environ['MLFLOW_TRACKING_USERNAME '] = 'user'
#os.environ['MLFLOW_TRACKING_PASSWORD '] = 'password'
#os.environ['MLFLOW_TRACKING_SERVER_CERT_PATH'] = 'path/to/nginx/auth/domain.pem'
#os.environ['MLFLOW_TRACKING_CLIENT_CERT_PATH'] = 'path/to/nginx/auth/domain.pem'
# MLflow enviroment
remote_server_uri = "https://user:password@localhost:5043/" # set to your server URI
mlflow.set_tracking_uri(remote_server_uri)
mlflow.set_experiment("MLflow_demo")错误:
MlflowException: API request to https://user:password@localhost:5043/api/2.0/mlflow/experiments/list failed with exception HTTPSConnectionPool(host='localhost', port=5043): Max retries exceeded with url: /api/2.0/mlflow/experiments/list?view_type=ALL (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1108)')))在阅读了文档中的一些注释和实现的问题之后,我接下来尝试了一下。
# Setting the requried environment variables
os.environ['MLFLOW_S3_ENDPOINT_URL'] = 'https://localhost:9000'
os.environ['AWS_ACCESS_KEY_ID'] = 'user'
os.environ['AWS_SECRET_ACCESS_KEY'] = 'password'
# Set username and password for added authentication
#os.environ['MLFLOW_TRACKING_URI '] = 'https://localhost:5043/'
#os.environ['MLFLOW_TRACKING_USERNAME '] = 'user'
#os.environ['MLFLOW_TRACKING_PASSWORD '] = 'password'
#os.environ['MLFLOW_TRACKING_SERVER_CERT_PATH'] = 'path/to/nginx/auth/domain.pem'
os.environ['MLFLOW_TRACKING_CLIENT_CERT_PATH'] = 'path/to/nginx/auth/domain.pem'
# MLflow enviroment
remote_server_uri = "https://user:password@localhost:5043/" # set to your server URI
mlflow.set_tracking_uri(remote_server_uri)
mlflow.set_experiment("MLflow_demo")错误:
MlflowException: API request to https://user:password@localhost:5043/api/2.0/mlflow/experiments/list failed with exception HTTPSConnectionPool(host='localhost', port=5043): Max retries exceeded with url: /api/2.0/mlflow/experiments/list?view_type=ALL (Caused by SSLError(SSLError(9, '[SSL] PEM lib (_ssl.c:4012)')))最后
# Setting the requried environment variables
os.environ['MLFLOW_S3_ENDPOINT_URL'] = 'https://localhost:9000'
os.environ['AWS_ACCESS_KEY_ID'] = 'user'
os.environ['AWS_SECRET_ACCESS_KEY'] = 'password'
# Set username and password for added authentication
#os.environ['MLFLOW_TRACKING_URI '] = 'https://localhost:5043/'
#os.environ['MLFLOW_TRACKING_USERNAME '] = 'user'
#os.environ['MLFLOW_TRACKING_PASSWORD '] = 'password'
os.environ['MLFLOW_TRACKING_SERVER_CERT_PATH'] = 'path/to/nginx/auth/domain.pem'
#os.environ['MLFLOW_TRACKING_CLIENT_CERT_PATH'] = 'path/to/nginx/auth/domain.pem'
# MLflow enviroment
remote_server_uri = "https://user:password@localhost:5043/" # set to your server URI
mlflow.set_tracking_uri(remote_server_uri)
mlflow.set_experiment("MLflow_demo")错误:
MlflowException: API request to https://user:password@localhost:5043/api/2.0/mlflow/experiments/list failed with exception HTTPSConnectionPool(host='localhost', port=5043): Max retries exceeded with url: /api/2.0/mlflow/experiments/list?view_type=ALL (Caused by SSLError(SSLCertVerificationError("hostname 'localhost' doesn't match '*.my-mlflow.com'")))你能给我一些如何解决这个问题的提示吗?
非常感谢!费尔南多。
发布于 2022-05-11 13:38:19
你可以设置:
os.environ['MLFLOW_TRACKING_INSECURE_TLS'] = 'true'然后试着把你的证书链从那里直接拿出来供生产使用。
https://stackoverflow.com/questions/71679081
复制相似问题