xDash Python Management¶
This allows to build and share xDash dashboards with Python code execution in xDash servers. This is made possible thanks to Python management features of xDash.
Docker image creation¶
Click New to display the Docker image creation wizard.
Image name parameter is required. Select the Base image to use. If packages or requirements need to be installed in the image, the user can load from the local disk:
- a requirements.txt file (as specified in https://pip.pypa.io/en/stable/user_guide/#requirements-files)
- a package.zip file. Useful to deploy your own packages. Follow packaging instructions here https://packaging.python.org/tutorials/packaging-projects/. Test your package locally before uploading it.
Click Create to leave the wizard, then click Build to start building the image on the server.
The build process is launched on the server site.
Click Output to view the server's Docker image build log.
If build is completed succesfully, the bottom of the log screen indicates that the image was successfully built and tagged:
The image status then changes from Building to Ready. The size of the image is displayed.
Security restrictions¶
For security reasons, Python code runs on Docker containers that do not have disk or network rigths.
Usage in Python dataNodes¶
Python inline and Python script dataNodes allow the evaluation of a Python script in the selected Docker image. See their documentation in Python dataNodes documentation.
Example with a package.zip file¶
This toy example uses Python and is based on the well known MNIST database of handwritten digits. In this dashboard, we use a previously trained Convolutional Neural Network to predict the digit written on a selected image.
-
Create a Docker image for this package tools-0.0.2.zip, as illustrated above.
-
Open this xDash project to use this package mnist_prediction.xprjson* (with function name)