Skip to content

Commit

Permalink
Update environment and add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
Marti2203 committed Sep 9, 2024
1 parent e7ca989 commit 519b642
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.minimal
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# autocoderover/acr:v1
FROM continuumio/miniconda3:main

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

ENV DEBIAN_FRONTEND=noninteractive
Expand Down
33 changes: 33 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 'AutoCodeRover'
description: 'Install AutoCodeRover dependencies.'

runs:

using: 'composite'

steps:

- uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Cache pip dependencies
id: cache-deps
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt', '${{ github.action_path }}') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install ACR dependencies
id: install-deps
run: |
pip install -r ${{ github.action_path }}/requirements.txt
echo "pip install ok"
echo "ACR_PATH=${{ github.action_path }}" >> $GITHUB_OUTPUT
shell: bash

outputs:
ACR_PATH:
description: "Path to AutoCodeRover source code directory."
value: ${{ steps.install-deps.outputs.ACR_PATH }}
10 changes: 7 additions & 3 deletions app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -533,17 +533,21 @@ def do_inference(

end_time = datetime.now()

dump_cost(start_time, end_time, task_output_dir)
dump_cost(start_time, end_time, task_output_dir, python_task.project_path)
finally:
python_task.reset_project()

return run_ok


def dump_cost(start_time: datetime, end_time: datetime, task_output_dir: str):
def dump_cost(
start_time: datetime, end_time: datetime, task_output_dir: str, project_path: str
):
with apputils.cd(project_path):
commit_hash = apputils.get_current_commit_hash()
model_stats = common.SELECTED_MODEL.get_overall_exec_stats()
stats = {
"commit": apputils.get_current_commit_hash(),
"commit": commit_hash,
"start_epoch": start_time.timestamp(),
"end_epoch": end_time.timestamp(),
"elapsed_seconds": (end_time - start_time).total_seconds(),
Expand Down
33 changes: 1 addition & 32 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,4 @@ dependencies:
- loguru=0.7.2
- rich=13.7.1
- pip:
- annotated-types==0.6.0
- anyio==4.2.0
- beautifulsoup4==4.12.3
- boto3==1.34.122
- certifi==2024.7.4
- distro==1.9.0
- docstring-parser==0.15
- h11==0.14.0
- httpcore==1.0.5
- httpx==0.27.0
- idna==3.7
- lxml==5.1.0
- openai==1.35.14
- pydantic==2.5.3
- pydantic-core==2.14.6
- python-dotenv==1.0.0
- rich==13.7.1
- sniffio==1.3.0
- soupsieve==2.5
- tenacity==8.2.3
- termcolor==2.4.0
- timeout-decorator==0.5.0
- tqdm==4.66.4
- typing-extensions==4.9.0
- unittest-xml-reporting==3.2.0
- coverage==7.4.4
- pylint==3.1.0
- litellm==1.41.24
- ollama==0.1.8
- flask==3.0.3
- flask_cors==4.0.0
- unidiff==0.7.5
- -r requirements.txt

0 comments on commit 519b642

Please sign in to comment.