Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions arch/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RUN rustup -v target add wasm32-wasip1
WORKDIR /arch
COPY crates .
RUN cargo build --release --target wasm32-wasip1 -p prompt_gateway -p llm_gateway
RUN cargo build --release -p brightstaff
RUN cargo build --release -p brightstaff -p oauth_gateway

FROM docker.io/envoyproxy/envoy:v1.34-latest AS envoy

Expand All @@ -27,6 +27,7 @@ RUN set -eux; \
COPY --from=builder /arch/target/wasm32-wasip1/release/prompt_gateway.wasm /etc/envoy/proxy-wasm-plugins/prompt_gateway.wasm
COPY --from=builder /arch/target/wasm32-wasip1/release/llm_gateway.wasm /etc/envoy/proxy-wasm-plugins/llm_gateway.wasm
COPY --from=builder /arch/target/release/brightstaff /app/brightstaff
COPY --from=builder /arch/target/release/oauth_gateway /app/oauth_gateway
COPY --from=envoy /usr/local/bin/envoy /usr/local/bin/envoy

WORKDIR /app
Expand All @@ -41,6 +42,6 @@ RUN pip install requests
RUN mkdir -p /var/log/supervisor && touch /var/log/envoy.log /var/log/supervisor/supervisord.log

RUN mkdir -p /var/log && \
touch /var/log/access_ingress.log /var/log/access_ingress_prompt.log /var/log/access_internal.log /var/log/access_llm.log
touch /var/log/access_ingress.log /var/log/access_ingress_prompt.log /var/log/access_internal.log /var/log/access_llm.log /var/log/oauth_gateway.log

ENTRYPOINT ["sh","-c", "/usr/bin/supervisord"]
23 changes: 23 additions & 0 deletions arch/envoy.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ static_resources:
domains:
- "*"
routes:
# OAuth Gateway routes
- match:
prefix: "/auth/"
route:
auto_host_rewrite: true
cluster: oauth_gateway_local
timeout: 30s
# Default route to prompt gateway
- match:
prefix: "/"
route:
Expand Down Expand Up @@ -624,6 +632,21 @@ static_resources:

clusters:

- name: oauth_gateway_local
connect_timeout: 1s
type: STATIC
dns_lookup_family: V4_ONLY
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: oauth_gateway_local
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: 127.0.0.1
port_value: 54545

- name: arch
connect_timeout: 5s
type: LOGICAL_DNS
Expand Down
7 changes: 7 additions & 0 deletions arch/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ redirect_stderr=true
stdout_logfile_maxbytes=0
stderr_logfile_maxbytes=0

[program:oauth_gateway]
command=sh -c "RUST_LOG=info /app/oauth_gateway 127.0.0.1 54545 2>&1 | tee /var/log/oauth_gateway.log | while IFS= read -r line; do echo '[oauth_gateway]' \"$line\"; done"
stdout_logfile=/dev/stdout
redirect_stderr=true
stdout_logfile_maxbytes=0
stderr_logfile_maxbytes=0

[program:envoy]
command=/bin/sh -c "python -m cli.config_generator && envsubst < /etc/envoy/envoy.yaml > /etc/envoy.env_sub.yaml && envoy -c /etc/envoy.env_sub.yaml --component-log-level wasm:info --log-format '[%%Y-%%m-%%d %%T.%%e][%%l] %%v' 2>&1 | tee /var/log/envoy.log | while IFS= read -r line; do echo '[archgw_logs]' \"$line\"; done"
stdout_logfile=/dev/stdout
Expand Down
Loading