diff --git a/docker-sonic-alpinevs/Dockerfile.j2 b/docker-sonic-alpinevs/Dockerfile.j2 index f2391ce..078ff58 100644 --- a/docker-sonic-alpinevs/Dockerfile.j2 +++ b/docker-sonic-alpinevs/Dockerfile.j2 @@ -160,6 +160,11 @@ RUN mkdir -p /sock RUN mkdir -p /var/run/sshd +ENV LUCIUS_LOG_DIR=/var/log/lucius +RUN mkdir -p /var/log/lucius + +RUN rm -f /var/log/README + COPY ["bin/sonic-admin.username", "/tmp/sonic-admin.username"] COPY ["bin/sonic-admin.password.hash", "/tmp/sonic-admin.password.hash"] diff --git a/docker-sonic-alpinevs/device/x86_64-kvm_x86_64-r0/alpinevs/platform.json b/docker-sonic-alpinevs/device/x86_64-kvm_x86_64-r0/alpinevs/platform.json new file mode 100644 index 0000000..83806f2 --- /dev/null +++ b/docker-sonic-alpinevs/device/x86_64-kvm_x86_64-r0/alpinevs/platform.json @@ -0,0 +1,164 @@ +{ + "interfaces": { + "Ethernet0": { + "index": "1", + "lanes": "1,2,3,4", + "breakout_modes": { "1x100G[40G]": ["1,2,3,4"] } + }, + "Ethernet4": { + "index": "2", + "lanes": "5,6,7,8", + "breakout_modes": { "1x100G[40G]": ["5,6,7,8"] } + }, + "Ethernet8": { + "index": "3", + "lanes": "9,10,11,12", + "breakout_modes": { "1x100G[40G]": ["9,10,11,12"] } + }, + "Ethernet12": { + "index": "4", + "lanes": "13,14,15,16", + "breakout_modes": { "1x100G[40G]": ["13,14,15,16"] } + }, + "Ethernet16": { + "index": "5", + "lanes": "17,18,19,20", + "breakout_modes": { "1x100G[40G]": ["17,18,19,20"] } + }, + "Ethernet20": { + "index": "6", + "lanes": "21,22,23,24", + "breakout_modes": { "1x100G[40G]": ["21,22,23,24"] } + }, + "Ethernet24": { + "index": "7", + "lanes": "25,26,27,28", + "breakout_modes": { "1x100G[40G]": ["25,26,27,28"] } + }, + "Ethernet28": { + "index": "8", + "lanes": "29,30,31,32", + "breakout_modes": { "1x100G[40G]": ["29,30,31,32"] } + }, + "Ethernet32": { + "index": "9", + "lanes": "33,34,35,36", + "breakout_modes": { "1x100G[40G]": ["33,34,35,36"] } + }, + "Ethernet36": { + "index": "10", + "lanes": "37,38,39,40", + "breakout_modes": { "1x100G[40G]": ["37,38,39,40"] } + }, + "Ethernet40": { + "index": "11", + "lanes": "41,42,43,44", + "breakout_modes": { "1x100G[40G]": ["41,42,43,44"] } + }, + "Ethernet44": { + "index": "12", + "lanes": "45,46,47,48", + "breakout_modes": { "1x100G[40G]": ["45,46,47,48"] } + }, + "Ethernet48": { + "index": "13", + "lanes": "49,50,51,52", + "breakout_modes": { "1x100G[40G]": ["49,50,51,52"] } + }, + "Ethernet52": { + "index": "14", + "lanes": "53,54,55,56", + "breakout_modes": { "1x100G[40G]": ["53,54,55,56"] } + }, + "Ethernet56": { + "index": "15", + "lanes": "57,58,59,60", + "breakout_modes": { "1x100G[40G]": ["57,58,59,60"] } + }, + "Ethernet60": { + "index": "16", + "lanes": "61,62,63,64", + "breakout_modes": { "1x100G[40G]": ["61,62,63,64"] } + }, + "Ethernet64": { + "index": "17", + "lanes": "65,66,67,68", + "breakout_modes": { "1x100G[40G]": ["65,66,67,68"] } + }, + "Ethernet68": { + "index": "18", + "lanes": "69,70,71,72", + "breakout_modes": { "1x100G[40G]": ["69,70,71,72"] } + }, + "Ethernet72": { + "index": "19", + "lanes": "73,74,75,76", + "breakout_modes": { "1x100G[40G]": ["73,74,75,76"] } + }, + "Ethernet76": { + "index": "20", + "lanes": "77,78,79,80", + "breakout_modes": { "1x100G[40G]": ["77,78,79,80"] } + }, + "Ethernet80": { + "index": "21", + "lanes": "81,82,83,84", + "breakout_modes": { "1x100G[40G]": ["81,82,83,84"] } + }, + "Ethernet84": { + "index": "22", + "lanes": "85,86,87,88", + "breakout_modes": { "1x100G[40G]": ["85,86,87,88"] } + }, + "Ethernet88": { + "index": "23", + "lanes": "89,90,91,92", + "breakout_modes": { "1x100G[40G]": ["89,90,91,92"] } + }, + "Ethernet92": { + "index": "24", + "lanes": "93,94,95,96", + "breakout_modes": { "1x100G[40G]": ["93,94,95,96"] } + }, + "Ethernet96": { + "index": "25", + "lanes": "97,98,99,100", + "breakout_modes": { "1x100G[40G]": ["97,98,99,100"] } + }, + "Ethernet100": { + "index": "26", + "lanes": "101,102,103,104", + "breakout_modes": { "1x100G[40G]": ["101,102,103,104"] } + }, + "Ethernet104": { + "index": "27", + "lanes": "105,106,107,108", + "breakout_modes": { "1x100G[40G]": ["105,106,107,108"] } + }, + "Ethernet108": { + "index": "28", + "lanes": "109,110,111,112", + "breakout_modes": { "1x100G[40G]": ["109,110,111,112"] } + }, + "Ethernet112": { + "index": "29", + "lanes": "113,114,115,116", + "breakout_modes": { "1x100G[40G]": ["113,114,115,116"] } + }, + "Ethernet116": { + "index": "30", + "lanes": "117,118,119,120", + "breakout_modes": { "1x100G[40G]": ["117,118,119,120"] } + }, + "Ethernet120": { + "index": "31", + "lanes": "121,122,123,124", + "breakout_modes": { "1x100G[40G]": ["121,122,123,124"] } + }, + "Ethernet124": { + "index": "32", + "lanes": "125,126,127,128", + "breakout_modes": { "1x100G[40G]": ["125,126,127,128"] } + } + } +} diff --git a/docker-sonic-alpinevs/start.sh b/docker-sonic-alpinevs/start.sh index 73f0a53..1d7ec4d 100755 --- a/docker-sonic-alpinevs/start.sh +++ b/docker-sonic-alpinevs/start.sh @@ -75,6 +75,7 @@ fi supervisorctl start syncd supervisorctl start portsyncd supervisorctl start orchagent +supervisorctl start pkt-handler supervisorctl start coppmgrd supervisorctl start neighsyncd supervisorctl start fdbsyncd diff --git a/docker-sonic-alpinevs/supervisord.conf.j2 b/docker-sonic-alpinevs/supervisord.conf.j2 index b4c4dab..202adeb 100644 --- a/docker-sonic-alpinevs/supervisord.conf.j2 +++ b/docker-sonic-alpinevs/supervisord.conf.j2 @@ -297,7 +297,7 @@ stderr_syslog=true [program:alpine] command=/usr/bin/alpinevs-script.sh priority=30 -autostart=true +autostart=false autorestart=false startsecs=0 startretries=0 @@ -306,7 +306,7 @@ exitcodes=0 [program:pkt-handler] command=/usr/bin/pkt-handler priority=26 -autostart=true +autostart=false autorestart=unexpected startsecs=5 startretries=10 diff --git a/src/libsai-grpc/entrypoint.cc b/src/libsai-grpc/entrypoint.cc index 381e422..a5fe48f 100644 --- a/src/libsai-grpc/entrypoint.cc +++ b/src/libsai-grpc/entrypoint.cc @@ -184,7 +184,10 @@ std::unique_ptr entry; sai_status_t sai_api_initialize( _In_ uint64_t flags, _In_ const sai_service_method_table_t* services) { - FLAGS_log_dir = "/var/log"; + + const char* log_dir = std::getenv("LUCIUS_LOG_DIR"); + FLAGS_log_dir = (log_dir != nullptr) ? log_dir : "/var/log"; + google::InitGoogleLogging("lucius"); google::InstallFailureSignalHandler(); diff --git a/src/services/init/debian/install b/src/services/init/debian/install index f984454..911545e 100644 --- a/src/services/init/debian/install +++ b/src/services/init/debian/install @@ -3,3 +3,5 @@ alpinevs-init.sh usr/bin/ alpinevs-init.service lib/systemd/system/ pmon_daemon_control.json usr/share/sonic/device/x86_64-kvm_x86_64-r0/alpine_vs sai.profile usr/share/sonic/device/x86_64-kvm_x86_64-r0/alpine_vs +platform.json usr/share/sonic/device/x86_64-kvm_x86_64-r0/alpine_vs +hwsku.json usr/share/sonic/device/x86_64-kvm_x86_64-r0/alpine_vs