Running PixyzSDK instance in non-root contianer

Hello,

I am deploying a PixyzSDK instance in a non-root container, and I encountered the following error when running the program:

 pxz.initialize()
 pxz.Error: error while creating directory //PixyzSDK, (errno=13)

The program works under the root user and also runs successfully on Windows. I am using Ubuntu22 as the base image, and the PixyzSDK folder is created in the /usr/share directory with read, write, execute permissions and has licenses , plugins folder and libSDC.dll in it. This makes the error message confusing. Why does initializing the PixyzSDK instance still require creating the PixyzSDK directory? Is there any configuration I might have missed when building the Docker image and running the PixyzSDK instance in a non-root container?

Another question: Unlike the Scenario Processor, I installed PixyzSDK using pip install pxz. Is it still necessary to run PiXYZFinishInstall to complete the installation? The program seems to run fine without it, but I could not find any information in the Unity documentation to confirm this. Thank you in advance.

Hello @HaoChen10,

About your error

pxz.Error: error while creating directory //PixyzSDK, (errno=13)

When you execute the pxz.initialize() function, it will create into the current home user directory (if not exist), a directory called “PixyzSDK” that will contain files like the latest session log.

If the HOME variable is not set, it will attempt to create the directory into //PixyzSDK in the root directory instead of /$HOME/PixyzSDK and it is not writable as a non root user.
To avoid this error, set the HOME variable to a writable directory place like /home/your_user or /tmp if you don’t need to keep the logs.

“and the PixyzSDK folder is created in the /usr/share…”

This directory need be created/managed by the PiXYZFinishInstall PixyzSDK execution (as root), I don’t recommend to create it manually. This step must be done only once (ex: at the container build time).

Is it still necessary to run PiXYZFinishInstall to complete the installation?

You need to execute the PiXYZFinishInstall script only once, after the first PixyzSDK installation (it will create the PixyzSDK directory and set the correct permissions).
If you have already executed it, you don’t need to run it again after the each pxz package installation.

A last word about the docker usage.

If you want to run pixyz into a docker container, you have many choices:

  • You can use the pre-builder container, check this help page: Docker image. This container runs without root permission and is ready to use.
  • build your own container:
    • from the pixyz docker: All pixyz requirements are already installed in the pixyz docker container, it is safe to use it as a base image.
  • from your own recipe: In this case, after the pixyz sdk installation, don’t forget to run (as root) the PiXYZFinishInstall PixyzSDK.

Best regards,

3 Likes

Thank you very much! I set the HOME directory, and everything is working perfectly now!

1 Like