quic / gunyah-support-scripts

Other
6 stars 4 forks source link

No luck in seting up the docker environment #7

Closed jglathe closed 10 months ago

jglathe commented 10 months ago

Hi there,

I tried to set up the docker environment for gunyah on my machine and it didn't go well:

jglathe@snapdragix:~/src/gunyah-support-scripts/scripts$ ./build-docker-img.sh 
Registry server is set to ubuntu:22.04
Building Docker file dockerfile-hyp
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/build?buildargs=%7B%22GID%22%3A%221000%22%2C%22REGISTRY%22%3A%22ubuntu%3A22.04%22%2C%22UID%22%3A%221000%22%2C%22USER%22%3A%22jglathe%22%7D&cachefrom=%5B%5D&cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=dockerfile-hyp&labels=%7B%7D&memory=0&memswap=0&networkmode=default&rm=1&shmsize=0&t=hyp%3Adev-term&target=&ulimits=null&version=1": dial unix /var/run/docker.sock: connect: permission denied
jglathe@snapdragix:~/src/gunyah-support-scripts/scripts$ docker --version
Docker version 24.0.5, build 24.0.5-0ubuntu1
jglathe@snapdragix:~/src/gunyah-support-scripts/scripts$ sudo ./build-docker-img.sh 
Registry server is set to ubuntu:22.04
Building Docker file dockerfile-hyp
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
            Install the buildx component to build images with BuildKit:
            https://docs.docker.com/go/buildx/

Sending build context to Docker daemon  84.99kB
Step 1/46 : ARG REGISTRY
Step 2/46 : FROM "$REGISTRY"
 ---> e343402cadef
Step 3/46 : RUN apt-get update
 ---> Using cache
 ---> 2643af7ffb50
Step 4/46 : ARG DEBIAN_FRONTEND=noninteractive
 ---> Using cache
 ---> c0fc9bee9a80
Step 5/46 : ENV TZ=America/Los_Angeles     LANG=en_US.UTF-8     LANGUAGE=en_US:en     LC_ALL=en_US.UTF-8
 ---> Using cache
 ---> 6b54104ed2f5
Step 6/46 : ARG USER=test
 ---> Using cache
 ---> 83b6e24d0d0f
Step 7/46 : ARG UID=50000
 ---> Using cache
 ---> a0e47bb721a2
Step 8/46 : ARG GID=200
 ---> Using cache
 ---> a33d412393ea
Step 9/46 : RUN groupadd -g "$GID" "$USER" &&   useradd -m -u "$UID" -g "$GID" -s /bin/bash "$USER" &&  echo "$USER:1234" | chpasswd && adduser "$USER" sudo
 ---> Running in a952998d8889
groupadd: group 'root' already exists
The command '/bin/sh -c groupadd -g "$GID" "$USER" &&   useradd -m -u "$UID" -g "$GID" -s /bin/bash "$USER" &&  echo "$USER:1234" | chpasswd && adduser "$USER" sudo' returned a non-zero code: 9
jglathe@snapdragix:~/src/gunyah-support-scripts/scripts$ 

Maybe I'm a bit too ambitious here, but this looks to me like a problem with running it as sudo. The machine I'm using is a Windows Dev Kit 2023 (sc8280xp-based chip, SQ3) running Ubuntu 23.10 with kernel 6.6.1. Is it even possible to run gunyah on this machine? The SoC looks powerful enough, and it's QualComm. Should I run the docker build environment on an x64 machine to get it going? Any help is greatly appreciated.

quic-yvasi commented 10 months ago

Hi, we haven't verified it on Windows dev kit. Our recommendation is to use an x86 machine with ubuntu 20.04 (or 22.04) and Docker installed as per instructions in docker website. We have seen that docker installed by ubuntu provided docker pkgs will encounter errors too. So please follow the instructions on docker website for ubuntu installation.

jglathe commented 10 months ago

Thank you for the fast answer. I have it running now in a wsl2 box running Ubuntu 22.04.03 (nested virtual hypervisor, cool) on a beefy desktop (R9-5950X, 64GB RAM). After installing docker as specified in the readme. The test cases worked fine. Just for fun I tried to install docker on the wdk with the same docker readme, and this failed. Anyway, next up will be adding gunyah to the wdk kernel :)

jglathe commented 10 months ago

Update: build-docker-img is running on the wdk itself now. Will make the other integration easier.