From 33cd01dbb1f96a72d3506753245658875fda65a6 Mon Sep 17 00:00:00 2001 From: Luke Lalor Date: Fri, 19 Jul 2024 16:09:03 -0700 Subject: [PATCH] put auto reload behind args so we don't get warning, update k8 docs (#558) --- k8s-operator/README.md | 29 +++++++++++++-------- sdk/eidolon_ai_sdk/bin/agent_http_server.py | 13 +++++---- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/k8s-operator/README.md b/k8s-operator/README.md index f62ef3f04..635fe9b5b 100644 --- a/k8s-operator/README.md +++ b/k8s-operator/README.md @@ -32,19 +32,26 @@ We develop on a Mac, so we have the following instructions for Mac users. If yo * Install your secrets - A secret with the needed credentials for your Eidolon deployment. The name of the secret is `eidolon`. + A secret with the needed credentials for your Eidolon deployment. The name of the secret is `eidolon`. - See the [Eidolon documentation](https://www.eidolonai.com) for more information on what keys you need. - However, typically this will be a secret with the following keys: - - `OLLAMA_URL` - the URL for your Ollama deployment if you are using ollama. - - `OPENAI_API_KEY` - your OpenAI API key if you are using OpenAI. - - `MISTRAL_API_KEY` - your Mistral API key if you are using Mistral. - - `ANTHROPIC_API_KEY` - your Anthropic API key if you are using Anthropic. + See the [Eidolon documentation](https://www.eidolonai.com) for more information on what keys you need. + However, typically this will be a secret with the following keys: + - `OLLAMA_URL` - the URL for your Ollama deployment if you are using ollama. + - `OPENAI_API_KEY` - your OpenAI API key if you are using OpenAI. + - `MISTRAL_API_KEY` - your Mistral API key if you are using Mistral. + - `ANTHROPIC_API_KEY` - your Anthropic API key if you are using Anthropic. - If you already have a .env file with these keys, you can create the secret with the following command: -```sh -kubectl create secret generic eidolon --from-env-file=/.env -``` + If you already have a .env file with these keys, you can create the secret with the following command: + ```sh + kubectl create secret generic eidolon --from-env-file=/.env + ``` + + ⚠️ To use the secret in your deployment, you need to add the following to your deployment yaml file's `spec`: + ```yaml + envFrom: + - secretRef: + name: eidolon + ``` * Install the eidolon operator ```sh diff --git a/sdk/eidolon_ai_sdk/bin/agent_http_server.py b/sdk/eidolon_ai_sdk/bin/agent_http_server.py index 06b030aaf..e53cdef68 100644 --- a/sdk/eidolon_ai_sdk/bin/agent_http_server.py +++ b/sdk/eidolon_ai_sdk/bin/agent_http_server.py @@ -90,17 +90,20 @@ def parse_args(): def main(): # Run the server - path_ = [os.path.dirname(p) for p in args.yaml_path] - path_.append(".") + kwargs = {} + if args.reload: + kwargs["reload"] = True + kwargs["reload_dirs"] = [".", *(os.path.dirname(p) for p in args.yaml_path)] + kwargs["reload_includes"] = ["*.yml", "*.yaml", "*.py"] + uvicorn.run( "eidolon_ai_sdk.bin.agent_http_server:app", host="0.0.0.0", port=args.port, log_level=log_level_str, - reload=args.reload, - reload_dirs=path_, - reload_includes=["*.yml", "*.yaml", "*.py"], + **kwargs ) + if __name__ == "__main__": main()