Skip to content

Commit b387c28

Browse files
committed
Separate LLM review into its own yml file
also, add pr commenting permissions
1 parent 8e5712b commit b387c28

File tree

2 files changed

+50
-34
lines changed

2 files changed

+50
-34
lines changed

.github/workflows/github-ci.yml

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -476,40 +476,6 @@ jobs:
476476
mini-apps/ionosphereSolverTests/atmosphere.png
477477
if-no-files-found: error
478478

479-
llm_pr_review:
480-
runs-on: carrington
481-
continue-on-error: true
482-
steps:
483-
- name: Checkout source
484-
uses: actions/checkout@v4
485-
with:
486-
submodules: false
487-
ref: ${{ github.event.pull_request.head.sha }}
488-
- name: Diff with PR target
489-
run: |
490-
git diff -W ${{ github.event.pull_request.base.sha }}..HEAD > diff.txt
491-
- name: Build prompt
492-
run: |
493-
cat > prompt.txt << BLOP
494-
<|im_start|>system
495-
You are CodeReviewBot, the automatic pull request reviewer for Vlasiator, the 6D hybrid-Vlasov magnetospheric simulation code. You are helpful and precise in your code review statements, and do not need to be overly polite.<|im_end|>
496-
<|im_start|>user
497-
Please analyze the following pull request diff, and give a short summary of its changes, as well as an analysis of potentially introduced problems or inconsistences. If there are none, give your approval for the PR.
498-
BLOP
499-
cat diff.txt >> prompt.txt
500-
cat >> prompt.txt << BLOP
501-
<|im_end|>
502-
<|im_start|>assistant
503-
BLOP
504-
505-
- name: Run llama.cpp
506-
run: |
507-
srun --interactive --mem-per-gpu=20G --cpus-per-gpu=8 -t00:10:00 -pgpu-oversub -G 1 -Mukko bash -c "module load GCCcore/11.3.0; module load CUDA; /wrk-vakka/users/uganse/llama.cpp/llama-cli -c 65535 -t 8 -ngl 63 -m /wrk-vakka/users/uganse/llama.cpp/models/Qwen2.5-32B-Instruct-Q4_K_M.gguf --no-display-prompt -f prompt.txt" | tee output.txt
508-
- name: Add PR comment
509-
uses: mshick/add-pr-comment@v2
510-
with:
511-
message-path: output.txt
512-
513479
check_cfg_files:
514480
runs-on: ubuntu-latest
515481
container: ursg/vlasiator_ci:20241101_1

.github/workflows/llm_pr_reviw.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: PR LLM auto-review
2+
3+
on:
4+
# Dispatch this workflow whenever master or dev get a PR
5+
pull_request:
6+
branches: ["dev","master"]
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
llm_pr_review:
14+
runs-on: carrington
15+
continue-on-error: true
16+
permissions:
17+
pull-requests: write
18+
steps:
19+
- name: Checkout source
20+
uses: actions/checkout@v4
21+
with:
22+
submodules: false
23+
ref: ${{ github.event.pull_request.head.sha }}
24+
- name: Try to merge with target
25+
run: git merge ${{ github.event.pull_request.base.sha }}
26+
- name: Diff with PR target
27+
run: |
28+
git diff -W ${{ github.event.pull_request.base.sha }}..HEAD > diff.txt
29+
- name: Build prompt
30+
run: |
31+
cat > prompt.txt << BLOP
32+
<|im_start|>system
33+
You are CodeReviewBot, the automatic pull request reviewer for Vlasiator, the 6D hybrid-Vlasov magnetospheric simulation code. You are helpful and precise in your code review statements, and do not need to be overly polite.<|im_end|>
34+
<|im_start|>user
35+
Please analyze the following pull request diff, and give a short summary of its changes, as well as an analysis of potentially introduced problems or inconsistences. If there are none, give your approval for the PR.
36+
BLOP
37+
cat diff.txt >> prompt.txt
38+
cat >> prompt.txt << BLOP
39+
<|im_end|>
40+
<|im_start|>assistant
41+
BLOP
42+
43+
- name: Run llama.cpp
44+
run: |
45+
srun --interactive --mem-per-gpu=20G --cpus-per-gpu=8 -t00:10:00 -pgpu-oversub -G 1 -Mukko bash -c "module load GCCcore/11.3.0; module load CUDA; /wrk-vakka/users/uganse/llama.cpp/llama-cli -c 65535 -t 8 -ngl 63 -m /wrk-vakka/users/uganse/llama.cpp/models/Qwen2.5-32B-Instruct-Q4_K_M.gguf --no-display-prompt -f prompt.txt" | tee output.txt
46+
- name: Add PR comment
47+
uses: mshick/add-pr-comment@v2
48+
with:
49+
message-path: output.txt
50+

0 commit comments

Comments
 (0)