Skip to content

Commit

Permalink
feat(api): set api variable to expose by default (#768)
Browse files Browse the repository at this point in the history
* update expose_openapi_schema variable name to expose_api
* default expose_api to true now that we have auth or our api

---------

Co-authored-by: Jonathan Perry <YrrepNoj@gmail.com>
  • Loading branch information
gphorvath and YrrepNoj committed Jul 12, 2024
1 parent fefd8f0 commit 310a735
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ jobs:
run: |
make build-api LOCAL_VERSION=e2e-test
docker image prune -af
uds zarf package deploy packages/api/zarf-package-leapfrogai-api-amd64-e2e-test.tar.zst --set=EXPOSE_OPENAPI_SCHEMA=true --confirm
uds zarf package deploy packages/api/zarf-package-leapfrogai-api-amd64-e2e-test.tar.zst --confirm
rm packages/api/zarf-package-leapfrogai-api-amd64-e2e-test.tar.zst
- name: Test API
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ clean: ## Clean up all the things (packages, build dirs, compiled .whl files, py
-rm -rf build/*
-rm -rf src/**/build/*
-rm -rf packages/**/build/*
find . -name 'uds-bundle-*-*.tar.zst' -delete
find . -type d -name 'zarf-sbom' -exec rm -rf {} +
find . -name '*.whl' -delete
find . -name '*.egg-info' -type d -exec rm -rf {} +
find . -type d -name '*.egg-info' -exec rm -rf {} +


gen-python: ## Generate the protobufs for the OpenAI typing within the leapfrogai_api module
Expand Down
2 changes: 1 addition & 1 deletion packages/api/chart/templates/uds-package.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.api.exposeOpenAPISchema }}
{{- if .Values.api.exposeAPI }}
apiVersion: uds.dev/v1alpha1
kind: Package
metadata:
Expand Down
2 changes: 1 addition & 1 deletion packages/api/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ supabase:
api:
replicas: 1
port: 8080
exposeOpenAPISchema: false
exposeAPI: true
defaultEmbeddingsModel: "###ZARF_VAR_DEFAULT_EMBEDDINGS_MODEL###"

migration:
Expand Down
2 changes: 1 addition & 1 deletion packages/api/lfai-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ image:
kiwigridTag: ###ZARF_CONST_KIWIGRID_VERSION###

api:
exposeOpenAPISchema: ###ZARF_VAR_EXPOSE_OPENAPI_SCHEMA###
exposeAPI: ###ZARF_VAR_EXPOSE_API###
4 changes: 2 additions & 2 deletions packages/api/zarf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ constants:
value: "1.23.3"

variables:
- name: EXPOSE_OPENAPI_SCHEMA
default: "false"
- name: EXPOSE_API
default: "true"
description: "Flag to expose the OpenAPI schema for debugging."
- name: HOSTED_DOMAIN
default: "uds.dev"
Expand Down
15 changes: 14 additions & 1 deletion uds-bundles/dev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ python -m venv .venv
source .venv/bin/activate
```

Each component is built into its own Zarf package. You can build all of the packages you need at once with the following `Make` targets:
Each component is built into its own Zarf package.

> ***Note:*** You need to build with `make build-* LOCAL_VERSION=dev` to set the tag to `dev` instead of the commit hash locally.
You can build all of the packages you need at once with the following `Make` targets:

```shell
make build-cpu # api, llama-cpp-python, text-embeddings, whisper, supabase
Expand Down Expand Up @@ -68,6 +72,15 @@ Deploy the LeapfrogAI bundle:
uds deploy uds-bundle-leapfrogai-*.tar.zst --confirm
```

Once running you can access the various components, if deployed and exposed, at the following URLS:

```shell
https://ai.uds.dev # UI
https://leapfrogai-api.uds.dev # API
https://supabase-kong.uds.dev # Supabase Kong
https://keycloak.uds.dev # Keycloak
```

## Checking and Managing the Deployment

For tips on how to monitor the deployment, accessing the UI, and clean up, please reference the [Quick Start](https://docs.leapfrog.ai/docs/local-deploy-guide/quick_start/#checking-deployment) guide in the LeapfrogAI docs.

0 comments on commit 310a735

Please sign in to comment.