machine-learning-exchange / mlx

Machine Learning eXchange (MLX). Data and AI Assets Catalog and Execution Engine
https://ml-exchange.org/
Apache License 2.0
204 stars 54 forks source link

Publish MLX API Client to PyPI #111

Open ckadner opened 3 years ago

ckadner commented 3 years ago

Enable 3rd party applications to interact with the MLX API server.

pip install mlx-...

The MLX name is already taken on PyPI, so we could decide between:

@romeokienzler @Tomcli @animeshsingh

ckadner commented 3 years ago

@romeokienzler -- I updated the api/client/README.md with instructions to install the MLX API client directly from GitHub

pip install "git+https://github.com/machine-learning-exchange/mlx.git@main#egg=mlx-client&subdirectory=api/client"
ckadner commented 3 years ago

@romeokienzler -- here are a few commands to test the pip install

# create a temporary directory
mkdir temp
cd temp

# create Python virtual environment
python3 -m venv .venv_mlx_client

# activate the virtual environment
source .venv_mlx_client/bin/activate

# install the MLX client
pip install "git+https://github.com/machine-learning-exchange/mlx.git@main#egg=mlx-client&subdirectory=api/client"

# show all the installed Python packages (should include "mlx-client      0.1.27-pipeline-namespace")
pip list

# run a simple Python command to show the mlx-client install location
python3 -c "import swagger_client; print('\nMLX Client is installed here: ' + swagger_client.__file__ + '\n')"

... and with output:

$ mkdir temp

$ cd temp

$ python3 -m venv .venv_mlx_client

$ source .venv_mlx_client/bin/activate

(.venv_mlx_client) $ pip install "git+https://github.com/machine-learning-exchange/mlx.git@main#egg=mlx-client&subdirectory=api/client"

Collecting mlx-client from git+https://github.com/machine-learning-exchange/mlx.git@main#egg=mlx-client&subdirectory=api/client
  Cloning https://github.com/machine-learning-exchange/mlx.git (to revision main) to /private/var/folders/44/7gxds1zd4gv87qgfhtsw_bcm0000gn/T/pip-install-o7gidgxn/mlx-client
  Running command git clone -q https://github.com/machine-learning-exchange/mlx.git /private/var/folders/44/7gxds1zd4gv87qgfhtsw_bcm0000gn/T/pip-install-o7gidgxn/mlx-client
Collecting certifi>=2017.4.17 (from mlx-client)
  Using cached https://files.pythonhosted.org/packages/05/1b/0a0dece0e8aa492a6ec9e4ad2fe366b511558cdc73fd3abc82ba7348e875/certifi-2021.5.30-py2.py3-none-any.whl
Collecting python-dateutil>=2.1 (from mlx-client)
  Using cached https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl
Collecting six>=1.10 (from mlx-client)
  Using cached https://files.pythonhosted.org/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl
Collecting urllib3>=1.23 (from mlx-client)
  Using cached https://files.pythonhosted.org/packages/0c/cd/1e2ec680ec7b09846dc6e605f5a7709dfb9d7128e51a026e7154e18a234e/urllib3-1.26.5-py2.py3-none-any.whl
Installing collected packages: certifi, six, python-dateutil, urllib3, mlx-client
  Running setup.py install for mlx-client ... done
Successfully installed certifi-2021.5.30 mlx-client-0.1.27-pipeline-namespace python-dateutil-2.8.1 six-1.16.0 urllib3-1.26.5

(.venv_mlx_client) $ pip list

Package         Version                  
--------------- -------------------------
certifi         2021.5.30                
mlx-client      0.1.27-pipeline-namespace
pip             19.2.3                   
python-dateutil 2.8.1                    
setuptools      41.2.0                   
six             1.16.0                   
urllib3         1.26.5                   

(.venv_mlx_client) $ python3 -c "import swagger_client; print('\nMLX Client is installed here: ' + swagger_client.__file__ + '\n')"

MLX Client is installed here: /Users/ckadner/Temp/temp/.venv_mlx_client/lib/python3.7/site-packages/swagger_client/__init__.py
ckadner commented 2 years ago

@ptitzler -- let me know if/when you will need to use a MLX API Client SDK for pulling MLX assets into Elyra. I think using a Python SDK rather than using the REST API endpoints would be preferable.

ckadner commented 2 years ago

There is some clean-up work to be done before we can publish the MLX API Client to PyPI.

ptitzler commented 2 years ago

No rush. The poc surfaced some design issues that we need to tackle first before we can properly support reading from remote catalogs.