Skip to content

Commit

Permalink
[sonic-utilities] Build as Python wheel instead of Debian package (so…
Browse files Browse the repository at this point in the history
…nic-net#160)

Build sonic-utilities as a Python wheel instead of a Debian package to support sonic-net/sonic-utilities#1122
  • Loading branch information
jleveque committed Sep 19, 2020
1 parent 39b28b6 commit 8f5eee1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions jenkins/common/sonic-utilities-build-pr/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@ pipeline {
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'sonic-utilities/deb_dist/sonic-utilities-1.2/htmlcov',
reportDir: 'sonic-utilities/htmlcov',
reportFiles: 'index.html',
reportName: 'RCov Report'
])

publishCoverage(adapters: [
coberturaAdapter('sonic-utilities/deb_dist/sonic-utilities-1.2/coverage.xml')
coberturaAdapter('sonic-utilities/coverage.xml')
])
}

success {
archiveArtifacts(artifacts: 'sonic-utilities/deb_dist/python-sonic-utilities_1.2-1_all.deb,wheels/sonic_config_engine-1.0-py2-none-any.whl,wheels/swsssdk-2.0.1-py2-none-any.whl,wheels/sonic_py_common-1.0-py2-none-any.whl,wheels/sonic_py_common-1.0-py3-none-any.whl, sonic-swss-tests/tests/log/**')
archiveArtifacts(artifacts: 'sonic-utilities/dist/sonic_utilities-1.2-py2-none-any.whl,wheels/sonic_config_engine-1.0-py2-none-any.whl,wheels/swsssdk-2.0.1-py2-none-any.whl,wheels/sonic_py_common-1.0-py2-none-any.whl,wheels/sonic_py_common-1.0-py3-none-any.whl, sonic-swss-tests/tests/log/**')
}

cleanup {
Expand Down
6 changes: 3 additions & 3 deletions jenkins/common/sonic-utilities-build/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,18 +56,18 @@ pipeline {
allowMissing: false,
alwaysLinkToLastBuild: false,
keepAll: true,
reportDir: 'sonic-utilities/deb_dist/sonic-utilities-1.2/htmlcov',
reportDir: 'sonic-utilities/htmlcov',
reportFiles: 'index.html',
reportName: 'RCov Report'
])

publishCoverage(adapters: [
coberturaAdapter('sonic-utilities/deb_dist/sonic-utilities-1.2/coverage.xml')
coberturaAdapter('sonic-utilities/coverage.xml')
])
}

success {
archiveArtifacts(artifacts: 'sonic-utilities/deb_dist/python-sonic-utilities_1.2-1_all.deb,wheels/sonic_config_engine-1.0-py2-none-any.whl,wheels/swsssdk-2.0.1-py2-none-any.whl,wheels/sonic_py_common-1.0-py2-none-any.whl,wheels/sonic_py_common-1.0-py3-none-any.whl, sonic-swss-tests/tests/log/**')
archiveArtifacts(artifacts: 'sonic-utilities/dist/sonic_utilities-1.2-py2-none-any.whl,wheels/sonic_config_engine-1.0-py2-none-any.whl,wheels/swsssdk-2.0.1-py2-none-any.whl,wheels/sonic_py_common-1.0-py2-none-any.whl,wheels/sonic_py_common-1.0-py3-none-any.whl, sonic-swss-tests/tests/log/**')
}

fixed {
Expand Down
6 changes: 3 additions & 3 deletions scripts/common/sonic-utilities-build/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ sudo dpkg -i buildimage/target/debs/buster/python2-yang_1.0.73_amd64.deb
cd sonic-utilities
# Test building the Debian package
sudo python setup.py --command-packages=stdeb.command bdist_deb
# Test building the Python wheel
sudo python setup.py bdist_wheel
EOF

Expand All @@ -43,7 +43,7 @@ docker login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWD sonicdev-microsoft.azurec
docker pull sonicdev-microsoft.azurecr.io:443/sonic-slave-buster-johnar:latest
docker run --rm=true --privileged -v $(pwd):/sonic -w /sonic -i sonicdev-microsoft.azurecr.io:443/sonic-slave-buster-johnar ./build_sonic_utilities.sh

cp sonic-utilities/deb_dist/python-sonic-utilities_*.deb buildimage/target/python-debs/
cp sonic-utilities/dist/sonic_utilities-*.whl buildimage/target/python-wheels/

cd sairedis
cp *.deb ../buildimage/target/debs/buster/
Expand Down

0 comments on commit 8f5eee1

Please sign in to comment.