Webserver and fileserver parametric ports#292
Webserver and fileserver parametric ports#292lorenzospano wants to merge 2 commits intoclearml:masterfrom
Conversation
|
Thanks for this @lorenzospano - We'll try to review it as soon as we can. |
|
Hi @lorenzospano |
|
Hi @shyallegro, In those cases, where network isolation and port mapping are not viable options, it would be useful to have a mechanism that allows to fully configure all the servers that clearml needs to run. |
@shyallegro I deployed ClearML using docker-compose according to the official instructions, and I modified the mapped ports. However, when I created new credentials in the UI's workspace, I found that the ports and addresses that could be copied were incorrect, and the address for files_server was not filled in. Are there any steps or tutorials for changing the port? It seems that the related configurations are not modified together. |
|
Hi @dadastory webserver:
environment:
- WEBSERVER__displayedServerUrls={"apiServer":"","filesServer":""} |
|
@shyallegro thanks , it finally works!!! but it seem do not support env inject like this:WEBSERVER__CLEARML_API_HOST: "http://${CLEARML_HOST_IP}:18008" |
|
@dadastory if you wish to configure webserve nginx reveres proxies, you can use these 2 variables |
|
@shyallegro thanks, i will try again |
|
@shyallegro Hi I followed your instructions and configured my ClearML webserver:
command:
- webserver
container_name: clearml-webserver
environment:
# - WEBSERVER__displayedServerUrls={"apiServer":"http://172.0.0.22:18008","filesServer":"http://172.0.0.22:18081"}
- WEBSERVER__fileBaseUrl="https://files.clearml.mydomain.com"
- WEBSERVER__useFilesProxy=true
- NGINX_APISERVER_ADDRESS="https://api.clearml.mydomain.com"
- NGINX_FILESERVER_ADDRESS="https://files.clearml.mydomain.com"However, when I access the services through Nginx reverse proxy, I always get 404 errors. I have a few questions:
Thanks in advance!
|
|
@dadastory you only need to specify the external addresses if the servers are not on the same docker network. |
|
@lorenzospano Thank you very much for the clarification. It turns out that no extra configuration is required, and a simple reverse proxy setup is sufficient. |

Motivation
This PR aims at making configurable all the ports that clearml-server uses.
Right now, some ports are hardcoded and not parametric ie webserver on port 80 and fileserver on port 8081.
Issue descrition - #293
Fileserver port parameterization
The listening port for the fileserver is hardcoded in
fileserver/fileserver.py(when launched via flask) and indocker/build/internal_files/entrypoint.sh(when launched via gunicorn).Flask setup
The code portion in
fileserver/fileserver.pyis reported below for simplicity.I modified the fileserver to read the default values for ip, port and debug from the config and added the configurations inside of
fileserver/config/default/fileserver.conf.This behavior was guided by the existing mechanism in apiserver.
Gunicorn setup
Similarly, I replicated the existing behavior of the apiserver to also make gunicorn configurable via environment variables.
The default port is preserved, while now it is also possible to override it with
FILESERVER_GUNICORN_BIND.The intended behavior is the same as the one used for the apiserver.
Webserver port parameterization
The webserver port is hardcoded in
docker/build/internal_files/clearml.conf.template.Per my understanding this is the conf that nginx uses to create the webserver UI, and it is not configurable via environment variables.
For this reason I modified the template to accepts an additional environment variable that allows to compile the webserver port via envsubst.
I also modified the envsubst command that is execute inside of
docker/build/internal_files/entrypoint.shto include such a value when the template is compiled.Testing
I tested the startup and basic interactions among those services.
I could not test (yet) more advanced features such as agents and pipeline runs.
If there is any known component that features hardcoded ports please highlight it so that I can improve my contribution