Skip to content

Commit d80874c

Browse files
authored
Add Weekly Retagger + GitHub unittest exclusion char
See #3
2 parents 68cff18 + f161087 commit d80874c

File tree

198 files changed

+26881
-26532
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+26881
-26532
lines changed

.github/scripts/extract_matrix.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
"GITHUB_CI": "true"
1919
}
2020

21-
PR_JOBS='^(?=.*python)(?!.*(retagger|dsl)).*$'
22-
2321
# If any of these terms are in the job json, they do not run in public
2422
# infrastructure
2523
JOB_EXCLUSION_TERMS = (
@@ -36,7 +34,7 @@
3634

3735
# WIP
3836
"darwin",
39-
"windows"
37+
#"windows"
4038
)
4139

4240
DOWNLOADS_LINKS = {
@@ -130,10 +128,12 @@ def get_download_steps(self, key: str, version: str) -> str:
130128
filename = download_link.split('/')[-1]
131129

132130
if self.runs_on == "windows-latest":
133-
return (f"""Invoke-WebRequest -Uri {download_link} -OutFile {filename}
131+
return (f"""
132+
Invoke-WebRequest -Uri {download_link} -OutFile {filename}
134133
$dirname = (& tar -tzf {filename} | Select-Object -First 1).Split('/')[0]
135134
tar -xzf {filename}
136-
Add-Content $env:GITHUB_ENV "{key}=$(Resolve-Path $dirname)""")
135+
Add-Content $env:GITHUB_ENV "{key}=$(Resolve-Path $dirname)"
136+
""")
137137

138138
return (f"wget -q {download_link} && "
139139
f"dirname=$(tar -tzf {filename} | head -1 | cut -f1 -d '/') && "
@@ -295,7 +295,6 @@ def get_tagged_jobs(buildspec, target, filter=None):
295295

296296

297297
def main(jsonnet_bin, ci_jsonnet, target, filter=None, indent=False):
298-
if not filter: filter = PR_JOBS
299298

300299
result = subprocess.check_output([jsonnet_bin, ci_jsonnet], text=True)
301300
buildspec = json.loads(result)

.github/scripts/merge_retagger_results.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def merge_reports(reports: list[str], outfile: str):
5353
def main(outfile: str, source_dir: str, pattern: str):
5454
path = f"{source_dir}/{pattern}"
5555
files = glob.glob(path)
56-
if len(files) == 0: raise FileNotFoundError("No report file found")
5756

5857
files = [file for file in files if file.endswith(".json")]
5958
merge_reports(files, outfile)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@echo off
2+
setlocal
3+
4+
if not "%1"=="" (
5+
set "to_extract=%ARTIFACT_PATH_PREFIX%\%1.tar"
6+
)
7+
8+
for %%i in (%to_extract%) do (
9+
if exist "%%i" (
10+
tar -xf "%%i" -C "%ARTIFACT_PATH_PREFIX%"
11+
echo Unpacked %%i in %CD%\%ARTIFACT_PATH_PREFIX%
12+
) else (
13+
echo file not found in %ARTIFACT_PATH_PREFIX%
14+
dir "%ARTIFACT_PATH_PREFIX%"
15+
)
16+
)
17+
18+
endlocal

.github/workflows/ci-matrix-gen.yml

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ on:
77
type: string
88
description: Job selection (Python regex)
99
required: false
10-
pull_request:
10+
workflow_call:
11+
inputs:
12+
jobs_to_run:
13+
required: true
14+
type: string
1115
schedule:
1216
- cron: '0 0 * * 1'
1317

@@ -18,7 +22,7 @@ jobs:
1822
matrix: ${{ steps.set-matrix.outputs.matrix }}
1923
env:
2024
TARGET: tier1
21-
JOBS: ${{ inputs.jobs_to_run || (github.event_name == 'schedule' && 'python-svm-build-gate-linux|python-unittest-retagger|python-unittest-retagger-merge') || ''}}
25+
JOBS: ${{ inputs.jobs_to_run }}
2226
steps: &generate_matrix
2327
- uses: actions/checkout@v4
2428
- name: Download sjsonnet
@@ -122,7 +126,7 @@ jobs:
122126
123127
# Setup mx, buildtools and labsjdk
124128
- name: Get mx, buildtools, and labsjdk
125-
if: ${{ runner.os != 'Windows' && matrix.mx_version }}
129+
if: ${{ matrix.mx_version }}
126130
shell: bash
127131
run: |
128132
git clone https://github.com/graalvm/mx
@@ -186,8 +190,59 @@ jobs:
186190
run: |
187191
${{ matrix.setup_steps }}
188192
189-
- name: Check disk space
190-
run: df -h
193+
- name: Check disk space and memory usage
194+
if: ${{ runner.os == 'macOS' }}
195+
run: |
196+
echo "before purge"
197+
df -h
198+
pagesize=$(sysctl -n hw.pagesize)
199+
vm_stat
200+
vm_stat | awk -v ps=$pagesize '
201+
/Pages free/ {free=$3}
202+
/Pages active/ {active=$3}
203+
/Pages inactive/ {inactive=$3}
204+
/Pages speculative/ {speculative=$3}
205+
/Pages wired/ {wired=$4}
206+
END {
207+
used=(active+inactive+wired+speculative)*ps/1024/1024;
208+
free=free*ps/1024/1024;
209+
printf "Used: %.2f MB\nFree: %.2f MB\n", used, free
210+
}'
211+
ps aux | sort -nrk 4 | head
212+
sudo purge
213+
echo "after purge"
214+
pagesize=$(sysctl -n hw.pagesize)
215+
vm_stat
216+
vm_stat | awk -v ps=$pagesize '
217+
/Pages free/ {free=$3}
218+
/Pages active/ {active=$3}
219+
/Pages inactive/ {inactive=$3}
220+
/Pages speculative/ {speculative=$3}
221+
/Pages wired/ {wired=$4}
222+
END {
223+
used=(active+inactive+wired+speculative)*ps/1024/1024;
224+
free=free*ps/1024/1024;
225+
printf "Used: %.2f MB\nFree: %.2f MB\n", used, free
226+
}'
227+
228+
229+
- name: Free resources on macOS
230+
run: |
231+
echo "Disabling Spotlight indexing..."
232+
sudo mdutil -a -i off
233+
sudo mdutil -a -d
234+
sudo launchctl bootout system /System/Library/LaunchDaemons/com.apple.metadata.mds.plist
235+
sudo pkill -f "mds|mds_stores|mdworker_shared|Spotlight|corespotlightd"
236+
237+
echo "Forcing disk cache to be purged..."
238+
sudo purge
239+
240+
echo "Top processes sorted by memory usage:"
241+
ps -emo pid,pmem,pcpu,comm | head 2>/dev/null
242+
echo ""
243+
memory_pressure
244+
echo ""
245+
if: ${{ runner.os == 'macOS' }}
191246

192247
- name: Run on Unix
193248
working-directory: main
@@ -196,6 +251,7 @@ jobs:
196251
env
197252
${{ matrix.run_steps }}
198253
- name: Run on Windows
254+
working-directory: main
199255
if: ${{ matrix.run_steps && runner.os == 'Windows' }}
200256
shell: cmd
201257
run: |
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Run Weekly unittest retagger
2+
on:
3+
schedule:
4+
- cron: '0 0 * * 1'
5+
workflow_dispatch:
6+
7+
jobs:
8+
run-retagger:
9+
uses: ./.github/workflows/ci-matrix-gen.yml
10+
with:
11+
jobs_to_run: python-svm-build-gate-linux-amd64|python-unittest-retagger
12+
13+
merge_all_reports:
14+
runs-on: ubuntu-latest
15+
needs: run-retagger
16+
if: ${{ success() }}
17+
env:
18+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
steps:
20+
21+
- name: Actions/Checkout
22+
uses: actions/checkout@main
23+
with:
24+
path: main
25+
26+
- name: Download reports
27+
uses: actions/download-artifact@v5
28+
with:
29+
pattern: python-unittest-retagger*
30+
merge-multiple: true
31+
continue-on-error: true
32+
33+
- name: Init Github branch
34+
working-directory: main
35+
run: |
36+
echo "Set new repo origin url"
37+
git remote set-url origin https://$GH_TOKEN@github.com/${{ github.repository }}.git
38+
git remote -v
39+
git config --global user.name "Retagger Workflow"
40+
git config --global user.email "Retagger_Workflow@oracle.com"
41+
git fetch origin
42+
git checkout -b weekly_retagger_${{ github.run_id }} origin/master
43+
44+
- name: Merge retagger reports
45+
env:
46+
GITHUB_CI: true
47+
working-directory: main
48+
run: |
49+
mkdir -p ../retagger-reports ../diffs
50+
ls && ls ..
51+
mv retagger-report*.json ../retagger-reports
52+
53+
declare -a os_list=("linux-x86_64" "linux-aarch64" "win32-AMD64")
54+
for os in "${os_list[@]}"; do
55+
echo "Merging tags for $os"
56+
python3 .github/scripts/merge_retagger_results.py --dir ../retagger-reports --outfile "../retagger-reports/reports-merged-$os.json" --pattern "*$os*" || true
57+
python3 graalpython/com.oracle.graal.python.test/src/runner.py merge-tags-from-report "../retagger-reports/reports-merged-$os.json" --platform "$os" || true
58+
git add -A
59+
git commit -m "Apply retags for $os" || true
60+
done
61+
62+
- name: Push updates to a new PR
63+
working-directory: main
64+
run: |
65+
git push --set-upstream origin weekly_retagger_${{ github.run_id }}
66+
gh label create "weekly-retagger" --color "BDDFDF" -d "[DO NOT ADD] Automatically set to weekly retagger PR" || echo "Label 'weekly-retagger' already exists"
67+
gh pr create -B master --title "[WORKFLOW] Weekly Retagger: Update tags" --body "Applied weekly retags on $os_list" -l "weekly-retagger"

.github/workflows/ci-unittests.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Run CI unittests
2+
on:
3+
pull_request:
4+
types: [review_requested, ready_for_review, synchronize]
5+
workflow_dispatch:
6+
7+
jobs:
8+
run-tests:
9+
if: github.event.pull_request.draft == false
10+
uses: ./.github/workflows/ci-matrix-gen.yml
11+
with:
12+
jobs_to_run: ^(?=.*python)(?!.*(retagger|dsl|windows|darwin)).*$

ci.jsonnet

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@
244244
"python-unittest-retagger": ut_retagger + platform_spec(no_jobs) + batches(RETAGGER_SPLIT) + platform_spec({
245245
"linux:amd64:jdk-latest" : tier2 + require(GPY_NATIVE_STANDALONE),
246246
"linux:aarch64:jdk-latest" : tier3 + require(GPY_NATIVE_STANDALONE),
247-
"darwin:aarch64:jdk-latest" : weekly + t("20:00:00"),
248-
"windows:amd64:jdk-latest" : weekly + t("20:00:00"),
247+
"darwin:aarch64:jdk-latest" : tier3 + require(GPY_NATIVE_STANDALONE),
248+
"windows:amd64:jdk-latest" : tier3 + require(GPY_NATIVE_STANDALONE),
249249
}),
250250
"python-coverage-jacoco-tagged": cov_jacoco_tagged + batches(COVERAGE_SPLIT) + platform_spec(no_jobs) + platform_spec({
251251
"linux:amd64:jdk21" : weekly + t("20:00:00"),
@@ -548,37 +548,6 @@
548548
["git", "push", "--force", "origin", "published"],
549549
]
550550
},
551-
{
552-
name: "python-unittest-retagger-merge",
553-
targets: ["tier3"],
554-
capabilities: ["linux", "amd64"],
555-
packages: {
556-
mx: "7.34.1",
557-
python3: "==3.12.8",
558-
},
559-
requireArtifacts: [
560-
{
561-
name: "python-unittest-retagger*",
562-
dir: ".",
563-
}
564-
],
565-
publishArtifacts: [
566-
{
567-
name: "retagger.diff",
568-
dir: ".",
569-
patterns: ["diff_reports"]
570-
}
571-
],
572-
run: [
573-
["mkdir", "-p", "../retagger-reports"],
574-
["sh", "-c", "mv retagger-report*.json ../retagger-reports"],
575-
["cd", "../retagger-reports"],
576-
["python3", "../main/.github/scripts/merge_retagger_results.py"],
577-
["cd", "../main"],
578-
["python3", "./graalpython/com.oracle.graal.python.test/src/runner.py", "merge-tags-from-report", "../retagger-reports/reports-merged.json"],
579-
["sh", "-c", "git diff >> diff_reports"],
580-
]
581-
},
582551
],
583552
}
584553

ci/graal/ci/common.jsonnet

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ local common_json = import "../common.json";
150150
packages+: {
151151
python3: "==3.8.10",
152152
"pip:ninja_syntax": common_json.pip.ninja_syntax,
153+
"pip:psutil": "==7.1.3",
153154
mx: common_json.mx_version,
154155
},
155156
python_version: "3", # To use the correct virtualenv

ci/graal/common.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"Jsonnet files should not include this file directly but use ci/common.jsonnet instead."
55
],
66

7-
"mx_version": "7.67.0",
7+
"mx_version": "7.68.4",
88

99
"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
1010
"jdks": {
@@ -49,12 +49,12 @@
4949
"graalvm-ee-25-ea": {"name": "graalvm-jdk", "version": "25.0.0", "ea": "36", "platformspecific": true },
5050

5151
"oraclejdk-latest": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25.0.1+8", "platformspecific": true, "extrabundles": ["static-libs"]},
52-
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-25.0.1+8-jvmci-25.1-b10", "platformspecific": true },
53-
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-25.0.1+8-jvmci-25.1-b10-debug", "platformspecific": true },
54-
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-25.0.1+8-jvmci-25.1-b10-sulong", "platformspecific": true },
55-
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-25.0.1+8-jvmci-25.1-b10", "platformspecific": true },
56-
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-25.0.1+8-jvmci-25.1-b10-debug", "platformspecific": true },
57-
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-25.0.1+8-jvmci-25.1-b10-sulong", "platformspecific": true }
52+
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-25.0.1+8-jvmci-25.1-b11", "platformspecific": true },
53+
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-25.0.1+8-jvmci-25.1-b11-debug", "platformspecific": true },
54+
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-25.0.1+8-jvmci-25.1-b11-sulong", "platformspecific": true },
55+
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-25.0.1+8-jvmci-25.1-b11", "platformspecific": true },
56+
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-25.0.1+8-jvmci-25.1-b11-debug", "platformspecific": true },
57+
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-25.0.1+8-jvmci-25.1-b11-sulong", "platformspecific": true }
5858
},
5959

6060
"eclipse": {
@@ -69,4 +69,4 @@
6969
"pylint": "==2.4.4",
7070
"black": "==23.11.0"
7171
}
72-
}
72+
}

ci/python-gate.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
},
161161
windows: {
162162
common: {
163-
PATH: "$MAVEN_HOME\\bin;$PATH",
163+
PATH: "$MAVEN_HOME\\bin;$PATH;C:\\hostedtoolcache\\windows\\Python\\3.12.3\\x64\\Scripts;C:\\hostedtoolcache\\windows\\Python\\3.12.3\\x64;C:\\Program Files\\PowerShell\\7;C:\\windows\\system32;C:\\windows;C:\\windows\\System32\\Wbem;C:\\windows\\System32\\WindowsPowerShell\\v1.0\\;C:\\windows\\System32\\OpenSSH\\;C:\\Program Files\\dotnet\\;C:\\Program Files\\Microsoft SQL Server\\150\\Tools\\Binn\\;C:\\Program Files\\Git\\cmd;C:\\Program Files\\Git\\usr\\bin;C:\\hostedtoolcache\\windows\\Ruby\\3.2.3\\x64\\bin;C:\\hostedtoolcache\\windows\\Go\\1.22.2\\x64\\bin;C:\\hostedtoolcache\\windows\\Node\\20.11.1\\x64\\;C:\\npm\\prefix;C:\\Program Files\\Amazon\\AWSCLIV2\\;C:\\Program Files\\Amazon\\SessionManagerPlugin\\bin\\;C:\\Program Files\\LLVM\\bin;C:\\Program Files\\CMake\\bin;C:\\Program Files\\OpenSSL\\bin;C:\\msys64\\usr\\bin;C:\\hostedtoolcache\\windows\\php\\8.2.15\\x64;C:\\Program Files\\Azure DevOps CLI\\bin;C:\\hostedtoolcache\\windows\\R\\4.3.3\\x64\\bin;C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\IDE\\Extensions\\Microsoft\\NuGet;",
164164
},
165165
amd64: {},
166166
aarch64: {},

0 commit comments

Comments
 (0)