docker-sonic-vs - is this just totally broken?

654 views
Skip to first unread message

Anton Smith

unread,
Dec 25, 2021, 1:50:12 PM12/25/21
to sonicproject
Hi everyone, I've been trying for days to get this to work.

I've built it myself successfully, but also tried to use artifacts built by the sonic team. I've tried master and 202106.

the issue is that once it's built, and you run it with docker, things seem fundamentally broken:
1) most commands show a sudo not found error:
show ip interfaces
/bin/sh: 1: sudo: not found
/bin/sh: 1: sudo: not found
2) there's no SSH daemon running
3) many commands have empty output, like show ip interfaces, even after configuring an IP address
4) the admin user doesn't exist - only possible to exec /bin/bash as root
5) the docker command isn't found, so you can't do e.g. docker ps

Is the docker-sonic-vs.gz target meant to be used by anyone? Does anybody else get a different result than I am getting? are there some magical incantations one needs to do to run the docker images and have them work?

I'm trying to make this less painful, as you might have seen I wrote a cloud-init script for usage with multipass to build sonic more easily and think i succeeded in that. But the artifiact whether built by me or taken from sonic team just seems to be unusable. Any help i get, I will document and share it/keep it with my builder repo, so that others can have an easier time than I have had.

Please help!

Regards,
Anton

Christian Svensson

unread,
Dec 27, 2021, 10:58:16 AM12/27/21
to Anton Smith, sonicproject
Hi Anton,

I downloaded the latest 202106 yesterday and 1-5 works for me.
I run it like this:
qemu-system-x86_64 -machine q35 -m 2048 -hda sonic-vs.img -nographic -netdev user,id=sonic0,hostfwd=tcp::5555-:22 -device e1000,netdev=sonic0

Regards,

--
You received this message because you are subscribed to the Google Groups "sonicproject" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonicproject...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonicproject/c12b8bc5-afc6-45dd-b3b4-3e9a9147ebf6n%40googlegroups.com.

Sean Collins

unread,
Dec 27, 2021, 11:43:27 AM12/27/21
to sonicproject
So, if it only works by using QEMU, is it actually a docker container? It sounds like the answer is no.

Anton Smith

unread,
Dec 27, 2021, 12:03:14 PM12/27/21
to Sean Collins, sonicproject
He didn’t use the docker container - he used the vm image.

I did a bit more digging - I got a working image by using images from November 2020. So somewhere after that, I suspect the docker builds are broken.

Note - I even used the artifacts from the azure build service, they had the exact same issues as mine.

I suspect the docker build “builds” but the images themselves are not tested.

You received this message because you are subscribed to a topic in the Google Groups "sonicproject" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonicproject/-vIipAPlHLA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonicproject...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonicproject/6daf8809-4d84-47d9-bb18-776db107a649n%40googlegroups.com.

Gord Chen

unread,
Dec 28, 2021, 12:52:46 AM12/28/21
to sonicproject

Fort the docker-sonic-vs, it would be used to perform the DVS test currently. 
And the sonic-vs container is based on the network namespace of a base container.   
  • docker run --privileged -id --name sw debian bash
  • sudo ./create_vnet.sh -n 32 sw
  • docker run --privileged -v /var/run/redis-vs/sw:/var/run/redis --network container:sw -d --name vs docker-sonic-vs  
Then the sonic-vs container would create the interfaces.

Regards,
Gord
Anton Smith 在 2021年12月28日 星期二上午1:03:14 [UTC+8] 的信中寫道:

Anton Smith

unread,
Dec 28, 2021, 8:42:38 AM12/28/21
to Gord Chen, sonicproject
Gord thank you. I had noticed the create_vnet.sh script, but thought it was only a helper script for connecting vs dockers to each other.

Is it correct that the debian sw container is actually a requirement for the docker-sonic-vs container to function properly?

If one wanted to create an arbitrary topology of docker-sonic-vs containers, does one need to create a sw for each one?

Regards,
Anton

flyse...@gmail.com

unread,
Dec 28, 2021, 8:31:41 PM12/28/21
to sonicproject
I think sw is not a requirement if you want to create an arbitrary topology for docker-sonic-vs container. 
But for executing tests in swss, it's actually a needed requirement for the topology setup by create_vnet.sh

Regards,
Jimi 

Anton Smith 在 2021年12月28日 星期二下午9:42:38 [UTC+8] 的信中寫道:
Reply all
Reply to author
Forward
0 new messages