Skip to content

Commit a0eb847

Browse files
committed
Dockerfile
1 parent 25c2928 commit a0eb847

4 files changed

Lines changed: 108 additions & 7 deletions

File tree

.dockerignore

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Project specific
2+
./prior-works/
3+
./data/
4+
./bench/
5+
./INSTALL.md
6+
./LICENSE
7+
./REQUIREMENTS.md
8+
9+
# Git
10+
.git
11+
.gitignore
12+
13+
# Python bytecode and cache
14+
__pycache__/
15+
*.py[cod]
16+
*$py.class
17+
.pytest_cache/
18+
.cache/
19+
20+
# Environments
21+
.venv/
22+
venv/
23+
ENV/
24+
env/
25+
.env
26+
.flaskenv
27+
28+
# Build and Distribution
29+
dist/
30+
build/
31+
*.egg-info/
32+
nosetests.xml
33+
coverage.xml
34+
.coverage
35+
htmlcov/
36+
37+
# IDEs and Editors
38+
.vscode/
39+
.idea/
40+
*.swp
41+
*.swo
42+
43+
# Docker-specific (preventing recursion)
44+
Dockerfile
45+
.dockerignore
46+
docker-compose.yml
47+
48+
# OS Junk
49+
.DS_Store
50+
Thumbs.db

Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM python:3.12-slim
2+
3+
LABEL org.opencontainers.image.source="https://github.com/ISE-Research/LinkAnchor"
4+
5+
# 1. Install Rust toolchain
6+
RUN apt-get update && apt-get install -y \
7+
curl \
8+
build-essential \
9+
git \
10+
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
11+
&& apt-get clean && rm -rf /var/lib/apt/lists/*
12+
# Add Rust to PATH
13+
ENV PATH="/root/.cargo/bin:${PATH}"
14+
15+
# 2. Set working directory
16+
WORKDIR /app
17+
18+
# 4. Copy project files
19+
COPY . .
20+
21+
# 5. Install Python dependencies
22+
RUN pip install .
23+
24+
# 6. Build rust-written modules using maturin
25+
RUN cd /app/src/git-wrapper && maturin build --release && pip install --no-cache-dir target/wheels/*.whl
26+
RUN cd /app/src/code-wrapper && maturin build --release && pip install --no-cache-dir target/wheels/*.whl
27+
28+
# 7. Define the entry point for the agent
29+
ENTRYPOINT ["python", "-m", "src.main"]

README.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,25 @@ The up-to-date version of the artifact can be found on github ([Link-Anchor gith
2626

2727
# ⚙️ Installation
2828

29+
## Docker
30+
You can pull the prebuild docker image:
31+
```bash
32+
docker pull ghcr.io/ise-research/linkanchor
33+
```
34+
or to build it manually:
35+
```bash
36+
docker build . --tag ghcr.io/ise-research/linkanchor
37+
```
38+
39+
## From Srouce
40+
2941
> Estimated setup time: < 10 minutes.
3042
31-
## Prerequisites
43+
### Prerequisites
3244
- Rust: Required for the git and code wrapper modules.
3345
- Python 3.10+: Recommended environment.
3446

35-
## Installation Steps
47+
### Installation Steps
3648

3749
```bash
3850

@@ -59,27 +71,37 @@ pip install .
5971
Use the following command to find the commit hash of the resolving commit:
6072

6173
```bash
62-
63-
export OPENAI_API_KEY=<YOUR_API_KEY>
74+
# If using the docker image
75+
docker run -it \
76+
-e OPENAI_API_KEY=<YOUR_API_KEY> \
77+
ghcr.io/ise-research/linkanchor \
78+
--git https://github.com/pallets/flask --issue https://github.com/pallets/flask/issues/5472
6479

6580
# If using raw python3
81+
export OPENAI_API_KEY=<YOUR_API_KEY>
6682
python3 -m src.main --git https://github.com/pallets/flask --issue https://github.com/pallets/flask/issues/5472
6783

6884
# if using uv (Recommanded)
85+
export OPENAI_API_KEY=<YOUR_API_KEY>
6986
uv run -m src.main --git https://github.com/pallets/flask --issue https://github.com/pallets/flask/issues/5472
7087
```
7188

7289
using the `--explain` flag, you can enter interactive mode in which LinkAnchor will explain the decision making process behind each step of the process.
7390

7491
```bash
75-
export OPENAI_API_KEY=<YOUR_API_KEY>
92+
# If using the docker image
93+
docker run -it \
94+
-e OPENAI_API_KEY=<YOUR_API_KEY> \
95+
ghcr.io/ise-research/linkanchor \
96+
--git https://github.com/pallets/flask --issue https://github.com/pallets/flask/issues/5472 --explain
7697

7798
# If using raw python3
99+
export OPENAI_API_KEY=<YOUR_API_KEY>
78100
python3 -m src.main --git https://github.com/pallets/flask --issue https://github.com/pallets/flask/issues/5472 --explain
79101

80102
# if using uv (Recommanded)
103+
export OPENAI_API_KEY=<YOUR_API_KEY>
81104
uv run -m src.main --git https://github.com/pallets/flask --issue https://github.com/pallets/flask/issues/5472 --explain
82-
83105
```
84106

85107

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
name = "git-anchor"
2+
name = "link-anchor"
33
version = "0.1.0"
44
description = ""
55
authors = [

0 commit comments

Comments
 (0)