Content-Length: 619482 | pFad | http://github.com/stacklok/codegate/commit/a72d86dff7df48c68d84fa13fdc13eddfac5b038

0C Harmonize readme and dev guide (fixes https://github.com/stacklok/cod… · stacklok/codegate@a72d86d · GitHub
Skip to content

Commit a72d86d

Browse files
wright-iolukehinds
andauthored
Harmonize readme and dev guide (fixes #700) (#701)
* 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. * Add information to integration test instructions for creating the necessary test data * Fix guidance to remove explicit venv creation and use poetry properly throughout --------- Co-authored-by: Luke Hinds <luke@stacklok.com>
1 parent acd4025 commit a72d86d

File tree

2 files changed

+74
-82
lines changed

2 files changed

+74
-82
lines changed

Diff for: README.md

-81
Original file line numberDiff line numberDiff line change
@@ -135,87 +135,6 @@ Check out the developer reference guides:
135135
- [Configuration system](./docs/configuration.md)
136136
- [Logging system](./docs/logging.md)
137137

138-
### Local setup
139-
140-
```bash
141-
# Get the code
142-
git clone https://github.com/stacklok/codegate.git
143-
cd codegate
144-
145-
# Set up virtual environment
146-
python -m venv venv
147-
source venv/bin/activate # On Windows: venv\Scripts\activate
148-
149-
# Install dev dependencies
150-
pip install -e ".[dev]"
151-
```
152-
153-
### Testing
154-
155-
To run the unit tests, execute this command:
156-
157-
```bash
158-
pytest
159-
```
160-
161-
To run the integration tests, create a `.env` file in the repo root directory
162-
and add the following properties to it:
163-
164-
```plain
165-
ENV_OPENAI_KEY=<YOUR_KEY>
166-
ENV_VLLM_KEY=<YOUR_KEY>
167-
ENV_ANTHROPIC_KEY=<YOUR_KEY>
168-
```
169-
170-
Then the integration tests can be executed by running:
171-
172-
```bash
173-
python tests/integration/integration_tests.py
174-
```
175-
176-
## 🐳 Docker deployment
177-
178-
### Build the image
179-
180-
```bash
181-
make image-build
182-
```
183-
184-
### Run the container
185-
186-
```bash
187-
# Basic usage with local image
188-
docker run -p 8989:8989 -p 9090:9090 codegate:latest
189-
190-
# With pre-built pulled image
191-
docker pull ghcr.io/stacklok/codegate:latest
192-
docker run --name codegate -d -p 8989:8989 -p 9090:9090 ghcr.io/stacklok/codegate:latest
193-
194-
# It will mount a volume to /app/codegate_volume
195-
# The directory supports storing Llama CPP models under subdirectory /models
196-
# A sqlite DB with the messages and alerts is stored under the subdirectory /db
197-
docker run --name codegate -d -v /path/to/volume:/app/codegate_volume -p 8989:8989 -p 9090:9090 ghcr.io/stacklok/codegate:latest
198-
```
199-
200-
### Exposed parameters
201-
202-
- CODEGATE_VLLM_URL: URL for the inference engine (defaults to
203-
[https://inference.codegate.ai](https://inference.codegate.ai))
204-
- CODEGATE_OPENAI_URL: URL for OpenAI inference engine (defaults to
205-
[https://api.openai.com/v1](https://api.openai.com/v1))
206-
- CODEGATE_ANTHROPIC_URL: URL for Anthropic inference engine (defaults to
207-
[https://api.anthropic.com/v1](https://api.anthropic.com/v1))
208-
- CODEGATE_OLLAMA_URL: URL for OLlama inference engine (defaults to
209-
[http://localhost:11434/api](http://localhost:11434/api))
210-
- CODEGATE_APP_LOG_LEVEL: Level of debug desired when running the codegate
211-
server (defaults to WARNING, can be ERROR/WARNING/INFO/DEBUG)
212-
- CODEGATE_LOG_FORMAT: Type of log formatting desired when running the codegate
213-
server (default to TEXT, can be JSON/TEXT)
214-
215-
```bash
216-
docker run -p 8989:8989 -p 9090:9090 -e CODEGATE_OLLAMA_URL=http://1.2.3.4:11434/api ghcr.io/stacklok/codegate:latest
217-
```
218-
219138
## 🤝 Contributing
220139

221140
We welcome contributions! Whether it's bug reports, feature requests, or code

Diff for: docs/development.md

+74-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ The project uses several tools to maintain code quality:
147147

148148
### 3. Testing
149149

150-
Run the test suite with coverage:
150+
#### Unit Tests
151+
To run the unit test suite with coverage:
151152

152153
```bash
153154
poetry run pytest
@@ -156,6 +157,35 @@ poetry run pytest
156157
Tests are located in the `tests/` directory and follow the same structure as the
157158
source code.
158159

160+
#### Integration Tests
161+
To run the integration tests, create a `.env` file in the repo root directory and add the
162+
following properties to it:
163+
```
164+
ENV_OPENAI_KEY=<YOUR_KEY>
165+
ENV_VLLM_KEY=<YOUR_KEY>
166+
ENV_ANTHROPIC_KEY=<YOUR_KEY>
167+
```
168+
169+
Next, run import_packages to ensure integration test data is created:
170+
```bash
171+
poetry run python scripts/import_packages.py
172+
```
173+
174+
Next, start the CodeGate server:
175+
```bash
176+
poetry run codegate serve --log-level DEBUG --log-format TEXT
177+
```
178+
179+
Then the integration tests can be executed by running:
180+
```bash
181+
poetry run python tests/integration/integration_tests.py
182+
```
183+
184+
You can include additional properties to specify test scope and other information. For instance, to execute the tests for Copilot providers, for instance, run:
185+
```bash
186+
CODEGATE_PROVIDERS=copilot CA_CERT_FILE=./codegate_volume/certs/ca.crt poetry run python tests/integration/integration_tests.py
187+
```
188+
159189
### 4. Make commands
160190

161191
The project includes a Makefile for common development tasks:
@@ -168,6 +198,49 @@ The project includes a Makefile for common development tasks:
168198
- `make build`: build distribution packages
169199
- `make all`: run all checks and build (recommended before committing)
170200

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

173246
CodeGate uses a hierarchical configuration system with the following priority

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/stacklok/codegate/commit/a72d86dff7df48c68d84fa13fdc13eddfac5b038

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy