Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dell platform dev #3176

Closed
wants to merge 41 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
159e69f
Added sonic-mgmt-framework as submodule / docker
Jun 19, 2019
3a8ef73
fix build issues
Jun 19, 2019
3b3ded5
Merge pull request #1 from project-arlo/brcm_poc
jghalam Jun 19, 2019
477f233
update sonic-mgmt-framework submodule branch to master
Jun 19, 2019
a1e885f
Merge pull request #2 from project-arlo/brcm_poc
jghalam Jun 19, 2019
3d804a4
Merged changes 70007e6d2ba3a4c0b371cd693ccc63e0a8906e77..00d4fcfed6a7…
dutta-partha Jun 22, 2019
23c4b77
Merge pull request #3 from project-arlo/brcm_poc
PrabhuSreenivasan Jun 22, 2019
6b7d777
Merge pull request #4 from Azure/master
srideepDell Jun 25, 2019
efd773f
Changes to build sonic-mgmt-framework docker
srideepDell Jun 26, 2019
5334b91
Merge pull request #5 from project-arlo/dell_dev_changes1
jghalam Jun 26, 2019
b4d36e7
bumped up sonic-mgmt-framework commit-id
Jun 26, 2019
757bf99
Merge pull request #6 from project-arlo/brcm_poc
nirenjan Jun 26, 2019
e292c98
version bump for sonic-mgmt-framework commit-it
srideepDell Jun 27, 2019
1260d46
Merge pull request #7 from Azure/master
srideepDell Jun 27, 2019
387b8b0
bumped up sonic-mgmt-framework commit-id
srideepDell Jun 28, 2019
a825f7e
Add python packages to docker
srideepDell Jun 28, 2019
8e4b212
Build fix for docker with python packages
srideepDell Jun 28, 2019
82acec7
Merge pull request #8 from project-arlo/dell_dev_changes1
jghalam Jun 28, 2019
335b387
Merge pull request #9 from project-arlo/master
PrabhuSreenivasan Jul 9, 2019
bc95cef
added libyang as dependent package
Jul 9, 2019
5fc3cb0
Merge pull request #10 from project-arlo/brcm_poc
jghalam Jul 9, 2019
de36781
Allow building images on NFS-mounted clones
nirenjan Jul 9, 2019
c7ecb4f
bumped up sonc-mgmt-framework commit to include PR #18
Jul 10, 2019
31ea940
Merge pull request #12 from project-arlo/brcm_poc
srideepDell Jul 10, 2019
ef7d06b
REST Server startup script is enahnced to read the settings from
Jul 10, 2019
f17c27f
Merge pull request #11 from project-arlo/build-sonic-on-nfs
PrabhuSreenivasan Jul 10, 2019
12e8ed2
Merge pull request #13 from project-arlo/brcm_poc
sachinholla Jul 10, 2019
11c3192
Replace src/telemetry as submodule to sonic-telemetry
nirenjan Jul 10, 2019
4c5b824
Update telemetry commit HEAD
nirenjan Jul 10, 2019
9d96e56
Merge pull request #14 from project-arlo/sonic-telemetry-submodule
srideepDell Jul 10, 2019
ff0e23a
Update sonic-telemetry commit HEAD
nirenjan Jul 10, 2019
ec0d35d
Merge pull request #15 from project-arlo/sonic-telemetry-submodule
srideepDell Jul 10, 2019
7597470
libyang env path update
Jul 11, 2019
98abbd4
Merge pull request #16 from project-arlo/brcm_poc
sachinholla Jul 11, 2019
9385bc4
Add libyang dependency to telemetry
seiferteric Jul 12, 2019
66ea5b5
Merge pull request #17 from project-arlo/telemetry-refactor
srideepDell Jul 12, 2019
1430d49
Add scripts to create JSON files for CLI backend
hpersh-dell Jul 12, 2019
c45e80c
Merge remote-tracking branch 'upstream/master'
nirenjan Jul 16, 2019
e86f0a2
In startup script, create directory where CLI back-end files live
hpersh-dell Jul 17, 2019
7a7e456
Merge branch 'master' into dell_platform_dev
srideepDell Jul 17, 2019
4125d6a
build dependency pkgs added to docker for build failure fix
srideepDell Jul 17, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
url = https://github.com/p4lang/ptf.git
[submodule "src/sonic-utilities"]
path = src/sonic-utilities
url = https://github.com/Azure/sonic-utilities
url = https://github.com/project-arlo/sonic-utilities.git
[submodule "platform/broadcom/sonic-platform-modules-arista"]
path = platform/broadcom/sonic-platform-modules-arista
url = https://github.com/aristanetworks/sonic
Expand Down Expand Up @@ -66,3 +66,9 @@
[submodule "platform/mellanox/mlnx-sai/SAI-Implementation"]
path = platform/mellanox/mlnx-sai/SAI-Implementation
url = https://github.com/Mellanox/SAI-Implementation
[submodule "src/sonic-mgmt-framework"]
path = src/sonic-mgmt-framework
url = https://github.com/project-arlo/sonic-mgmt-framework.git
[submodule "src/telemetry"]
path = src/telemetry
url = https://github.com/project-arlo/sonic-telemetry.git
1 change: 1 addition & 0 deletions Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ endif
DOCKER_RUN := docker run --rm=true --privileged \
-v $(DOCKER_BUILDER_MOUNT) \
-w $(DOCKER_BUILDER_WORKDIR) \
--tmpfs /fsroot:exec,dev \
-e "http_proxy=$(http_proxy)" \
-e "https_proxy=$(https_proxy)" \
-i$(if $(TERM),t,)
Expand Down
21 changes: 11 additions & 10 deletions build_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ DOCKER_VERSION=5:18.09.2~3-0~debian-stretch
LINUX_KERNEL_VERSION=4.9.0-9-2

## Working directory to prepare the file system
FILESYSTEM_ROOT=./fsroot
FILESYSTEM_ROOT=/fsroot
PLATFORM_DIR=platform
## Hostname for the linux image
HOSTNAME=sonic
Expand All @@ -56,9 +56,8 @@ DEFAULT_USERINFO="Default admin user,,,"

## Prepare the file system directory
if [[ -d $FILESYSTEM_ROOT ]]; then
sudo rm -rf $FILESYSTEM_ROOT || die "Failed to clean chroot directory"
sudo chown $(id -nu):$(id -ng) $FILESYSTEM_ROOT || die "Failed to own chroot directory"
fi
mkdir -p $FILESYSTEM_ROOT
mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR
mkdir -p $FILESYSTEM_ROOT/$PLATFORM_DIR/x86_64-grub
touch $FILESYSTEM_ROOT/$PLATFORM_DIR/firsttime
Expand Down Expand Up @@ -426,8 +425,7 @@ fi

## Organization specific extensions such as Configuration & Scripts for features like AAA, ZTP...
if [ "${enable_organization_extensions}" = "y" ]; then
if [ -f files/build_templates/organization_extensions.sh ]; then
sudo chmod 755 files/build_templates/organization_extensions.sh
if [ -x files/build_templates/organization_extensions.sh ]; then
./files/build_templates/organization_extensions.sh -f $FILESYSTEM_ROOT -h $HOSTNAME
fi
fi
Expand Down Expand Up @@ -487,16 +485,19 @@ sudo umount $FILESYSTEM_ROOT/proc || true
sudo mkdir $FILESYSTEM_ROOT/host

## Compress most file system into squashfs file
sudo rm -f $ONIE_INSTALLER_PAYLOAD $FILESYSTEM_SQUASHFS
rm -f $ONIE_INSTALLER_PAYLOAD $FILESYSTEM_SQUASHFS
## Output the file system total size for diag purpose
## Note: -x to skip directories on different file systems, such as /proc
sudo du -hsx $FILESYSTEM_ROOT
sudo mkdir -p $FILESYSTEM_ROOT/var/lib/docker
sudo mksquashfs $FILESYSTEM_ROOT $FILESYSTEM_SQUASHFS -e boot -e var/lib/docker -e $PLATFORM_DIR
sudo mksquashfs $FILESYSTEM_ROOT /tmp/$FILESYSTEM_SQUASHFS -e boot -e var/lib/docker -e $PLATFORM_DIR
cp /tmp/$FILESYSTEM_SQUASHFS $FILESYSTEM_SQUASHFS

## Compress docker files
pushd $FILESYSTEM_ROOT && sudo tar czf $OLDPWD/$FILESYSTEM_DOCKERFS -C var/lib/docker .; popd
pushd $FILESYSTEM_ROOT && sudo tar czf /tmp/$FILESYSTEM_DOCKERFS -C var/lib/docker .; popd
cp /tmp/$FILESYSTEM_DOCKERFS $FILESYSTEM_DOCKERFS

## Compress together with /boot, /var/lib/docker and $PLATFORM_DIR as an installer payload zip file
pushd $FILESYSTEM_ROOT && sudo zip $OLDPWD/$ONIE_INSTALLER_PAYLOAD -r boot/ $PLATFORM_DIR/; popd
sudo zip -g $ONIE_INSTALLER_PAYLOAD $FILESYSTEM_SQUASHFS $FILESYSTEM_DOCKERFS
pushd $FILESYSTEM_ROOT && sudo zip /tmp/$ONIE_INSTALLER_PAYLOAD -r boot/ $PLATFORM_DIR/; popd
sudo zip -g /tmp/$ONIE_INSTALLER_PAYLOAD $FILESYSTEM_SQUASHFS $FILESYSTEM_DOCKERFS
cp /tmp/$ONIE_INSTALLER_PAYLOAD $ONIE_INSTALLER_PAYLOAD
44 changes: 44 additions & 0 deletions dockers/docker-sonic-mgmt-framework/Dockerfile.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM docker-config-engine-stretch

ARG docker_container_name
RUN [ -f /etc/rsyslog.conf ] && sed -ri "s/%syslogtag%/$docker_container_name#%syslogtag%/;" /etc/rsyslog.conf

## Make apt-get non-interactive
ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update
RUN pip install connexion==1.1.15 \
python_dateutil==2.6.0\
setuptools==21.0.0 \
grpcio-tools==1.20.0 \
pyangbind==0.6.0 \
certifi==2017.4.17 \
python-dateutil==2.6.0 \
six==1.11.0 \
urllib3==1.21.1


#RUN apt-get install -f -y libdbus-1-3 libdaemon0 libjansson4

## Install redis-tools dependencies
## TODO: implicitly install dependencies
RUN apt-get -y install libjemalloc1 libatomic1 liblua5.1-0 lua-bitop lua-cjson

COPY \
{% for deb in docker_sonic_mgmt_framework_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor -%}
debs/

RUN dpkg -i \
{% for deb in docker_sonic_mgmt_framework_debs.split(' ') -%}
debs/{{ deb }}{{' '}}
{%- endfor %}

COPY ["start.sh", "rest-server.sh", "/usr/bin/"]
COPY ["supervisord.conf", "/etc/supervisor/conf.d/"]

RUN apt-get clean -y; apt-get autoclean -y; apt-get autoremove -y
RUN rm -rf /debs

ENTRYPOINT ["/usr/bin/supervisord"]
52 changes: 52 additions & 0 deletions dockers/docker-sonic-mgmt-framework/rest-server.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env bash

# Startup script for SONiC Management REST Server

SERVER_PORT=
LOG_LEVEL=
CLIENT_AUTH=
SERVER_CRT=
SERVER_KEY=
CA_CERT=

# Read basic server settings from REST_SERVER|default entry
HAS_REST_CONFIG=$(sonic-cfggen -d -v "1 if REST_SERVER and REST_SERVER['default']")
if [ "$HAS_REST_CONFIG" == "1" ]; then
SERVER_PORT=$(sonic-cfggen -d -v "REST_SERVER['default']['port']")
CLIENT_AUTH=$(sonic-cfggen -d -v "REST_SERVER['default']['client_auth']")
LOG_LEVEL=$(sonic-cfggen -d -v "REST_SERVER['default']['log_level']")
fi

# Read certificate file paths from DEVICE_METADATA|x509 entry.
HAS_X509_CONFIG=$(sonic-cfggen -d -v "1 if DEVICE_METADATA and DEVICE_METADATA['x509']")
if [ "$HAS_X509_CONFIG" == "1" ]; then
SERVER_CRT=$(sonic-cfggen -d -v "DEVICE_METADATA['x509']['server_crt']")
SERVER_KEY=$(sonic-cfggen -d -v "DEVICE_METADATA['x509']['server_key']")
CA_CRT=$(sonic-cfggen -d -v "DEVICE_METADATA['x509']['ca_crt']")
fi

# Create temporary server certificate if they not configured in ConfigDB
if [ -z $SERVER_CRT ] && [ -z $SERVER_KEY ]; then
echo "Generating temporary TLS server certificate ..."
(cd /tmp && /usr/sbin/generate_cert --host="localhost,127.0.0.1")
SERVER_CRT=/tmp/cert.pem
SERVER_KEY=/tmp/key.pem
fi


REST_SERVER_ARGS="-ui /rest_ui -logtostderr"
[ ! -z $SERVER_PORT ] && REST_SERVER_ARGS+=" -port $SERVER_PORT"
[ ! -z $LOG_LEVEL ] && REST_SERVER_ARGS+=" -v $LOG_LEVEL"
[ ! -z $CLIENT_AUTH ] && REST_SERVER_ARGS+=" -client_auth $CLIENT_AUTH"
[ ! -z $SERVER_CRT ] && REST_SERVER_ARGS+=" -cert $SERVER_CRT"
[ ! -z $SERVER_KEY ] && REST_SERVER_ARGS+=" -key $SERVER_KEY"
[ ! -z $CA_CRT ] && REST_SERVER_ARGS+=" -cacert $CA_CRT"

echo "REST_SERVER_ARGS = $REST_SERVER_ARGS"


export CVL_SCHEMA_PATH=/usr/sbin/schema
export LIBYANG_EXTENSIONS_PLUGINS_DIR=/usr/lib/x86_64-linux-gnu/libyang/extensions
export LIBYANG_USER_TYPES_PLUGINS_DIR=/usr/lib/x86_64-linux-gnu/libyang/user_types

exec /usr/sbin/rest_server ${REST_SERVER_ARGS}
10 changes: 10 additions & 0 deletions dockers/docker-sonic-mgmt-framework/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env bash

mkdir -p /var/sonic
echo "# Config files managed by sonic-config-engine" > /var/sonic/config_status

rm -f /var/run/rsyslogd.pid

supervisorctl start rsyslogd

supervisorctl start rest-server
28 changes: 28 additions & 0 deletions dockers/docker-sonic-mgmt-framework/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[supervisord]
logfile_maxbytes=1MB
logfile_backups=2
nodaemon=true

[program:start.sh]
command=/usr/bin/start.sh
priority=1
autostart=true
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog

[program:rsyslogd]
command=/usr/sbin/rsyslogd -n
priority=2
autostart=false
autorestart=false
stdout_logfile=syslog
stderr_logfile=syslog

[program:rest-server]
command=/usr/bin/rest-server.sh
priority=3
autostart=false
autorestart=true
stdout_logfile=syslog
stderr_logfile=syslog
14 changes: 14 additions & 0 deletions files/build_templates/mgmt-framework.service.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[Unit]
Description=Management Framework container
Requires=swss.service
After=swss.service
Before=ntp-config.service

[Service]
User={{ sonicadmin_user }}
ExecStartPre=/usr/bin/{{docker_container_name}}.sh start
ExecStart=/usr/bin/{{docker_container_name}}.sh wait
ExecStop=/usr/bin/{{docker_container_name}}.sh stop

[Install]
WantedBy=multi-user.target
9 changes: 9 additions & 0 deletions files/image_config/platform/rc.local
Original file line number Diff line number Diff line change
Expand Up @@ -322,4 +322,13 @@ if [ -f $FIRST_BOOT_FILE ]; then
firsttime_exit
fi

# Create dir where following scripts put their output files
mkdir -p /var/platform

# Write contents of system EEPROM as JSON file
/usr/bin/decode-syseeprom | /usr/bin/syseeprom-to-json > /var/platform/syseeprom

# Start system information poller
/usr/bin/syspoll &

exit 0
22 changes: 22 additions & 0 deletions rules/docker-sonic-mgmt-framework.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# docker image for mgmt-framework

DOCKER_MGMT-FRAMEWORK_STEM = docker-sonic-mgmt-framework
DOCKER_MGMT-FRAMEWORK = $(DOCKER_MGMT-FRAMEWORK_STEM).gz
DOCKER_MGMT-FRAMEWORK_DBG = $(DOCKER_MGMT-FRAMEWORK_STEM)-$(DBG_IMAGE_MARK).gz

$(DOCKER_MGMT-FRAMEWORK)_PATH = $(DOCKERS_PATH)/$(DOCKER_MGMT-FRAMEWORK_STEM)

$(DOCKER_MGMT-FRAMEWORK)_DEPENDS += $(REDIS_TOOLS) $(SONIC_MGMT-FRAMEWORK)
#$(DOCKER_MGMT-FRAMEWORK)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_DEPENDS)

SONIC_DOCKER_IMAGES += $(DOCKER_MGMT-FRAMEWORK)
$(DOCKER_MGMT-FRAMEWORK)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_STRETCH)
#$(DOCKER_MGMT-FRAMEWORK)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_STRETCH)_DBG_IMAGE_PACKAGES)

SONIC_INSTALL_DOCKER_IMAGES += $(DOCKER_MGMT-FRAMEWORK)
SONIC_STRETCH_DOCKERS += $(DOCKER_MGMT-FRAMEWORK)

$(DOCKER_MGMT-FRAMEWORK)_CONTAINER_NAME = mgmt-framework
$(DOCKER_MGMT-FRAMEWORK)_RUN_OPT += --net=host --privileged -t
$(DOCKER_MGMT-FRAMEWORK)_RUN_OPT += -v /etc/sonic:/etc/sonic:ro

7 changes: 7 additions & 0 deletions rules/sonic-mgmt-framework.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SONiC mgmt-framework package

SONIC_MGMT-FRAMEWORK = sonic-mgmt-framework_1.0-01_amd64.deb
$(SONIC_MGMT-FRAMEWORK)_SRC_PATH = $(SRC_PATH)/sonic-mgmt-framework
$(SONIC_MGMT-FRAMEWORK)_DEPENDS = $(LIBYANG_DEV) $(LIBYANG)
$(SONIC_MGMT-FRAMEWORK)_RDEPENDS = $(LIBYANG)
SONIC_DPKG_DEBS += $(SONIC_MGMT-FRAMEWORK)
2 changes: 2 additions & 0 deletions rules/telemetry.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@

SONIC_TELEMETRY = sonic-telemetry_0.1_amd64.deb
$(SONIC_TELEMETRY)_SRC_PATH = $(SRC_PATH)/telemetry
$(SONIC_TELEMETRY)_DEPENDS = $(LIBYANG_DEV) $(LIBYANG)
$(SONIC_TELEMETRY)_RDEPENDS = $(LIBYANG)
SONIC_DPKG_DEBS += $(SONIC_TELEMETRY)
1 change: 1 addition & 0 deletions src/sonic-mgmt-framework
Submodule sonic-mgmt-framework added at 0f1e1d
1 change: 1 addition & 0 deletions src/telemetry
Submodule telemetry added at dd18f0
20 changes: 0 additions & 20 deletions src/telemetry/Makefile

This file was deleted.

5 changes: 0 additions & 5 deletions src/telemetry/debian/changelog

This file was deleted.

1 change: 0 additions & 1 deletion src/telemetry/debian/compat

This file was deleted.

17 changes: 0 additions & 17 deletions src/telemetry/debian/control

This file was deleted.

3 changes: 0 additions & 3 deletions src/telemetry/debian/rules

This file was deleted.

14 changes: 0 additions & 14 deletions src/telemetry/debian/telemetry.init.d

This file was deleted.