Samsung / ONE

On-device Neural Engine
Other
426 stars 151 forks source link

[one-cmds] Introduce `onecc-docker` binary and `one-compiler-docker` package #8232

Open jyoungyun opened 2 years ago

jyoungyun commented 2 years ago

What

Let's consider how to use one-cmds tools easily for more people.

For now, one-cmds tools only support Ubuntu 18.04 and 20.04(not officially). So people in other environments can't use our tools unless they upgrade the OS (or install Ubuntu OS).

IMO, in this case, docker can be a good solution.

Docker is an open source containerization platform. It supports developer to provide applications into containers. And docker is already available on a variety of Linux platforms, macOS and Windows 10 through Docker Desktop. So if we provide one-compiler tool using docker, we can support many types of environment at once.

How

Dockerfile

This dockerfile generates a docker image for one-compiler on Ubuntu 18.04 or 20.04. User can run a process in isolated container using this docker image with several onecc parameters.

onecc-docker tool

This onecc-docker tool runs docker container using above docker image. It sets user and group ids the same as those on host PC, mounts /tmp and ${HOME} directory, adds HOME environment, and changes working directory to current directory.

one-compiler-docker package

one-compiler package

Todo

mhs4670go commented 2 years ago

I have a few question.

  1. It seems that users should build a docker image with Dockerfile when they start from scratch. Is it impossible to let users to pull the pre-built image from docker hub or somewhere?
  2. onecc and onecc-docker are different drivers and users can know about it because we are not supporting ubuntu 16.04 officially. So, how about not use same symbolic link? I mean user would use onecc-docker and onecc as a different driver. We can let users who are working on ubuntu 16.04 to use onecc-docker by a message like "You can use onecc-docker" when they run onecc driver.
jyoungyun commented 2 years ago
  1. It seems that users should build a docker image with Dockerfile when they start from scratch. Is it impossible to let users to pull the pre-built image from docker hub or somewhere?

We can upload Docker image. But it means that we have one more thing to manage. Now we only manage Dockerfile however if we upload Docker Image, we need to manage a job related docker image. So it has designed to provide Dockerfile directly.

  1. onecc and onecc-docker are different drivers and users can know about it because we are not supporting ubuntu 16.04 officially. So, how about not use same symbolic link? I mean user would use onecc-docker and onecc as a different driver. We can let users who are working on ubuntu 16.04 to use onecc-docker by a message like "You can use onecc-docker" when they run onecc driver.

It is an idea to extend existing onecc tool. Existing tool only supports specific environment. However new designed onecc will support all environment even though our tool does not support that environment.

I thought it was appropriate to provide the user in one tool than the multiple tools that the user should use depending on the environment.