forked from sonic-net/sonic-buildimage
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sonic-sdk] add sonic sdk and sonic sdk buildenv (sonic-net#6712)
- Why I did it To give SONiC Application Extension developers an environment to run and develop their apps. - How I did it Created sonic-sdk and sonic-sdk-buildenv dockers and their dbg versions. - How to verify it Build: $ make -f slave target/sonic-sdk.gz target/sonic-sdk-buildenv.gz
- Loading branch information
1 parent
dca8cef
commit 8db6e33
Showing
16 changed files
with
230 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} | ||
FROM sonic-sdk | ||
|
||
ARG base_os_version | ||
ARG docker_database_version | ||
ARG docker_swss_version | ||
ARG docker_syncd_version | ||
ARG image_version | ||
|
||
# Make apt-get non-interactive | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && \ | ||
apt-get install -f -y \ | ||
build-essential | ||
|
||
{% if docker_sonic_sdk_buildenv_debs.strip() -%} | ||
# Copy locally-built Debian package dependencies | ||
{{ copy_files("debs/", docker_sonic_sdk_buildenv_debs.split(' '), "/debs/") }} | ||
|
||
# Install locally-built Debian packages and implicitly install their dependencies | ||
{{ install_debian_packages(docker_sonic_sdk_buildenv_debs.split(' ')) }} | ||
{%- endif %} | ||
|
||
{% if docker_sonic_sdk_buildenv_whls.strip() %} | ||
# Copy locally-built Python wheel dependencies | ||
{{ copy_files("python-wheels/", docker_sonic_sdk_buildenv_whls.split(' '), "/python-wheels/") }} | ||
|
||
# Install locally-built Python wheel dependencies | ||
{{ install_python_wheels(docker_sonic_sdk_buildenv_whls.split(' ')) }} | ||
{% endif %} | ||
|
||
# Clean up | ||
RUN apt-get clean -y && \ | ||
apt-get autoclean -y && \ | ||
apt-get autoremove -y && \ | ||
rm -rf /debs /python-wheels/ | ||
|
||
LABEL com.azure.sonic.sdk.versions.base-os=$base_os_version | ||
LABEL com.azure.sonic.sdk.versions.database=$docker_database_version | ||
LABEL com.azure.sonic.sdk.versions.swss=$docker_swss_version | ||
LABEL com.azure.sonic.sdk.versions.syncd=$docker_syncd_version | ||
LABEL com.azure.sonic.sdk.version.image_hash=$image_version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{% from "dockers/dockerfile-macros.j2" import install_debian_packages, install_python_wheels, copy_files %} | ||
FROM docker-config-engine-buster | ||
|
||
# Make apt-get non-interactive | ||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update | ||
|
||
{% if docker_sonic_sdk_debs.strip() -%} | ||
# Copy locally-built Debian package dependencies | ||
{{ copy_files("debs/", docker_sonic_sdk_debs.split(' '), "/debs/") }} | ||
|
||
# Install locally-built Debian packages and implicitly install their dependencies | ||
{{ install_debian_packages(docker_sonic_sdk_debs.split(' ')) }} | ||
{%- endif %} | ||
|
||
{% if docker_sonic_sdk_whls.strip() %} | ||
# Copy locally-built Python wheel dependencies | ||
{{ copy_files("python-wheels/", docker_sonic_sdk_whls.split(' '), "/python-wheels/") }} | ||
|
||
# Install locally-built Python wheel dependencies | ||
{{ install_python_wheels(docker_sonic_sdk_whls.split(' ')) }} | ||
{% endif %} | ||
|
||
# Clean up | ||
RUN apt-get clean -y && \ | ||
apt-get autoclean -y && \ | ||
apt-get autoremove -y && \ | ||
rm -rf /debs /python-wheels/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
build_version: '{{ build_version }}' | ||
{% if debian_version is defined -%} | ||
debian_version: '{{ debian_version }}' | ||
{% endif -%} | ||
{% if kernel_version is defined -%} | ||
kernel_version: '{{ kernel_version }}' | ||
{% endif -%} | ||
asic_type: {{ asic_type }} | ||
commit_id: '{{ commit_id }}' | ||
build_date: {{ build_date }} | ||
build_number: {{ build_number }} | ||
built_by: {{ built_by }} | ||
{% if components is defined -%} | ||
{% for component in components.split() | unique -%} | ||
{% set name, version = component.split('==') -%} | ||
{{ name }}: {{ version }} | ||
{% endfor -%} | ||
{% endif -%} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
tee $1 > /dev/null <<EOF | ||
build_version: '$sonic_version' | ||
asic_type: $sonic_asic_platform | ||
commit_id: '$(git rev-parse --short HEAD)' | ||
build_date: $(date -u) | ||
build_number: ${BUILD_NUMBER:-0} | ||
built_by: $USER@$BUILD_HOSTNAME | ||
EOF | ||
export build_version="${sonic_version}" | ||
export asic_type="${sonic_asic_platform}" | ||
export commit_id="$(git rev-parse --short HEAD)" | ||
export build_date="$(date -u)" | ||
export build_number="${BUILD_NUMBER:-0}" | ||
export built_by="$USER@$BUILD_HOSTNAME" | ||
j2 sonic_version.yml.j2 > $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../files/build_templates/sonic_version.yml.j2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
DPATH := $($(DOCKER_SONIC_SDK_BUILDENV)_PATH) | ||
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/docker-sonic-sdk-buildenv.mk rules/docker-sonic-sdk-buildenv.dep | ||
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) | ||
DEP_FILES += $(shell git ls-files $(DPATH)) | ||
|
||
$(DOCKER_SONIC_SDK_BUILDENV)_CACHE_MODE := GIT_CONTENT_SHA | ||
$(DOCKER_SONIC_SDK_BUILDENV)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) | ||
$(DOCKER_SONIC_SDK_BUILDENV)_DEP_FILES := $(DEP_FILES) | ||
|
||
$(eval $(call add_dbg_docker,$(DOCKER_SONIC_SDK_BUILDENV),$(DOCKER_SONIC_SDK_BUILDENV_DBG))) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# SONiC SDK Docker Image | ||
|
||
DOCKER_SONIC_SDK_BUILDENV_STEM = sonic-sdk-buildenv | ||
DOCKER_SONIC_SDK_BUILDENV = $(DOCKER_SONIC_SDK_BUILDENV_STEM).gz | ||
DOCKER_SONIC_SDK_BUILDENV_DBG = $(DOCKER_SONIC_SDK_BUILDENV_STEM)-$(DBG_IMAGE_MARK).gz | ||
|
||
$(DOCKER_SONIC_SDK_BUILDENV)_PATH = $(DOCKERS_PATH)/docker-sonic-sdk-buildenv | ||
|
||
$(DOCKER_SONIC_SDK_BUILDENV)_DEPENDS += $(LIBSAIVS) \ | ||
$(LIBSAIVS_DEV) \ | ||
$(LIBSAIREDIS_DEV) \ | ||
$(LIBSAIMETADATA_DEV) \ | ||
$(LIBSWSSCOMMON_DEV) \ | ||
$(LIBHIREDIS_DEV) \ | ||
$(LIBNL3_DEV) \ | ||
$(LIBNL_GENL3_DEV) \ | ||
$(LIBNL_ROUTE3_DEV) \ | ||
$(LIBNL_NF3_DEV) \ | ||
$(LIBNL_CLI_DEV) | ||
|
||
$(DOCKER_SONIC_SDK_BUILDENV)_DBG_DEPENDS = $($(DOCKER_SONIC_SDK)_DBG_DEPENDS) \ | ||
$(LIBSAIVS_DBG) | ||
$(DOCKER_SONIC_SDK_BUILDENV)_DBG_IMAGE_PACKAGES = $($(DOCKER_SONIC_SDK)_DBG_IMAGE_PACKAGES) | ||
|
||
|
||
$(DOCKER_SONIC_SDK_BUILDENV)_LOAD_DOCKERS += $(DOCKER_SONIC_SDK) | ||
|
||
SONIC_DOCKER_IMAGES += $(DOCKER_SONIC_SDK_BUILDENV) | ||
SONIC_DOCKER_DBG_IMAGES += $(DOCKER_SONIC_SDK_BUILDENV_DBG) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
DPATH := $($(DOCKER_SONIC_SDK)_PATH) | ||
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/docker-sonic-sdk.mk rules/docker-sonic-sdk.dep | ||
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST) | ||
DEP_FILES += $(shell git ls-files $(DPATH)) | ||
|
||
$(DOCKER_SONIC_SDK)_CACHE_MODE := GIT_CONTENT_SHA | ||
$(DOCKER_SONIC_SDK)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST) | ||
$(DOCKER_SONIC_SDK)_DEP_FILES := $(DEP_FILES) | ||
|
||
$(eval $(call add_dbg_docker,$(DOCKER_SONIC_SDK),$(DOCKER_SONIC_SDK_DBG))) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# SONiC SDK Docker Image | ||
|
||
DOCKER_SONIC_SDK_STEM = sonic-sdk | ||
DOCKER_SONIC_SDK = $(DOCKER_SONIC_SDK_STEM).gz | ||
DOCKER_SONIC_SDK_DBG = $(DOCKER_SONIC_SDK_STEM)-$(DBG_IMAGE_MARK).gz | ||
|
||
$(DOCKER_SONIC_SDK)_PATH = $(DOCKERS_PATH)/docker-sonic-sdk | ||
|
||
$(DOCKER_SONIC_SDK)_DEPENDS += $(LIBSAIREDIS) \ | ||
$(LIBSAIMETADATA) | ||
$(DOCKER_SONIC_SDK)_LOAD_DOCKERS += $(DOCKER_CONFIG_ENGINE_BUSTER) | ||
|
||
$(DOCKER_SONIC_SDK)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_DEPENDS) \ | ||
$(LIBSAIREDIS_DBG) \ | ||
$(LIBSAIMETADATA_DBG) | ||
$(DOCKER_SONIC_SDK)_DBG_IMAGE_PACKAGES = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_IMAGE_PACKAGES) | ||
|
||
SONIC_DOCKER_IMAGES += $(DOCKER_SONIC_SDK) | ||
SONIC_DOCKER_DBG_IMAGES += $(DOCKER_SONIC_SDK_DBG) | ||
|
||
$(DOCKER_SONIC_SDK)_LABELS += com.azure.sonic.versions.libswsscommon=$(LIBSWSSCOMMON_VERSION) | ||
$(DOCKER_SONIC_SDK)_LABELS += com.azure.sonic.versions.libsairedis=$(LIBSAIREDIS_VERSION) | ||
|
||
$(DOCKER_SONIC_SDK)_FILES += $(SUPERVISOR_PROC_EXIT_LISTENER_SCRIPT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters