forked from ROCm/TheRock
-
Notifications
You must be signed in to change notification settings - Fork 8
104 lines (93 loc) · 3.11 KB
/
build_python_packages.yml
File metadata and controls
104 lines (93 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Build Python Packages
on:
workflow_dispatch:
inputs:
version_spec:
required: false
type: string
package_suffix:
required: false
type: string
workflow_call:
inputs:
version_spec:
required: false
type: string
package_suffix:
required: false
type: string
jobs:
build_python_packages:
name: Build Python Packages
runs-on: azure-linux-scale-rocm
container:
image: ghcr.io/rocm/therock_build_manylinux_x86_64:main
strategy:
fail-fast: true
env:
CACHE_DIR: ${{ github.workspace }}/.container-cache
CCACHE_DIR: "${{ github.workspace }}/.container-cache/ccache"
CCACHE_MAXSIZE: "700M"
steps:
- name: "Checking out repository"
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Report Runner Health
run: |
echo "CCACHE_DIR=${CCACHE_DIR}"
df -h
ccache -z
mkdir -p $CCACHE_DIR
cmake --version
echo "Installed Python versions:"
ls -d /opt/python
echo "python: $(which python), python3: $(which python3)"
echo "Git version: $(git --version)"
# TODO: We shouldn't be using a cache on actual release branches, but it
# really helps for iteration time.
- name: Enable cache
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
path: ${{ env.CACHE_DIR }}
key: build-python-manylinux-v2-${{ github.sha }}
restore-keys: |
build-python-manylinux-v2-
- name: Fetch sources
run: |
./build_tools/fetch_sources.py --depth 1
# The full checkout is very large: ~16GB, 9 of which is GIT stuff.
# So we delete the latter. This must be done after getting any git
# stamps or such things.
- name: Trim Disk Space
run: |
rm -Rf sources/.repo
df -h
- name: Build Projects
run: |
cd python_projects/runtime
export THEROCK_PY_VERSION="${{ inputs.version_spec }}"
export THEROCK_PY_SUFFIX="${{ inputs.package_suffix }}"
export CMAKE_C_COMPILER_LAUNCHER=ccache
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
echo "Building package ${THEROCK_PY_VERSION}"
pip wheel -v .
auditwheel repair TheRock_runtime*.whl
- name: Report
if: ${{ !cancelled() }}
run: |
ccache -s
cd python_projects/runtime
ls -lh . wheelhouse
- name: Upload artifacts
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
if: ${{ !cancelled() }}
with:
name: TheRock-runtime-linux-x86_64-python
path: |
python_projects/runtime/wheelhouse/*.whl
if-no-files-found: warn
- name: Save cache
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
if: always()
with:
path: ${{ env.CACHE_DIR }}
key: build-python-manylinux-v2-${{ github.sha }}