-
Notifications
You must be signed in to change notification settings - Fork 0
Feat demo #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat demo #66
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,223 @@ | ||||||||||||
| --- | ||||||||||||
| title: Create Helm Chart | ||||||||||||
| description: Packaging OpenBB into a Helm Chart and deploying it. | ||||||||||||
| --- | ||||||||||||
|
|
||||||||||||
| import { Steps, Aside, Tabs, TabItem } from '@astrojs/starlight/components'; | ||||||||||||
|
|
||||||||||||
| ## About OpenBB | ||||||||||||
|
|
||||||||||||
| The [**OpenBB Platform**](https://openbb.co/products/odp) is a unified financial data interface that simplifies API management for developers and analysts. | ||||||||||||
|
|
||||||||||||
| **Key Benefits:** | ||||||||||||
|
|
||||||||||||
| - **Single API Access** — Connect to multiple data providers without managing separate integrations | ||||||||||||
| - **High-Quality Data** — Access reliable market data across stocks, crypto, forex, and more | ||||||||||||
| - **Easy Integration** — Deploy as a containerized service for consistent environments | ||||||||||||
|
|
||||||||||||
| ## Overview | ||||||||||||
|
|
||||||||||||
| This guide demonstrates how to containerize the OpenBB API Server using Helm charts, enabling you to deploy it consistently across Kubernetes clusters with standard deployment tools. | ||||||||||||
|
|
||||||||||||
| <Aside type="note"> | ||||||||||||
| Containerizing OpenBB with Helm provides reproducible deployments, easy scaling, and simplified management across different environments. | ||||||||||||
| </Aside> | ||||||||||||
|
|
||||||||||||
| ## Prerequisites | ||||||||||||
|
|
||||||||||||
| Before proceeding, ensure you have the following tools installed: | ||||||||||||
|
|
||||||||||||
| - **Helm** 3.x or later — [Installation Guide](https://helm.sh/docs/intro/install) | ||||||||||||
| - **Docker** — For building custom OpenBB images | ||||||||||||
|
|
||||||||||||
| ## Build Custom Docker Image | ||||||||||||
|
|
||||||||||||
| Since the official image might be outdated, we recommend building your own Docker image from the latest source code. | ||||||||||||
|
|
||||||||||||
| <Steps> | ||||||||||||
|
|
||||||||||||
| 1. **Clone the OpenBB repository** | ||||||||||||
|
|
||||||||||||
| Start by cloning the repository and checking out a stable version: | ||||||||||||
|
|
||||||||||||
| ```bash | ||||||||||||
| git clone https://github.com/OpenBB-finance/OpenBB.git | ||||||||||||
| cd OpenBB | ||||||||||||
|
|
||||||||||||
| # Switch to a specific version (e.g., v4.6.0) | ||||||||||||
| git checkout v4.6.0 | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| 2. **Build and push the Docker image** | ||||||||||||
|
|
||||||||||||
| The OpenBB repository includes a pre-configured Dockerfile at `build/docker/platform.dockerfile`. Use this directly: | ||||||||||||
|
|
||||||||||||
| ```bash | ||||||||||||
| # Build the image with the version tag | ||||||||||||
| docker build -f build/docker/platform.dockerfile -t <registry_url>/openbb:v4.6.0 . | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| After building, push the image to your registry: | ||||||||||||
|
|
||||||||||||
| ```bash | ||||||||||||
| docker push <registry_url>/openbb:v4.6.0 | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| <Aside type="note"> | ||||||||||||
| Replace `<registry_url>` with your actual registry address (e.g., `myregistry.azurecr.io`, `my-docker-hub-username`). | ||||||||||||
| </Aside> | ||||||||||||
|
|
||||||||||||
| </Steps> | ||||||||||||
|
|
||||||||||||
| ## Create and Package Helm Chart | ||||||||||||
|
|
||||||||||||
| <Steps> | ||||||||||||
|
|
||||||||||||
| 1. **Create a new Helm chart** | ||||||||||||
|
|
||||||||||||
| ```bash | ||||||||||||
| helm create openbb | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| This generates a directory named `openbb` with the standard Helm chart structure, including templates for Deployment, Service, and ConfigMaps. | ||||||||||||
|
|
||||||||||||
| 2. **Configure the Helm** | ||||||||||||
|
|
||||||||||||
| Edit `openbb/Chart.yaml` to match your release metadata. You can add additional details like `icon`, `home`, and `maintainers` for better discoverability: | ||||||||||||
|
|
||||||||||||
| ```yaml title="openbb/Chart.yaml" | ||||||||||||
| apiVersion: v2 | ||||||||||||
| name: openbb | ||||||||||||
| description: A Helm chart for deploying the OpenBB Platform API | ||||||||||||
| type: application | ||||||||||||
| version: 0.1.0 | ||||||||||||
| appVersion: "v4.6.0" | ||||||||||||
| icon: https://raw.githubusercontent.com/OpenBB-finance/OpenBBTerminal/main/images/openbb_logo.png | ||||||||||||
| home: https://openbb.co | ||||||||||||
| sources: | ||||||||||||
| - https://github.com/OpenBB-finance/OpenBB | ||||||||||||
| maintainers: | ||||||||||||
| - name: Your Name | ||||||||||||
| email: your.email@example.com | ||||||||||||
|
Comment on lines
+100
to
+101
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The YAML for |
||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| Edit `openbb/values.yaml` to configure the image and health check settings. Point the image to your custom registry image and configure probes to use `/docs` (since the root path `/` might return 404): | ||||||||||||
|
|
||||||||||||
| ```yaml title="openbb/values.yaml" | ||||||||||||
| image: | ||||||||||||
| repository: <registry_url>/openbb | ||||||||||||
| pullPolicy: IfNotPresent | ||||||||||||
| tag: "v4.6.0" | ||||||||||||
|
|
||||||||||||
| service: | ||||||||||||
| type: NodePort | ||||||||||||
| port: 8000 | ||||||||||||
| targetPort: 8000 | ||||||||||||
| nodePort: 30080 # Optional: Fixed NodePort for easier testing | ||||||||||||
|
|
||||||||||||
| livenessProbe: | ||||||||||||
| httpGet: | ||||||||||||
| path: /docs # Use /docs instead of root path | ||||||||||||
| port: http | ||||||||||||
|
|
||||||||||||
| readinessProbe: | ||||||||||||
| httpGet: | ||||||||||||
| path: /docs # Use /docs instead of root path | ||||||||||||
| port: http | ||||||||||||
|
Comment on lines
+118
to
+126
|
||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| <Aside type="tip"> | ||||||||||||
| Make sure `targetPort` (8000) matches the port your OpenBB application listens on inside the container. | ||||||||||||
| </Aside> | ||||||||||||
|
|
||||||||||||
| 3. **Package the Helm chart** | ||||||||||||
|
|
||||||||||||
| ```bash | ||||||||||||
| helm package openbb | ||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| This creates a compressed archive: `openbb-0.1.0.tgz`. | ||||||||||||
|
|
||||||||||||
| 4. **Push the chart to your registry** | ||||||||||||
|
|
||||||||||||
| ```bash | ||||||||||||
| helm push openbb-0.1.0.tgz oci://<registry_url>/charts --plain-http | ||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||||||||||||
| ``` | ||||||||||||
|
|
||||||||||||
| Replace `<registry_url>` with your actual registry address. | ||||||||||||
|
Comment on lines
+144
to
+147
|
||||||||||||
| helm push openbb-0.1.0.tgz oci://<registry_url>/charts --plain-http | |
| ``` | |
| Replace `<registry_url>` with your actual registry address. | |
| helm push openbb-0.1.0.tgz oci://<registry_url>/charts |
Replace <registry_url> with your actual, TLS-secured registry address (HTTPS). Avoid using --plain-http except in tightly controlled local test environments.
Copilot
AI
Jan 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Python code example lacks proper error handling for JSON parsing. If the response status is 200 but the response body is not valid JSON, the response.json() call on line 204 could raise a JSONDecodeError. Consider wrapping this in a try-except block or validating the response content type before parsing.
Copilot
AI
Jan 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message format is inconsistent. Lines 188 and 191 use "✗" symbols with different message structures ("API returned status:" vs "Failed to connect:"), while line 208 uses "Error {status_code}:" format. Consider standardizing the error message format across all error cases for better consistency and readability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Catching a generic Exception is too broad and can hide bugs or swallow important exceptions. It's better to catch more specific exceptions. For network-related issues, requests.exceptions.RequestException is more appropriate, as used in the check_health function.
except requests.exceptions.RequestException as e:
print(f"✗ Request failed: {e}")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The heading text is incomplete - it reads "Configure the Helm" but should specify what is being configured. Consider changing to "Configure the Helm Chart" or "Configure Helm Chart Values".