Managing Docker Models¶
Docker Image Overview and Constraints¶
In addition to supporting Python (2, 3) and R models developed in Jupyter or Notebook, Docker is among the types of models PrL supports. Docker models have the advantage of being able to run any custom code, in any program language, and also Linux distribution preferred by users. The default operating system for all other types of models is the AWS AMI Linux distribution. There are few constraints related to data ingestion and persistence functions in the docker image setup. The Docker image persisted in Model Management:
- Consumes data from the /data/input folder
- Persists data in the /data/output folder
These folders are set up for automated execution by the Job Manager service, which retrieves the data for the job and persists it in /data/input, as well as the data written to the /data/output folder; Job Manager services place the data in the designated persistence service location, like Data Exchange, Predictive Learning Storage, or Integrated Data Lake (IDL).
About Creating a Docker Image to Use in MindSphere¶
When creating a Docker image to use in MindSphere, and to ensure the image contains the proper folders for Job Manager to copy in input files, or to copy results, add these lines close to the beginning of the Docker file:
RUN ["mkdir","/data"] RUN ["mkdir","/data/input"] RUN ["mkdir","/data/output"] RUN [chmod 777 -R /data RUN ["mkdir","/iot_data"] RUN ["mkdir","/iot_data/input"] RUN ["mkdir","/iot_data/output"] RUN ["mkdir","/iot_data/datasets"] RUN chmod 777 -R /iot_data
Persisting a Docker Image in Model Management¶
Follow these steps to create a new Docker model:
- Click the "New Version" button on the Manage Analytical Models page. The Create New Version pop-up window opens.
- Select "Docker Image" from the Type drop-down list. The system displays two Docker-relevant controls: a "Generate Token" button, and a text field.
- Enter a complete Docker image repository path and tag version in the text field.
- Do not click the "Generate Token" button. Read the information below, then proceed with the steps below.
Generate Token Option¶
Before a Docker Image can be associated with a Model, it must be brought into the Predictive Learning (PrL) service, which requires that you push the Docker Image to the PrL service repository.
Important: Time Constraints Involved with the Generating Token Option¶
Please note the following time constraints before proceeding:
- If you fail to complete all steps involved in generating a token within the 2-hour and 24-hour time windows discussed below, you will need to start the process over again. Also, once the two-hour window closes you cannot make updates to the uploaded Docker image.
- Within 24 hours of the token being generated you must link the Docker image, tag, and repository path to the model. If not completed within this time frame, the repository is automatically deleted.
Finish Generating a Token for a Docker Image¶
Follow the steps below and complete them within two hours of generating your token:
- Click the "Generate Token" button. The service generates a unique repository.
- Create a tag for your Docker image to serve as a reference to the upload version.
- Log in and push the tagged Docker image into the service's repository using the Docker push command.
Once you upload your Docker image, you can:
- Associate the Docker image with your model by referencing the correct repository and tag in Managing Models.
- Safely close dialog window between uploading the Docker image and creating the Model Management entry.
Any questions left?
Except where otherwise noted, content on this site is licensed under the MindSphere Development License Agreement.