Skip to content

Commit

Permalink
[test]: Use docker-sonic-vs as the base instead of docker-config-engi…
Browse files Browse the repository at this point in the history
…ne (#49)

Signed-off-by: Shu0T1an ChenG <[email protected]>
  • Loading branch information
stcheng authored Jul 25, 2019
1 parent 28851e9 commit 3541a33
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 18 deletions.
2 changes: 1 addition & 1 deletion jenkins/vs/sonic-swss-build-pr/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pipeline {
copyArtifacts(projectName: 'sonic-sairedis-build', filter: '**/*.deb', target: 'sairedis', flatten: true)
copyArtifacts(projectName: 'common/sonic-swss-common-build', filter: '**/*.deb', target: 'common', flatten: true)
copyArtifacts(projectName: 'common/sonic-utilities-build', filter: '**/*.deb', target: 'utilities', flatten: true)
copyArtifacts(projectName: 'buildimage-vs-all', filter: '**/*', target: 'buildimage', flatten: false)
copyArtifacts(projectName: 'buildimage-vs-all', filter: '**/*.deb,**/docker-sonic-vs.gz', target: 'buildimage', flatten: false)
}
}

Expand Down
2 changes: 1 addition & 1 deletion jenkins/vs/sonic-swss-build/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pipeline {
copyArtifacts(projectName: 'sonic-sairedis-build', filter: '**/*.deb', target: 'sairedis', flatten: true)
copyArtifacts(projectName: 'common/sonic-swss-common-build', filter: '**/*.deb', target: 'common', flatten: true)
copyArtifacts(projectName: 'common/sonic-utilities-build', filter: '**/*.deb', target: 'utilities', flatten: true)
copyArtifacts(projectName: 'buildimage-vs-all', filter: '**/*', target: 'buildimage', flatten: false)
copyArtifacts(projectName: 'buildimage-vs-all', filter: '**/*.deb,**/docker-sonic-vs.gz', target: 'buildimage', flatten: false)
}
}

Expand Down
13 changes: 13 additions & 0 deletions scripts/vs/sonic-swss-build/docker-sonic-vs/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM docker-sonic-vs

ARG docker_container_name

ADD ["debs", "/debs"]
RUN dpkg -i /debs/libswsscommon_1.0.0_amd64.deb
RUN dpkg -i /debs/libsaimetadata_1.0.0_amd64.deb
RUN dpkg -i /debs/libsairedis_1.0.0_amd64.deb
RUN dpkg -i /debs/libsaivs_1.0.0_amd64.deb
RUN dpkg -i /debs/syncd-vs_1.0.0_amd64.deb
RUN dpkg -i /debs/swss_1.0.0_amd64.deb

ENTRYPOINT ["/usr/bin/supervisord"]
25 changes: 9 additions & 16 deletions scripts/vs/sonic-swss-build/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,19 @@ cleanup() {
sudo ip -all netns delete
}

cp *.deb buildimage/target/debs/stretch/
cp sairedis/*.deb buildimage/target/debs/stretch/
cp common/*.deb buildimage/target/debs/stretch/
cp utilities/*.deb buildimage/target/debs/stretch/
mkdir -p scripts/vs/sonic-swss-build/debs
cp *.deb scripts/vs/sonic-swss-build/debs
cp sairedis/*.deb scripts/vs/sonic-swss-build/debs
cp common/*.deb scripts/vs/sonic-swss-build/debs
cp utilities/*.deb scripts/vs/sonic-swss-build/debs

pushd buildimage/platform/vs
docker load < buildimage/target/docker-sonic-vs.gz

pushd scripts/vs/sonic-swss-build
mkdir -p docker-sonic-vs/debs
mkdir -p docker-sonic-vs/files
mkdir -p docker-sonic-vs/python-debs
mkdir -p docker-sonic-vs/python-wheels
sudo mount --bind ../../target/debs/stretch docker-sonic-vs/debs
sudo mount --bind ../../target/files/stretch docker-sonic-vs/files
sudo mount --bind ../../target/python-debs docker-sonic-vs/python-debs
sudo mount --bind ../../target/python-wheels docker-sonic-vs/python-wheels
docker load < ../../target/docker-config-engine-stretch.gz
sudo mount --bind debs docker-sonic-vs/debs
docker build --squash --no-cache -t docker-sonic-vs docker-sonic-vs
sudo umount docker-sonic-vs/debs
sudo umount docker-sonic-vs/files
sudo umount docker-sonic-vs/python-debs
sudo umount docker-sonic-vs/python-wheels
popd

docker save docker-sonic-vs | gzip -c > buildimage/target/docker-sonic-vs.gz
Expand Down

0 comments on commit 3541a33

Please sign in to comment.