Running mindsdb_server in docker

Hello,

I am a python noob, and a Docker lightweight. I’ve gotten as far as downloading the docker container, running it, attaching to it, and starting the server. But after the server starts, there seems to be an issue I am just not adept enough to figure out where I am going wrong.

With the mindsdb/mindsdb docker container I was actually able to train a model and run a prediction on a dataset using the CLI, but I’d like to be able to access the server remotely and make use of the Scout GUI program.

~$ docker pull mindsdb/mindsdb_server
~$ docker run -it -d -p 43773:43773 --name=mindsdb_server mindsdb/mindsdb_server
~$ docker exec -it mindsdb_server python
>>> import mindsdb_server as server
[nltk_data] Downloading package punkt to /root/nltk_data...
[nltk_data]   Unzipping tokenizers/punkt.zip.
Failed to export cesium timeseires encoder
Failed to export amplitude audio encoder
WARNING:mindsdb-logger-core-logger:__init__.py:30 - MySQL Datasource is not avaiable by default. If you wish to use it, please install mysqlclient or mindsdb[extra_data_sources]

WARNING:mindsdb-logger-core-logger:__init__.py:35 - PostgresDS Datasource is not avaiable by default. If you wish to use it, please install psycopg2 or mindsdb[extra_data_sources]

Initializing shared ressources !
WARNING:mindsdb-logger-core-logger:libs/helpers/general_helpers.py:68 - There is a new version of MindsDB 1.99.9, please upgrade using:
pip3 uninstall mindsdb --upgrade

WARNING:mindsdb-logger-core-logger:libs/helpers/general_helpers.py:68 - There is a new version of MindsDB 1.99.9, please upgrade using:
pip3 uninstall mindsdb --upgrade

>>> server.start_server(port=43773)
 * Serving Flask app "mindsdb_server.shared_ressources" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
 * Running on http://0.0.0.0:43773/ (Press CTRL+C to quit)
 * Restarting with stat
    /usr/local/bin/python: can't find '__main__' module in '/'

Thanks for your help and best regards,

Schmorrison

2 Likes

Hi @schmorrison. We did some major changes to the mindsdb and mindsdb-server, which means mindsdb-server is currently deprecated. That said, mindsdb now will have an HTTP Restful API and TCP/API MySQL API. You can get the latest mindsdb version from PypI just run pip install mindsdb in your virtual environment. After successful installation, you can start mindsdb with python3 -m mindsdb which should start the server in the locallhost:43773. In the MindsDB Scout, you will need to select the Remote server option, which should point to the locallhost:43773. After that, you will be ready to use your local setup through Scout. . About the docker setup, I will check with the team if we have all of the latest changes pushed to the docker hub. If you have more questions, please let me know. I am waiting to see if you did this successfully.

1 Like

Thanks a million @Zoran for the quick reply!

That seems to have gotten me started. But not without hiccups. After connecting, and importing a datasource by URL, I seem to have trouble when creating a new pridictor:

172.17.0.1 - - [05/Jul/2020 15:27:06] "GET /predictors/ HTTP/1.1" 200 -
172.17.0.1 - - [05/Jul/2020 15:27:07] "GET /util/ping HTTP/1.1" 200 -
172.17.0.1 - - [05/Jul/2020 15:27:10] "GET /predictors/ HTTP/1.1" 200 -
Failed to export cesium timeseires encoder
Failed to export amplitude audio encoder
PostgresDS Datasource is not available by default. If you wish to use it, please install psycopg2 or mindsdb[extra_data_sources]
172.17.0.1 - - [05/Jul/2020 15:27:13] "PUT /predictors/predict%20price HTTP/1.1" 200 -
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.7/multiprocessing/spawn.py", line 105, in spawn_main
exitcode = _main(fd)
  File "/usr/local/lib/python3.7/multiprocessing/spawn.py", line 115, in _main
self = reduction.pickle.load(from_parent)
  File "/usr/local/lib/python3.7/site-packages/mindsdb_native/libs/data_types/data_source.py", line 69, in __getattr__
return getattr(self._df, item)
  File "/usr/local/lib/python3.7/site-packages/mindsdb_native/libs/data_types/data_source.py", line 69, in __getattr__
return getattr(self._df, item)
  File "/usr/local/lib/python3.7/site-packages/mindsdb_native/libs/data_types/data_source.py", line 69, in __getattr__
return getattr(self._df, item)
  [Previous line repeated 495 more times]
RecursionError: maximum recursion depth exceeded while calling a Python object
172.17.0.1 - - [05/Jul/2020 15:27:15] "GET /predictors/ HTTP/1.1" 200 -
172.17.0.1 - - [05/Jul/2020 15:27:17] "GET /util/ping HTTP/1.1" 200 -
172.17.0.1 - - [05/Jul/2020 15:27:20] "GET /predictors/ HTTP/1.1" 200 -
172.17.0.1 - - [05/Jul/2020 15:27:23] "GET /predictors/ HTTP/1.1" 200 -

As you can see from the terminal, after the PUT request to /predictors/predict%20price there seems to be an error.

Ok, so I just retried and it seems like its training now. Not sure why it had that error, but it is definitely training.

2 Likes

That’s great @schmorrison. We are already resolving the issue you have mentioned in the previous post, you can track the progress on GitHub. If you have any questions or experiencing any issues let me know.