Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Commit a3b7462

Browse files
author
Doug Wright
committed
Remove redundancy and differences between README and Development Guide
- Removed information from README that repeated or conflicted with the Development Guide (docs/development.md). - Moved development guidance that was only in the README into the Development Guide - Added a note to clarify context needed for running integration tests.
1 parent 332794d commit a3b7462

File tree

1 file changed

+72
-2
lines changed

1 file changed

+72
-2
lines changed

docs/development.md

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,14 @@ from potential AI-related security risks. Key features include:
3838
2. Install Poetry following the
3939
[official installation guide](https://python-poetry.org/docs/#installation)
4040

41-
3. Install project dependencies:
41+
3. Set up virtual environment
42+
43+
```bash
44+
python -m venv venv
45+
source venv/bin/activate # On Windows: venv\Scripts\activate
46+
```
47+
48+
4. Install project dependencies:
4249

4350
```bash
4451
poetry install --with dev
@@ -147,7 +154,8 @@ The project uses several tools to maintain code quality:
147154

148155
### 3. Testing
149156

150-
Run the test suite with coverage:
157+
#### Unit Tests
158+
To run the unit test suite with coverage:
151159

152160
```bash
153161
poetry run pytest
@@ -156,6 +164,25 @@ poetry run pytest
156164
Tests are located in the `tests/` directory and follow the same structure as the
157165
source code.
158166

167+
#### Integration Tests
168+
To run the integration tests, create a `.env` file in the repo root directory and add the
169+
following properties to it:
170+
```
171+
ENV_OPENAI_KEY=<YOUR_KEY>
172+
ENV_VLLM_KEY=<YOUR_KEY>
173+
ENV_ANTHROPIC_KEY=<YOUR_KEY>
174+
```
175+
176+
Then the integration tests can be executed by running:
177+
```bash
178+
python tests/integration/integration_tests.py
179+
```
180+
181+
You can include additional properties to specify test scope and other information. For instance, to execute the tests for Copilot providers, for instance, run:
182+
```bash
183+
CODEGATE_PROVIDERS=copilot CA_CERT_FILE=./codegate_volume/certs/ca.crt python tests/integration/integration_tests.py
184+
```
185+
159186
### 4. Make commands
160187

161188
The project includes a Makefile for common development tasks:
@@ -168,6 +195,49 @@ The project includes a Makefile for common development tasks:
168195
- `make build`: build distribution packages
169196
- `make all`: run all checks and build (recommended before committing)
170197

198+
## 🐳 Docker deployment
199+
200+
### Build the image
201+
202+
```bash
203+
make image-build
204+
```
205+
206+
### Run the container
207+
208+
```bash
209+
# Basic usage with local image
210+
docker run -p 8989:8989 -p 9090:9090 codegate:latest
211+
212+
# With pre-built pulled image
213+
docker pull ghcr.io/stacklok/codegate:latest
214+
docker run --name codegate -d -p 8989:8989 -p 9090:9090 ghcr.io/stacklok/codegate:latest
215+
216+
# It will mount a volume to /app/codegate_volume
217+
# The directory supports storing Llama CPP models under subdirectory /models
218+
# A sqlite DB with the messages and alerts is stored under the subdirectory /db
219+
docker run --name codegate -d -v /path/to/volume:/app/codegate_volume -p 8989:8989 -p 9090:9090 ghcr.io/stacklok/codegate:latest
220+
```
221+
222+
### Exposed parameters
223+
224+
- CODEGATE_VLLM_URL: URL for the inference engine (defaults to
225+
[https://inference.codegate.ai](https://inference.codegate.ai))
226+
- CODEGATE_OPENAI_URL: URL for OpenAI inference engine (defaults to
227+
[https://api.openai.com/v1](https://api.openai.com/v1))
228+
- CODEGATE_ANTHROPIC_URL: URL for Anthropic inference engine (defaults to
229+
[https://api.anthropic.com/v1](https://api.anthropic.com/v1))
230+
- CODEGATE_OLLAMA_URL: URL for OLlama inference engine (defaults to
231+
[http://localhost:11434/api](http://localhost:11434/api))
232+
- CODEGATE_APP_LOG_LEVEL: Level of debug desired when running the codegate
233+
server (defaults to WARNING, can be ERROR/WARNING/INFO/DEBUG)
234+
- CODEGATE_LOG_FORMAT: Type of log formatting desired when running the codegate
235+
server (default to TEXT, can be JSON/TEXT)
236+
237+
```bash
238+
docker run -p 8989:8989 -p 9090:9090 -e CODEGATE_OLLAMA_URL=http://1.2.3.4:11434/api ghcr.io/stacklok/codegate:latest
239+
```
240+
171241
## Configuration system
172242

173243
CodeGate uses a hierarchical configuration system with the following priority

0 commit comments

Comments
 (0)