Skip to content

Commit 844802e

Browse files
Hyperion: Prepare service for Artemis integration (#176)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent 4b00f13 commit 844802e

30 files changed

+1082
-793
lines changed

.github/workflows/hyperion_deploy-test.yml

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,14 @@ on:
66
image-tag:
77
type: string
88
description: "Image tag to deploy (default: pr-<number> if PR exists, latest for default branch)"
9-
deploy-hyperion:
10-
type: boolean
11-
default: true
12-
description: (Re-)deploys hyperion.
13-
deploy-proxy:
14-
default: false
15-
type: boolean
16-
description: (Re-)deploys the proxy components. Usually not necessary and might cause downtime.
179

1810
jobs:
19-
deploy-hyperion:
20-
if: ${{ inputs.deploy-hyperion }}
11+
deploy-app:
2112
uses: ls1intum/.github/.github/workflows/deploy-docker-compose.yml@main
2213
with:
2314
environment: "Hyperion - Test 1"
24-
docker-compose-file: "./hyperion/docker/compose.hyperion.yaml"
15+
docker-compose-file: "./hyperion/compose.yaml"
2516
main-image-name: ls1intum/edutelligence/hyperion
2617
image-tag: ${{ inputs.image-tag }}
2718
deployment-base-path: "/opt/hyperion"
28-
secrets: inherit
29-
30-
deploy-proxy:
31-
if: ${{ inputs.deploy-proxy }}
32-
uses: ls1intum/.github/.github/workflows/deploy-docker-compose.yml@main
33-
with:
34-
environment: "Hyperion - Test 1"
35-
docker-compose-file: "./hyperion/docker/compose.proxy.yaml"
36-
# We just keep the main-image-name and image-tag as placeholders
37-
main-image-name: ls1intum/edutelligence/hyperion
38-
image-tag: ${{ inputs.image-tag }}
39-
deployment-base-path: "/opt/proxy"
40-
secrets: inherit
41-
19+
secrets: inherit

.github/workflows/hyperion_deploy-with-helios.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ on:
2020
type: string
2121

2222
jobs:
23-
deploy-hyperion:
23+
deploy-app:
2424
uses: ls1intum/.github/.github/workflows/deploy-docker-compose.yml@main
2525
with:
2626
environment: ${{ inputs.environment_name }}
27-
docker-compose-file: "./hyperion/docker/compose.hyperion.yaml"
27+
docker-compose-file: "./hyperion/compose.yaml"
2828
main-image-name: ls1intum/edutelligence/hyperion
2929
image-tag: ${{ inputs.commit_sha }}
3030
deployment-base-path: "/opt/hyperion"

hyperion.code-workspace

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,26 @@
22
"folders": [
33
{
44
"name": "EduTelligence",
5-
"path": "./",
5+
"path": "."
66
},
77
{
88
"name": "Hyperion",
9-
"path": "./hyperion"
9+
"path": "hyperion"
1010
},
1111
{
1212
"name": "Shared",
13-
"path": "./shared"
13+
"path": "shared"
14+
},
15+
{
16+
"name": "Artemis",
17+
"path": "../Artemis"
1418
}
1519
],
1620
"settings": {
1721
"python.terminal.activateEnvironment": true,
1822
"python.terminal.activateEnvInCurrentTerminal": true,
19-
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python"
23+
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
24+
"java.configuration.updateBuildConfiguration": "interactive"
2025
},
2126
"extensions": {
2227
"recommendations": [

hyperion/.env.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# mTLS for production, can be false for development
2+
TLS_ENABLED=false
3+
TLS_CERT_PATH=/certs/server.crt
4+
TLS_KEY_PATH=/certs/server.key
5+
TLS_CA_PATH=/certs/ca.crt
6+
17
MODEL_NAME="openai:gpt-4o"
28

39
# For Non-Azure OpenAI

hyperion/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
.venv
22
.DS_Store
33

4+
# Artemis sync configuration - stores path to Artemis project
5+
.artemis_sync_config.json
6+
47
# Idea files
58
.idea/
69

hyperion/Dockerfile

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,52 @@
1-
FROM python:3.13-alpine
2-
3-
RUN apk update && \
4-
apk add --no-cache gcc musl-dev postgresql-dev rust cargo curl
5-
1+
FROM python:3.13-slim
2+
3+
# Install minimal dependencies and grpc_health_probe
4+
RUN apt-get update && apt-get install -y \
5+
gcc \
6+
libpq-dev \
7+
curl \
8+
wget \
9+
&& rm -rf /var/lib/apt/lists/*
10+
11+
# Install grpc_health_probe for proper gRPC health checking
12+
ARG GRPC_HEALTH_PROBE_VERSION=v0.4.25
13+
RUN wget -qO/bin/grpc_health_probe \
14+
https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-amd64 \
15+
&& chmod +x /bin/grpc_health_probe
16+
17+
# Install poetry
618
RUN pip install poetry==2.1.1
719

820
WORKDIR /app
921

10-
# Create the proper directory structure
11-
RUN mkdir -p /app/hyperion /app/shared
22+
# Create the directory structure to match pyproject.toml expectations
23+
RUN mkdir -p hyperion
1224

13-
# Copy shared library into the right location
14-
COPY shared/ /app/shared/
25+
# Copy shared library to parent directory (for path dependency)
26+
COPY shared/ ./shared/
1527

16-
# Copy hyperion files
17-
COPY hyperion/pyproject.toml hyperion/poetry.lock /app/hyperion/
18-
COPY hyperion/app/ /app/hyperion/app/
19-
COPY hyperion/playground/ /app/hyperion/playground/
28+
# Copy hyperion files to hyperion subdirectory
29+
COPY hyperion/pyproject.toml ./hyperion/
30+
COPY hyperion/app/ ./hyperion/app/
2031

21-
# Set working directory to hyperion folder where the poetry config is
32+
# Change to hyperion directory for poetry install
2233
WORKDIR /app/hyperion
2334

24-
# Install dependencies but don't try to install the current project
25-
RUN poetry install --no-root
35+
# Install dependencies (without lock file to avoid path issues)
36+
RUN poetry config virtualenvs.create false && \
37+
poetry install --only=main --no-root
38+
39+
# Create non-root user
40+
RUN useradd --create-home --shell /bin/bash hyperion
41+
42+
# Create certificates directory
43+
RUN mkdir -p /certs && chown hyperion:hyperion /certs
44+
45+
# Switch to non-root user
46+
USER hyperion
2647

2748
# Expose the gRPC port
2849
EXPOSE 50051
2950

30-
# Use our custom entrypoint script
31-
ENTRYPOINT ["poetry", "run", "hyperion"]
51+
# Start the application
52+
ENTRYPOINT ["python", "-c", "from app.main import serve; serve()"]

0 commit comments

Comments
 (0)