Skip to content

Commit dc6b9c9

Browse files
committed
Merge branch 'refactor/prod-and-dev-Dockerfiles' into ci/refactor-ghas
2 parents 90eea8b + 5ed3069 commit dc6b9c9

31 files changed

Lines changed: 3505 additions & 2326 deletions

.github/workflows/lint-and-test.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
env:
1010
NODE_VERSION: '18'
11-
PYTHON_VERSION: '3.11'
11+
PYTHON_VERSION: '3.13'
1212

1313
jobs:
1414
changes:
@@ -110,15 +110,16 @@ jobs:
110110
- name: Checkout code
111111
uses: actions/checkout@v4
112112

113-
- name: Set Docker Image Names
113+
- name: Set Docker Image Name
114114
run: |
115115
echo "LINT_IMAGE_NAME=${{ matrix.library }}-lint:${{ needs.sanitize-branch-name.outputs.sanitized_ref }}-${{ github.run_number }}" >> $GITHUB_ENV
116116
echo "TEST_IMAGE_NAME=${{ matrix.library }}-test:${{ needs.sanitize-branch-name.outputs.sanitized_ref }}-${{ github.run_number }}" >> $GITHUB_ENV
117117
shell: bash
118118

119119
- name: Build lint image
120120
run: |
121-
docker build -t $LINT_IMAGE_NAME --build-arg TEST=0 -f libs/Dockerfile libs
121+
docker build -t $LINT_IMAGE_NAME --build-arg DIRECTORY=${{ matrix.library }} --build-arg TEST=0 -f libs/Dockerfile libs
122+
122123
123124
- name: Run linting
124125
run: |

README.md

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,25 +225,60 @@ cd infrastructure/rag;helm dependency update; cd ../..
225225
226226
After the initial build of the helm chart *Tilt* is able to update the files.
227227

228+
##### Development vs Production Mode
229+
230+
The template supports two deployment modes for local development:
231+
232+
- **Production Mode** (default): Uses production Dockerfiles with local library dependencies for realistic testing
233+
- **Development Mode**: Uses development Dockerfiles with live code updates for fast iteration
234+
228235
The following will tear up the microservices in *k3d*.
229236
For the following steps, it is assumed your current working directory is the root of the git-repository.
230237

238+
**Production Mode (default):**
239+
231240
```shell
232241
tilt up
233242
```
234243

244+
**Development Mode:**
245+
246+
```shell
247+
tilt up -- --dev=true
248+
```
249+
250+
##### Docker File Structure
251+
252+
Each service now has separate Docker files optimized for different use cases:
253+
254+
- `Dockerfile`: Production-optimized builds with multi-stage architecture and security hardening
255+
- `Dockerfile.dev`: Development-optimized builds with faster build times and development tools
256+
257+
The Tilt configuration automatically selects the appropriate Dockerfile based on the mode:
258+
259+
- Production mode uses `Dockerfile` with local library dependencies (`prod-local` group)
260+
- Development mode uses `Dockerfile.dev` with live code updates and development dependencies
261+
235262
Environment variables are loaded from `.env` file in the root of this git-repository.
236263

237264
The *Tilt* UI is available at [http://localhost:10350/](http://localhost:10350/)
238265

239266
If you want to access *Qdrant* etc. just click the resource in the UI. In the upper corner will be the link, to access the resource.
240267

268+
##### Debugging
269+
241270
To enable debugging, start tilt with the following command:
242271

243272
```shell
244273
tilt up -- --debug=true
245274
```
246275

276+
It is recommended to combine debugging with development mode:
277+
278+
```shell
279+
tilt up -- --debug=true --dev=true
280+
```
281+
247282
The backend will wait until your debugger is connected before it will fully start.
248283
The debugger used is `debugpy` which is compatible with VS Code.
249284
To connect the debugger, you can use the following `launch.json`:
@@ -368,10 +403,12 @@ A detailed explanation of, how to access a service via ingress, can be found in
368403
### 2.1 Server provisioning
369404

370405
The RAG template requires *at least*:
371-
- A Kubernetes Cluster
372-
- S3 ObjectStorage
406+
407+
- A Kubernetes Cluster
408+
- S3 ObjectStorage
373409

374410
Provided is an example Terraform script, using the [STACKIT Terrraform Provider](https://registry.terraform.io/providers/stackitcloud/stackit/latest/docs):
411+
375412
```terraform
376413
resource "stackit_ske_project" "rag-ske" {
377414
project_id = var.stackit_project_id
@@ -429,8 +466,8 @@ Further requirements for the server can be found in the [infrastructure README](
429466

430467
A detailed description regarding the configuration of Langfuse can be found in the [infrastructure README](./infrastructure/README.md).
431468

432-
433469
## 3. Build and Test
470+
434471
The example `Tiltfile` provides a triggered linting and testing.
435472
The linting-settings can be changed in the `services/rag-backend/pyproject.toml` file under section `tool.flake8`.
436473

0 commit comments

Comments
 (0)