Skip to main content

Registration of CS Plug-in

A CIRCUS CS plug-in is a Docker image, which can be exported as a tar archive (xxx_ver.1.0.0.tar). To register a plug-in, take the following steps.

Preparation

Use the docker load command (on the host) to import the Docker image:

$ docker load -i xxx_ver.1.0.0.tar
note

You need to run this command on the host machine (where circuscad/circus itself is installed). CIRCUS will use the Docker-outside-of-Docker (DooD) technique to access this plug-in from the running container.

Start CIRCUS, attach to the container's Bash, and run the following command.

# /root/cad_plugin_registration.sh [REPOSITORY]:[TAG]

You will see a confirmation message like the following. Type "Y" and Enter.

Confirmation of plug-in registration

tip

You can inspect the [REPOSITORY] and [TAG] needed to import the container using the docker images command.

Option 2: Running CIRCUS CLI in the Container

  1. Run the following command on the host and inspect the full image ID of the plug-in.

    $ docker images --no-trunc

    The string following "sha256:" in the Image ID column of the Docker image to be registered is the full ID required for registration (see figure below).

    docker image list

  2. Run the following command (in the container) to register the information of the CIRCUS CS plug-in.

    Inside the container
    # /root/servicies.sh &
    # cd /var/circus/packages/circus-api
    # node circus register-cad-plugin [FULL-IMAGE-ID]
  3. You will see a confirmation message like the following. Type "Y" and Enter.

    Confirmation of plug-in registration

To Use GPU (for Linux Only, Optional)

When the installed plug-in needs to access a GPU, you need to install CUDA Driver and nvidia-container-runtime, and configure Docker.

  1. Add the repository of nvidia-container-runtime.

    $ curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | sudo apt-key add -
    $ distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
    $ curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list | sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list
    $ sudo apt update
  2. Install nvidia-container-runtime and restart the host machine.

    $ sudo apt install nvidia-container-runtime
    $ sudo reboot
  3. Edit /etc/docker/daemon.json and add the following (sudo required).

    {
    "default-runtime": "nvidia",
    "runtimes": {
    "nvidia": {
    "path": "/usr/bin/nvidia-container-runtime",
    "runtimeArgs": []
    }
    }
    }