Skip to content
This repository has been archived by the owner on Feb 15, 2025. It is now read-only.

Commit

Permalink
Feat: sidenav redesign with import and export (#398)
Browse files Browse the repository at this point in the history
* chore: merge main

* fix: remove husky reference in readme

* chore: add ability to turn off keycloak auth

* fix: dynamic env import

* fix: add disable keycloak var to zarf yaml

* chore: version bump 0.1.8

* chore: Add to uds bundle

* chore: update folder name

* fix: remove duplicate ui from bundle, adjust default vars

* fix: use dev tag for ui uds bundle

* chore: get anonkey from secretRef

* chore: Rever to require supabase anon key instead of using secret from hosted version

* chore: default uds bundle to SAAS supabase temporarily

* chore: dev/gpu config gets SAAS supabase temporarily too

* fix: dynamic variables instead of static

* fix: update variable names for zarf

* fix: conversations id import bug

* fix: minor changes from pr review

* fix: minor changes from pr review 2

* chore: update vars to pull secret for sb or use provided value
  • Loading branch information
andrewrisse authored Apr 22, 2024
1 parent 7a3a0ad commit 368e4e9
Show file tree
Hide file tree
Showing 45 changed files with 1,092 additions and 521 deletions.
4 changes: 2 additions & 2 deletions packages/ui/chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0
version: 0.1.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: '0.1.7'
appVersion: '0.1.8'
22 changes: 15 additions & 7 deletions packages/ui/chart/templates/ui/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,31 @@ spec:
ports:
- containerPort: 3000
env:
- name: PUBLIC_LEAPFROGAI_API_BASE_URL
- name: LEAPFROGAI_API_BASE_URL
value: '###ZARF_VAR_LEAPFROGAI_API_BASE_URL###'
- name: ORIGIN
value: '###ZARF_VAR_DOMAIN###'
- name: PUBLIC_DEFAULT_MODEL
- name: DEFAULT_MODEL
value: '###ZARF_VAR_MODEL###'
- name: PUBLIC_DEFAULT_SYSTEM_PROMPT
- name: DEFAULT_SYSTEM_PROMPT
value: '###ZARF_VAR_SYSTEM_PROMPT###'
- name: PUBLIC_DEFAULT_TEMPERATURE
- name: DEFAULT_TEMPERATURE
value: '###ZARF_VAR_TEMPERATURE###'
- name: LEAPFROGAI_API_KEY
value: '###ZARF_VAR_LEAPFROGAI_API_KEY###'
- name: PUBLIC_SUPABASE_URL
value: '###ZARF_VAR_SUPABASE_URL###'
value: {{ .Values.package.supabase_url }}
- name: PUBLIC_SUPABASE_ANON_KEY
value: '###ZARF_VAR_SUPABASE_ANON_KEY###'

{{ if .Values.package.supabase_anon_key }}
value: {{ .Values.package.supabase_anon_key }}
{{ else }}
valueFrom:
secretKeyRef:
name: supabase-jwt
key: anonKey
{{ end }}
- name: PUBLIC_DISABLE_KEYCLOAK
value: '###ZARF_VAR_DISABLE_KEYCLOAK###'
resources:
requests:
memory: '0'
Expand Down
2 changes: 2 additions & 0 deletions packages/ui/chart/values.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
package:
host: lfaiui
supabase_url: '###ZARF_VAR_SUPABASE_URL###'
supabase_anon_key: '###ZARF_VAR_SUPABASE_ANON_KEY###'
2 changes: 1 addition & 1 deletion packages/ui/zarf-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ package:
create:
set:
image_repository: 'ghcr.io/defenseunicorns/leapfrogai/leapfrogai-ui'
image_version: 0.1.7
image_version: dev
name: leapfrogai-ui
max_package_size: '1000000000'
12 changes: 8 additions & 4 deletions packages/ui/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ constants:
variables:
- name: LEAPFROGAI_API_BASE_URL #LEAPFROGAI_API_BASE_URL
description: The base URL for the LeapfrogAI API
default: http://api.leapfrogai.svc.cluster.local:8080/openai/v1
default: api.leapfrogai.svc.cluster.local:8080/openai/v1
prompt: true
sensitive: true
- name: LEAPFROGAI_API_KEY
Expand All @@ -29,7 +29,7 @@ variables:
sensitive: true
- name: MODEL
description: The default LLM model to use for chat and summarization
default: vllm
default: llama-cpp-python
prompt: true
sensitive: false
- name: SYSTEM_PROMPT
Expand All @@ -44,12 +44,16 @@ variables:
sensitive: false
- name: SUPABASE_URL
description: URL for supabase
default: 'http://supabase.leapfrogai.svc.cluster.local:8080'
prompt: true
default: supabase-kong.leapfrogai.svc.cluster.local:8080
sensitive: false
- name: SUPABASE_ANON_KEY
description: Public key for Supabase
default: ''
prompt: true
sensitive: false
- name: DISABLE_KEYCLOAK
description: Disable keycloak true or false
default: 'true'
prompt: true
sensitive: false

Expand Down
11 changes: 5 additions & 6 deletions src/leapfrogai_ui/.env.example
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# PUBLIC STATIC
PUBLIC_DEFAULT_TEMPERATURE=0.1
PUBLIC_DEFAULT_SYSTEM_PROMPT="You are a helpful AI assistant created by Defense Unicorns."
PUBLIC_DEFAULT_MODEL=vllm
PUBLIC_LEAPFROGAI_API_BASE_URL=https://leapfrogai-api.uds.dev/openai/v1

# PUBLIC DYNAMIC
DEFAULT_TEMPERATURE=0.1
DEFAULT_SYSTEM_PROMPT="You are a helpful AI assistant created by Defense Unicorns."
DEFAULT_MODEL=vllm
LEAPFROGAI_API_BASE_URL=https://leapfrogai-api.uds.dev/openai/v1
PUBLIC_SUPABASE_URL=http://localhost:54321
PUBLIC_SUPABASE_ANON_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6ImFub24iLCJleHAiOjE5ODM4MTI5OTZ9.CRXP1A7WOeoJeXxjNni43kdQwgnWNReilDMblYTn_I0
PUBLIC_DISABLE_KEYCLOAK=false

# PRIVATE DYNAMIC
LEAPFROGAI_API_KEY=my-test-key
Expand Down
9 changes: 0 additions & 9 deletions src/leapfrogai_ui/.env.public

This file was deleted.

1 change: 0 additions & 1 deletion src/leapfrogai_ui/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ COPY package-lock.json ./
RUN npm ci
COPY . .
ENV NODE_ENV=production
RUN cp .env.public .env
RUN npm run build
RUN npm prune

Expand Down
36 changes: 36 additions & 0 deletions src/leapfrogai_ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/leapfrogai_ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@
"@carbon/layout": "^11.20.0",
"@carbon/themes": "^11.32.0",
"@carbon/type": "^11.26.0",
"@supabase/auth-ui-shared": "^0.1.8",
"@supabase/auth-ui-svelte": "^0.2.9",
"@supabase/ssr": "^0.1.0",
"@supabase/supabase-js": "^2.39.8",
"@sveltejs/vite-plugin-svelte": "^3.0.2",
Expand Down
Loading

0 comments on commit 368e4e9

Please sign in to comment.