Skip to content

Commit 5fdbf54

Browse files
committed
fix for python install on self-hosted runners
1 parent b3bbdd4 commit 5fdbf54

File tree

2 files changed

+25
-113
lines changed

2 files changed

+25
-113
lines changed

.github/workflows/pr_push.yml

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -16,64 +16,8 @@ permissions:
1616
contents: read
1717

1818
jobs:
19-
CodeChecks:
20-
uses: ./.github/workflows/reusable_checks.yml
21-
DocsBuild:
22-
uses: ./.github/workflows/reusable_docs_build.yml
23-
FastBuild:
24-
name: Fast builds
25-
needs: [CodeChecks, DocsBuild]
26-
uses: ./.github/workflows/reusable_fast.yml
27-
Build:
28-
name: Basic builds
29-
needs: [FastBuild]
30-
uses: ./.github/workflows/reusable_basic.yml
31-
DevDax:
32-
needs: [FastBuild]
33-
uses: ./.github/workflows/reusable_dax.yml
34-
Sanitizers:
35-
needs: [FastBuild]
36-
uses: ./.github/workflows/reusable_sanitizers.yml
37-
Qemu:
38-
needs: [FastBuild]
39-
uses: ./.github/workflows/reusable_qemu.yml
40-
Benchmarks:
41-
needs: [Build]
42-
uses: ./.github/workflows/reusable_benchmarks.yml
43-
ProxyLib:
44-
needs: [Build]
45-
uses: ./.github/workflows/reusable_proxy_lib.yml
46-
GPU:
47-
needs: [Build]
48-
uses: ./.github/workflows/reusable_gpu.yml
49-
Valgrind:
50-
needs: [Build]
51-
uses: ./.github/workflows/reusable_valgrind.yml
52-
MultiNuma:
53-
needs: [Build]
54-
uses: ./.github/workflows/reusable_multi_numa.yml
55-
Coverage:
56-
# total coverage (on upstream only)
57-
if: github.repository == 'oneapi-src/unified-memory-framework'
58-
needs: [Build, DevDax, GPU, MultiNuma, Qemu, ProxyLib]
59-
uses: ./.github/workflows/reusable_coverage.yml
60-
secrets: inherit
61-
with:
62-
trigger: "${{github.event_name}}"
63-
Coverage_partial:
64-
# partial coverage (on forks)
65-
if: github.repository != 'oneapi-src/unified-memory-framework'
66-
needs: [Build, Qemu, ProxyLib]
67-
uses: ./.github/workflows/reusable_coverage.yml
6819
CodeQL:
69-
needs: [Build]
7020
permissions:
7121
contents: read
7222
security-events: write
7323
uses: ./.github/workflows/reusable_codeql.yml
74-
Trivy:
75-
needs: [Build]
76-
permissions:
77-
contents: read
78-
security-events: write
79-
uses: ./.github/workflows/reusable_trivy.yml

.github/workflows/reusable_codeql.yml

Lines changed: 25 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -20,75 +20,43 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
os: [ubuntu-latest, windows-latest]
23+
os: [windows-latest]
2424
include:
2525
- os: ubuntu-latest
2626
# Windows doesn't recognize 'CMAKE_BUILD_TYPE', it uses '--config' param in build command
2727
extra_build_option: '-DCMAKE_BUILD_TYPE=Release'
2828
- os: windows-latest
29-
runs-on: ${{matrix.os}}
29+
runs-on: ["DSS-CUDA", "DSS-WINDOWS"]
3030

3131
steps:
3232
- name: Checkout repository
3333
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
3434
with:
3535
fetch-depth: 0
3636

37-
- name: Setup newer Python
38-
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
39-
with:
40-
python-version: "3.10"
41-
42-
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
44-
with:
45-
languages: cpp
46-
47-
- name: "[Win] Initialize vcpkg"
48-
if: matrix.os == 'windows-latest'
49-
uses: lukka/run-vcpkg@5e0cab206a5ea620130caf672fce3e4a6b5666a1 # v11.5
50-
with:
51-
vcpkgGitCommitId: 3dd44b931481d7a8e9ba412621fa810232b66289
52-
vcpkgDirectory: ${{env.BUILD_DIR}}/vcpkg
53-
vcpkgJsonGlob: '**/vcpkg.json'
54-
55-
- name: "[Win] Install dependencies"
56-
if: matrix.os == 'windows-latest'
37+
- name: aaa
5738
run: |
58-
vcpkg install
59-
python3 -m pip install -r third_party/requirements.txt
39+
echo "aa $PATH"
40+
echo "bb $env:PATH"
41+
python --version
42+
python3 --version
6043
61-
- name: "[Lin] Install apt packages"
62-
if: matrix.os == 'ubuntu-latest'
44+
- name: Check for Python >= 3.10
45+
id: check_python
6346
run: |
64-
sudo apt-get update
65-
sudo apt-get install -y cmake clang libhwloc-dev libnuma-dev libjemalloc-dev libtbb-dev
66-
67-
# Latest distros do not allow global pip installation
68-
- name: "[Lin] Install Python requirements in venv"
69-
if: matrix.os == 'ubuntu-latest'
70-
run: |
71-
python3 -m venv .venv
72-
. .venv/bin/activate
73-
echo "$PATH" >> $GITHUB_PATH
74-
python3 -m pip install -r third_party/requirements.txt
75-
76-
- name: Configure CMake
77-
run: >
78-
cmake
79-
-B ${{env.BUILD_DIR}}
80-
${{matrix.extra_build_option}}
81-
-DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
82-
-DCMAKE_PREFIX_PATH="${{env.VCPKG_PATH}}"
83-
-DUMF_FORMAT_CODE_STYLE=OFF
84-
-DUMF_DEVELOPER_MODE=ON
85-
-DUMF_BUILD_LIBUMF_POOL_JEMALLOC=ON
86-
-DUMF_BUILD_LEVEL_ZERO_PROVIDER=ON
87-
-DUMF_BUILD_CUDA_PROVIDER=ON
88-
-DUMF_TESTS_FAIL_ON_SKIP=ON
89-
90-
- name: Build
91-
run: cmake --build ${{env.BUILD_DIR}} --config Release -j
92-
93-
- name: Perform CodeQL Analysis
94-
uses: github/codeql-action/analyze@b7bf0a3ed3ecfa44160715d7c442788f65f0f923 # v3.23.2
47+
echo "python_exists=false" >> $GITHUB_OUTPUT
48+
$pythonCommand = Get-Command python -ErrorAction SilentlyContinue
49+
if ($pythonCommand) {
50+
$pythonVersion = python --version 2>&1
51+
$versionPattern = 'Python (\d+)\.(\d+)\.(\d+)'
52+
echo $pythonVersion
53+
if ($pythonVersion -match $versionPattern) {
54+
$major = [int]$matches[1]
55+
$minor = [int]$matches[2]
56+
if ($major -gt 3 -or ($major -eq 3 -and $minor -ge 10)) {
57+
echo "python_exists=true" >> $GITHUB_OUTPUT
58+
}
59+
}
60+
}
61+
shell: pwsh
62+

0 commit comments

Comments
 (0)