Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
281 commits
Select commit Hold shift + click to select a range
190c4a4
for test
chensuyue Aug 7, 2022
b9822a0
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 7, 2022
5c83569
test
chensuyue Aug 7, 2022
eade719
print env
chensuyue Aug 7, 2022
5bd154a
update
chensuyue Aug 7, 2022
6ee7533
remove image
chensuyue Aug 7, 2022
9deaefd
test for python
chensuyue Aug 8, 2022
a906f46
test for python
chensuyue Aug 8, 2022
bcb42e5
test for python
chensuyue Aug 8, 2022
6fc988a
bug fix
chensuyue Aug 8, 2022
40924ed
test
chensuyue Aug 8, 2022
d24f9a1
test
chensuyue Aug 8, 2022
65c516f
Update Dockerfile.devel
VincyZhang Aug 8, 2022
4d67f95
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 8, 2022
f68fd52
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 8, 2022
4d83173
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 8, 2022
49d6585
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 8, 2022
6afaaa7
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 8, 2022
16eca55
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 8, 2022
5bcb46e
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 8, 2022
660aa6f
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 8, 2022
8fdacae
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 8, 2022
00f155e
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 8, 2022
0bb62c7
Update Dockerfile.devel
VincyZhang Aug 8, 2022
2599a35
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 8, 2022
4d981d3
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 8, 2022
9f4c5a2
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 8, 2022
40336db
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 8, 2022
c663af8
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 8, 2022
a7b7717
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 8, 2022
fae699f
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 8, 2022
a999df5
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 8, 2022
add65e4
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 9, 2022
00c5a1e
Rename azure-pipelines-1.yml to azure-pipelines-wenxin.yml
VincyZhang Aug 9, 2022
d0ecc8a
Update azure-pipelines-wenxin.yml for Azure Pipelines
VincyZhang Aug 9, 2022
5cebcdc
Merge branch 'master' into wenxin-test
sys-lpot-val Aug 9, 2022
a7a60a9
Update azure-pipelines-1.yml for Azure Pipelines
VincyZhang Aug 8, 2022
c467c3b
Update and rename azure-pipelines-wenxin.yml to .azure-pipelines/azur…
VincyZhang Aug 9, 2022
e739875
Update Dockerfile.devel
VincyZhang Aug 9, 2022
834f862
Merge pull request #2 from VincyZhang/wenxin-test
chensuyue Aug 9, 2022
92111ef
update dockerfile name
chensuyue Aug 9, 2022
ce20191
Update azure-pipelines-demo.yml for Azure Pipelines
VincyZhang Aug 9, 2022
f0f27c9
Update azure-pipelines-demo.yml
VincyZhang Aug 9, 2022
7731af8
Merge pull request #11 from VincyZhang/wenxin-test
VincyZhang Aug 9, 2022
123e210
Update README.md
VincyZhang Aug 9, 2022
13ed112
resolve conflict
chensuyue Aug 9, 2022
368cd03
resolve conflict
chensuyue Aug 9, 2022
1dfd032
Merge branch 'master' into azure/ut-update
chensuyue Aug 9, 2022
054ef05
update ut test
chensuyue Aug 9, 2022
94ae9f2
for test
chensuyue Aug 9, 2022
085576c
fix bug
chensuyue Aug 9, 2022
7be4c4c
bug fix
chensuyue Aug 9, 2022
17fded4
test
chensuyue Aug 9, 2022
9482fe7
test 1
chensuyue Aug 9, 2022
9827f74
bug fix
chensuyue Aug 9, 2022
1cc8d7c
add log_dir
chensuyue Aug 9, 2022
2eacf82
for test
chensuyue Aug 9, 2022
a98444d
fix bug
chensuyue Aug 9, 2022
f103ee7
fix bug
chensuyue Aug 9, 2022
0402808
update basic ut
chensuyue Aug 9, 2022
088bdf6
add all ut test
chensuyue Aug 9, 2022
da6045c
log dir path fix
chensuyue Aug 9, 2022
5bd9b4b
fix env setup
chensuyue Aug 9, 2022
8b29c38
fix env setup
chensuyue Aug 9, 2022
4fa530e
fix bug
chensuyue Aug 9, 2022
a96019e
test only, revert before merge
chensuyue Aug 9, 2022
c05cb2e
bug fix
chensuyue Aug 9, 2022
3456241
bug fix
chensuyue Aug 10, 2022
c7dac3a
echo version
chensuyue Aug 10, 2022
9bf5305
update mxnet install
chensuyue Aug 10, 2022
dbe816f
Merge pull request #14 from VincyZhang/azure/ut-update
chensuyue Aug 10, 2022
4772070
code-scan
WenjiaoYue Aug 10, 2022
0f1b9a9
test
WenjiaoYue Aug 10, 2022
a07836f
Merge pull request #15 from VincyZhang/code-scan
chensuyue Aug 10, 2022
370e449
test
WenjiaoYue Aug 10, 2022
db2c237
test
WenjiaoYue Aug 10, 2022
3c008bc
test
WenjiaoYue Aug 10, 2022
e19db8f
test
WenjiaoYue Aug 10, 2022
322f847
test
WenjiaoYue Aug 10, 2022
9bfc38a
test
WenjiaoYue Aug 10, 2022
574c5aa
test
WenjiaoYue Aug 10, 2022
105427f
test
WenjiaoYue Aug 10, 2022
56256ac
test
WenjiaoYue Aug 10, 2022
60a5cfc
test
WenjiaoYue Aug 10, 2022
173e8aa
test
WenjiaoYue Aug 10, 2022
b504de8
tst
WenjiaoYue Aug 10, 2022
40a375d
test
WenjiaoYue Aug 10, 2022
08b4897
test
WenjiaoYue Aug 10, 2022
2389bb5
test
WenjiaoYue Aug 10, 2022
8fcd649
clean up
sys-lpot-val Aug 10, 2022
df6b7b1
clean up
sys-lpot-val Aug 10, 2022
1a1533a
test
WenjiaoYue Aug 10, 2022
39dfeaa
test
WenjiaoYue Aug 10, 2022
de4a174
clean up
sys-lpot-val Aug 10, 2022
2236cba
Update azure-pipelines-demo.yml
VincyZhang Aug 9, 2022
fc59acc
test
XuehaoSun Aug 10, 2022
e35b1ec
test
XuehaoSun Aug 10, 2022
a963a27
test
WenjiaoYue Aug 10, 2022
bdf038c
Merge branch 'code-scan' of https://github.com/VincyZhang/neural-comp…
WenjiaoYue Aug 10, 2022
438766e
test
WenjiaoYue Aug 10, 2022
201f47c
test
WenjiaoYue Aug 10, 2022
757fe09
Update code-scan.yml for Azure Pipelines
WenjiaoYue Aug 10, 2022
7cc9237
test
WenjiaoYue Aug 10, 2022
2e0719b
test
WenjiaoYue Aug 10, 2022
25080a2
test
WenjiaoYue Aug 10, 2022
a6433e9
test
WenjiaoYue Aug 10, 2022
65d1234
test
WenjiaoYue Aug 10, 2022
5cdcae6
test
WenjiaoYue Aug 10, 2022
d1bafbc
test
WenjiaoYue Aug 10, 2022
684c3b1
test
WenjiaoYue Aug 10, 2022
7ba4170
test
WenjiaoYue Aug 10, 2022
8575064
test
WenjiaoYue Aug 10, 2022
7f77735
test
WenjiaoYue Aug 10, 2022
26f4574
test
WenjiaoYue Aug 10, 2022
225a7da
test
WenjiaoYue Aug 10, 2022
c9f2025
Suyue/ut update (#16)
chensuyue Aug 10, 2022
ca415ed
test
WenjiaoYue Aug 10, 2022
c9e18ed
test
WenjiaoYue Aug 10, 2022
2f812bf
test
WenjiaoYue Aug 10, 2022
a502689
test
WenjiaoYue Aug 10, 2022
a55b04e
test
WenjiaoYue Aug 10, 2022
9eecf6f
test
WenjiaoYue Aug 10, 2022
114b5cc
test
WenjiaoYue Aug 10, 2022
a76aaf1
test
WenjiaoYue Aug 11, 2022
7fa4d17
test
WenjiaoYue Aug 11, 2022
b5d73fa
test
WenjiaoYue Aug 11, 2022
c699b44
test
WenjiaoYue Aug 11, 2022
490fa17
test
WenjiaoYue Aug 11, 2022
4fa133a
test
WenjiaoYue Aug 11, 2022
170023b
test
WenjiaoYue Aug 11, 2022
1034162
test
WenjiaoYue Aug 11, 2022
c547205
test
WenjiaoYue Aug 11, 2022
5e8475f
test
WenjiaoYue Aug 11, 2022
9315654
test
WenjiaoYue Aug 11, 2022
e166732
test
WenjiaoYue Aug 11, 2022
55d7b9e
Update code-scan.yml for Azure Pipelines
WenjiaoYue Aug 11, 2022
6d6ae6d
test
WenjiaoYue Aug 11, 2022
00036d6
Merge branch 'code-scan' of https://github.com/VincyZhang/neural-comp…
WenjiaoYue Aug 11, 2022
80fa329
test
WenjiaoYue Aug 11, 2022
007bf73
test
WenjiaoYue Aug 11, 2022
c537216
test
WenjiaoYue Aug 11, 2022
177004b
test
WenjiaoYue Aug 11, 2022
b879d4c
test
WenjiaoYue Aug 11, 2022
d56cda0
test
WenjiaoYue Aug 11, 2022
a073dfa
test
WenjiaoYue Aug 11, 2022
fa138a3
test
WenjiaoYue Aug 11, 2022
116423f
test
WenjiaoYue Aug 11, 2022
fe1af55
test
WenjiaoYue Aug 11, 2022
0ee8c64
test
WenjiaoYue Aug 11, 2022
17465d2
test
WenjiaoYue Aug 11, 2022
356ce80
test
WenjiaoYue Aug 11, 2022
3552039
test
WenjiaoYue Aug 11, 2022
3ee9be7
test
WenjiaoYue Aug 11, 2022
335331d
test
WenjiaoYue Aug 11, 2022
ad0fa29
test
WenjiaoYue Aug 11, 2022
a6231d5
test
WenjiaoYue Aug 11, 2022
0bce4fa
test
WenjiaoYue Aug 11, 2022
c94b138
test
WenjiaoYue Aug 11, 2022
0bbb2cc
test
WenjiaoYue Aug 11, 2022
999cfb4
test
WenjiaoYue Aug 11, 2022
03a6a7a
test
WenjiaoYue Aug 11, 2022
9e1f33c
test
WenjiaoYue Aug 11, 2022
b92845a
test
WenjiaoYue Aug 11, 2022
42dc109
test
WenjiaoYue Aug 11, 2022
ad64b2b
test
WenjiaoYue Aug 11, 2022
b609ee9
test
WenjiaoYue Aug 11, 2022
7c61991
test
WenjiaoYue Aug 11, 2022
ffab298
test
WenjiaoYue Aug 11, 2022
4b78d1b
test
WenjiaoYue Aug 11, 2022
79a116e
test
WenjiaoYue Aug 11, 2022
590caa4
test
WenjiaoYue Aug 11, 2022
412a86f
test
WenjiaoYue Aug 11, 2022
9a176fe
test
WenjiaoYue Aug 11, 2022
7bf4c36
test
WenjiaoYue Aug 11, 2022
718df03
test
WenjiaoYue Aug 11, 2022
5145e8e
test
WenjiaoYue Aug 11, 2022
b17c512
Update code-scan.yml for Azure Pipelines
WenjiaoYue Aug 11, 2022
d3eda07
test
WenjiaoYue Aug 11, 2022
65d121d
test
WenjiaoYue Aug 11, 2022
e0a5a8b
test
WenjiaoYue Aug 11, 2022
f0791be
test
WenjiaoYue Aug 11, 2022
39d864b
test
WenjiaoYue Aug 11, 2022
25d90a6
test
WenjiaoYue Aug 11, 2022
a470292
test
WenjiaoYue Aug 11, 2022
7043b98
test
WenjiaoYue Aug 11, 2022
e886f5a
test
WenjiaoYue Aug 11, 2022
d880175
test
WenjiaoYue Aug 11, 2022
a8a1e6b
test
WenjiaoYue Aug 11, 2022
7e68f21
test
WenjiaoYue Aug 11, 2022
634aaa8
test
WenjiaoYue Aug 11, 2022
048bd7f
test
WenjiaoYue Aug 11, 2022
b797578
test
WenjiaoYue Aug 11, 2022
16077c3
test
WenjiaoYue Aug 11, 2022
7013b49
test
WenjiaoYue Aug 11, 2022
a00566f
test
WenjiaoYue Aug 11, 2022
e3fbdcd
test
WenjiaoYue Aug 11, 2022
cca691e
test
WenjiaoYue Aug 11, 2022
1449e9b
test
WenjiaoYue Aug 11, 2022
0f84a66
test
WenjiaoYue Aug 11, 2022
25dfade
for test
chensuyue Aug 11, 2022
6cef4bc
fix
chensuyue Aug 11, 2022
ecc62a5
debug
chensuyue Aug 11, 2022
9bd14f0
test
chensuyue Aug 11, 2022
242a54e
test
WenjiaoYue Aug 12, 2022
e304eda
copyright test
WenjiaoYue Aug 12, 2022
a4efa3e
test
WenjiaoYue Aug 12, 2022
426130d
Merge branch 'code-scan' of https://github.com/VincyZhang/neural-comp…
WenjiaoYue Aug 12, 2022
1c46a43
test
WenjiaoYue Aug 12, 2022
fc7b05e
test
WenjiaoYue Aug 12, 2022
4b94255
test
WenjiaoYue Aug 12, 2022
3a36f27
Update code-scan.yml for Azure Pipelines
WenjiaoYue Aug 12, 2022
f51756f
test
WenjiaoYue Aug 12, 2022
b8a68b7
test
WenjiaoYue Aug 12, 2022
864dcca
test
WenjiaoYue Aug 12, 2022
dccc7ad
TEST
WenjiaoYue Aug 12, 2022
7bb6ee7
test
WenjiaoYue Aug 12, 2022
fbb3faf
test
WenjiaoYue Aug 12, 2022
08f6853
test
WenjiaoYue Aug 12, 2022
fa4e279
test
WenjiaoYue Aug 12, 2022
88d746b
test
WenjiaoYue Aug 12, 2022
3893684
test
WenjiaoYue Aug 12, 2022
fb3583a
test
WenjiaoYue Aug 12, 2022
1aec85c
test
WenjiaoYue Aug 12, 2022
1700de4
test
WenjiaoYue Aug 12, 2022
37827db
test
WenjiaoYue Aug 12, 2022
34e50d8
test
WenjiaoYue Aug 12, 2022
bc4a783
test
WenjiaoYue Aug 12, 2022
eaec1bd
test
WenjiaoYue Aug 12, 2022
7fa9242
test
WenjiaoYue Aug 12, 2022
a4a952f
test
WenjiaoYue Aug 12, 2022
cdca6de
test
WenjiaoYue Aug 12, 2022
6cbb390
test
WenjiaoYue Aug 12, 2022
5ae14a9
test
WenjiaoYue Aug 12, 2022
e739aef
test
WenjiaoYue Aug 12, 2022
3da4e4f
test
WenjiaoYue Aug 12, 2022
6de9c51
test
WenjiaoYue Aug 12, 2022
9eb8b2f
test
WenjiaoYue Aug 12, 2022
c21efdf
test
WenjiaoYue Aug 12, 2022
87cf104
test
WenjiaoYue Aug 12, 2022
17f299e
test
WenjiaoYue Aug 12, 2022
ed8700b
test
WenjiaoYue Aug 12, 2022
37279fc
test
WenjiaoYue Aug 12, 2022
d56968d
test
WenjiaoYue Aug 12, 2022
5e74788
test
WenjiaoYue Aug 12, 2022
90ff87f
test
WenjiaoYue Aug 12, 2022
3b81d2c
test
WenjiaoYue Aug 12, 2022
86cd3fb
test
WenjiaoYue Aug 12, 2022
b7ede92
Merge pull request #19 from VincyZhang/code-scan
WenjiaoYue Aug 12, 2022
a148e8b
change ut structure and try coverage combine
VincyZhang Aug 15, 2022
b09b3d8
modity
VincyZhang Aug 17, 2022
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
51 changes: 51 additions & 0 deletions .azure-pipelines/azure-pipelines-demo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Starter pipeline
# Start with a minimal pipeline that you can customize to build and deploy your code.
# Add steps that build, run tests, deploy, and more:
# https://aka.ms/yaml

trigger: none
pr:
- wenxin-test

pool: docker-agent

variables:
IMAGE_NAME: 'neural-compressor'
IMAGE_TAG: 'py38'

stages:
- stage: Build
displayName: Build and push stage
jobs:
- job: Build
displayName: Build
steps:
- script: |
echo ${BUILD_SOURCESDIRECTORY}
sudo rm -fr ${BUILD_SOURCESDIRECTORY} || true
displayName: 'Clean workspace'

- checkout: self
displayName: "Checkout out Repo"

- script: |
if [[ ! $(docker images | grep -i ${IMAGE_NAME}) ]]; then
docker build -f ${BUILD_SOURCESDIRECTORY}/.azure-pipelines/docker/Dockerfile.devel -t ${IMAGE_NAME}:${IMAGE_TAG} .
fi
docker images | grep -i ${IMAGE_NAME}
if [[ $? -ne 0 ]]; then
echo "NO Such Image ${IMAGE_NAME}"
exit 1
fi
displayName: "Build Devel Images"

- script: |
docker stop $(docker ps -aq)
docker rm -vf $(docker ps -aq) || true
displayName: 'Clean Docker'

- script: |
docker run --disable-content-trust --privileged --name="pr" --hostname="pr-host" -v ${BUILD_SOURCESDIRECTORY}:/neural_compressor ${IMAGE_NAME}:${IMAGE_TAG} /bin/bash +x -c "cd /neural_compressor && python -m pip install --no-cache-dir -r requirements.txt && python setup.py sdist bdist_wheel && pip install dist/neural_compressor-*.whl && pip list && pip install intel-tensorflow && python test/strategy/test_bayesian.py"
displayName: 'Build Binary and Run UT'


210 changes: 210 additions & 0 deletions .azure-pipelines/code-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
trigger: none
pr:
- master
pool: suyue-test

variables:
IMAGE_NAME: "code-scan"
IMAGE_TAG: "1.0"
CODE_SCAN_PATH: ".azure-pipelines/scripts/codeScan"
CODE_SCAN_LOG_PATH: ".azure-pipelines/scripts/codeScan/scanLog"
CURRENT_PATH: $(Build.SourcesDirectory)
CURRENT_STATUS: true
ER: "1212"

stages:
- stage: BanditCodeScan
displayName: Bandit Code Scan
dependsOn: []
jobs:
- job: Bandit
displayName: Bandit
condition: eq(variables['CURRENT_STATUS'], 'true')
steps:
- script: |
echo ${BUILD_SOURCESDIRECTORY}
sudo rm -fr ${BUILD_SOURCESDIRECTORY} || true
echo y | docker system prune
displayName: "Clean workspace"
- checkout: self
displayName: "Checkout out Repo"
- script: |
if [[ ! $(docker images | grep -i ${IMAGE_NAME}) ]]; then
docker build -f ${BUILD_SOURCESDIRECTORY}/.azure-pipelines/docker/Dockerfile.devel -t ${IMAGE_NAME}:${IMAGE_TAG} .
fi
docker images | grep -i ${IMAGE_NAME}
if [[ $? -ne 0 ]]; then
echo "NO Such Image ${IMAGE_NAME}"
exit 1
fi
displayName: "Build Devel Images"
- script: |
docker stop $(docker ps -aq)
docker rm -vf $(docker ps -aq) || true
displayName: "Clean Docker"

- task: Bash@3
inputs:
targetType: "inline"
script: |
docker run --disable-content-trust --privileged --name="bandit" -v ${BUILD_SOURCESDIRECTORY}:/neural-compressor ${IMAGE_NAME}:${IMAGE_TAG} bash /neural-compressor/$(CODE_SCAN_PATH)/bandit/bandit.sh $(CURRENT_STATUS)
echo "------$(CURRENT_STATUS)-------"
echo $(CURRENT_STATUS)

echo "---$(ER)----$(QR)------"
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(CURRENT_PATH)/$(CODE_SCAN_LOG_PATH)/lpot-bandit.log
artifact: bandit
publishLocation: "pipeline"

# - script: |
# if [ $(CURRENT_STATUS) -ne 0 ] ; then
# exit 1
# fi
# exit 0



# - stage: PylintCodeScan
# displayName: Pylint Code Scan
# dependsOn: []
# jobs:
# - job: Pylint
# displayName: Pylint
# steps:
# - script: |
# if [ $(CURRENT_STATUS) -ne 0 ] ; then
# exit 1
# fi
# exit 0
# - script: |
# echo ${BUILD_SOURCESDIRECTORY}
# sudo rm -fr ${BUILD_SOURCESDIRECTORY} || true
# echo y | docker system prune
# displayName: "Clean workspace"
# - checkout: self
# displayName: "Checkout out Repo"
# - script: |
# if [[ ! $(docker images | grep -i ${IMAGE_NAME}) ]]; then
# docker build -f ${BUILD_SOURCESDIRECTORY}/.azure-pipelines/docker/Dockerfile.devel -t ${IMAGE_NAME}:${IMAGE_TAG} .
# fi
# docker images | grep -i ${IMAGE_NAME}
# if [[ $? -ne 0 ]]; then
# echo "NO Such Image ${IMAGE_NAME}"
# exit 1
# fi
# displayName: "Build Devel Images"
# - script: |
# docker stop $(docker ps -aq)
# docker rm -vf $(docker ps -aq) || true
# displayName: "Clean Docker"

# - task: Bash@3
# inputs:
# targetType: "inline"
# script: |
# docker run --disable-content-trust --privileged --name="pylint" -v ${BUILD_SOURCESDIRECTORY}:/neural-compressor ${IMAGE_NAME}:${IMAGE_TAG} bash /neural-compressor/$(CODE_SCAN_PATH)/pylint/pylint.sh

# - task: PublishPipelineArtifact@1
# inputs:
# targetPath: $(CURRENT_PATH)/$(CODE_SCAN_LOG_PATH)/lpot-pylint.json
# artifact: pylint
# publishLocation: "pipeline"

# - script: |
# if [ $(CURRENT_STATUS) -ne 0 ] ; then
# exit 1
# fi
# exit 0

# - stage: PyspellingCodeScan
# displayName: Pyspelling Code Scan
# dependsOn: []
# jobs:
# - job: Pyspelling
# displayName: Pyspelling
# steps:
# - script: |
# if [ $(CURRENT_STATUS) -ne 0 ] ; then
# exit 1
# fi
# exit 0
# - script: |
# echo ${BUILD_SOURCESDIRECTORY}
# sudo rm -fr ${BUILD_SOURCESDIRECTORY} || true
# echo y | docker system prune
# displayName: "Clean workspace"
# - checkout: self
# displayName: "Checkout out Repo"
# - script: |
# if [[ ! $(docker images | grep -i ${IMAGE_NAME}) ]]; then
# docker build -f ${BUILD_SOURCESDIRECTORY}/.azure-pipelines/docker/Dockerfile.devel -t ${IMAGE_NAME}:${IMAGE_TAG} .
# fi
# docker images | grep -i ${IMAGE_NAME}
# if [[ $? -ne 0 ]]; then
# echo "NO Such Image ${IMAGE_NAME}"
# exit 1
# fi
# displayName: "Build Devel Images"
# - script: |
# docker stop $(docker ps -aq)
# docker rm -vf $(docker ps -aq) || true
# displayName: "Clean Docker"

# - task: Bash@3
# inputs:
# targetType: "inline"
# script: |
# docker run --disable-content-trust --privileged --name="pyspelling" -v ${BUILD_SOURCESDIRECTORY}:/neural-compressor ${IMAGE_NAME}:${IMAGE_TAG} bash /neural-compressor/$(CODE_SCAN_PATH)/pyspelling/pyspelling.sh

# - task: PublishPipelineArtifact@1
# inputs:
# targetPath: $(CURRENT_PATH)/$(CODE_SCAN_LOG_PATH)/lpot_pyspelling.log
# artifact: pyspelling
# publishLocation: "pipeline"

# - stage: CopyRight
# displayName: CopyRight Code Scan
# dependsOn: []
# jobs:
# - job: CopyRight
# displayName: CopyRight
# steps:
# - task: Bash@3
# inputs:
# targetType: "inline"
# script: |
# set -ex
# supported_extensions=(py, sh, yaml)

# git --no-pager diff --name-only $(git show-ref -s remotes/origin/$(System.PullRequest.TargetBranch)) $(CURRENT_PATH)/neural_compressor > $(CURRENT_PATH)/$(CODE_SCAN_LOG_PATH)/diff.log
# files=$(cat $(CURRENT_PATH)/$(CODE_SCAN_LOG_PATH)/diff.log | awk '!a[$0]++')

# for file in ${files}
# do
# if [[ "${supported_extensions[@]}" =~ "${file##*.}" ]]; then
# echo "Checking license in 1 ${file}"
# if [ $(grep -E -c "Copyright \\(c\\) ([0-9]{4})(-[0-9]{4})? Intel Corporation" ${file}) = 0 ]; then
# echo ${file} >> $(CURRENT_PATH)/$(CODE_SCAN_LOG_PATH)/copyright_issue_summary.log
# fi
# else
# echo "Skipping ${file}"
# fi
# done

# - task: PublishPipelineArtifact@1
# inputs:
# targetPath: $(CURRENT_PATH)/$(CODE_SCAN_LOG_PATH)/copyright_issue_summary.log
# artifact: copyright
# publishLocation: "pipeline"

# - task: Bash@3
# inputs:
# targetType: "inline"
# script: |
# ls $(CURRENT_PATH)/$(CODE_SCAN_LOG_PATH)/copyright_issue_summary.log
# if [ $? -eq 0 ] ; then
# echo "------------------Check <copyright_issue_summary.log> for wrong file list !!!!!!!!!!!!!!!!!!!!!!!"; exit 1
# fi
# exit 0
43 changes: 43 additions & 0 deletions .azure-pipelines/docker/Dockerfile.devel
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#
# Copyright (c) 2022 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
ARG UBUNTU_VER=20.04
FROM ubuntu:${UBUNTU_VER} as devel

# See http://bugs.python.org/issue19846
ENV LANG C.UTF-8

RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
python3 \
python3-pip \
python3-dev \
python3-distutils \
autoconf \
build-essential \
git \
libgl1-mesa-glx \
libglib2.0-0 \
numactl \
time \
wget

RUN ln -sf $(which python3) /usr/bin/python

RUN python -m pip --no-cache-dir install --upgrade pip
RUN python -m pip install --no-cache-dir setuptools

RUN pip list

WORKDIR /

53 changes: 53 additions & 0 deletions .azure-pipelines/docker/DockerfileWithNC.devel
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#
# Copyright (c) 2022 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

ARG UBUNTU_VER=20.04
FROM ubuntu:${UBUNTU_VER} as devel

# See http://bugs.python.org/issue19846
ENV LANG C.UTF-8

ARG REPO=x
ARG TARGET_BRANCH=y
ARG SOURCE_BRANCH=z
ARG DEBIAN_FRONTEND=noninteractive

RUN apt-get update && apt-get install -y --no-install-recommends --fix-missing \
python3 \
python3-pip \
python3-dev \
python3-distutils \
autoconf \
build-essential \
git \
libgl1-mesa-glx \
libglib2.0-0

RUN ln -sf $(which python3) /usr/bin/python

RUN python -m pip --no-cache-dir install --upgrade pip

RUN git clone --single-branch --branch=${SOURCE_BRANCH} ${REPO} neural-compressor && \
cd neural-compressor && \
python -m pip install --no-cache-dir setuptools && \
python -m pip install --no-cache-dir pycocotools && \
python -m pip install --no-cache-dir -r requirements.txt && \
python setup.py install

RUN pip list
RUN pip list | grep neural

WORKDIR /neural-compressor
RUN git rev-parse HEAD
16 changes: 16 additions & 0 deletions .azure-pipelines/scripts/codeScan/bandit/bandit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# set -ex
bandit_log_dir="/neural-compressor/.azure-pipelines/scripts/codeScan/scanLog"
pip install bandit

python -m bandit -r -lll -iii /neural-compressor/neural_compressor > $bandit_log_dir/lpot-bandit.log

exit_code=$?
if [ ${exit_code} -eq 0 ] ; then
sed -i "s|CURRENT_STATUS\: true|CURRENT_STATUS\: false|g" /neural-compressor/azure-pipelines.yml
sed -i "s|ER|QR|g" /neural-compressor/azure-pipelines.yml

# sed -i 's/CURRENT_STATUS:.*$/CURRENT_STATUS: false' /neural-compressor/azure-pipelines.yml
echo "Bandit exited with non-zero exit code."; exit 1
fi
exit 0

Loading