Skip to content
This repository was archived by the owner on Dec 24, 2024. It is now read-only.

Commit 127c9a5

Browse files
committed
try manylinux container
1 parent 9191877 commit 127c9a5

File tree

1 file changed

+63
-38
lines changed

1 file changed

+63
-38
lines changed

.github/workflows/ci-linux.yml

+63-38
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,74 @@
11
name: CI Linux
22

33
on:
4-
workflow_call:
54
workflow_dispatch:
5+
inputs:
6+
force_debug_with_tmate:
7+
type: boolean
8+
description: 'Run the build with tmate session'
9+
required: false
10+
default: false
11+
debug_with_tmate:
12+
type: boolean
13+
description: 'Run the build with a tmate session ONLY in case of failure'
14+
required: false
15+
default: false
16+
release:
17+
type: boolean
18+
description: 'Release to latest'
19+
required: false
20+
default: false
621
pull_request:
722
merge_group:
823
push:
924
branches:
1025
- main
1126

1227
concurrency:
13-
# A PR number if a pull request and otherwise the commit hash. This cancels
14-
# queued and in-progress runs for the same PR (presubmit) or commit
15-
# (postsubmit).
1628
group: ci-build-test-cpp-linux-${{ github.event.number || github.sha }}
1729
cancel-in-progress: true
1830

1931
jobs:
2032
build:
2133
name: Build (linux)
22-
strategy:
23-
fail-fast: false
24-
matrix:
25-
runs-on:
26-
- ubuntu-22.04
27-
# - nod-ai-shared-cpubuilder-manylinux-x86_64
28-
runs-on: ${{ matrix.runs-on }}
34+
runs-on: ubuntu-22.04
35+
container:
36+
image: quay.io/pypa/manylinux_2_28_x86_64
37+
env:
38+
GITHUB_SHA: ${{ github.sha }}
2939
steps:
3040
- name: Install tmate
31-
if: ${{ matrix.runs-on == 'nod-ai-shared-cpubuilder-manylinux-x86_64' }}
3241
run: dnf install -y epel-release && dnf install -y tmate
3342

34-
- name: Configure local git mirrors
35-
if: ${{ matrix.runs-on == 'nod-ai-shared-cpubuilder-manylinux-x86_64' }}
36-
run: |
37-
/gitmirror/scripts/trigger_update_mirrors.sh
38-
/gitmirror/scripts/git_config.sh
39-
4043
- name: Install deps
41-
if: ${{ matrix.runs-on == 'nod-ai-shared-cpubuilder-manylinux-x86_64' }}
4244
run: |
4345
dnf install -y almalinux-release-devel
44-
yum install -y elfutils-libelf-devel p7zip p7zip-plugins
45-
46-
- name: Install deps
47-
if: ${{ matrix.runs-on == 'ubuntu-22.04' }}
48-
run: |
49-
sudo apt install -y libelf-dev libnuma-dev libdrm-dev
46+
yum install -y elfutils-libelf-devel p7zip p7zip-plugins \
47+
sudo ncurses-compat-libs openssh vim-common
5048
5149
- name: Setup Cpp
52-
if: ${{ matrix.runs-on == 'ubuntu-22.04' }}
5350
uses: aminya/setup-cpp@v1
5451
with:
5552
compiler: llvm-18
5653
cmake: true
5754
ninja: true
58-
ccache: true
5955

6056
- name: "Checking out repository"
6157
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
6258
with:
6359
submodules: recursive
6460

6561
- name: Build and install libnuma
66-
if: ${{ matrix.runs-on == 'nod-ai-shared-cpubuilder-manylinux-x86_64' }}
6762
run: |
6863
curl --silent -L \
6964
https://github.com/numactl/numactl/releases/download/v2.0.18/numactl-2.0.18.tar.gz \
7065
-o numactl-2.0.18.tar.gz
7166
tar -xf numactl-2.0.18.tar.gz
7267
pushd numactl-2.0.18
7368
./configure
69+
# i have no idea why this is necessary
70+
# but without it you get something about "can't cd into dir"
71+
sed -i '7563s/`cd "$dir" && pwd`/$dir/g' libtool
7472
make install
7573
popd
7674
@@ -82,22 +80,22 @@ jobs:
8280
8381
- name: Build ROCR distro
8482
run: |
85-
rocr_dir="$(cd ${{ github.workspace }} && pwd)"
86-
build_rocr_dir="${{ github.workspace }}/rocr-build"
83+
rocr_dir="$(cd $GITHUB_WORKSPACE && pwd)"
84+
build_rocr_dir="$GITHUB_WORKSPACE/rocr-build"
8785
mkdir -p "$build_rocr_dir"
8886
build_rocr_dir="$(cd $build_rocr_dir && pwd)"
89-
rocr_install_dir="${{ github.workspace }}/rocr-install"
87+
rocr_install_dir="$GITHUB_WORKSPACE/rocr-install"
9088
9189
cmake -GNinja \
9290
-DCMAKE_BUILD_TYPE=Release \
9391
-DCMAKE_INSTALL_PREFIX="$rocr_install_dir" \
94-
-DClang_DIR=/usr/lib/llvm-18/lib/cmake/clang \
95-
-DLLVM_DIR=/usr/lib/llvm-18/lib/cmake/llvm \
92+
-DClang_DIR=$HOME/llvm/lib/cmake/clang \
93+
-DLLVM_DIR=$HOME/llvm/lib/cmake/llvm \
9694
-DIMAGE_SUPPORT=OFF \
9795
-S "$rocr_dir" -B "$build_rocr_dir"
9896
9997
cmake --build "$build_rocr_dir" --target install
100-
tar -cf rocr-$(git rev-parse --short HEAD).tar rocr-install
98+
tar -cf rocr-${GITHUB_SHA::8}.tar rocr-install
10199
102100
- name: Upload artifacts
103101
uses: actions/upload-artifact@v4
@@ -108,11 +106,11 @@ jobs:
108106
if-no-files-found: warn
109107

110108
- name: Setup tmate session
111-
if: ${{ failure() }}
109+
if: ${{ (failure() && inputs.debug_with_tmate) || inputs.force_debug_with_tmate }}
112110
uses: mxschmitt/[email protected]
113111
with:
114112
limit-access-to-actor: true
115-
install-dependencies: ${{ matrix.runs-on == 'ubuntu-22.04' }}
113+
install-dependencies: false
116114

117115
test_aie:
118116
name: AIE tests
@@ -144,7 +142,7 @@ jobs:
144142
mkdir -p $build_dir
145143
cmake -GNinja \
146144
-DCMAKE_BUILD_TYPE=Release \
147-
"-Dhsa-runtime64_DIR=$hsa_runtime64_ROOT/lib/cmake/hsa-runtime64" \
145+
"-Dhsa-runtime64_DIR=$hsa_runtime64_ROOT/lib64/cmake/hsa-runtime64" \
148146
-S "$PWD" -B "$build_dir"
149147
cmake --build "$build_dir" --target aie_hsa_bare_add_one
150148
@@ -160,9 +158,36 @@ jobs:
160158
mkdir -p $build_dir
161159
cmake -GNinja \
162160
-DCMAKE_BUILD_TYPE=Release \
163-
"-Dhsa-runtime64_DIR=$hsa_runtime64_ROOT/lib/cmake/hsa-runtime64" \
161+
"-Dhsa-runtime64_DIR=$hsa_runtime64_ROOT/lib64/cmake/hsa-runtime64" \
164162
-S "$PWD" -B "$build_dir"
165163
166164
! cmake --build "$build_dir" --target aie_hsa_dispatch_test
167165
168166
popd
167+
168+
release:
169+
name: Release
170+
if: ${{ inputs.release }}
171+
needs: [build, test_aie]
172+
runs-on: ubuntu-22.04
173+
permissions:
174+
id-token: write
175+
contents: write
176+
steps:
177+
- name: Download artifacts
178+
uses: actions/download-artifact@v4
179+
with:
180+
name: linux_x86_64_distro
181+
182+
- name: Release current commit
183+
uses: ncipollo/[email protected]
184+
with:
185+
artifacts: rocr-*.tar
186+
token: "${{ secrets.GITHUB_TOKEN }}"
187+
tag: "latest"
188+
name: "latest"
189+
removeArtifacts: false
190+
allowUpdates: true
191+
replacesArtifacts: true
192+
makeLatest: true
193+
artifactErrorsFailBuild: true

0 commit comments

Comments
 (0)