Template

A template is a creator of a lab, pipeline action, or WebApp with predefined programs, datasets, models, or other settings.

Built-in Templates

MLSteam has built-in templates for common ML tasks, such as:

  • Image classification

  • Object detection

  • Face mask detection

  • Speech recognition

../_images/view_templates1.png

A template may have tags denoting its attributes.

  • type:lab: a lab template

  • type:action: a pipeline action template

  • type:webapp: a WebApp template

Create a Template

A template could be created from an exported template file or from a raw Docker image.

To create a template from a template file:

  1. Save the source template file in a project-scoped folder.

  2. In the template page, click on the NEW button.

    ../_images/btn_new.png
  3. Click on the From folder menu item.

  4. In the template creation dialog, select the folder and the source template file.

  5. Click on the IMPORT button.

    ../_images/new_template_from_file_1.png
  6. After the template creation finishes, reload the template page and the new template will be displayed.

Note

An MLSteam template file encapsulates a Docker image and the relevant template settings.

To create a template from a Docker image:

  1. Upload the Docker image to MLSteam if it has not existed.

  2. In the template page, click on the NEW button.

    ../_images/btn_new.png
  3. Click on the From image menu item.

  4. Under the Template information section, select the image and fill in the following fields:

    • Template name

    • Template version

    • Template description

    • Template tags (separated by commas, semicolons, or pipes)

  5. Under the Template type section, choose one of the template types and fill in the corresponding fields:

    1. Lab

      • IDE Interface: could be terminal, jupyter, or both

      • Dataset mounts

      • Resource requirements: minimum resource requirements for CPU cores, memory size, and GPU cards

    2. WebApp

      • Command to launch the app

      • Port map: app ports to export

      • URL: webapp access URL; the default setting is http://${IP}:${PORT}. Set this field to customize the URL scheme or path, such as https://${IP}:${PORT}/path/to/homepage. Note that only the exact matches of ${IP} and ${PORT} will be replaced by the actual assigned values for the corresponding running Webapp.

      • Mount filesystem: folder mounts

      • Parameters

      • Resource requirements: minimum resource requirements for CPU cores, memory size, and GPU cards

    3. Pipeline action

      • Command to run the pipeline

      • Command visibility: whether the command is readonly, editable, or hidden in the pipeline action dialog

      • Mount filesystem

      • Parameters

      • Resource requirements: minimum resource requirements for CPU cores, memory size, and GPU cards

    Note

    Resource requirements are referential. They do not stop users from creating a lab with a flavor not satisfying the resource requirements; only a warning message is displayed.

    1. Click on the CREATE button.

Delete a Template

To delete a template:

  1. Go to template page and click on the delete button at the selected version.

    ../_images/del_template_1.png
  2. Click on the OK button.

Note

A built-in template could not be deleted in the template page.

Export a Template

A template could be exported and imported between MLSteam systems. To export a template:

  1. Create a project-scoped folder which serves as the export destination if it has not existed.

  2. Go to template page and click on the EXPORT button at the selected version.

    ../_images/export_template_1.png
  3. Select the destination folder and the path within the folder to save the exported template file.

  4. Click on the EXPORT button.

    ../_images/export_template_2.png

Upload an Image

This section describes several ways to upload a Docker image for creating a template.

To upload an image from a Docker image:

  1. In the Image tab, click on the NEW button.

  2. Click on the Internet Pull menu item.

  3. Fill in the image link and the image name in the dialog.

  4. Click on the PULL button.

To upload a local Docker container or image through registry:

  1. Export the local Docker container or image with the docker export or docker save commands. The exported image file will be in the tar format.

  2. Push the exported image file to a Docker image registry accessible by MLSteam.

    Note

    If your MLSteam installation has a Docker image registry, you may push the exported image by running the commands provided by MLSteam. To get the commands, click on the NEW button and click on the Push menu item.

    If this is the first time you push the Docker image, set up the Docker image registry before you run the push commands.

  3. Follow the steps to upload an image from a Docker image registry.

To upload an image from a Docker image file:

  1. Save the source Docker image file in a project-scoped dataset.

  2. In the Image tab, click on the NEW button.

  3. Click on the From File menu item.

  4. Fill in the image name and select the source image file from the dataset.

  5. Click on the IMPORT button.

To upload a local Docker container or image without registry:

  1. Export the local Docker container or image with the docker export or docker save commands. The exported image file will be in the tar format.

  2. Upload the exported image file to a project-scoped dataset.

  3. Follow the steps to upload an image from dataset.

Setup a Docker Image Registry Running on Http

To enable access to a Docker image registry running on the http protocol, such as MLSteam’s built-in registry, you need to setup an insecure registry record for Docker.

  1. Edit the Docker configuration file.

    • For Docker Desktop for Windows, click on the Docker icon, select Settings, and then select Docker Engine.

    • For Docker Desktop for Mac, click on the Docker icon, select Preferences, and then select Docker Engine.

    • For Windows Server, the default location is C:\ProgramData\docker\config\daemon.json.

    • For Linux, the default location is /etc/docker/daemon.json. The actual location may vary in different Linux distributions.

  2. Add the following settings into the file:

    {
        "insecure-registries": ["<domain.sample.com>:<port>"]
        ,"runtimes": {
            "nvidia": {
                "path": "nvidia-container-runtime",
                "runtimeArgs": []
            }
        }
    }
    

    Replace <domain.sample.com> and <port> by the actual registry address.

    Note

    For the MLSteam built-in registry, its address is available at the Image tab: click on the NEW button and click on the Push menu item.

  3. Restart the Docker to put the changes into effect.

    • For Linux with systemd, run the command:

      sudo systemctl restart docker