Create a notebook instance with custom container

Create a notebook instance with custom container

Custom images allow you to create a notebook environment that is precisely tailored to your specific needs. You can pre-install specific libraries, frameworks, or tools that are not included in the standard application-supported images. This saves you time and ensures you have everything you need right from the start.
  1. Optimized Performance: You can optimize your custom image for performance by including only the necessary dependencies and configurations. This can lead to faster startup times, reduced resource usage, and improved overall performance of your notebook instance.

  2. Reproducibility: Custom images help ensure reproducibility of your work. By encapsulating your entire environment configuration within the image, you can easily recreate the same setup on different instances or share it with collaborators, guaranteeing consistent results.

  3. Security and Compliance: If you have specific security or compliance requirements, you can build a custom image that adheres to those standards. This might involve using specific versions of software, applying security patches, or configuring network settings in a particular way.

  4. Flexibility and Control: Custom images give you complete control over your environment. You can experiment with different configurations, install specific versions of software, and customize the environment to match your workflow preferences.

  5. Consider using a custom image when
    1. You need specific libraries or tools not available in the standard images.
    2. You want to optimize the performance of your notebook instance.
    3. You need to ensure reproducibility of your work.
    4. You have specific security or compliance requirements.
    5. You want full control over your environment configuration.

Prepare your Custom Container

  • Ensure that your custom container is stored in a container registry accessible to the Greennode AI Platform.

  • Make sure your custom image contains the necessary environment setup, libraries, and dependencies for your notebook instance.

  • When running a notebook instance with a custom container in Kubernetes (K8s) technology, the securityContext is a crucial parameter that specifies the user or user group under which the processes in the container should run. This helps enforce security measures and ensures that the processes have the necessary permissions to perform their tasks without encountering permission-denied errors.

    • Specify RunAsUser or RunAsGroup: Within the securityContext, specify either runAsUser or runAsGroup to define the user or group that the container process should run as.

      • runAsUser: Specifies the numeric UID (User ID) for the user. This ensures that the container runs with the permissions of the specified user.

      • runAsGroup: Specifies the numeric GID (Group ID) for the group. This ensures that the container runs with the permissions of the specified group.

    • Ensure Proper Permissions: Ensure that the user or group specified in the securityContext has the necessary permissions to access resources and perform tasks required by the notebook instance. This may include permissions to access data volumes, write to specific directories, execute certain commands, etc

Create a notebook instance with a custom container

Step 1: Accessing the Notebook Instance Dashboard

Step 2: Creating a Notebook Instance

1. Basic Configuration
  • Provide a suitable name for your instance, e.g., "MyMLInstance."

  • Choosing the location for this notebook instance.

2. Resource configuration
Specify the instance type for your notebook instance including CPU, GPU, and RAM configurations based on your workload. This selection will affect on your cost, please only select the instance type that is suitable for your demands.

3. Image

Selecting the “Custom container” option at “Image” section

    • Specify Image Storage URL: Provide the URL of your custom image stored in the container registry. This URL will be used by the Greennode AI Platform to pull the image during instance creation.

    • Provide Credentials:

      • If your custom image requires authentication to access, provide the necessary credentials (such as username and password or access token) to the Greennode AI Platform.

      • Ensure that the credentials are securely stored and provided in the required format.

    • Specify Access Port:

      • Define the port number through which you want to access the notebook instance.

      • Ensure that the port is accessible and not blocked by any firewall rules.

    • Specify Health-Check Port and Path:

      • Define the port number and path for the health-check endpoint of your notebook instance.

      • The health-check endpoint is used by the Greennode AI Platform to monitor the health status of the instance.

      • Ensure that the health-check port and path are correctly configured and accessible.

    • SSH Port Customization: Provide the desired port number when creating the notebook instance. This allows you to secure your instance further or avoid conflicts with other services.

    • Arguments and Commands

      • Arguments: These are additional parameters that can be passed to the Jupyter Notebook server when it starts. They can be used to customize various settings, such as the default notebook directory, authentication methods, or Jupyter extensions.
      • Commands: You can specify custom commands that will be executed after the Jupyter Notebook server starts. This allows you to install additional packages, configure the environment, or run specific tasks automatically.

Step 3: Initializing the Instance

  • Click the "Create Instance" button to initialize your notebook instance with the specified configurations at the bottom right corner to complete the process.

Step 4: Accessing the Notebook Instance

  • Once created successfully, access your notebook instance with “Running” status from the Notebook Dashboard.

  • Click on the “Open Editor” option to use your selected Code Editor for coding. It enables the user to upload their data stored locally to their Notebook Instance Cloud Server. Understand more about our third-party code editor at https://jupyterlab.readthedocs.io/en/latest/

Info
Important Note Regarding Custom Images: The /workspace directory
Currently, the Greennode AI platform has a rule that automatically mounts a Persistent Volume Claim (PVC) to the /workspace directory within each Kubernetes Pod. This provides you with persistent storage for your data. However, if you use a Custom Image and place your code within the /workspace directory of that image, this code will not be visible in the /workspace directory of the running container when integrated into Kubernetes.

Therefore, when building a Custom Image, please avoid placing code or important data directly in the /workspace directory. You can create a different subdirectory (e.g., /app or /code) and place your code there to avoid conflicts with the PVC.

    • Related Articles

    • Create a notebook instance with pre-built container

      A pre-built notebook instance is a managed environment where you can easily run Jupyter notebooks with access to Greennode AI resources. These instances are pre-configured with the computational resources you choose and can be used for data analysis, ...
    • Install a Notebook Instance

      This guide will assist you in creating a notebook instance on the Greennode AI Platform for your data science and machine learning projects, where data scientists and engineers can write, execute, and iterate on code. It usually includes features for ...
    • Import a model registry with custom container

      The model registry is a centralized repository for storing trained models, their metadata, versions, and associated artifacts. It allows for version control, management, and organization of models developed during the training phase. This enables ...
    • Deploy a model endpoint with custom container

      In this section, you will learn how to deploy and serve your custom machine-learning models using a custom container in our Greennode AI Platform. Follow the steps below to configure and deploy your model for online prediction: Step 0: Import a model ...
    • Manage a notebook instance

      Notebook instances provide you with a dedicated environment to develop and experiment with your AI models. After creating a notebook instance, follow these steps to seamlessly manage your instances: Step 1: Accessing Notebook Instances Dashboard: ...