1
1
#! /bin/bash
2
- # Description: Script responsible for generation of an obf_src wheel using pyarmor package.
2
+ # Description: Script responsible for generation of an src wheel
3
3
4
4
# Setting the repo root for local build environment or CI.
5
5
[[ -z " ${WORKSPACE} " ]] && REPO_ROOT=' /tao-pt' || REPO_ROOT=" ${WORKSPACE} "
6
6
echo " Building from ${REPO_ROOT} "
7
7
8
- echo " Installing required packages"
9
- pip install pyarmor pyinstaller pybind11
10
- echo " Registering pyarmor"
11
- pyarmor register ${REPO_ROOT} /release/docker/pyarmor-regfile-1219.zip || exit $?
12
-
13
8
echo " Clearing build and dists"
14
9
python ${REPO_ROOT} /setup.py clean --all
15
10
rm -rf dist/*
@@ -20,25 +15,20 @@ find . | grep -E "(__pycache__|\.pyc|\.pyo$)" | xargs rm -rf
20
15
mkdir /dist
21
16
cp -r ${REPO_ROOT} /nvidia_tao_pytorch/* /dist/
22
17
23
- echo " Obfuscating the code using pyarmor"
24
- cd ${REPO_ROOT}
25
- python -c " from release.python.utils import encrypt_source_code; encrypt_source_code.encrypt_files('${REPO_ROOT} /nvidia_tao_pytorch')"
26
-
27
18
echo " Migrating codebase"
28
19
# Move sources to orig_src
29
20
rm -rf /orig_src
30
21
mkdir /orig_src
31
22
mv ${REPO_ROOT} /nvidia_tao_pytorch/* /orig_src/
32
23
33
- # Move obf_src files to src
24
+ # Move files to src
34
25
mv /dist/* ${REPO_ROOT} /nvidia_tao_pytorch/
35
- mv ${REPO_ROOT} /nvidia_tao_pytorch/pytransform_vax_001219 ${REPO_ROOT} /
36
26
37
27
echo " Building bdist wheel"
38
28
python setup.py bdist_wheel || exit $?
39
29
40
30
echo " Restoring the original project structure"
41
- # Move the obf_src files.
31
+ # Move the files.
42
32
rm -rf ${REPO_ROOT} /nvidia_tao_pytorch/*
43
33
44
34
# Move back the original files
@@ -47,5 +37,3 @@ mv /orig_src/* ${REPO_ROOT}/nvidia_tao_pytorch/
47
37
# Remove the tmp folders.
48
38
rm -rf /dist
49
39
rm -rf /orig_src
50
- rm -rf /obf_src
51
- rm -rf ${REPO_ROOT} /pytransform_vax_001219
0 commit comments