stratum / stratum

Stratum is an open source silicon-independent switch operating system for software defined networks.
https://www.opennetworking.org/stratum/
Apache License 2.0
385 stars 133 forks source link

occurrence Error that launch Docker Container on Tofino-based platforms with BSP. #227

Closed baekguihyun closed 4 years ago

baekguihyun commented 4 years ago

Describe the bug Hello, Developer.

I tried to build a dock image containing Barefoot SDE and Stratum, including BSP mode, and to run the docker container on the switch. However, the following error occurred when trying to run the container.

SAI default initialize: 1 bf_switchd: library /usr/local/lib/libpltfm_mgr.so loaded bf_switchd: agent[0] initialized Tcl server started.. Tcl server: listen socket created Tcl server: bind done on port 8008, listening... Tcl server: waiting for incoming connections... 2020-05-08 08:16:37.333978 BF_PLTFM ERROR - Error getting ipv6 address for interface usb0

CHSS MGMT ERROR: Failed to configure cdc_eth ipv6 2020-05-08 08:20:27.707726 BF_PLTFM ERROR - Error Getting the Board info from BMC. Hence exiting ****

Environment

Building on Desktop:

Launch on Switch:

lsmod :

Module Size Used by bf_kdrv 28672 0 x86_pkg_temp_thermal 16384 0 gpio_ich 16384 0 optoe 20480 0


**To Reproduce**
Steps to reproduce the behavior:
1. The docker build script has been modified. (/stratum/hal/bin/barefoot/docker)
   - [build-stratum-bf-container.sh](https://github.com/stratum/stratum/blob/30b7793f1a8571e3fcc5818e9cca6238a3fc53e1/stratum/hal/bin/barefoot/docker/build-stratum-bf-container.sh)
     - Line 39: 
   SDE_BSP_TAR=$3
   SDE_TAR=""
   KERNEL_HEADERS_TAR=""
   RUNTIME_IMG_TAG=""
   ```

 - Line 71:
   ```
   docker build -t "$BUILDER_IMAGE" \
      --build-arg JOBS="$JOBS" \
      --build-arg SDE_TAR="$SDE_TAR" \
      --build-arg SDE_BSP_TAR=$SDE_BSP_TAR \
      -f "$DOCKERFILE_DIR/Dockerfile.builder" "$DOCKERFILE_DIR"
   ```
  1. Run this command 'sudo ./build-stratum-bf-container.sh ~/bf-sde-9.0.0.tar ~/linux-4.14.49-mbuild.tar.gz bf-reference-bsp-9.0.0.tar' for building docker imag
  2. The built docker image has been moved to the switch.
  3. In switch, Run the following command
    docker run -it --privileged -v /dev:/dev -v /sys:/sys \
      --env WITH_ONLP=false \
      --env PLATFORM=x86-64-accton-wedge100bf-32x-r0 \
      -v /lib/modules/4.14.49-OpenNetworkLinux:/lib/modules/4.14.49-OpenNetworkLinux \
      -v /lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu \
      -v /usr/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu \
      -p 28000:28000 -p 9339:9339 -v /stratum_docker_configs:/stratum_configs \
      -v /var/log:/stratum_logs \
      stratumproject/stratum-bf:bf-sde-9.0.0.tar-linux-4.14.49-mbuild.tar.gz
  4. See error

Tcl server started.. Tcl server: listen socket created Tcl server: bind done on port 8008, listening... Tcl server: waiting for incoming connections... 2020-05-11 01:41:51.134000 BF_PLTFM ERROR - Error getting ipv6 address for interface usb0

CHSS MGMT ERROR: Failed to configure cdc_eth ipv6

Expected behavior A clear and concise description of what you expected to happen.

Tcl server started.. Tcl server: listen socket created Tcl server: bind done on port 8008, listening... Tcl server: waiting for incoming connections... Health monitor started Skip diag lib deinit |E0511 00:27:50.588335 5539 hal.cc:234] Stratum external facing services are listening to 0.0.0.0:28000, localhost:28000... E0511 00:29:07.589924 5539 hal.cc:376] StratumErrorSpace::ERR_INTERNAL: Failed to check in with procmon: failed to connect to all addresses E0511 00:29:07.591130 5539 hal.cc:244] Error when checking in with procmon: Failed to check in with procmon: failed to connect to all addresses.

Additional context Nothing.

Yi-Tseng commented 4 years ago

Hi,

Can you try to replace -p 28000:28000 -p 9339:9339 to --network host? Some BSP requires the host network interfaces like usb0

baekguihyun commented 4 years ago

Thank you very much!