Skip to content

Commit 519b642

Browse files
committed
Update environment and add github action
1 parent e7ca989 commit 519b642

File tree

4 files changed

+42
-36
lines changed

4 files changed

+42
-36
lines changed

Dockerfile.minimal

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# autocoderover/acr:v1
22
FROM continuumio/miniconda3:main
33

4-
RUN git config --global user.email acr@nus.edu.sg
4+
RUN git config --global user.email acr@autocoderover.dev
55
RUN git config --global user.name acr
66

77
ENV DEBIAN_FRONTEND=noninteractive

action.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: 'AutoCodeRover'
2+
description: 'Install AutoCodeRover dependencies.'
3+
4+
runs:
5+
6+
using: 'composite'
7+
8+
steps:
9+
10+
- uses: actions/setup-python@v5
11+
with:
12+
python-version: '3.11'
13+
14+
- name: Cache pip dependencies
15+
id: cache-deps
16+
uses: actions/cache@v3
17+
with:
18+
path: ~/.cache/pip
19+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt', '${{ github.action_path }}') }}
20+
restore-keys: |
21+
${{ runner.os }}-pip-
22+
- name: Install ACR dependencies
23+
id: install-deps
24+
run: |
25+
pip install -r ${{ github.action_path }}/requirements.txt
26+
echo "pip install ok"
27+
echo "ACR_PATH=${{ github.action_path }}" >> $GITHUB_OUTPUT
28+
shell: bash
29+
30+
outputs:
31+
ACR_PATH:
32+
description: "Path to AutoCodeRover source code directory."
33+
value: ${{ steps.install-deps.outputs.ACR_PATH }}

app/main.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,17 +533,21 @@ def do_inference(
533533

534534
end_time = datetime.now()
535535

536-
dump_cost(start_time, end_time, task_output_dir)
536+
dump_cost(start_time, end_time, task_output_dir, python_task.project_path)
537537
finally:
538538
python_task.reset_project()
539539

540540
return run_ok
541541

542542

543-
def dump_cost(start_time: datetime, end_time: datetime, task_output_dir: str):
543+
def dump_cost(
544+
start_time: datetime, end_time: datetime, task_output_dir: str, project_path: str
545+
):
546+
with apputils.cd(project_path):
547+
commit_hash = apputils.get_current_commit_hash()
544548
model_stats = common.SELECTED_MODEL.get_overall_exec_stats()
545549
stats = {
546-
"commit": apputils.get_current_commit_hash(),
550+
"commit": commit_hash,
547551
"start_epoch": start_time.timestamp(),
548552
"end_epoch": end_time.timestamp(),
549553
"elapsed_seconds": (end_time - start_time).total_seconds(),

environment.yml

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -28,35 +28,4 @@ dependencies:
2828
- loguru=0.7.2
2929
- rich=13.7.1
3030
- pip:
31-
- annotated-types==0.6.0
32-
- anyio==4.2.0
33-
- beautifulsoup4==4.12.3
34-
- boto3==1.34.122
35-
- certifi==2024.7.4
36-
- distro==1.9.0
37-
- docstring-parser==0.15
38-
- h11==0.14.0
39-
- httpcore==1.0.5
40-
- httpx==0.27.0
41-
- idna==3.7
42-
- lxml==5.1.0
43-
- openai==1.35.14
44-
- pydantic==2.5.3
45-
- pydantic-core==2.14.6
46-
- python-dotenv==1.0.0
47-
- rich==13.7.1
48-
- sniffio==1.3.0
49-
- soupsieve==2.5
50-
- tenacity==8.2.3
51-
- termcolor==2.4.0
52-
- timeout-decorator==0.5.0
53-
- tqdm==4.66.4
54-
- typing-extensions==4.9.0
55-
- unittest-xml-reporting==3.2.0
56-
- coverage==7.4.4
57-
- pylint==3.1.0
58-
- litellm==1.41.24
59-
- ollama==0.1.8
60-
- flask==3.0.3
61-
- flask_cors==4.0.0
62-
- unidiff==0.7.5
31+
- -r requirements.txt

0 commit comments

Comments
 (0)