Skip to content

Commit d38a95c

Browse files
authored
[CI]update build.sh (#10941)
* update build.sh * add proxy * update cache path * skip aistudio down for connection * fix
1 parent d74c950 commit d38a95c

File tree

6 files changed

+26
-14
lines changed

6 files changed

+26
-14
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,6 @@ jobs:
7272
else
7373
echo "local develop branch exist, skipping"
7474
fi
75-
76-
unset http_proxy && unset https_proxy
7775
'
7876
7977
- name: Setup Environment
@@ -84,6 +82,7 @@ jobs:
8482
set -e
8583
python -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
8684
python -m pip config set global.cache-dir "/home/.cache/pip"
85+
source $work_dir/../../../proxy
8786
python -m pip install --upgrade pip
8887
cd /workspace/PaddleNLP && git config --global --add safe.directory $PWD
8988
make install
@@ -93,6 +92,7 @@ jobs:
9392
run: |
9493
docker exec -t $container_name /bin/bash -c '
9594
set -e
95+
source $work_dir/../../../proxy
9696
cd /workspace/PaddleNLP
9797
make lint
9898
'

.github/workflows/unittest-cpu.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ env:
1111
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
1212
BRANCH: ${{ github.event.pull_request.base.ref }}
1313
TASK: PaddleNLP-CI-${{ github.event.pull_request.number }}-unittest-cpu
14+
HF_ENDPOINT: https://hf-mirror.com
15+
STUDIO_GIT_HOST: http://git.prod.idc-to-cloud.aistudio.baidu-int.com
16+
PPNLP_HOME: /home/disk1/cache
17+
HF_DATASETS_CACHE: /home/disk1/cache/huggingface/datasets
18+
TRANSFORMERS_CACHE: /home/disk1/cache/huggingface
1419

1520
jobs:
1621
Test:
@@ -33,12 +38,18 @@ jobs:
3338
-v $work_dir/../../..:$work_dir/../../.. \
3439
-v $work_dir:/workspace \
3540
-v /home/.cache/pip:/home/.cache/pip \
41+
-v /home/disk1/cache:/home/disk1/cache \
3642
-e BRANCH \
3743
-e PR_ID \
3844
-e COMMIT_ID \
3945
-e work_dir \
4046
-e no_proxy \
4147
-e python_version \
48+
-e HF_ENDPOINT \
49+
-e STUDIO_GIT_HOST \
50+
-e PPNLP_HOME \
51+
-e HF_DATASETS_CACHE \
52+
-e TRANSFORMERS_CACHE \
4253
-w /workspace ${docker_image}
4354
4455
- name: Download Code
@@ -68,7 +79,6 @@ jobs:
6879
echo "Not in a pull_request event. Skipping PR-specific operations."
6980
fi
7081
git log --pretty=oneline -10
71-
unset http_proxy && unset https_proxy
7282
'
7383
7484
- name: Setup Environment
@@ -79,6 +89,7 @@ jobs:
7989
set -e
8090
python -m pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
8191
python -m pip config set global.cache-dir "/home/.cache/pip"
92+
source $work_dir/../../../proxy
8293
python -m pip install --upgrade pip
8394
cd /workspace/PaddleNLP && git config --global --add safe.directory $PWD
8495
pip install -r tests/requirements.txt

scripts/regression/build.sh

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,17 @@ mkdir -p ${PPNLP_HOME}/upload_${AGILE_PIPELINE_BUILD_NUMBER}
2222
upload_path=${PPNLP_HOME}/upload_${AGILE_PIPELINE_BUILD_NUMBER}
2323
export Build_list=()
2424

25-
python -m pip config --user set global.index http://pip.baidu-int.com/search/
26-
python -m pip config --user set global.index-url http://pip.baidu-int.com/simple
27-
python -m pip config --user set global.trusted-host pip.baidu-int.com
25+
python -m pip config --user set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
26+
python -m pip config --user set global.trusted-host pypi.tuna.tsinghua.edu.cn
2827

2928
get_diff_case(){
3029
git diff --name-only HEAD~1 HEAD
3130
for file_name in `git diff --name-only HEAD~1 HEAD`;do
3231
arr_file_name=(${file_name//// })
3332
if [[ ${arr_file_name[0]} == "paddlenlp" ]];then
3433
Build_list[${#Build_list[*]}]="paddlenlp"
34+
elif [[ ${arr_file_name[0]} == "requirements"* ]]; then
35+
Build_list[${#Build_list[*]}]="paddlenlp"
3536
elif [[ ${arr_file_name[0]} == "csrc" ]];then
3637
Build_list[${#Build_list[*]}]="paddlenlp_ops"
3738
else
@@ -64,12 +65,9 @@ paddlenlp_build (){
6465
rm -rf paddle_pipelines.egg-info/
6566
rm -rf dist/
6667

67-
python -m pip install -r requirements.txt --trusted-host pip.baidu-int.com
68-
python -m pip install -r requirements-dev.txt --trusted-host pip.baidu-int.com
68+
python -m pip install -r requirements.txt
69+
python -m pip install -r requirements-dev.txt
6970
python setup.py bdist_wheel
70-
python -m pip uninstall protobuf -y
71-
python -m pip install protobuf==3.20.2
72-
python -m pip install numpy==1.26.4 --force-reinstall
7371
python -m pip install --ignore-installed dist/p****.whl --force-reinstall
7472
python -c "import paddlenlp; print('paddlenlp commit:',paddlenlp.version.commit)" >> ${log_path}/commit_info.txt
7573

@@ -127,7 +125,6 @@ if [[ ${#Build_list[*]} -ne 0 ]];then
127125
fi
128126

129127
if [ -e "${upload_path}" ] && [ "$(ls -A "${upload_path}/")" ]; then
130-
python -m pip install bce-python-sdk==0.8.74 --trusted-host pip.baidu-int.com --force-reinstall
131128
cd ${upload_path} && ls -A "${upload_path}"
132129
cd ${PPNLP_HOME} && python upload.py ${upload_path} 'paddlenlp/wheels'
133130
rm -rf ${upload_path}

tests/llm/test_grpo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def test_grpo(self):
9292
# 运行主逻辑
9393
cmd = 'python -u -m paddle.distributed.launch \
9494
--devices "$CUDA_VISIBLE_DEVICES" run_rl.py \
95-
../../config/qwen/reinforce_plus_plus_argument.yaml \
95+
../../config/qwen/grpo_argument.yaml \
9696
--actor_model_name_or_path "Qwen/Qwen2-1.5B" \
9797
--max_dec_len 128 \
9898
--max_steps 3 \

tests/llm/test_reinforce_plus_plus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def test_reinforce_plus_plus(self):
9292
# 运行主逻辑
9393
cmd = 'python -u -m paddle.distributed.launch \
9494
--devices "$CUDA_VISIBLE_DEVICES" run_rl.py \
95-
../../config/qwen/reinforce_plus_plus_argument.yaml \
95+
../../config/qwen/grpo_argument.yaml \
9696
--rl_algorithm "reinforce_plus_plus" \
9797
--actor_model_name_or_path "Qwen/Qwen2-1.5B" \
9898
--max_dec_len 128 \

tests/utils/test_aistudio_download.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@
1717
from paddlenlp.transformers.aistudio_utils import aistudio_download
1818
from paddlenlp.utils.download import resolve_file_path
1919

20+
from ..testing_utils import skip_for_none_ce_case
21+
2022

2123
class TestAistudioDownload(unittest.TestCase):
24+
@skip_for_none_ce_case
2225
def test_aistudio_download(self):
2326
# 设置测试数据
2427
repo_id = "PaddleNLP/DeepSeek-R1-Distill-Qwen-1.5B"
@@ -39,6 +42,7 @@ def test_aistudio_download(self):
3942
print(result)
4043
self.assertEqual(result, f"{local_dir}/{filename}")
4144

45+
@skip_for_none_ce_case
4246
def test_aistudio_download_transformer(self):
4347
# 设置测试数据
4448
repo_id = "PaddleNLP/DeepSeek-R1-Distill-Qwen-1.5B"

0 commit comments

Comments
 (0)