Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of contents


Table of Contents
minLevel1
maxLevel4

Overview


This section explains how to build an environment for developing container apps using iPRO Camera SDK. In this tutorial, the installation directory of SDK is written as ${SDK_DIR}.

Info

Container AdamApp is for cameras with SoC ambaCV5X and firmware version 3.30 or later, and can be developed with SDK version 2.10 or later. Please check here for camera SoC.

Recommended development environment


The recommended supported environments are as follows:

  • OS :Linux (64bit)

  • Distribution :Ubuntu 22.04 LTS, Ubuntu 20.04 LTS

Development environment construction procedure


Obtaining a Developer License

Please apply for and obtain a developer license from the link below.

Inquiry / SDK Download - Development Partner Portal (En) (i-pro.com)

Preparing the Docker environment

Install Docker Engine on your development PC.

Follow the instructions here to install Docker Engine. Below is an outline of the page.

  • Just to be safe, uninstall the old package.
    However, please make sure in advance that it is okay to uninstall the package. We are not responsible for any problems that may occur as a result of deleting it.

    Code Block
    for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker containerd runc; do sudo apt-get remove $pkg; done

     

  • Add the Docker repository to be used with apt-get. Copy and paste the four lines starting with echo together.

    Code Block
    # Add Docker's official GPG key:
    sudo apt-get update
    sudo apt-get install ca-certificates curl
    sudo install -m 0755 -d /etc/apt/keyrings
    sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
    sudo chmod a+r /etc/apt/keyrings/docker.asc
    # Add the repository to Apt sources:
    echo \
      "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
      $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
      sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    sudo apt-get update
  • Install the latest Docker engine.

    Code Block
    sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

    When asked "Do you want to continue? [Y/n]", enter Y and press Enter.

  • Check the operation after installation. 

    Code Block
    sudo docker run hello-world

    This is an example of what will be displayed if the operation is successful.

    Code Block
    ipro@PC-HP2208N0101R:~$ sudo docker run hello-world
    Unable to find image 'hello-world:latest' locally
    latest: Pulling from library/hello-world
    c1ec31eb5944: Pull complete
    Digest: sha256:d1b0b5888fbb59111dbf2b3ed698489c41046cb9d6d61743e37ef8d9f3dda06f
    Status: Downloaded newer image for hello-world:latest
    Hello from Docker!
    This message shows that your installation appears to be working correctly.
    To generate this message, Docker took the following steps:
     1. The Docker client contacted the Docker daemon.
     2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
        (amd64)
     3. The Docker daemon created a new container from that image which runs the
        executable that produces the output you are currently reading.
     4. The Docker daemon streamed that output to the Docker client, which sent it
        to your terminal.
    To try something more ambitious, you can run an Ubuntu container with:
     $ docker run -it ubuntu bash
    Share images, automate workflows, and more with a free Docker ID:
     https://hub.docker.com/
    For more examples and ideas, visit:
     https://docs.docker.com/get-started/
    

 

Info

The above will fail if you are connected to the Internet via a proxy server. Please follow the steps below for "If connecting via a proxy server" section.

 

Info

If you are using WSL2 to build your environment on a Windows PC, you may experience an issue where Docker cannot be started on Ubuntu-22.04.

In that case, please refer to the information here and use iptables-legacy.

  • The docker command requires root privileges by default, so add the user to the docker group so that it can be executed with user privileges.
    The official documentation states this in Post-installation steps | Docker Docs.

  • Create a docker user group.

    Code Block
    sudo groupadd docker

    If you see the message "groupadd: group 'docker' already exists", the group has already been created so continue.

  • Add the user you normally use to the docker group.

    Code Block
    sudo usermod -aG docker $USER

     

  • The settings will be reflected.

    Code Block
    newgrp docker

     

  • Verify that Docker can be run without sudo.

    Code Block
    docker run hello-world

    This is an example of what will be displayed if the operation is successful.

    Code Block
    ipro@PC-HP2208N0101R:~$ docker run hello-world
    Hello from Docker!
    This message shows that your installation appears to be working correctly.
    To generate this message, Docker took the following steps:
     1. The Docker client contacted the Docker daemon.
     2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
        (amd64)
     3. The Docker daemon created a new container from that image which runs the
        executable that produces the output you are currently reading.
     4. The Docker daemon streamed that output to the Docker client, which sent it
        to your terminal.
    To try something more ambitious, you can run an Ubuntu container with:
     $ docker run -it ubuntu bash
    Share images, automate workflows, and more with a free Docker ID:
     https://hub.docker.com/
    For more examples and ideas, visit:
     https://docs.docker.com/get-started/

     

  • Change the systemd configuration to automatically start the Docker service at boot time.

    Code Block
    sudo systemctl enable docker.service
    sudo systemctl enable containerd.service

     

  • Restart Ubuntu once to check if the docker service starts at boot time. In WSL, you cannot restart in the ubuntu terminal. Once you close the window with the x button, start powershell and enter the following.

    Code Block
    wsl --shutdown

     

  • Then start Ubuntu 22.04 LTS again from the start menu.

  • Enter the following command and if the correct version number is displayed, it is successful.

    Code Block
    docker version

    This is an example of what is displayed when the operation is successful.

    Code Block
    ipro@PC-HP2208N0101R:~$ docker version
    Client: Docker Engine - Community
     Version:           26.1.4
     API version:       1.45
     Go version:        go1.21.11
     Git commit:        5650f9b
     Built:             Wed Jun  5 11:28:57 2024
     OS/Arch:           linux/amd64
     Context:           default
    Server: Docker Engine - Community
     Engine:
      Version:          26.1.4
      API version:      1.45 (minimum version 1.24)
      Go version:       go1.21.11
      Git commit:       de5c9cf
      Built:            Wed Jun  5 11:28:57 2024
      OS/Arch:          linux/amd64
      Experimental:     false
     containerd:
      Version:          1.6.33
      GitCommit:        d2d58213f83a351ca8f528a95fbd145f5654e957
     runc:
      Version:          1.1.12
      GitCommit:        v1.1.12-0-g51d5e94
     docker-init:
      Version:          0.19.0
      GitCommit:        de40ad0

If connecting via a proxy server

Follow the steps to allow Docker to access the Internet via a proxy server. If you are not using a proxy server, you do not need to follow these steps.

  • Create a Docker client configuration file and write it as follows:

    Code Block
    vi ~/.docker/config.json

    The contents to be written are as follows.

    Code Block
    {
     "proxies":
     {
       "default":
       {
         "httpProxy": "http://[Proxy server IP address:port]",
         "httpsProxy": "http://[Proxy server IP address:port]"
       }
     }
    }

    特定のIPアドレスだけをプロキシなしで接続したい場合は”noProxy”で設定できます。詳細は プロキシサーバを使うように Docker を設定 — Docker-docs-ja 24.0 ドキュメント をご覧ください。
    If you want only certain IP addresses to connect without a proxy, you can set “noProxy”. For more information, see https://docs.docker.com/network/proxy/ .

  • Save the file.

Install qemu

This article describes how to install qemu, which is required in the development environment to create a container version of the additional app.

Info

If you reboot your PC, linux/arm64 may no longer be displayed in the available architectures. In that case, please install qemu again using the same procedure.

 

Installing qemu

Code Block
sudo apt update
sudo apt-get install qemu binfmt-support qemu-user-static # Install the qemu packages
sudo docker run --rm --privileged multiarch/qemu-user-static --reset -p yes # This step will execute the registering scripts

 

Preparing for docker buildx

  • To use experimental features and BuildKit, set and reflect additional environment variables.

  • Open the configuration file:

    Code Block
    vi ~/.bashrc
  • Add the following to the end

    Code Block
    export DOCKER_CLI_EXPERIMENTAL=enabled
    export DOCKER_BUILDKIT=1

    Save the file.

  • Check if buildx is available.

    Code Block
    docker --help | grep buildx

    Example output

    Code Block
      buildx*     Docker Buildx (Docker Inc., v0.10.5)

     

  • Check the architectures that can currently be built.

    Code Block
    docker buildx ls

    Example output

    Code Block
    NAME/NODE DRIVER/ENDPOINT STATUS  BUILDKIT                              PLATFORMS
    default * docker
      default default         running v0.11.7-0.20230525183624-798ad6b0ce9f linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/386, linux/arm64, linux/riscv64, linux/ppc64, linux/ppc64le, linux/s390x, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6

    If you see linux/arm64 in the output, you're successful.

Checking the development environment

We will check whether the environment has been built.
*The results are just an example, and may differ depending on your environment.

  • Docker Engine is installed

    Code Block
    $ docker --version
    Docker version 23.0.1, build cb74dfc

    If it is not installed, please install Docker Engine.

  • The Docker daemon is running.
    [If you are using systemd]

    Code Block
    $ systemctl status docker
    ● docker.service - Docker Application Container Engine
         Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
         Active: active (running) since Wed 2023-06-28 08:41:48 JST; 5h 6min ago
    TriggeredBy: ● docker.socket
           Docs: https://docs.docker.com
       Main PID: 1051 (dockerd)
          Tasks: 24
         Memory: 199.9M
            CPU: 5.471s
         CGroup: /system.slice/docker.service
                 └─1051 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
    
         (以下略)

    If Active is inactive (dead), start the service with the systemctl start docker command.

  • Docker buildx installed

    Code Block
    $ docker --help | grep buildx
      buildx*     Docker Buildx (Docker Inc., v0.10.5)

    If none are listed, follow Docker Buildx to install them separately.

  • qemu is installed and Arm64-bit apps can be cross-built. Make sure linux/arm64 is in the list below.

    Code Block
    $ docker buildx ls
    default * docker
      default default         running v0.11.7-0.20230525183624-798ad6b0ce9f linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/amd64/v4, linux/arm64, linux/riscv64, linux/ppc64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6

    If you don't have linux/arm64, install qemu.

Installing the Docker extension

Please download and install the Docker extension module from the link below. If an old Docker extension module that only supports Container AdamApp for Azure IoT Edge is installed, it will be updated.

Inquiry / SDK Download - Development Partner Portal (En) (i-pro.com)

Please install from the screen in the red frame below. If it appears as in the green frame, the installation was successful.

img-20240913-173409.png
Info

The version will change depending on the release date.

If you have cloud support turned on for the old Docker extension module that only supports Container AdamApp for Azure IoT Edge, you must turn it off.

Access the camera (if the IP address is 192.168.0.10) with the following URL.

Code Block
http://192.168.0.10/admin/setup_ca_software.html

If Cloud Support is set to "On", change it to "Off" and press "Settings".

20240510-172901.pngImage Removedimg-20240913-173519.pngImage Added