Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
185 commits
Select commit Hold shift + click to select a range
fec1e14
chore: Added README.md, .gitignore (Python) files
a-klos Jun 5, 2024
246957b
feat: initial infrastructure files
a-klos Jun 13, 2024
4c7c6b6
chore: adds better example for basic auth
MelvinKl Jun 17, 2024
9062f8e
chore: fix a few bugs
MelvinKl Jun 26, 2024
5de79a7
chore: decrease disk-preussure on k3d
MelvinKl Jun 27, 2024
736fcc2
chore: fix image pulling
MelvinKl Jul 5, 2024
849a48f
feat: make image pull secret creation optional
MelvinKl Jul 8, 2024
d1ecf43
chore: update dockerfiles
MelvinKl Jul 9, 2024
30f8627
chore: Update Readme.md
MelvinKl Jul 12, 2024
43347b5
fix: frontend
a-klos Jul 19, 2024
9ec014e
chore: Update deployment.yaml
MelvinKl Jul 25, 2024
4f33d2f
chore: adds readme
MelvinKl Jul 29, 2024
a8f87de
chore: rename to general case
MelvinKl Aug 1, 2024
8df40bb
fix: added a fixed tag to the langfuse image to avoid future bugs
youssefcamao Aug 14, 2024
a12b3cf
feat: adds logging config
MelvinKl Aug 15, 2024
a1a7b24
feat: adds embedder types selector
MelvinKl Aug 15, 2024
0ba6766
chore: adjust infrastructure for changed embber type implementation
MelvinKl Aug 15, 2024
773074c
feat: adds reranking to retriever
MelvinKl Aug 22, 2024
262e6c5
feat: adds basic setup for stackit cluster
MelvinKl Aug 22, 2024
f2ca873
fix: broken configmap due to merging
MelvinKl Aug 22, 2024
dbad835
feat: adds terrraform for s3
MelvinKl Aug 26, 2024
03ec843
feat: adds langfuse ragas evaluator
MelvinKl Aug 26, 2024
4e69588
feat: Adding Stackit Vlllm to the llms
youssefcamao Aug 27, 2024
c28043d
fix: stackit vllm infra
MelvinKl Aug 28, 2024
9aaa487
feat: Adds stackit vllm embedder
MelvinKl Sep 2, 2024
b693f9a
chore: set langfuse version tag
MelvinKl Sep 3, 2024
c3b1495
fix: ingress related issues
a-klos Sep 12, 2024
8f7ea00
chore: add worker arg to backend values
a-klos Sep 12, 2024
beb735a
fix: quotation for backend workers/queue size
MelvinKl Sep 12, 2024
704df9d
feat: makes basic.auth for not admin optional
MelvinKl Sep 16, 2024
ba41a1c
chore: only expose chat endpoint
MelvinKl Sep 16, 2024
af74341
fix: ragas evaluation
MelvinKl Sep 20, 2024
0049004
chore: add chat history cm
a-klos Sep 20, 2024
fa2e70c
feat: add max concurrency for evaluation
MelvinKl Sep 24, 2024
b83bc5a
fix: reload of uvicorn
a-klos Oct 1, 2024
c68b260
refactor!: unite front- and backend subcharts in parent chart
a-klos Oct 24, 2024
5be6bda
add: init values to langfuse values file
a-klos Oct 28, 2024
888dd17
chore: update logging file destination
a-klos Oct 30, 2024
3aec198
chore: add vllm values to helm chart
a-klos Nov 8, 2024
b166718
chore: add security context to deployments
a-klos Nov 15, 2024
06aea32
chore: one-chart
MelvinKl Nov 19, 2024
bd572de
fix: fixed the hostname bug in langfuse
youssefcamao Nov 19, 2024
7e308f4
feat: Add a confluence loader to rag infrastructure
youssefcamao Nov 19, 2024
a9c4650
chore: revise qdrant section
MelvinKl Nov 20, 2024
3056a10
refactor: removed myapi config from the infrastructure
youssefcamao Nov 21, 2024
50ed06a
fix: ragas
MelvinKl Nov 25, 2024
7c9d338
fix: creation of pull secret
MelvinKl Nov 28, 2024
404bf6f
chore: adjust spaces in Readme.md
a-klos Nov 28, 2024
cd54e60
chore: update langfuse image tag and make image pull secret optional
a-klos Dec 3, 2024
5f770f0
chore: add code of conduct
a-klos Dec 4, 2024
938840b
chore: contribution guideline
a-klos Dec 4, 2024
00db018
refactor: delete not necessary contribution instruction
a-klos Dec 4, 2024
bf992f7
fix: production deployment issues
a-klos Dec 10, 2024
75b885d
fix: minor issues appeared during production deployment
a-klos Dec 11, 2024
fabc80f
chore: add Apache License 2.0 to the repository
a-klos Dec 16, 2024
feee878
feat: update ollama version and add ollama embedder configuration
a-klos Dec 17, 2024
f6650f5
refactor: remove AlephAlpha configuration and references from the cod…
a-klos Dec 18, 2024
aa9db3d
chore: update and fix qdrant helm/image version. adjust values for fa…
a-klos Jan 15, 2025
cc1d24f
chore: add additional error message to values
a-klos Jan 15, 2025
0b254d1
chore: update PR template to correct username mention (#1)
a-klos Jan 20, 2025
259bfaf
chore: update image repository to use ghcr.io/stackitcloud for all se…
a-klos Jan 20, 2025
38e9645
chore: update image tags to version v1.0.0 for consistency across ser…
a-klos Jan 20, 2025
1aaa4db
chore: initial commit
MelvinKl Jun 5, 2024
7120068
chore: basic structure
MelvinKl Jun 6, 2024
35c3a3d
feat: dockerfile base
a-klos Jun 12, 2024
0461b93
feat: add endpoints and relevant files
a-klos Jun 13, 2024
0605451
feat: adds overwritable chain for chat
MelvinKl Jun 13, 2024
a69db3a
chore: remove doctopus-specific error message
MelvinKl Jun 14, 2024
e4c4adb
chore: fix a few bugs
MelvinKl Jun 27, 2024
15dd1ee
fix: langfuse chain tracing
MelvinKl Jul 5, 2024
a7dbca0
chore: linting
MelvinKl Jul 5, 2024
710db61
feat: Build and Test Pipeline
Jul 9, 2024
93de5db
chore: update Dockerfiles
MelvinKl Jul 9, 2024
35753e1
fix: Builds in use case
MelvinKl Jul 11, 2024
1701abb
fix: pipeline
MelvinKl Jul 11, 2024
400b378
chore: split core
MelvinKl Jul 22, 2024
ec93caa
chore: add readme
MelvinKl Jul 29, 2024
a10e330
feat: add validator for upload document
MelvinKl Jul 29, 2024
ee542f1
fix: default_chat_chain
MelvinKl Aug 1, 2024
a65857d
fix: adjusted the chat chain to recognize the search result
youssefcamao Aug 13, 2024
ce91671
feat: adds logging config
MelvinKl Aug 15, 2024
119e070
chore: adds pyyaml dependency for loading logging config
MelvinKl Aug 20, 2024
066b8c4
feat: adds embedder types selector
MelvinKl Aug 22, 2024
7481051
feat: adds reranking to retriever in rag library
MelvinKl Aug 26, 2024
ae7792a
feat: adds ragas langfuse evaluator
MelvinKl Aug 26, 2024
77c8977
feat: Adding Stackit Vlllm to the llms
youssefcamao Aug 27, 2024
299cbca
fix: return of source documents
MelvinKl Aug 28, 2024
7d7f8fb
feat: makes use of history in answer generation
MelvinKl Aug 29, 2024
c848afd
chore: delete nonecessary api generator scripts in subfolders
a-klos Aug 29, 2024
e35f417
feat: Adds stackit vllm embedder
MelvinKl Sep 2, 2024
cc83ed5
chore: remove printing message
MelvinKl Sep 2, 2024
901e23f
chore: Remove docker base because if breaks tilt
MelvinKl Sep 2, 2024
8951742
fix: default chat chain with no history
MelvinKl Sep 3, 2024
94dfc48
fix: ragas evaluation
MelvinKl Sep 3, 2024
f72c6de
feat: add default score to non-answered ragas questions
MelvinKl Sep 3, 2024
4ff542d
feat: adds rephrasing chain for usage of history in retrieval
MelvinKl Sep 5, 2024
073bc52
feat: Adds cancellation chat endpoint
MelvinKl Sep 18, 2024
11a0ca2
fix: ragas evaluation
MelvinKl Sep 20, 2024
c9c89f9
fix: cancellation
manu-hoffmann Sep 20, 2024
f9739af
fix: tracing session id
manu-hoffmann Sep 20, 2024
cd5921b
feat:: replace chat chain by minimal langgraph chat graph
a-klos Sep 20, 2024
b434084
fix: langgraph edges and missing dependencies
a-klos Sep 23, 2024
924109c
fix: remove fixed number of retrieved documents
a-klos Sep 24, 2024
5b0f6ca
feat: max concurrency limit for evaluation
MelvinKl Sep 24, 2024
32d78e8
fix: evaluation endpoint
MelvinKl Sep 27, 2024
de3d7f6
chore: Added a script that helps with updating the poetry files
youssefcamao Oct 1, 2024
611d6e6
fix: fixed a bug when running the script with a defined source folder
youssefcamao Oct 8, 2024
b8207ed
fix: async multithreading semaphore issue
a-klos Oct 24, 2024
cc9c6e9
fix: arch in dockerfiles
a-klos Oct 30, 2024
bbdf335
chore: Slim down graph
MirUlr Nov 8, 2024
0ad6f60
fix: langgraph won't crash in case of missing/empty collection.
MirUlr Nov 8, 2024
5c2d41f
refactor!: put admin and extractor api logic to rag-core-library
a-klos Nov 13, 2024
66c4790
feat: Add confluence loader to the extractor api lib
youssefcamao Nov 19, 2024
01ae992
chore: author and short description change
MelvinKl Nov 20, 2024
0bf19e2
fix: Cleanups and improvments
youssefcamao Nov 21, 2024
14525a0
chore: adjust readme for core-api
MelvinKl Nov 22, 2024
be2473c
refactor: dependency container of admin api lib
a-klos Nov 22, 2024
c342a82
chore: readme adjustment
MelvinKl Nov 25, 2024
19ea02a
fix: ragas
MelvinKl Nov 25, 2024
f8ecf22
refactor: ragas settings
a-klos Nov 28, 2024
dc10f07
chore: adjust spaces in readme.md
a-klos Nov 28, 2024
67a609f
chore: run confluence loader in thread. add response 423
a-klos Dec 3, 2024
f8b8869
chore: add code of conduct
a-klos Dec 4, 2024
cdcafdc
chore: contribution guideline and pr template
a-klos Dec 4, 2024
3e1709f
refactor: rename chunker base class
a-klos Dec 4, 2024
e98f2c8
chore: docstring to the implemented endpoints of the admin api lib
a-klos Dec 4, 2024
ced1e09
chore: add docstrings to abstract classes of the admin api lib
a-klos Dec 5, 2024
fba7510
chore: doc strings to classes and methods
a-klos Dec 5, 2024
0434aec
chore: docstrings for extractor api lib
a-klos Dec 5, 2024
1bf5cf8
chore: add and adjust doc strings of the admin api lib
a-klos Dec 6, 2024
6203fe9
chore: refactor file structure and update import paths in extractor A…
a-klos Dec 6, 2024
7641224
chore: add docstrings to rag-core-lib
a-klos Dec 6, 2024
956f000
chore: add docstring to rag-core-api part 1
a-klos Dec 10, 2024
698824a
fix: confluence deletion issue
a-klos Dec 11, 2024
94d9555
chore: add docstrings and module descriptions for evaluator and graph…
a-klos Dec 12, 2024
f6fb9f9
chore: restructure directory structure and revise imports
a-klos Dec 13, 2024
a2efaef
chore: add doc strings to rag backend.
a-klos Dec 16, 2024
8e50e87
chore: add Apache License 2.0 to the repository
a-klos Dec 16, 2024
76cc417
feat: add OllamaEmbedderSettings and integrate into DependencyContainer
a-klos Dec 17, 2024
3c07a18
chore: remove alephalpha and not necessary classes.
a-klos Dec 18, 2024
bf18aeb
feat: add 422 response for unprocessable entity in API endpoints
a-klos Dec 18, 2024
245f4b3
refactor: update to_json methods to use model_dump_json for JSON seri…
a-klos Dec 20, 2024
edd2253
test: add function tests for the rag core api
a-klos Jan 15, 2025
2939b5a
chore: handle empty messages
a-klos Jan 15, 2025
867d642
docs: update use case example repository link in README (#1)
a-klos Jan 20, 2025
fa5c2b7
chore: remove Azure build and test pipeline (#2)
a-klos Jan 20, 2025
2f02b68
ci: automate releases with semantic-release (#3)
nossi99 Feb 4, 2025
2128f5b
ci: automate releases with semantic-release (#4)
nossi99 Feb 4, 2025
14b12fb
chore: update versions of dependencies (#5)
a-klos Feb 17, 2025
db6d1c9
chore: update STORAGE_KEY to use stackit-rag-template-files (#5)
a-klos Feb 17, 2025
a650b9e
fix: Fix typos in question_rephrasing_prompt.py (#4)
oed-muellern Feb 21, 2025
af06dfa
chore: fix typo in readme (#6)
a-klos Feb 28, 2025
8626486
chore: multi confluence support (#6)
a-klos Mar 17, 2025
7ad14ec
chore: encode basicAuth and add new Confluence settings in values.yam…
a-klos Mar 17, 2025
55b8d0c
feat: add hybrid search for retrieval (#7)
a-klos Mar 18, 2025
9c6604e
fix: docker image registry
MelvinKl Apr 22, 2025
e25a6c7
chore: fix default values
MelvinKl Apr 22, 2025
461fd1d
feat: make issuer for certificates adjustable (#9)
MelvinKl Apr 22, 2025
5620c4f
fix: use valid repo name for backend image (#12)
a-klos Apr 28, 2025
1535b05
ci: adjust trigger to manual (#11)
a-klos May 7, 2025
d1ddd87
feat: improve prompt templates and add language detection (#9)
MelvinKl May 7, 2025
1d90c94
chore: update to python 3.13 & update all dependencies (#10)
MelvinKl May 7, 2025
f89ddc3
ci: update trigger to manual for semantic release action (#13)
a-klos May 20, 2025
eba10cb
chore: remove unused variables from values file (#14)
MelvinKl May 20, 2025
b32528e
feat: add terraform scripts (#15)
huhn511 May 25, 2025
6ff2084
refactor: remove confluence loader configuration and related secrets …
a-klos Jun 2, 2025
f6f1a74
refactor!: improve admin and extractor api definition (#12)
MelvinKl Jun 2, 2025
1585576
chore: add settings for source uploader (admin backend) (#18)
a-klos Jun 3, 2025
fe5ad30
ci: enhance semantic release configuration (#13)
a-klos Jun 10, 2025
845664d
fix: remove conditional basicAuth secret reference from admin deploym…
a-klos Jun 10, 2025
e660617
fix: standardize parameter name for document processing in MSDocsExtr…
a-klos Jun 10, 2025
f9d28ca
feat: sitemapextractor (#14)
a-klos Jun 11, 2025
f42814c
fix: summary creation issue(#16)
a-klos Jun 11, 2025
0a17eae
fix: update STACKIT_VLLM_MODEL to use cortecs/Llama-3.3-70B-Instruct-…
a-klos Jun 12, 2025
af37c7b
refactor: update DNS name variable and enhance object storage bucket …
a-klos Jun 12, 2025
7cf406a
fix: langfuse orphaned thread issue (#17)
a-klos Jun 13, 2025
d8d3b53
refactor: pdf extractor (#18)
a-klos Jun 16, 2025
ba8a27c
fix: update qdrant image tag to v1.14.1 (#22)
a-klos Jun 23, 2025
5336196
feat: provide the chat of the rag by MCP (#21)
a-klos Jun 23, 2025
2f9ac3d
chore: update project title from "RAG SIT x Stackit" to "STACKIT RAG"…
a-klos Jun 23, 2025
0e2febe
chore: allow additional requests_kwargs parameter in sitemap loader (…
a-klos Jun 23, 2025
3c42652
Drop rag-infrastructure & rag-core-library submodules (backed up in .…
a-klos Jul 3, 2025
7be7209
Import rag-infrastructure history into infrastructure/
a-klos Jul 3, 2025
69e9fe9
Import rag-core-library history into libs/
a-klos Jul 3, 2025
67e90d1
refactor: migrate to monorepo structure (#28)
a-klos Jul 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
65 changes: 65 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# RAG Template Environment Variables
# Copy this file to .env and fill in your actual values

# =============================================================================
# S3 Object Storage Configuration (Required)
# =============================================================================
S3_ACCESS_KEY_ID=your_s3_access_key_here
S3_SECRET_ACCESS_KEY=your_s3_secret_key_here

# =============================================================================
# Basic Authentication (Required)
# =============================================================================
BASIC_AUTH="foo:$apr1$ryE0iE7H$F2SlPDNoFdGoaHrcla2HL/"

# =============================================================================
# Langfuse Configuration (Required for observability)
# =============================================================================
LANGFUSE_PUBLIC_KEY=pk-lf-your-public-key-here
LANGFUSE_SECRET_KEY=sk-lf-your-secret-key-here

# Langfuse Initialization (Optional - for pre-creating organization/project)
LANGFUSE_INIT_ORG_ID="my-org"
LANGFUSE_INIT_PROJECT_ID="my-project"
LANGFUSE_INIT_PROJECT_PUBLIC_KEY=pk-lf-your-public-key-here
LANGFUSE_INIT_PROJECT_SECRET_KEY=sk-lf-your-secret-key-here
LANGFUSE_INIT_USER_EMAIL="user@stackit.cloud"
LANGFUSE_INIT_USER_NAME="stackiteer"
LANGFUSE_INIT_USER_PASSWORD="stackit123"

# =============================================================================
# Frontend Authentication (Required)
# =============================================================================
VITE_AUTH_USERNAME=foo
VITE_AUTH_PASSWORD=bar

# =============================================================================
# LLM Provider API Keys (Choose one or more)
# =============================================================================

# STACKIT AI Model Serving as provider (Recommended)
# A guide how to get your API key by using the STACKIT portal UI: https://docs.stackit.cloud/stackit/en/getting-started-with-the-stackit-portal-ui-319914591.html
# A guide how to get your API key by using the Product API: https://docs.stackit.cloud/stackit/en/getting-started-with-the-product-api-319914605.html
STACKIT_VLLM_API_KEY=your-stackit-vllm-api-key
STACKIT_EMBEDDER_API_KEY=your-stackit-embedder-api-key

# OpenAI (For RAGAS evaluation - Optional)
RAGAS_OPENAI_API_KEY=sk-your-openai-api-key-here

# =============================================================================
# Confluence Integration (Optional)
# =============================================================================
CONFLUENCE_TOKEN="your-confluence-api-token,your-confluence-api-token"
CONFLUENCE_URL="https://your-company.atlassian.net,https://your-company.atlassian.net"
CONFLUENCE_SPACE_KEY="YOUR_SPACE_KEY_1,YOUR_SPACE_KEY_2"
CONFLUENCE_VERIFY_SSL="True,True"
CONFLUENCE_DOCUMENT_NAME="document1,document2"

# =============================================================================
# Additional Notes:
# =============================================================================
# 1. Required variables must be set for the system to work properly
# 2. S3-compatible storage is required for document storage
# 3. Choose either STACKIT or configure Ollama for LLM providers
# 4. Confluence integration is optional but enables document ingestion from Confluence
# 5. For production deployment, see infrastructure/README.md for additional configuration
228 changes: 182 additions & 46 deletions .github/workflows/lint-and-test.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,48 @@
name: lint-and-test

on:
pull_request:
branches:
pull_request:
branches:
- main
workflow_dispatch:
workflow_dispatch:

env:
NODE_VERSION: '18'
PYTHON_VERSION: '3.11'

jobs:
changes:
name: Detect Changes
runs-on: ubuntu-latest
outputs:
services: ${{ steps.changes.outputs.services }}
libs: ${{ steps.changes.outputs.libs }}
frontend: ${{ steps.changes.outputs.frontend }}
infrastructure: ${{ steps.changes.outputs.infrastructure }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Detect changes
id: changes
uses: dorny/paths-filter@v2
with:
filters: |
services:
- 'services/admin-backend/**'
- 'services/document-extractor/**'
- 'services/rag-backend/**'
- 'services/mcp-server/**'
libs:
- 'libs/**'
frontend:
- 'services/frontend/**'
infrastructure:
- 'infrastructure/**'
- 'Tiltfile'

sanitize-branch-name:
runs-on: ubuntu-latest
outputs:
Expand All @@ -15,76 +51,176 @@ jobs:
- name: sanitize-branch-name
id: sanitize
run: |
SANITIZED_REF=$(echo "${GITHUB_HEAD_REF}" | tr '[:upper:]' '[:lower:]' | tr -c 'a-z0-9' '-')
SANITIZED_REF=$(echo "${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" | tr '[:upper:]' '[:lower:]' | tr -c 'a-z0-9' '-')
SANITIZED_REF=${SANITIZED_REF#-}
SANITIZED_REF=${SANITIZED_REF%-}
SANITIZED_REF=${SANITIZED_REF:0:63}
if [[ -z "$SANITIZED_REF" || "$SANITIZED_REF" =~ ^-+$ ]]; then
SANITIZED_REF="tmp-branch"
fi
echo "::set-output name=sanitized_ref::${SANITIZED_REF}"
echo "sanitized_ref=${SANITIZED_REF}" >> $GITHUB_OUTPUT
shell: bash
env:
GITHUB_HEAD_REF: ${{ github.head_ref }}

update-submodules:
name: update-submodules
build-and-test-services:
name: Build and Test Services
runs-on: ubuntu-latest
permissions:
contents: write
needs: [changes, sanitize-branch-name]
if: needs.changes.outputs.services == 'true' || github.event_name == 'workflow_dispatch'
strategy:
fail-fast: false
matrix:
service: ["admin-backend", "document-extractor", "rag-backend", "mcp-server"]
steps:
- name: checkout
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
submodules: false

- name: update-submodules
id: update-submodules
- name: Set Docker Image Name
run: |
git config --global url."https://github.com/".insteadOf "git@github.com:"
git submodule sync --recursive
git submodule update --init --remote --recursive

if [ -n "$(git status --porcelain)" ]; then
echo "Submodules have new commits. Committing and pushing..."
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -am "chore: update submodules to latest main"
git push
else
echo "No submodule changes."
fi
echo "IMAGE_NAME=${{ matrix.service }}:${{ needs.sanitize-branch-name.outputs.sanitized_ref }}-${{ github.run_number }}" >> $GITHUB_ENV
shell: bash

- name: Build Docker image
run: |
docker build -t $IMAGE_NAME --build-arg dev=1 -f services/${{ matrix.service }}/Dockerfile .

- name: Run linting
run: |
docker run --rm $IMAGE_NAME make lint

- name: Run tests
run: |
docker run --rm $IMAGE_NAME make test

build-and-lint:
name: Build and Lint
build-and-test-libs:
name: Build and Test Libraries
runs-on: ubuntu-latest
needs: [sanitize-branch-name, update-submodules]
needs: [changes, sanitize-branch-name]
if: needs.changes.outputs.libs == 'true' || github.event_name == 'workflow_dispatch'
strategy:
fail-fast: true
matrix:
service: [ "admin-backend", "document-extractor", "rag-backend"]
fail-fast: false
matrix:
library: ["rag-core-lib", "rag-core-api", "admin-api-lib", "extractor-api-lib"]
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}
submodules: true

- name: Set Docker Image Name
- name: Set Docker Image Names
run: |
echo "IMAGE_NAME=${{ matrix.service }}:${{ needs.sanitize-branch-name.outputs.sanitized_ref }}-${{ github.run_number }}" >> $GITHUB_ENV
echo "LINT_IMAGE_NAME=${{ matrix.library }}-lint:${{ needs.sanitize-branch-name.outputs.sanitized_ref }}-${{ github.run_number }}" >> $GITHUB_ENV
echo "TEST_IMAGE_NAME=${{ matrix.library }}-test:${{ needs.sanitize-branch-name.outputs.sanitized_ref }}-${{ github.run_number }}" >> $GITHUB_ENV
shell: bash

- name: Build lint image
run: |
docker build -t $IMAGE_NAME --build-arg dev=1 --build-arg TAG=debug -f ${{ matrix.service }}/Dockerfile .
docker build -t $LINT_IMAGE_NAME --build-arg TEST=0 -f libs/Dockerfile libs

- name: Generate lint report
- name: Run linting
run: |
docker run --rm --entrypoint make "$IMAGE_NAME" lint
docker run --rm $LINT_IMAGE_NAME make lint

- name: Build test image
run: |
docker build -t $TEST_IMAGE_NAME --build-arg DIRECTORY=${{ matrix.library }} --build-arg TEST=1 -f libs/Dockerfile libs

- name: Run tests
run: |
docker run --rm --entrypoint make "$IMAGE_NAME" test
docker run --rm $TEST_IMAGE_NAME make test

build-and-test-frontend:
name: Build and Test Frontend
runs-on: ubuntu-latest
needs: [changes]
if: needs.changes.outputs.frontend == 'true' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: services/frontend/package-lock.json

- name: Install dependencies
working-directory: services/frontend
run: npm ci

- name: Run linting
working-directory: services/frontend
run: npm run eslint

- name: Run tests
working-directory: services/frontend
run: npm run test

- name: Build chat app
working-directory: services/frontend
run: npm run chat:build

- name: Build admin app
working-directory: services/frontend
run: npm run admin:build

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: frontend-build-artifacts
path: |
services/frontend/apps/*/dist/
retention-days: 7

validate-infrastructure:
name: Validate Infrastructure
runs-on: ubuntu-latest
needs: [changes]
if: needs.changes.outputs.infrastructure == 'true' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: "~1.0"

- name: Terraform Format Check
working-directory: infrastructure/terraform
run: terraform fmt -check -recursive

- name: Terraform Init
working-directory: infrastructure/terraform
run: terraform init -backend=false

- name: Terraform Validate
working-directory: infrastructure/terraform
run: terraform validate

- name: Validate Helm Charts
run: |
curl https://get.helm.sh/helm-v3.12.0-linux-amd64.tar.gz | tar xz
sudo mv linux-amd64/helm /usr/local/bin/helm
helm lint infrastructure/rag/

summary:
name: CI Summary
runs-on: ubuntu-latest
needs: [build-and-test-services, build-and-test-libs, build-and-test-frontend, validate-infrastructure]
if: always()
steps:
- name: Check results
run: |
echo "Services: ${{ needs.build-and-test-services.result }}"
echo "Libraries: ${{ needs.build-and-test-libs.result }}"
echo "Frontend: ${{ needs.build-and-test-frontend.result }}"
echo "Infrastructure: ${{ needs.validate-infrastructure.result }}"

if [[ "${{ needs.build-and-test-services.result }}" == "failure" ]] || \
[[ "${{ needs.build-and-test-libs.result }}" == "failure" ]] || \
[[ "${{ needs.build-and-test-frontend.result }}" == "failure" ]] || \
[[ "${{ needs.validate-infrastructure.result }}" == "failure" ]]; then
echo "❌ One or more jobs failed"
exit 1
else
echo "✅ All jobs passed or were skipped"
fi
Loading