We explore the different ways in which users can interact with Dotscience using the Dotscience Python Library and the Dotscience client
The Dotscience library can run in 3 modes. The modes can be entered using the appropriate ds commands in the Python library.
- Dotscience anywhere / remote mode
ds.interactive() tells the system that there is no script file that the code is coming from. This is typical when using a Jupyter notebook instead of a .py Python script.
When writing the code in a Python script file, e.g., a .py instead of a Jupyter notebook, call ds.script(). This instructs the library to record the script filename (from sys.argv) in the output runs, so they can be tracked back to the originating script. This is not needed in interactive mode because Dotscience knows which Jupyter notebook you are using, and
sys.argv points to the Jupyter Python kernel in that case.
Dotscience anywhere mode
NOTE: There is no provenance or data versioning in this mode
This mode offers an easy way to deploy AI models into Kubernetes & monitor them. Using the dotscience-python library, you can now connect to an environment with
ds.connect( os.getenv("DOTSCIENCE_USERNAME"), os.getenv("DOTSCIENCE_APIKEY"), os.getenv("DOTSCIENCE_PROJECT_NAME"), os.getenv("DOTSCIENCE_URL") )
By default, this connects to https://cloud.dotscience.com/ if the last argument is not specified.
All subsequent operations when using the dotscience-python library connect to the Hub specified. This can be used to register metadata, models and perform deployments from external scripts. For a demo of this feature and its usage, follow the Katacoda based tutorial at https://dotscience.com/deploy.