-
Notifications
You must be signed in to change notification settings - Fork 545
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into vxlan-fixes
- Loading branch information
Showing
4 changed files
with
157 additions
and
0 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,92 @@ | ||
ARG DEBIAN_VERSION="bookworm" | ||
FROM sonicdev-microsoft.azurecr.io:443/sonic-slave-${DEBIAN_VERSION}:latest | ||
|
||
ARG UID=1000 | ||
ARG GID=1000 | ||
|
||
RUN groupadd -g ${GID} sonicdev && \ | ||
useradd -u ${UID} -g ${GID} -ms /bin/bash sonicdev | ||
|
||
RUN mkdir -p /workspace && \ | ||
mkdir -p /workspace/debs && \ | ||
mkdir -p /workspace/tools && \ | ||
chown -R sonicdev:sonicdev /workspace | ||
|
||
ENV PATH="${PATH}:/workspace/tools" | ||
|
||
RUN apt-get update && \ | ||
sudo apt-get install -y \ | ||
libhiredis-dev \ | ||
libzmq3-dev \ | ||
swig4.0 \ | ||
libdbus-1-dev \ | ||
libteam-dev \ | ||
protobuf-compiler \ | ||
libprotobuf-dev && \ | ||
sudo pip3 install lcov_cobertura | ||
|
||
COPY dev/download_artifact.sh /workspace/tools/download_artifact.sh | ||
|
||
WORKDIR /workspace/debs | ||
|
||
ARG BRANCH_NAME="master" | ||
ARG PLATFORM="amd64" | ||
ARG DEBIAN_VERSION | ||
|
||
# SWSS COMMON | ||
|
||
ARG SWSS_COMMON_PROJECT_NAME="Azure.sonic-swss-common" | ||
ARG SWSS_COMMON_ARTIFACT_NAME="sonic-swss-common" | ||
ARG SWSS_COMMON_FILE_PATHS="/libswsscommon_1.0.0_${PLATFORM}.deb /libswsscommon-dev_1.0.0_${PLATFORM}.deb" | ||
|
||
RUN download_artifact.sh "${SWSS_COMMON_PROJECT_NAME}" "${BRANCH_NAME}" "${SWSS_COMMON_ARTIFACT_NAME}" "${SWSS_COMMON_FILE_PATHS}" | ||
|
||
# SAIREDIS | ||
|
||
ARG SAIREDIS_PROJECT_NAME="Azure.sonic-sairedis" | ||
ARG SAIREDIS_ARTIFACT_NAME="sonic-sairedis" | ||
ARG SAIREDIS_FILE_PATHS="\ | ||
/libsaivs_1.0.0_${PLATFORM}.deb \ | ||
/libsaivs-dev_1.0.0_${PLATFORM}.deb \ | ||
/libsairedis_1.0.0_${PLATFORM}.deb \ | ||
/libsairedis-dev_1.0.0_${PLATFORM}.deb \ | ||
/libsaimetadata_1.0.0_${PLATFORM}.deb \ | ||
/libsaimetadata-dev_1.0.0_${PLATFORM}.deb \ | ||
/syncd-vs_1.0.0_${PLATFORM}.deb \ | ||
" | ||
RUN download_artifact.sh "${SAIREDIS_PROJECT_NAME}" "${BRANCH_NAME}" "${SAIREDIS_ARTIFACT_NAME}" "${SAIREDIS_FILE_PATHS}" | ||
|
||
# COMMON LIB | ||
|
||
ARG COMMON_LIB_PROJECT_NAME="Azure.sonic-buildimage.common_libs" | ||
ARG COMMON_LIB_ARTIFACT_NAME="common-lib" | ||
ARG COMMON_LIB_FILE_PATHS="\ | ||
/target/debs/${DEBIAN_VERSION}/libnl-3-200_3.7.0-0.2%2Bb1sonic1_${PLATFORM}.deb \ | ||
/target/debs/${DEBIAN_VERSION}/libnl-3-dev_3.7.0-0.2%2Bb1sonic1_${PLATFORM}.deb \ | ||
/target/debs/${DEBIAN_VERSION}/libnl-genl-3-200_3.7.0-0.2%2Bb1sonic1_${PLATFORM}.deb \ | ||
/target/debs/${DEBIAN_VERSION}/libnl-genl-3-dev_3.7.0-0.2%2Bb1sonic1_${PLATFORM}.deb \ | ||
/target/debs/${DEBIAN_VERSION}/libnl-route-3-200_3.7.0-0.2%2Bb1sonic1_${PLATFORM}.deb \ | ||
/target/debs/${DEBIAN_VERSION}/libnl-route-3-dev_3.7.0-0.2%2Bb1sonic1_${PLATFORM}.deb \ | ||
/target/debs/${DEBIAN_VERSION}/libnl-nf-3-200_3.7.0-0.2%2Bb1sonic1_${PLATFORM}.deb \ | ||
/target/debs/${DEBIAN_VERSION}/libnl-nf-3-dev_3.7.0-0.2%2Bb1sonic1_${PLATFORM}.deb \ | ||
/target/debs/${DEBIAN_VERSION}/libyang_1.0.73_${PLATFORM}.deb \ | ||
" | ||
RUN download_artifact.sh "${COMMON_LIB_PROJECT_NAME}" "${BRANCH_NAME}" "${COMMON_LIB_ARTIFACT_NAME}" "${COMMON_LIB_FILE_PATHS}" | ||
|
||
# DASH API | ||
|
||
ARG DASH_API_PROJECT_NAME="sonic-net.sonic-dash-api" | ||
ARG DASH_API_ARTIFACT_NAME="sonic-dash-api" | ||
ARG DASH_API_FILE_PATHS="/libdashapi_1.0.0_${PLATFORM}.deb" | ||
|
||
RUN download_artifact.sh "${DASH_API_PROJECT_NAME}" "${BRANCH_NAME}" "${DASH_API_ARTIFACT_NAME}" "${DASH_API_FILE_PATHS}" | ||
|
||
RUN dpkg -i *.deb | ||
|
||
WORKDIR /workspace | ||
|
||
USER sonicdev | ||
|
||
ENTRYPOINT [ "bash" ] |
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,18 @@ | ||
services: | ||
sonicdev: | ||
container_name: sonicdev | ||
build: | ||
context: .. | ||
dockerfile: dev/Dockerfile.yml | ||
args: | ||
- DEBIAN_VERSION | ||
- UID | ||
- GID | ||
- BRANCH_NAME | ||
- PLATFORM | ||
volumes: | ||
- ..:/workspace/sonic-swss | ||
init: true | ||
privileged: true | ||
working_dir: /workspace/sonic-swss | ||
|
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,46 @@ | ||
#!/bin/bash | ||
|
||
# download_artifact.sh <pipelineName> <branchName> <artifactName> <targetPaths> | ||
# | ||
# targetPaths: space separated list of target paths to download from the artifact | ||
# e.g. | ||
# ./download_artifact.sh "Azure.sonic-swss-common" "master" "sonic-swss-common" "/libswsscommon-dev_1.0.0_amd64.deb /libswsscommon_1.0.0_amd64.deb" | ||
|
||
set -x -e | ||
|
||
pipelineName=${1} | ||
branchName=${2} | ||
artifactName=${3} | ||
targetPaths=${4} | ||
|
||
queryPipelinesUrl="https://dev.azure.com/mssonic/build/_apis/pipelines" | ||
|
||
definitions=$(curl -s "${queryPipelinesUrl}" | jq -r ".value[] | select (.name == \"${pipelineName}\").id") | ||
|
||
queryBuildsUrl="https://dev.azure.com/mssonic/build/_apis/build/builds?definitions=${definitions}&branchName=refs/heads/${branchName}&resultFilter=succeeded&statusFilter=completed&api-version=6.0" | ||
|
||
buildId=$(curl -s ${queryBuildsUrl} | jq -r '.value[0].id') | ||
|
||
queryArtifactUrl="https://dev.azure.com/mssonic/build/_apis/build/builds/${buildId}/artifacts?artifactName=${artifactName}&api-version=6.0" | ||
|
||
function download_artifact { | ||
|
||
target_path=${1} | ||
output_file=$(sed 's/.*\///' <<< ${target_path}) | ||
|
||
download_artifact_url=$(curl -s ${queryArtifactUrl} | jq -r '.resource.downloadUrl') | ||
download_artifact_url=$(sed 's/zip$/file/' <<< ${download_artifact_url}) | ||
download_artifact_url="$download_artifact_url&subPath=${target_path}" | ||
|
||
wget -O ${output_file} ${download_artifact_url} | ||
} | ||
|
||
function download_artifacts { | ||
target_paths_array=(${targetPaths}) | ||
for target_path in "${target_paths_array[@]}" | ||
do | ||
download_artifact ${target_path} | ||
done | ||
} | ||
|
||
download_artifacts |