Skip to content

Commit a872a87

Browse files
author
lvkunpeng
committed
update cmake_switch_python.yml
1 parent 08802c5 commit a872a87

File tree

2 files changed

+58
-209
lines changed

2 files changed

+58
-209
lines changed

.github/workflows/cmake_switch_python.yml

Lines changed: 58 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -3,51 +3,54 @@ run-name: Runs on ${{ github.event_name }}
33

44
on:
55
workflow_dispatch:
6+
inputs:
7+
agile_branch:
8+
description: 'Branch for compilation'
9+
required: false
10+
default: 'develop'
11+
agile_revision:
12+
description: 'Git commit or revision hash'
13+
required: false
14+
default: 'ef256258ca705ee3b4d709d7dec0332f33988c22'
15+
616
workflow_call:
17+
inputs:
18+
agile_branch:
19+
required: false
20+
type: string
21+
default: 'develop'
22+
agile_revision:
23+
required: false
24+
type: string
25+
default: 'ef256258ca705ee3b4d709d7dec0332f33988c22'
26+
727
repository_dispatch:
8-
types: [cmake-build]
28+
types: [cebuild-mac-arm]
929

1030
jobs:
1131
prepare-source:
12-
runs-on: [self-hosted, GPU-8Card]
32+
runs-on: [self-hosted]
1333
env:
14-
AGILE_COMPILE_BRANCH: develop
15-
AGILE_REVISION: ef256258ca705ee3b4d709d7dec0332f33988c22
16-
outputs:
17-
source-dir: ${{ steps.set-output.outputs.source-dir }}
34+
AGILE_COMPILE_BRANCH: ${{ github.event.client_payload.agile_branch || github.event.inputs.agile_branch || inputs.agile_branch || 'develop' }}
35+
AGILE_REVISION: ${{ github.event.client_payload.agile_revision || github.event.inputs.agile_revision || inputs.agile_revision || 'ef256258ca705ee3b4d709d7dec0332f33988c22' }}
1836

1937
steps:
2038
- name: Prepare Paddle Source Code
2139
id: set-output
2240
run: |
2341
set -xe
2442
workspace=$(pwd)
25-
echo "当前工作目录: $workspace"
26-
27-
# echo "开始清空当前目录下所有文件..."
28-
# rm -rf "$workspace"/*
29-
# echo "当前目录已清空,开始重新下载 Paddle.tar..."
30-
# url="https://paddle-qa.bj.bcebos.com/CodeSync/${AGILE_COMPILE_BRANCH}/${AGILE_REVISION}/Paddle.tar"
31-
# wget -q --no-proxy ${url} --no-check-certificate || wget_failed=101
32-
# if [[ "${wget_failed}" == "101" ]]; then
33-
# echo "wget failed, start cloning..."
34-
# git clone https://github.com/PaddlePaddle/Paddle.git --depth=100 -b ${AGILE_COMPILE_BRANCH} Paddle
35-
# else
36-
# tar xf Paddle.tar
37-
# fi
38-
39-
if [ -f "Paddle.tar" ]; then
40-
echo "Paddle 源码包已存在,跳过下载/clone。"
41-
tar xf Paddle.tar
43+
44+
echo "开始清空当前目录下所有文件..."
45+
rm -rf "$workspace"/*
46+
echo "当前目录已清空,开始重新下载 Paddle.tar..."
47+
url="https://paddle-qa.bj.bcebos.com/CodeSync/${AGILE_COMPILE_BRANCH}/${AGILE_REVISION}/Paddle.tar"
48+
wget -q --no-proxy ${url} --no-check-certificate || wget_failed=101
49+
if [[ "${wget_failed}" == "101" ]]; then
50+
echo "wget failed, start cloning..."
51+
git clone https://github.com/PaddlePaddle/Paddle.git --depth=100 -b ${AGILE_COMPILE_BRANCH} Paddle
4252
else
43-
url="https://paddle-qa.bj.bcebos.com/CodeSync/${AGILE_COMPILE_BRANCH}/${AGILE_REVISION}/Paddle.tar"
44-
wget -q --no-proxy ${url} --no-check-certificate || wget_failed=101
45-
if [[ "${wget_failed}" == "101" ]]; then
46-
echo "wget failed, start cloning..."
47-
git clone https://github.com/PaddlePaddle/Paddle.git --depth=100 -b ${AGILE_COMPILE_BRANCH} Paddle
48-
else
49-
tar xf Paddle.tar
50-
fi
53+
tar xf Paddle.tar
5154
fi
5255
5356
cd Paddle
@@ -56,11 +59,8 @@ jobs:
5659
git log -10
5760
mkdir -p BUILD_RESULT
5861
59-
echo "source-dir=$workspace/Paddle" >> $GITHUB_OUTPUT
60-
echo "源码准备完毕:$workspace/Paddle"
61-
6262
build-wheels:
63-
runs-on: [self-hosted, GPU-8Card]
63+
runs-on: [self-hosted]
6464
needs: prepare-source
6565
strategy:
6666
fail-fast: false
@@ -115,30 +115,29 @@ jobs:
115115
cp ./build/python/dist/*.whl ./BUILD_RESULT || true
116116
rm -rf ./build
117117
118-
- name: Upload Wheel for Python ${{ matrix.python-version }}
119-
uses: actions/upload-artifact@v4
120-
with:
121-
name: paddle-whl-py${{ matrix.python-version }}
122-
path: Paddle/BUILD_RESULT
123-
if-no-files-found: ignore
124-
125-
collect-artifacts:
126-
runs-on: self-hosted
118+
upload_bos:
119+
environment: CodeSync
120+
runs-on: [self-hosted]
127121
needs: build-wheels
122+
env:
123+
AK: ${{ secrets.BOS_CREDENTIAL_AK }}
124+
SK: ${{ secrets.BOS_CREDENTIAL_SK }}
128125
steps:
129-
- name: Download All Wheels
130-
uses: actions/download-artifact@v4
131-
with:
132-
path: all-wheels
133-
134-
- name: Archive All Wheels
126+
- name: Setup Python 3.10 and Upload to BOS
135127
run: |
136-
mkdir -p merged
137-
find all-wheels -name '*.whl' -exec cp {} merged/ \;
138-
ls -lh merged/
139-
140-
- name: Upload Merged Wheels
141-
uses: actions/upload-artifact@v4
142-
with:
143-
name: paddle-whl-all
144-
path: merged/
128+
set -xe
129+
PYTHON_BIN=python3.10
130+
131+
$PYTHON_BIN -m venv myenv --clear
132+
source myenv/bin/activate
133+
python -m pip install bce-python-sdk==0.9.29
134+
135+
wget -q --no-proxy --no-check-certificate https://paddle-qa.bj.bcebos.com/CodeSync/develop/PaddlePaddle/PaddleTest/tools/bos_tools.py
136+
push_file=$PWD/bos_tools.py
137+
138+
cd ${workspace}/Paddle/BUILD_RESULT
139+
140+
for whl_file in $(ls *.whl); do
141+
python $push_file $whl_file ${whl_package}
142+
done
143+

.github/workflows/lkp_cmake_py313.yml

Lines changed: 0 additions & 150 deletions
This file was deleted.

0 commit comments

Comments
 (0)