Skip to content

Commit 7e40f8a

Browse files
committed
Add velorum into docker-compose
1 parent 298d551 commit 7e40f8a

6 files changed

Lines changed: 70 additions & 0 deletions

File tree

container/config-generator/generate.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,21 @@ def env?(key)
8383
def env_set?(key)
8484
@env.fetch(key, nil) != nil
8585
end
86+
87+
def find_envs(pattern, group: false)
88+
if group
89+
@env.each_with_object({}) do |(key, value), groups|
90+
match = key.match(pattern)
91+
next unless match
92+
93+
group_key = match[1]
94+
suffix = key.sub(/.*#{Regexp.escape(group_key)}_?/, '')
95+
(groups[group_key] ||= {})[suffix] = value
96+
end
97+
else
98+
@env.select { |key, _| key =~ pattern }
99+
end
100+
end
86101
end
87102

88103
# Run the generator

container/config-generator/templates/sagittarius.sagittarius.yml.erb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ rails:
66
db:
77
host: <%= env('POSTGRES_HOST') %>
88
port: <%= env('POSTGRES_PORT') %>
9+
velorum:
10+
enabled: <%= env_set?('VELORUM_ENABLED') ? env('VELORUM_ENABLED') : env('COMPOSE_PROFILES').include?('ide_velorum') %>
11+
host: <%= env('VELORUM_HOST') %>:<%= env('VELORUM_PORT') %>
12+
jwt_secret: <%= env('VELORUM_JWT_SECRET') %>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[
2+
<% find_envs(/VELORUM_MODEL_(\S+?)_.+/, group: true).each_with_index do |(_, envs), i| %>
3+
<%= ',' if i > 0 %>
4+
{
5+
"identifier": "<%= envs.fetch('IDENTIFIER', '') %>",
6+
"name": "<%= envs.fetch('NAME', '') %>",
7+
"capabilities": [
8+
<%= envs.fetch('CAPABILITIES', '').split(',').map { |c| "\"#{c}\"" }.join(',') %>
9+
],
10+
"provider": "<%= envs.fetch('PROVIDER', '') %>",
11+
"api": "<%= envs.fetch('API', '') %>",
12+
"auth": "<%= envs.fetch('AUTH', '') %>",
13+
"token_cost": <%= envs.fetch('TOKEN_COST', '').to_f %>
14+
}
15+
<% end %>
16+
]

docker-compose/.env

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,28 @@ DRACO_REST_AQUILA_TOKEN=draco-rest
2121
DRACO_CRON_AQUILA_TOKEN=draco-cron
2222

2323
# Active services
24+
# Available services: ide, runtime, ide_velorum (AI orchestrator)
2425
COMPOSE_PROFILES=ide,runtime
2526

2627
# Image config
2728
IMAGE_REGISTRY=registry.gitlab.com/code0-tech/packages
2829
IMAGE_TAG=
2930
IMAGE_EDITION= # ce or ee
3031

32+
# Velorum config
33+
# VELORUM_ENABLED=false (override, default checks if COMPOSE_PROFILES contains ide_velorum)
34+
VELORUM_HOST=velorum
35+
VELORUM_PORT=50051
36+
VELORUM_JWT_SECRET=088cfc7a7fc2b07696d8ee5e1ea9d642 # change to a random value
37+
38+
# example, GPT5 in the variable name can be changed to other values. This set of variables can be repeated multiple times
39+
# VELORUM_MODEL_GPT5_IDENTIFIER=gpt-5
40+
# VELORUM_MODEL_GPT5_NAME=GPT 5
41+
# VELORUM_MODEL_GPT5_CAPABILITIES=explain,generate
42+
# VELORUM_MODEL_GPT5_API= # if using a non-default base-url
43+
# VELORUM_MODEL_GPT5_AUTH= # authentication token
44+
# VELORUM_MODEL_GPT5_TOKEN_COST=1
45+
3146
# Internal config options
3247
SAGITTARIUS_RAILS_HOST=sagittarius-rails-web
3348
SAGITTARIUS_RAILS_PORT=3000

docker-compose/docker-compose.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,24 @@ services:
110110
profiles:
111111
- ide
112112

113+
velorum:
114+
image: ${IMAGE_REGISTRY}/velorum:${IMAGE_TAG}
115+
depends_on:
116+
config-generator:
117+
condition: service_completed_successfully
118+
restart: unless-stopped
119+
environment:
120+
SECURITY_TOKEN: $VELORUM_JWT_SECRET
121+
volumes:
122+
- generated-configs:/tmp/generated-configs:ro
123+
entrypoint: |
124+
sh -c "
125+
cp /tmp/generated-configs/velorum.models.configuration.json models.configuration.json
126+
exec uv run main.py
127+
"
128+
profiles:
129+
- ide_velorum
130+
113131
nginx:
114132
image: nginx:1.31.0-alpine-slim
115133
depends_on:

support/download_projects

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ mkdir -p projects
1010
download_project aquila
1111
download_project draco
1212
download_project sagittarius
13+
download_project sculptor
1314
download_project taurus
15+
download_project velorum

0 commit comments

Comments
 (0)