Skip to content

Commit 906a34e

Browse files
authored
Merge pull request #21 from gensyn-ai/ui-proxy-enabled
Switch to internal proxy with relative API path
2 parents 21bc9ba + 1e072b3 commit 906a34e

File tree

4 files changed

+38
-22
lines changed

4 files changed

+38
-22
lines changed

.github/workflows/build-containers.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ jobs:
3232
tags: gensynai/codeassist-web-ui:${{ github.ref_name }}
3333
context: ./web-ui
3434
build-args: |
35-
NEXT_PUBLIC_TESTER_URL=http://localhost:8008
36-
NEXT_PUBLIC_STATE_SERVICE_URL=http://localhost:8000
35+
NEXT_PUBLIC_TESTER_URL=/api/tester
36+
NEXT_PUBLIC_STATE_SERVICE_URL=/api/backend
3737
NEXT_PUBLIC_ALCHEMY_API_KEY=wvs3CE89g2JwoshNNCMe1
3838
3939
build-zero-style-ui:
@@ -64,9 +64,9 @@ jobs:
6464
tags: gensynai/codeassist-zero-style-ui:${{ github.ref_name }}
6565
context: ./web-ui
6666
build-args: |
67-
NEXT_PUBLIC_TESTER_URL=http://localhost:8008
68-
NEXT_PUBLIC_STATE_SERVICE_URL=http://localhost:8000
69-
NEXT_PUBLIC_POLICY_MODELS_URL=http://localhost:8001
67+
NEXT_PUBLIC_TESTER_URL=/api/tester
68+
NEXT_PUBLIC_STATE_SERVICE_URL=/api/backend
69+
NEXT_PUBLIC_POLICY_MODELS_URL=/api/policy
7070
NEXT_PUBLIC_ZERO_STYLE_MODE=true
7171
NEXT_PUBLIC_ALCHEMY_API_KEY=wvs3CE89g2JwoshNNCMe1
7272

compose.yml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
services:
22
ollama:
3+
container_name: codeassist-ollama
34
image: ollama/ollama:0.11.10
45
networks:
56
- codeassist_network
@@ -9,12 +10,13 @@ services:
910
- ./ollama-data:/root/.ollama
1011

1112
web-ui:
13+
container_name: codeassist-web-ui
1214
build:
1315
context: ./web-ui
1416
args:
15-
- NEXT_PUBLIC_TESTER_URL=http://localhost:8008
16-
- NEXT_PUBLIC_STATE_SERVICE_URL=http://localhost:8000
17-
- NEXT_PUBLIC_POLICY_MODELS_URL=http://localhost:8001
17+
- NEXT_PUBLIC_TESTER_URL=/api/tester
18+
- NEXT_PUBLIC_STATE_SERVICE_URL=/api/backend
19+
- NEXT_PUBLIC_POLICY_MODELS_URL=/api/policy
1820
- NEXT_PUBLIC_ALCHEMY_API_KEY=wvs3CE89g2JwoshNNCMe1
1921
networks:
2022
- codeassist_network
@@ -26,12 +28,13 @@ services:
2628
- PERSISTENT_DATA_DIR=/app/persistent-data
2729

2830
simulation-ui:
31+
container_name: codeassist-simulation-ui
2932
build:
3033
context: ./web-ui
3134
args:
32-
- NEXT_PUBLIC_TESTER_URL=http://localhost:8008
33-
- NEXT_PUBLIC_STATE_SERVICE_URL=http://localhost:8000
34-
- NEXT_PUBLIC_POLICY_MODELS_URL=http://localhost:8001
35+
- NEXT_PUBLIC_TESTER_URL=/api/tester
36+
- NEXT_PUBLIC_STATE_SERVICE_URL=/api/backend
37+
- NEXT_PUBLIC_POLICY_MODELS_URL=/api/policy
3538
- NEXT_PUBLIC_SIMULATION_MODE=true
3639
- NEXT_PUBLIC_ALCHEMY_API_KEY=wvs3CE89g2JwoshNNCMe1
3740
networks:
@@ -44,12 +47,13 @@ services:
4447
- PERSISTENT_DATA_DIR=/app/persistent-data
4548

4649
zero-style-ui:
50+
container_name: codeassist-zero-style-ui
4751
build:
4852
context: ./web-ui
4953
args:
50-
- NEXT_PUBLIC_TESTER_URL=http://localhost:8008
51-
- NEXT_PUBLIC_STATE_SERVICE_URL=http://localhost:8000
52-
- NEXT_PUBLIC_POLICY_MODELS_URL=http://localhost:8001
54+
- NEXT_PUBLIC_TESTER_URL=/api/tester
55+
- NEXT_PUBLIC_STATE_SERVICE_URL=/api/backend
56+
- NEXT_PUBLIC_POLICY_MODELS_URL=/api/policy
5357
- NEXT_PUBLIC_ZERO_STYLE_MODE=true
5458
networks:
5559
- codeassist_network
@@ -61,6 +65,7 @@ services:
6165
- PERSISTENT_DATA_DIR=/app/persistent-data
6266

6367
state-service:
68+
container_name: codeassist-state-service
6469
build: ./state-service
6570
networks:
6671
- codeassist_network
@@ -70,14 +75,15 @@ services:
7075
- ./persistent-data:/app/persistent-data
7176
- ./datasets:/app/datasets
7277
environment:
73-
- OLLAMA_BASE_URL=http://ollama:11434
74-
- OLLAMA_HOST=http://ollama:11434
78+
- OLLAMA_BASE_URL=http://codeassist-ollama:11434
79+
- OLLAMA_HOST=http://codeassist-ollama:11434
7580
- PERSISTENT_DATA_DIR=/app/persistent-data
76-
- SOLUTION_TESTER_BASE_URL=http://solution-tester:8008
77-
- POLICY_MODEL_BASE_URL=http://policy-models:8001
81+
- SOLUTION_TESTER_BASE_URL=http://codeassist-solution-tester:8008
82+
- POLICY_MODEL_BASE_URL=http://codeassist-policy-model:8001
7883
- TELEMETRY_BASE_URL=http://telemetry-api.telemetry-api-staging.svc.internal-apps-central1.clusters.gensyn.ai
7984

8085
solution-tester:
86+
container_name: codeassist-solution-tester
8187
build: ./solution-tester
8288
networks:
8389
- codeassist_network
@@ -87,6 +93,7 @@ services:
8793
- ./persistent-data:/app/persistent-data
8894

8995
policy-models:
96+
container_name: codeassist-policy-model
9097
build: ./policy_models
9198
networks:
9299
- codeassist_network
@@ -96,8 +103,8 @@ services:
96103
- ./persistent-data:/app/persistent-data
97104
environment:
98105
- DEVICE=cpu
99-
- OLLAMA_BASE_URL=http://ollama:11434
100-
- OLLAMA_HOST=http://ollama:11434
106+
- OLLAMA_BASE_URL=http://codeassist-ollama:11434
107+
- OLLAMA_HOST=http://codeassist-ollama:11434
101108
- PERSISTENT_DATA_DIR=/app/persistent-data
102109
- ASM_ASSISTANT_MODEL_PATH=/app/persistent-data/trainer/models/asm_assistant_model.pt
103110
- ASM_FEATURIZER_PATH=/app/persistent-data/trainer/models/asm_featurizer.pt

web-ui/.env.development

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
NEXT_PUBLIC_TESTER_URL=http://localhost:8008
2-
NEXT_PUBLIC_STATE_SERVICE_URL=http://localhost:8000
1+
NEXT_PUBLIC_TESTER_URL=/api/tester
2+
NEXT_PUBLIC_STATE_SERVICE_URL=/api/backend
3+
NEXT_PUBLIC_POLICY_MODELS_URL=/api/policy
34
NEXT_PUBLIC_ALCHEMY_API_KEY=wvs3CE89g2JwoshNNCMe1

web-ui/next.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ const nextConfig = {
44
ignoreDuringBuilds: true,
55
},
66
output: "standalone",
7+
async rewrites() {
8+
return [
9+
{ source: '/api/tester/:path*', destination: 'http://codeassist-solution-tester:8008/:path*' },
10+
{ source: '/api/backend/:path*', destination: 'http://codeassist-state-service:8000/:path*' },
11+
{ source: '/api/policy/:path*', destination: 'http://codeassist-policy-model:8001/:path*' },
12+
];
13+
},
14+
715
webpack: (config) => {
816
config.resolve = config.resolve || {};
917
config.resolve.alias = {

0 commit comments

Comments
 (0)