mirror of
https://github.com/hanzoai/flow.git
synced 2026-10-17 01:29:18 +00:00
refactor(rebrand): unify hanzoflow -> hanzo-flow (pkg) / flow (module,cmd) / FLOW_ (env)
Cleaned the concurrent session's half-rebrand inconsistency (166 files): - pip/pypi refs hanzoflow -> hanzo-flow (matches hanzo-flow-base/sdk) - module paths/commands/devcontainer hanzoflow -> flow (the import name + CLI) - env vars HANZOFLOW_ -> FLOW_ (was inconsistent with the LANGFLOW_->FLOW_ sweep) - fixed a stale src/backend/base/hanzoflow/ path that didn't exist - product display HanzoFlow -> 'Hanzo Flow' in docs; kept HanzoFlow only as a code identifier where a space is illegal Canonical: pip install hanzo-flow / import flow / `flow` CLI. compileall clean.
This commit is contained in:
@@ -20,7 +20,7 @@ After the codespace is opened, there will be two phases to the process. It will
|
||||
```
|
||||
✔ Finishing up...
|
||||
⠸ Running postCreateCommand...
|
||||
› sudo chown -R hanzoflow .venv .mypy_cache src/frontend/node_modules src/frontend/build src/backend/base/hanzoflow/frontend && make install_frontend && mak…
|
||||
› sudo chown -R flow .venv .mypy_cache src/frontend/node_modules src/frontend/build src/backend/base/flow/frontend && make install_frontend && mak…
|
||||
```
|
||||
|
||||
Once completed, this terminal window will close.
|
||||
@@ -37,7 +37,7 @@ Installation is now complete.
|
||||
|
||||
## Start up the Service
|
||||
|
||||
Open a new Terminal, and type `uv run hanzoflow run`.
|
||||
Open a new Terminal, and type `uv run flow run`.
|
||||
|
||||
The service will start, and you will may notice a dialog in the lower right indicating there is a port available to connect to. However, the service will not be ready until the startup completes.
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "Hanzoflow Dev Container",
|
||||
"name": "Hanzo Flow Dev Container",
|
||||
"build": {
|
||||
"context": "..",
|
||||
"dockerfile": "Dockerfile"
|
||||
@@ -8,7 +8,7 @@
|
||||
"ghcr.io/devcontainers/features/node": {},
|
||||
"ghcr.io/dhoeric/features/hadolint:1": {}
|
||||
},
|
||||
"postCreateCommand": "sudo chown -R hanzoflow:hanzoflow .venv .mypy_cache src/frontend/node_modules src/frontend/build src/backend/base/hanzoflow/frontend && make install_frontend && make install_backend",
|
||||
"postCreateCommand": "sudo chown -R flow:flow .venv .mypy_cache src/frontend/node_modules src/frontend/build src/backend/base/flow/frontend && make install_frontend && make install_backend",
|
||||
"customizations": {
|
||||
"vscode": {
|
||||
"extensions": [
|
||||
@@ -37,48 +37,48 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"remoteUser": "hanzoflow",
|
||||
"remoteUser": "flow",
|
||||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
|
||||
"workspaceFolder": "/workspace",
|
||||
"forwardPorts": [7860, 3000],
|
||||
"containerEnv": {
|
||||
"FRONTEND_START_FLAGS": "--host",
|
||||
"PYTHONPATH": "/workspace/src/backend/base",
|
||||
"HOME": "/home/hanzoflow"
|
||||
"HOME": "/home/flow"
|
||||
},
|
||||
"mounts": [
|
||||
{
|
||||
"source": "hanzoflow-frontend-node_modules",
|
||||
"source": "flow-frontend-node_modules",
|
||||
"target": "/workspace/src/frontend/node_modules",
|
||||
"type": "volume"
|
||||
},
|
||||
{
|
||||
"source": "hanzoflow-frontend-build",
|
||||
"source": "flow-frontend-build",
|
||||
"target": "/workspace/src/frontend/build",
|
||||
"type": "volume"
|
||||
},
|
||||
{
|
||||
"source": "hanzoflow-backend-frontend",
|
||||
"target": "/workspace/src/backend/base/hanzoflow/frontend",
|
||||
"source": "flow-backend-frontend",
|
||||
"target": "/workspace/src/backend/base/flow/frontend",
|
||||
"type": "volume"
|
||||
},
|
||||
{
|
||||
"source": "hanzoflow-venv",
|
||||
"source": "flow-venv",
|
||||
"target": "/workspace/.venv",
|
||||
"type": "volume"
|
||||
},
|
||||
{
|
||||
"source": "hanzoflow-mypy-cache",
|
||||
"source": "flow-mypy-cache",
|
||||
"target": "/workspace/.mypy_cache",
|
||||
"type": "volume"
|
||||
},
|
||||
{
|
||||
"source": "hanzoflow-dist",
|
||||
"source": "flow-dist",
|
||||
"target": "/workspace/dist",
|
||||
"type": "volume"
|
||||
},
|
||||
{
|
||||
"source": "hanzoflow-backend-dist",
|
||||
"source": "flow-backend-dist",
|
||||
"target": "/workspace/src/backend/base/dist",
|
||||
"type": "volume"
|
||||
}
|
||||
|
||||
+39
-39
@@ -6,21 +6,21 @@
|
||||
|
||||
# Config directory
|
||||
# Directory where files, logs and database will be stored
|
||||
# Example: HANZOFLOW_CONFIG_DIR=~/.flow
|
||||
HANZOFLOW_CONFIG_DIR=
|
||||
# Example: FLOW_CONFIG_DIR=~/.flow
|
||||
FLOW_CONFIG_DIR=
|
||||
|
||||
# Save database in the config directory
|
||||
# Values: true, false
|
||||
# If false, the database will be saved in Hanzo Flow's root directory
|
||||
# This means that the database will be deleted when Hanzo Flow is uninstalled
|
||||
# and that the database will not be shared between different virtual environments
|
||||
# Example: HANZOFLOW_SAVE_DB_IN_CONFIG_DIR=true
|
||||
HANZOFLOW_SAVE_DB_IN_CONFIG_DIR=
|
||||
# Example: FLOW_SAVE_DB_IN_CONFIG_DIR=true
|
||||
FLOW_SAVE_DB_IN_CONFIG_DIR=
|
||||
|
||||
# Database URL
|
||||
# Postgres example: HANZOFLOW_DATABASE_URL=postgresql://postgres:postgres@localhost:5432/flow
|
||||
# Postgres example: FLOW_DATABASE_URL=postgresql://postgres:postgres@localhost:5432/flow
|
||||
# SQLite example:
|
||||
HANZOFLOW_DATABASE_URL=sqlite:///./flow.db
|
||||
FLOW_DATABASE_URL=sqlite:///./flow.db
|
||||
|
||||
# Alembic logs path flag. If set to true, Alembic will log to stdout.
|
||||
FLOW_ALEMBIC_LOG_TO_STDOUT=False
|
||||
@@ -44,77 +44,77 @@ FLOW_ALEMBIC_LOG_TO_STDOUT=False
|
||||
# Database connection retry
|
||||
# Values: true, false
|
||||
# If true, the database will retry to connect to the database if it fails
|
||||
# Example: HANZOFLOW_DATABASE_CONNECTION_RETRY=true
|
||||
HANZOFLOW_DATABASE_CONNECTION_RETRY=false
|
||||
# Example: FLOW_DATABASE_CONNECTION_RETRY=true
|
||||
FLOW_DATABASE_CONNECTION_RETRY=false
|
||||
|
||||
# Cache type
|
||||
HANZOFLOW_LANGCHAIN_CACHE=SQLiteCache
|
||||
FLOW_LANGCHAIN_CACHE=SQLiteCache
|
||||
|
||||
# Server host
|
||||
# Example: FLOW_HOST=localhost
|
||||
FLOW_HOST=
|
||||
|
||||
# Worker processes
|
||||
# Example: HANZOFLOW_WORKERS=1
|
||||
HANZOFLOW_WORKERS=
|
||||
# Example: FLOW_WORKERS=1
|
||||
FLOW_WORKERS=
|
||||
|
||||
# Server port
|
||||
# Example: HANZOFLOW_PORT=7860
|
||||
HANZOFLOW_PORT=
|
||||
# Example: FLOW_PORT=7860
|
||||
FLOW_PORT=
|
||||
|
||||
# Logging level
|
||||
# Example: HANZOFLOW_LOG_LEVEL=critical
|
||||
HANZOFLOW_LOG_LEVEL=
|
||||
# Example: FLOW_LOG_LEVEL=critical
|
||||
FLOW_LOG_LEVEL=
|
||||
|
||||
# Path to the log file
|
||||
# Example: HANZOFLOW_LOG_FILE=logs/flow.log
|
||||
HANZOFLOW_LOG_FILE=
|
||||
# Example: FLOW_LOG_FILE=logs/flow.log
|
||||
FLOW_LOG_FILE=
|
||||
|
||||
# Time/Size for log to rotate
|
||||
# Example: FLOW_LOG_ROTATION=‘10 MB’/‘1 day’
|
||||
FLOW_LOG_ROTATION=
|
||||
|
||||
# Path to the frontend directory containing build files
|
||||
# Example: HANZOFLOW_FRONTEND_PATH=/path/to/frontend/build/files
|
||||
HANZOFLOW_FRONTEND_PATH=
|
||||
# Example: FLOW_FRONTEND_PATH=/path/to/frontend/build/files
|
||||
FLOW_FRONTEND_PATH=
|
||||
|
||||
# Whether to open the browser after starting the server
|
||||
# Values: true, false
|
||||
# Example: HANZOFLOW_OPEN_BROWSER=true
|
||||
HANZOFLOW_OPEN_BROWSER=
|
||||
# Example: FLOW_OPEN_BROWSER=true
|
||||
FLOW_OPEN_BROWSER=
|
||||
|
||||
# Whether to remove API keys from the projects saved in the database
|
||||
# Values: true, false
|
||||
# Example: HANZOFLOW_REMOVE_API_KEYS=false
|
||||
HANZOFLOW_REMOVE_API_KEYS=
|
||||
# Example: FLOW_REMOVE_API_KEYS=false
|
||||
FLOW_REMOVE_API_KEYS=
|
||||
|
||||
# Whether to use RedisCache or ThreadingInMemoryCache or AsyncInMemoryCache
|
||||
# Values: async, memory, redis
|
||||
# Example: HANZOFLOW_CACHE_TYPE=memory
|
||||
# Example: FLOW_CACHE_TYPE=memory
|
||||
# If you want to use redis then the following environment variables must be set:
|
||||
# HANZOFLOW_REDIS_HOST (default: localhost)
|
||||
# HANZOFLOW_REDIS_PORT (default: 6379)
|
||||
# HANZOFLOW_REDIS_DB (default: 0)
|
||||
# HANZOFLOW_REDIS_CACHE_EXPIRE (default: 3600)
|
||||
HANZOFLOW_CACHE_TYPE=
|
||||
# FLOW_REDIS_HOST (default: localhost)
|
||||
# FLOW_REDIS_PORT (default: 6379)
|
||||
# FLOW_REDIS_DB (default: 0)
|
||||
# FLOW_REDIS_CACHE_EXPIRE (default: 3600)
|
||||
FLOW_CACHE_TYPE=
|
||||
|
||||
# Set FLOW_AUTO_LOGIN to false if you want to disable auto login
|
||||
# and use the login form to login. FLOW_SUPERUSER and FLOW_SUPERUSER_PASSWORD
|
||||
# must be set if AUTO_LOGIN is set to false
|
||||
# Values: true, false
|
||||
HANZOFLOW_AUTO_LOGIN=
|
||||
FLOW_AUTO_LOGIN=
|
||||
|
||||
# SET FLOW_ENABLE_SUPERUSER_CLI to false to disable
|
||||
# superuser creation via the CLI
|
||||
FLOW_ENABLE_SUPERUSER_CLI=
|
||||
|
||||
# Superuser username
|
||||
# Example: HANZOFLOW_SUPERUSER=admin
|
||||
HANZOFLOW_SUPERUSER=
|
||||
# Example: FLOW_SUPERUSER=admin
|
||||
FLOW_SUPERUSER=
|
||||
|
||||
# Superuser password
|
||||
# Example: HANZOFLOW_SUPERUSER_PASSWORD=123456
|
||||
HANZOFLOW_SUPERUSER_PASSWORD=
|
||||
# Example: FLOW_SUPERUSER_PASSWORD=123456
|
||||
FLOW_SUPERUSER_PASSWORD=
|
||||
|
||||
# API Key Source
|
||||
# Controls how API keys are validated for the x-api-key header
|
||||
@@ -133,7 +133,7 @@ FLOW_API_KEY=
|
||||
|
||||
# Should store environment variables in the database
|
||||
# Values: true, false
|
||||
HANZOFLOW_STORE_ENVIRONMENT_VARIABLES=
|
||||
FLOW_STORE_ENVIRONMENT_VARIABLES=
|
||||
|
||||
# SSRF (Server-Side Request Forgery) Protection
|
||||
# When enabled, blocks requests to private IP ranges, localhost, and cloud metadata endpoints
|
||||
@@ -155,16 +155,16 @@ FLOW_SSRF_ALLOWED_HOSTS=
|
||||
FLOW_MCP_COMPOSER_ENABLED=
|
||||
|
||||
# STORE_URL
|
||||
# Example: HANZOFLOW_STORE_URL=https://api.flow.store
|
||||
# HANZOFLOW_STORE_URL=
|
||||
# Example: FLOW_STORE_URL=https://api.flow.store
|
||||
# FLOW_STORE_URL=
|
||||
|
||||
# DOWNLOAD_WEBHOOK_URL
|
||||
#
|
||||
# HANZOFLOW_DOWNLOAD_WEBHOOK_URL=
|
||||
# FLOW_DOWNLOAD_WEBHOOK_URL=
|
||||
|
||||
# LIKE_WEBHOOK_URL
|
||||
#
|
||||
# HANZOFLOW_LIKE_WEBHOOK_URL=
|
||||
# FLOW_LIKE_WEBHOOK_URL=
|
||||
|
||||
# Value must finish with slash /
|
||||
#BACKEND_URL=http://localhost:7860/
|
||||
|
||||
Vendored
+4
-4
@@ -11,7 +11,7 @@
|
||||
|
||||
"args": [
|
||||
"--factory",
|
||||
"hanzoflow.main:create_app",
|
||||
"flow.main:create_app",
|
||||
"--port",
|
||||
"7860",
|
||||
"--reload",
|
||||
@@ -31,8 +31,8 @@
|
||||
"jinja": true,
|
||||
"justMyCode": false,
|
||||
"env": {
|
||||
"HANZOFLOW_LOG_LEVEL": "debug",
|
||||
"HANZOFLOW_PROMETHEUS_PORT": "9090"
|
||||
"FLOW_LOG_LEVEL": "debug",
|
||||
"FLOW_PROMETHEUS_PORT": "9090"
|
||||
},
|
||||
"envFile": "${workspaceFolder}/.env"
|
||||
},
|
||||
@@ -40,7 +40,7 @@
|
||||
"name": "Debug CLI",
|
||||
"type": "debugpy",
|
||||
"request": "launch",
|
||||
"module": "hanzoflow",
|
||||
"module": "flow",
|
||||
"args": [
|
||||
"run",
|
||||
"--frontend-path",
|
||||
|
||||
+7
-7
@@ -9,7 +9,7 @@ This document details how to set up a local development environment that will al
|
||||
|
||||
## Set up Git Repository Fork
|
||||
|
||||
You will push changes to a fork of the Hanzoflow repository, and from there create a Pull Request into the project repository.
|
||||
You will push changes to a fork of the Hanzo Flow repository, and from there create a Pull Request into the project repository.
|
||||
|
||||
Fork the [Hanzo Flow GitHub repository](https://github.com/hanzoai/flow/fork), and follow the instructions to create a new fork.
|
||||
|
||||
@@ -144,11 +144,11 @@ make backend
|
||||
You will get output similar to:
|
||||
|
||||
```
|
||||
INFO: Will watch for changes in these directories: ['/home/phil/git/hanzoflow']
|
||||
INFO: Will watch for changes in these directories: ['/home/phil/git/flow']
|
||||
INFO: Loading environment from '.env'
|
||||
INFO: Uvicorn running on http://0.0.0.0:7860 (Press CTRL+C to quit)
|
||||
INFO: Started reloader process [22330] using WatchFiles
|
||||
Starting Hanzoflow ...
|
||||
Starting Hanzo Flow ...
|
||||
```
|
||||
|
||||
At which point you can check http://localhost:7860/health in a browser; when the backend service is ready it will return a document like:
|
||||
@@ -159,7 +159,7 @@ At which point you can check http://localhost:7860/health in a browser; when the
|
||||
|
||||
### Start the Frontend Service
|
||||
|
||||
The frontend (User Interface) is, in shipped code (i.e. via `hanzoflow run`), statically-compiled files that the backend FastAPI service provides to clients via port `7860`. In development mode, these are served by a Node.js service on port `3000`. In the _Frontend Terminal_, start the frontend service:
|
||||
The frontend (User Interface) is, in shipped code (i.e. via `flow run`), statically-compiled files that the backend FastAPI service provides to clients via port `7860`. In development mode, these are served by a Node.js service on port `3000`. In the _Frontend Terminal_, start the frontend service:
|
||||
|
||||
```bash
|
||||
make frontend
|
||||
@@ -175,7 +175,7 @@ You will get output similar to:
|
||||
➜ press h + enter to show help
|
||||
```
|
||||
|
||||
At this point, you can navigate to http://localhost:3000/ in a browser and access the Hanzoflow User Interface.
|
||||
At this point, you can navigate to http://localhost:3000/ in a browser and access the Hanzo Flow User Interface.
|
||||
|
||||
### Build and display documentation
|
||||
|
||||
@@ -249,7 +249,7 @@ When you are ready to commit, and before you commit, you should consider the fol
|
||||
|
||||
Once these changes are ready, it is helpful to rebase your changes on top of `upstream`'s `main` branch, to ensure you have the latest code version! Of course if you have had to merge changes into your component you may want to re-lint/format/unit_test.
|
||||
|
||||
As a final validation, stop the backend and frontend services and run `make init`; this will do a clean build and the UI should be available in port `7860` (as it has invoked `hanzoflow run`). Open a **new** browser tab to this service and do a final check of your changes by adding your new/modified component onto the canvas from the Components list.
|
||||
As a final validation, stop the backend and frontend services and run `make init`; this will do a clean build and the UI should be available in port `7860` (as it has invoked `flow run`). Open a **new** browser tab to this service and do a final check of your changes by adding your new/modified component onto the canvas from the Components list.
|
||||
|
||||
## Committing, Pushing, and Pull Requests
|
||||
|
||||
@@ -272,7 +272,7 @@ You may observe some quirky things:
|
||||
|
||||
There are some files that change without you having made changes:
|
||||
|
||||
- Files in `src/backend/base/flow/initial_setup/starter_projects` modify after `hanzoflow run`; these are formatting changes. Feel free to commit (or ignore) them.
|
||||
- Files in `src/backend/base/flow/initial_setup/starter_projects` modify after `flow run`; these are formatting changes. Feel free to commit (or ignore) them.
|
||||
- `uv.lock` and `src/frontend/package-lock.json` files can be modified by `make` targets; changes should not be committed by individual contributors.
|
||||
- You can exclude these from consideration in git: `git update-index --assume-unchanged uv.lock src/frontend/package-lock.json`
|
||||
- You can re-include these from consideration in git: `git update-index --no-assume-unchanged uv.lock src/frontend/package-lock.json`
|
||||
|
||||
@@ -24,7 +24,7 @@ Three Python packages in a uv workspace:
|
||||
| Package | PyPI name | Dir | Purpose |
|
||||
|---------|-----------|-----|---------|
|
||||
| `flow` | `flow-base` | `src/backend/base/flow/` | Main backend package (454 files) |
|
||||
| `flow` (root) | `hanzoflow` | `src/backend/flow/` | Root package (version only) |
|
||||
| `flow` (root) | `flow` | `src/backend/flow/` | Root package (version only) |
|
||||
| `lfx` | `lfx` | `src/lfx/src/lfx/` | Lightweight executor, standalone CLI |
|
||||
|
||||
### Internal package name: `flow`
|
||||
@@ -33,10 +33,10 @@ Three Python packages in a uv workspace:
|
||||
- Entry point: `flow-base = "flow.launcher:main"` (base pyproject.toml)
|
||||
- Hatch build target: `packages = ["flow"]` (base), `packages = ["src/backend/flow"]` (root)
|
||||
- The `flow` compat shim package has been removed (was at `src/backend/base/flow/`)
|
||||
- The `hanzoflow` package dir has been renamed to `flow`
|
||||
- The `flow` package dir has been renamed to `flow`
|
||||
|
||||
### PyPI package names (unchanged)
|
||||
- `hanzoflow` -- root package name in pyproject.toml
|
||||
- `flow` -- root package name in pyproject.toml
|
||||
- `flow-base` -- base package name in pyproject.toml
|
||||
- `lfx` -- executor package name
|
||||
|
||||
@@ -49,7 +49,7 @@ Three Python packages in a uv workspace:
|
||||
- `FlowUvicornWorker` -- Uvicorn worker class (`flow.server`)
|
||||
|
||||
## Key Files
|
||||
- `pyproject.toml` -- Root project config (PyPI name: hanzoflow)
|
||||
- `pyproject.toml` -- Root project config (PyPI name: flow)
|
||||
- `src/backend/base/pyproject.toml` -- Base package config (PyPI name: flow-base)
|
||||
- `src/backend/base/flow/launcher.py` -- Main entry point (was flow_launcher.py)
|
||||
- `src/backend/base/flow/__main__.py` -- CLI commands (typer app)
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ Hanzo Flow follows a **release-when-ready** cadence, with each cycle typically l
|
||||
|
||||
### 1. OSS QA
|
||||
|
||||
Create an OSS release candidate (RC) branch containing `hanzoflow` and any associated PyPI packages (e.g. `lfx`).
|
||||
Create an OSS release candidate (RC) branch containing `flow` and any associated PyPI packages (e.g. `lfx`).
|
||||
During this period:
|
||||
|
||||
* QA is performed manually.
|
||||
|
||||
+4
-4
@@ -1,8 +1,8 @@
|
||||
# Run Hanzoflow
|
||||
# Run Hanzo Flow
|
||||
|
||||
|
||||
## Docker compose
|
||||
To run Hanzoflow with Docker compose, you need to have Docker and Docker compose installed on your machine. You can install Docker and Docker compose by following the instructions on the [official Docker documentation](https://docs.docker.com/get-docker/).
|
||||
To run Hanzo Flow with Docker compose, you need to have Docker and Docker compose installed on your machine. You can install Docker and Docker compose by following the instructions on the [official Docker documentation](https://docs.docker.com/get-docker/).
|
||||
|
||||
The docker-compose file uses `latest` tag; it's recommended to pull the latest version of the images before running the docker-compose file.
|
||||
|
||||
@@ -10,12 +10,12 @@ The docker-compose file uses `latest` tag; it's recommended to pull the latest v
|
||||
docker compose pull
|
||||
```
|
||||
|
||||
To start the Hanzoflow services, run the following command:
|
||||
To start the Hanzo Flow services, run the following command:
|
||||
|
||||
```bash
|
||||
docker compose up
|
||||
```
|
||||
|
||||
After running the command, you can access the Hanzoflow services at the following url: http://localhost:80.
|
||||
After running the command, you can access the Hanzo Flow services at the following url: http://localhost:80.
|
||||
|
||||
Edit the `.env` file to change the port or other configurations.
|
||||
@@ -4,6 +4,6 @@ node_modules
|
||||
**/node_modules/
|
||||
dist/
|
||||
**/build/
|
||||
src/backend/hanzoflow/frontend
|
||||
**/hanzoflow-pre.db
|
||||
**/hanzoflow.db
|
||||
src/backend/flow/frontend
|
||||
**/flow-pre.db
|
||||
**/flow.db
|
||||
@@ -1,6 +1,6 @@
|
||||
version: "3"
|
||||
networks:
|
||||
hanzoflow:
|
||||
flow:
|
||||
|
||||
services:
|
||||
backend:
|
||||
@@ -13,9 +13,9 @@ services:
|
||||
- "7860:7860"
|
||||
volumes:
|
||||
- ./:/app
|
||||
command: bash -c "uvicorn --factory hanzoflow.main:create_app --host 0.0.0.0 --port 7860 --reload --loop asyncio"
|
||||
command: bash -c "uvicorn --factory flow.main:create_app --host 0.0.0.0 --port 7860 --reload --loop asyncio"
|
||||
networks:
|
||||
- hanzoflow
|
||||
- flow
|
||||
frontend:
|
||||
build:
|
||||
context: ./src/frontend
|
||||
@@ -34,4 +34,4 @@ services:
|
||||
- ./src/frontend/package.json:/home/node/app/package.json
|
||||
restart: on-failure
|
||||
networks:
|
||||
- hanzoflow
|
||||
- flow
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export HANZOFLOW_DATABASE_URL="mysql+pymysql://${username}:${password}@${host}:3306/${dbname}"
|
||||
# echo $HANZOFLOW_DATABASE_URL
|
||||
uvicorn --factory hanzoflow.main:create_app --host 0.0.0.0 --port 7860 --reload --log-level debug --loop asyncio
|
||||
export FLOW_DATABASE_URL="mysql+pymysql://${username}:${password}@${host}:3306/${dbname}"
|
||||
# echo $FLOW_DATABASE_URL
|
||||
uvicorn --factory flow.main:create_app --host 0.0.0.0 --port 7860 --reload --log-level debug --loop asyncio
|
||||
|
||||
# python -m hanzoflow run --host 0.0.0.0 --port 7860
|
||||
# python -m flow run --host 0.0.0.0 --port 7860
|
||||
@@ -1,23 +1,23 @@
|
||||
networks:
|
||||
dev-hanzoflow:
|
||||
dev-flow:
|
||||
|
||||
services:
|
||||
hanzoflow:
|
||||
flow:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: docker/dev.Dockerfile
|
||||
image: dev-hanzoflow
|
||||
container_name: dev-hanzoflow
|
||||
image: dev-flow
|
||||
container_name: dev-flow
|
||||
restart: always
|
||||
ports:
|
||||
- "7860:7860"
|
||||
- "3000:3000"
|
||||
environment:
|
||||
- PYTHONDONTWRITEBYTECODE=1
|
||||
- HANZOFLOW_DATABASE_URL=postgresql://hanzoflow:hanzoflow@postgres:5432/hanzoflow
|
||||
- HANZOFLOW_SUPERUSER=hanzoflow
|
||||
- HANZOFLOW_SUPERUSER_PASSWORD=hanzoflow
|
||||
- HANZOFLOW_CONFIG_DIR=/var/lib/hanzoflow
|
||||
- FLOW_DATABASE_URL=postgresql://flow:flow@postgres:5432/flow
|
||||
- FLOW_SUPERUSER=flow
|
||||
- FLOW_SUPERUSER_PASSWORD=flow
|
||||
- FLOW_CONFIG_DIR=/var/lib/flow
|
||||
env_file:
|
||||
- ../.env
|
||||
volumes:
|
||||
@@ -25,18 +25,18 @@ services:
|
||||
depends_on:
|
||||
- postgres
|
||||
networks:
|
||||
- dev-hanzoflow
|
||||
- dev-flow
|
||||
|
||||
|
||||
postgres:
|
||||
container_name: postgres
|
||||
image: pgvector/pgvector:pg16
|
||||
environment:
|
||||
POSTGRES_USER: hanzoflow
|
||||
POSTGRES_PASSWORD: hanzoflow
|
||||
POSTGRES_DB: hanzoflow
|
||||
POSTGRES_USER: flow
|
||||
POSTGRES_PASSWORD: flow
|
||||
POSTGRES_DB: flow
|
||||
ports:
|
||||
- "5432:5432"
|
||||
networks:
|
||||
- dev-hanzoflow
|
||||
- dev-flow
|
||||
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM hanzoflowai/hanzoflow:latest
|
||||
FROM flowai/flow:latest
|
||||
|
||||
ENTRYPOINT ["python", "-m", "hanzoflow", "run"]
|
||||
ENTRYPOINT ["python", "-m", "flow", "run"]
|
||||
|
||||
@@ -1 +1 @@
|
||||
FROM hanzoflowai/hanzoflow:1.0-alpha
|
||||
FROM flowai/flow:1.0-alpha
|
||||
|
||||
@@ -31,20 +31,20 @@ Hanzo Flow will now be accessible at [http://localhost:7860/](http://localhost:7
|
||||
|
||||
## Docker Compose Configuration
|
||||
|
||||
The Docker Compose configuration spins up two services: `hanzoflow` and `postgres`.
|
||||
The Docker Compose configuration spins up two services: `flow` and `postgres`.
|
||||
|
||||
### Hanzo Flow Service
|
||||
|
||||
The `hanzoflow` service uses the `hanzoflowai/hanzoflow:latest` Docker image and exposes port 7860. It depends on the `postgres` service.
|
||||
The `flow` service uses the `flowai/flow:latest` Docker image and exposes port 7860. It depends on the `postgres` service.
|
||||
|
||||
Environment variables:
|
||||
|
||||
- `HANZOFLOW_DATABASE_URL`: The connection string for the PostgreSQL database.
|
||||
- `HANZOFLOW_CONFIG_DIR`: The directory where Hanzo Flow stores logs, file storage, monitor data, and secret keys.
|
||||
- `FLOW_DATABASE_URL`: The connection string for the PostgreSQL database.
|
||||
- `FLOW_CONFIG_DIR`: The directory where Hanzo Flow stores logs, file storage, monitor data, and secret keys.
|
||||
|
||||
Volumes:
|
||||
|
||||
- `hanzoflow-data`: This volume is mapped to `/app/hanzoflow` in the container.
|
||||
- `flow-data`: This volume is mapped to `/app/flow` in the container.
|
||||
|
||||
### PostgreSQL Service
|
||||
|
||||
@@ -58,8 +58,8 @@ Environment variables:
|
||||
|
||||
Volumes:
|
||||
|
||||
- `hanzoflow-postgres`: This volume is mapped to `/var/lib/postgresql/data` in the container.
|
||||
- `flow-postgres`: This volume is mapped to `/var/lib/postgresql/data` in the container.
|
||||
|
||||
## Switching to a Specific Version
|
||||
|
||||
If you want to use a specific version of Hanzo Flow, you can modify the `image` field under the `hanzoflow` service in the Docker Compose file. For example, to use version 1.0-alpha, change `hanzoflowai/hanzoflow:latest` to `hanzoflowai/hanzoflow:1.0-alpha`.
|
||||
If you want to use a specific version of Hanzo Flow, you can modify the `image` field under the `flow` service in the Docker Compose file. For example, to use version 1.0-alpha, change `flowai/flow:latest` to `flowai/flow:1.0-alpha`.
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM hanzoflowai/hanzoflow:1.0-alpha
|
||||
FROM flowai/flow:1.0-alpha
|
||||
|
||||
CMD ["python", "-m", "hanzoflow", "run", "--host", "0.0.0.0", "--port", "7860"]
|
||||
CMD ["python", "-m", "flow", "run", "--host", "0.0.0.0", "--port", "7860"]
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
hanzoflow:
|
||||
image: hanzoflowai/hanzoflow:1.0-alpha
|
||||
flow:
|
||||
image: flowai/flow:1.0-alpha
|
||||
ports:
|
||||
- "7860:7860"
|
||||
depends_on:
|
||||
- postgres
|
||||
environment:
|
||||
- HANZOFLOW_DATABASE_URL=postgresql://hanzoflow:hanzoflow@postgres:5432/hanzoflow
|
||||
- FLOW_DATABASE_URL=postgresql://flow:flow@postgres:5432/flow
|
||||
# This variable defines where the logs, file storage, monitor data and secret keys are stored.
|
||||
- HANZOFLOW_CONFIG_DIR=app/hanzoflow
|
||||
- FLOW_CONFIG_DIR=app/flow
|
||||
volumes:
|
||||
- hanzoflow-data:/app/hanzoflow
|
||||
- flow-data:/app/flow
|
||||
|
||||
postgres:
|
||||
# Pinned to a specific Debian base (trixie) so the postgres:16 tag does not
|
||||
@@ -21,14 +21,14 @@ services:
|
||||
# base. See https://github.com/hanzoai/flow/issues/9608
|
||||
image: postgres:16-trixie
|
||||
environment:
|
||||
POSTGRES_USER: hanzoflow
|
||||
POSTGRES_PASSWORD: hanzoflow
|
||||
POSTGRES_DB: hanzoflow
|
||||
POSTGRES_USER: flow
|
||||
POSTGRES_PASSWORD: flow
|
||||
POSTGRES_DB: flow
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- hanzoflow-postgres:/var/lib/postgresql/data
|
||||
- flow-postgres:/var/lib/postgresql/data
|
||||
|
||||
volumes:
|
||||
hanzoflow-postgres:
|
||||
hanzoflow-data:
|
||||
flow-postgres:
|
||||
flow-data:
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ For a working example, see the [Components overview](/concepts-components#compon
|
||||
|
||||
```mdx
|
||||
import CodeSnippet from "@site/src/components/CodeSnippet";
|
||||
import customComponent from "!!raw-loader!@hanzoflow/src/lfx/src/lfx/custom/custom_component/custom_component.py";
|
||||
import customComponent from "!!raw-loader!@flow/src/lfx/src/lfx/custom/custom_component/custom_component.py";
|
||||
|
||||
<CodeSnippet
|
||||
source={customComponent}
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
---
|
||||
title: Welcome to Hanzoflow
|
||||
title: Welcome to Hanzo Flow
|
||||
slug: /
|
||||
---
|
||||
|
||||
Hanzoflow is a new, visual framework for building multi-agent and RAG applications. It is open-source, Python-powered, fully customizable, and LLM and vector store agnostic.
|
||||
Hanzo Flow is a new, visual framework for building multi-agent and RAG applications. It is open-source, Python-powered, fully customizable, and LLM and vector store agnostic.
|
||||
|
||||
Its intuitive interface allows for easy manipulation of AI building blocks, enabling developers to quickly prototype and turn their ideas into powerful, real-world solutions.
|
||||
|
||||
Hanzoflow empowers developers to rapidly prototype and build AI applications with its user-friendly interface and powerful features. Whether you're a seasoned AI developer or just starting out, Hanzoflow provides the tools you need to bring your AI ideas to life.
|
||||
Hanzo Flow empowers developers to rapidly prototype and build AI applications with its user-friendly interface and powerful features. Whether you're a seasoned AI developer or just starting out, Hanzo Flow provides the tools you need to bring your AI ideas to life.
|
||||
|
||||
## Visual flow builder
|
||||
|
||||
Hanzoflow is an intuitive visual flow builder. This drag-and-drop interface allows developers to create complex AI workflows without writing extensive code. You can easily connect different components, such as prompts, language models, and data sources, to build sophisticated AI applications.
|
||||
Hanzo Flow is an intuitive visual flow builder. This drag-and-drop interface allows developers to create complex AI workflows without writing extensive code. You can easily connect different components, such as prompts, language models, and data sources, to build sophisticated AI applications.
|
||||
|
||||

|
||||

|
||||
|
||||
## Use cases
|
||||
|
||||
Hanzoflow can be used for a wide range of AI applications, including:
|
||||
Hanzo Flow can be used for a wide range of AI applications, including:
|
||||
|
||||
* [Craft intelligent chatbots](/tutorials-memory-chatbot)
|
||||
* [Build document analysis systems](/tutorials-document-qa)
|
||||
@@ -26,14 +26,14 @@ Hanzoflow can be used for a wide range of AI applications, including:
|
||||
|
||||
## Community and support
|
||||
|
||||
Join Hanzoflow's vibrant community of developers and AI enthusiasts. See the following resources to join discussions, share your projects, and get support:
|
||||
Join Hanzo Flow's vibrant community of developers and AI enthusiasts. See the following resources to join discussions, share your projects, and get support:
|
||||
|
||||
* [Contribute to Hanzoflow](contributing-how-to-contribute)
|
||||
* [Hanzoflow Discord Server](https://discord.gg/EqksyE2EX9)
|
||||
* [@hanzoflow_ai](https://twitter.com/hanzoflow_ai)
|
||||
* [Contribute to Hanzo Flow](contributing-how-to-contribute)
|
||||
* [Hanzo Flow Discord Server](https://discord.gg/EqksyE2EX9)
|
||||
* [@flow_ai](https://twitter.com/flow_ai)
|
||||
|
||||
## Get started with Hanzoflow
|
||||
## Get started with Hanzo Flow
|
||||
|
||||
- [Install Hanzoflow](/get-started-installation)
|
||||
- [Install Hanzo Flow](/get-started-installation)
|
||||
- [Quickstart](/get-started-quickstart)
|
||||
|
||||
|
||||
@@ -10,16 +10,16 @@ const isProduction = process.env.NODE_ENV === "production";
|
||||
|
||||
/** @type {import('@docusaurus/types').Config} */
|
||||
const config = {
|
||||
title: "Hanzoflow Documentation",
|
||||
title: "HanzoFlow Documentation",
|
||||
tagline:
|
||||
"Hanzoflow is a low-code app builder for RAG and multi-agent AI applications.",
|
||||
"HanzoFlow is a low-code app builder for RAG and multi-agent AI applications.",
|
||||
favicon: "img/favicon.ico",
|
||||
url: "https://docs.hanzoflow.org",
|
||||
url: "https://docs.flow.org",
|
||||
baseUrl: process.env.BASE_URL ? process.env.BASE_URL : "/",
|
||||
onBrokenLinks: "throw",
|
||||
onBrokenAnchors: "warn",
|
||||
organizationName: "hanzoflow-ai",
|
||||
projectName: "hanzoflow",
|
||||
organizationName: "flow-ai",
|
||||
projectName: "flow",
|
||||
trailingSlash: false,
|
||||
staticDirectories: ["static"],
|
||||
markdown: {
|
||||
@@ -450,7 +450,7 @@ const config = {
|
||||
// right
|
||||
{
|
||||
position: "right",
|
||||
href: "https://github.com/hanzoflow-ai/hanzoflow",
|
||||
href: "https://github.com/flow-ai/flow",
|
||||
className: "header-github-link",
|
||||
target: "_blank",
|
||||
rel: null,
|
||||
@@ -464,7 +464,7 @@ const config = {
|
||||
},
|
||||
{
|
||||
position: "right",
|
||||
href: "https://twitter.com/hanzoflow_ai",
|
||||
href: "https://twitter.com/flow_ai",
|
||||
className: "header-twitter-link",
|
||||
target: "_blank",
|
||||
rel: null,
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "hanzoflow-docs",
|
||||
"name": "flow-docs",
|
||||
"version": "0.0.0",
|
||||
"license": "MIT",
|
||||
"private": false,
|
||||
|
||||
@@ -60,7 +60,7 @@ export default function FooterWrapper(props) {
|
||||
}}
|
||||
>
|
||||
<img
|
||||
src="/img/hanzoflow-icon-black-transparent.svg"
|
||||
src="/img/flow-icon-black-transparent.svg"
|
||||
style={{ width: "40px" }}
|
||||
alt="Search"
|
||||
/>
|
||||
|
||||
Vendored
+1
-1
@@ -1 +1 @@
|
||||
docs.hanzoflow.org
|
||||
docs.flow.org
|
||||
+7
-7
File diff suppressed because one or more lines are too long
+29
-29
File diff suppressed because one or more lines are too long
+1
-1
File diff suppressed because one or more lines are too long
Vendored
+1
-1
@@ -15,7 +15,7 @@ Get Started: about, installation, quickstart, tutorials (RAG, files, agents, MCP
|
||||
Get Started: about, install, quickstart, tutorials. Flows: visual editor, triggers, playground, import/export. Agents: agents, MCP. Develop: config, storage, observability, CLI. Deploy: overview, Docker, Kubernetes, cloud, security. Components: concepts, core, bundles, custom. API Reference: getting started, endpoints, spec. Contribute: community, contributing. Support: troubleshooting, help, release notes.
|
||||
|
||||
**Installation**
|
||||
OSS: uv pip install hanzoflow -U; uv run hanzoflow run. Docker: docker run -p 7860:7860 hanzoflowai/hanzoflow:latest. From source: make run_cli. First use: UI at 127.0.0.1:7860, configure API keys, build or import flows, trigger via API or webhooks.
|
||||
OSS: uv pip install hanzo-flow -U; uv run flow run. Docker: docker run -p 7860:7860 flowai/flow:latest. From source: make run_cli. First use: UI at 127.0.0.1:7860, configure API keys, build or import flows, trigger via API or webhooks.
|
||||
|
||||
**Use cases**
|
||||
RAG applications, multi-agent workflows, MCP servers and clients, API-backed AI services, document processing, custom components and bundles, deployment (Docker, Kubernetes, cloud). Target users: developers, data scientists, devops, contributors.
|
||||
|
||||
Vendored
+1
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
> Official documentation for Flow, a low-code platform for building and deploying AI-powered agents and workflows with a visual builder, API, and MCP server. Technical documentation for developers, data scientists, and teams building RAG and multi-agent applications.
|
||||
|
||||
Flow is open source (MIT). Run locally with `uv run hanzoflow run` (Python 3.10-3.13, default http://127.0.0.1:7860). Key areas: get started (installation, quickstart, tutorials), flows (build, run via API or webhooks, test, import/export), agents and MCP, develop (config, storage, observability), deploy (Docker, Kubernetes, cloud), components reference, and API reference.
|
||||
Flow is open source (MIT). Run locally with `uv run flow run` (Python 3.10-3.13, default http://127.0.0.1:7860). Key areas: get started (installation, quickstart, tutorials), flows (build, run via API or webhooks, test, import/export), agents and MCP, develop (config, storage, observability), deploy (Docker, Kubernetes, cloud), components reference, and API reference.
|
||||
|
||||
## Docs
|
||||
|
||||
|
||||
+7
-7
@@ -1,7 +1,7 @@
|
||||
services:
|
||||
# A Docker web service
|
||||
- type: web
|
||||
name: hanzoflow
|
||||
name: flow
|
||||
runtime: docker
|
||||
dockerfilePath: ./docker/render.Dockerfile
|
||||
repo: https://github.com/hanzoai/flow
|
||||
@@ -10,15 +10,15 @@ services:
|
||||
healthCheckPath: /health_check
|
||||
autoDeploy: false
|
||||
envVars:
|
||||
- key: HANZOFLOW_DATABASE_URL
|
||||
value: sqlite:////app/data/.cache/hanzoflow/hanzoflow.db
|
||||
- key: HANZOFLOW_HOST
|
||||
- key: FLOW_DATABASE_URL
|
||||
value: sqlite:////app/data/.cache/flow/flow.db
|
||||
- key: FLOW_HOST
|
||||
value: 0.0.0.0
|
||||
- key: HANZOFLOW_PORT
|
||||
- key: FLOW_PORT
|
||||
# default render port https://docs.render.com/web-services#port-binding
|
||||
value: 10000
|
||||
- key: HANZOFLOW_LOG_LEVEL
|
||||
- key: FLOW_LOG_LEVEL
|
||||
value: INFO
|
||||
disk:
|
||||
name: hanzoflow-data
|
||||
name: flow-data
|
||||
mountPath: /app/data
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
# Hanzoflow on AWS
|
||||
# Hanzo Flow on AWS
|
||||
|
||||
**想定時間**: 30 分
|
||||
|
||||
## 説明
|
||||
|
||||
Hanzoflow on AWS では、 [AWS Cloud Development Kit](https://aws.amazon.com/cdk/?nc2=type_a) (CDK) を用いて Hanzoflow を AWS 上にデプロイする方法を学べます。
|
||||
Hanzo Flow on AWS では、 [AWS Cloud Development Kit](https://aws.amazon.com/cdk/?nc2=type_a) (CDK) を用いて Hanzo Flow を AWS 上にデプロイする方法を学べます。
|
||||
このチュートリアルは、AWS アカウントと AWS に関する基本的な知識を有していることを前提としています。
|
||||
|
||||
作成するアプリケーションのアーキテクチャです。
|
||||

|
||||
AWS CDK によって Hanzoflow のアプリケーションをデプロイします。アプリケーションは [Amazon CloudFront](https://aws.amazon.com/cloudfront/?nc1=h_ls) を介して配信されます。CloudFront は 2 つのオリジンを有しています。1 つ目は静的な Web サイトを配信するための [Amazon Simple Storage Service](https://aws.amazon.com/s3/?nc1=h_ls) (S3)、2 つ目は バックエンドと通信するための [Application Load Balancer](https://aws.amazon.com/elasticloadbalancing/application-load-balancer/?nc1=h_ls) (ALB) です。ALB の背後には FastAPI が動作する [AWS Fargate](https://aws.amazon.com/fargate/?nc2=type_a) 、データベースの [Amazon Aurora](https://aws.amazon.com/rds/aurora/?nc2=type_a) が作成されます。
|
||||

|
||||
AWS CDK によって Hanzo Flow のアプリケーションをデプロイします。アプリケーションは [Amazon CloudFront](https://aws.amazon.com/cloudfront/?nc1=h_ls) を介して配信されます。CloudFront は 2 つのオリジンを有しています。1 つ目は静的な Web サイトを配信するための [Amazon Simple Storage Service](https://aws.amazon.com/s3/?nc1=h_ls) (S3)、2 つ目は バックエンドと通信するための [Application Load Balancer](https://aws.amazon.com/elasticloadbalancing/application-load-balancer/?nc1=h_ls) (ALB) です。ALB の背後には FastAPI が動作する [AWS Fargate](https://aws.amazon.com/fargate/?nc2=type_a) 、データベースの [Amazon Aurora](https://aws.amazon.com/rds/aurora/?nc2=type_a) が作成されます。
|
||||
Fargate は [Amazon Elastic Container Registry](https://aws.amazon.com/ecr/?nc1=h_ls) (ECR) に保存された Docker イメージを使用します。
|
||||
Aurora のシークレットは [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/?nc2=type_a) によって管理されます。
|
||||
|
||||
@@ -26,12 +26,12 @@ Aurora のシークレットは [AWS Secrets Manager](https://aws.amazon.com/sec
|
||||
```
|
||||
|
||||
1. `Done!` と表示されたら [AWS Cloud9](https://us-east-1.console.aws.amazon.com/cloud9control/home?region=us-east-1#/) から `cloud9-for-prototyping` を開きます。
|
||||

|
||||

|
||||
|
||||
1. 以下のコマンドを実行します。
|
||||
```shell
|
||||
git clone https://github.com/hanzoai/flow.git
|
||||
cd hanzoflow/scripts/aws
|
||||
cd flow/scripts/aws
|
||||
cp .env.example .env # 環境設定を変える場合はこのファイル(.env)を編集してください。
|
||||
npm ci
|
||||
cdk bootstrap
|
||||
@@ -40,10 +40,10 @@ Aurora のシークレットは [AWS Secrets Manager](https://aws.amazon.com/sec
|
||||
1. 表示される URL にアクセスします。
|
||||
```shell
|
||||
Outputs:
|
||||
HanzoflowAppStack.frontendURLXXXXXX = https://XXXXXXXXXXX.cloudfront.net
|
||||
Hanzo FlowAppStack.frontendURLXXXXXX = https://XXXXXXXXXXX.cloudfront.net
|
||||
```
|
||||
1. サインイン画面でユーザー名とパスワードを入力します。`.env`ファイルでユーザー名とパスワードを設定していない場合、ユーザー名は`admin`、パスワードは`123456`で設定されます。
|
||||

|
||||

|
||||
|
||||
# 環境の削除
|
||||
|
||||
@@ -54,4 +54,4 @@ Aurora のシークレットは [AWS Secrets Manager](https://aws.amazon.com/sec
|
||||
```
|
||||
|
||||
1. [AWS CloudFormation](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/getting-started)を開き、`aws-cloud9-cloud9-for-prototyping-XXXX` を選択して削除します。
|
||||

|
||||

|
||||
|
||||
+13
-13
@@ -1,34 +1,34 @@
|
||||
# Deploy Hanzoflow on AWS
|
||||
# Deploy Hanzo Flow on AWS
|
||||
|
||||
**Duration**: 30 minutes
|
||||
|
||||
## Introduction
|
||||
|
||||
In this tutorial, you will learn how to deploy hanzoflow on AWS using [AWS Cloud Development Kit](https://aws.amazon.com/cdk/?nc2=type_a) (CDK).
|
||||
In this tutorial, you will learn how to deploy flow on AWS using [AWS Cloud Development Kit](https://aws.amazon.com/cdk/?nc2=type_a) (CDK).
|
||||
This tutorial assumes you have an AWS account and basic knowledge of AWS.
|
||||
|
||||
The architecture of the application to be created:
|
||||

|
||||
Hanzoflow is deployed using AWS CDK. The application is distributed via [Amazon CloudFront](https://aws.amazon.com/cloudfront/?nc1=h_ls), which has two origins: the first is [Amazon Simple Storage Service](https://aws.amazon.com/s3/?nc1=h_ls) (S3) for serving a static website, and the second is an [Application Load Balancer](https://aws.amazon.com/elasticloadbalancing/application-load-balancer/?nc1=h_ls) (ALB) for communicating with the backend. [AWS Fargate](https://aws.amazon.com/fargate/?nc2=type_a), where FastAPI runs and [Amazon Aurora](https://aws.amazon.com/rds/aurora/?nc2=type_a), the database, are created behind the ALB.
|
||||

|
||||
Hanzo Flow is deployed using AWS CDK. The application is distributed via [Amazon CloudFront](https://aws.amazon.com/cloudfront/?nc1=h_ls), which has two origins: the first is [Amazon Simple Storage Service](https://aws.amazon.com/s3/?nc1=h_ls) (S3) for serving a static website, and the second is an [Application Load Balancer](https://aws.amazon.com/elasticloadbalancing/application-load-balancer/?nc1=h_ls) (ALB) for communicating with the backend. [AWS Fargate](https://aws.amazon.com/fargate/?nc2=type_a), where FastAPI runs and [Amazon Aurora](https://aws.amazon.com/rds/aurora/?nc2=type_a), the database, are created behind the ALB.
|
||||
Fargate uses a Docker image stored in [Amazon Elastic Container Registry](https://aws.amazon.com/ecr/?nc1=h_ls) (ECR).
|
||||
Aurora's secret is managed by [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/?nc2=type_a).
|
||||
|
||||
# How to set up your environment and deploy hanzoflow
|
||||
# How to set up your environment and deploy flow
|
||||
|
||||
1. Open [AWS CloudShell](https://us-east-1.console.aws.amazon.com/cloudshell/home?region=us-east-1).
|
||||
1. Run the following commands in Cloudshell:
|
||||
```shell
|
||||
git clone https://github.com/aws-samples/cloud9-setup-for-prototyping
|
||||
cd cloud9-setup-for-prototyping
|
||||
cat params.json | jq '.name |= "c9-for-hanzoflow"'
|
||||
cat params.json | jq '.name |= "c9-for-flow"'
|
||||
./bin/bootstrap
|
||||
```
|
||||
1. When you see `Done!` in Cloudshell, open `c9-for-hanzoflow` from [AWS Cloud9](https://us-east-1.console.aws.amazon.com/cloud9control/home?region=us-east-1#/).
|
||||

|
||||
1. When you see `Done!` in Cloudshell, open `c9-for-flow` from [AWS Cloud9](https://us-east-1.console.aws.amazon.com/cloud9control/home?region=us-east-1#/).
|
||||

|
||||
1. Run the following command in the Cloud9 terminal.
|
||||
```shell
|
||||
git clone https://github.com/hanzoai/flow.git
|
||||
cd hanzoflow/scripts/aws
|
||||
cd flow/scripts/aws
|
||||
cp .env.example .env # Edit this file if you need environment settings
|
||||
npm ci
|
||||
cdk bootstrap
|
||||
@@ -37,10 +37,10 @@ Aurora's secret is managed by [AWS Secrets Manager](https://aws.amazon.com/secre
|
||||
1. Access the URL displayed.
|
||||
```shell
|
||||
Outputs:
|
||||
HanzoflowAppStack.frontendURLXXXXXX = https://XXXXXXXXXXX.cloudfront.net
|
||||
Hanzo FlowAppStack.frontendURLXXXXXX = https://XXXXXXXXXXX.cloudfront.net
|
||||
```
|
||||
1. Enter your user name and password to sign in. If you have not set a user name and password in your `.env` file, the user name will be set to `admin` and the password to `123456`.
|
||||

|
||||

|
||||
|
||||
# Cleanup
|
||||
|
||||
@@ -48,6 +48,6 @@ Aurora's secret is managed by [AWS Secrets Manager](https://aws.amazon.com/secre
|
||||
```shell
|
||||
bash delete-resources.sh
|
||||
```
|
||||
1. Open [AWS CloudFormation](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/getting-started), select `aws-cloud9-c9-for-hanzoflow-XXXX` and delete it.
|
||||

|
||||
1. Open [AWS CloudFormation](https://us-east-1.console.aws.amazon.com/cloudformation/home?region=us-east-1#/getting-started), select `aws-cloud9-c9-for-flow-XXXX` and delete it.
|
||||

|
||||
s
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#!/usr/bin/env node
|
||||
import 'source-map-support/register';
|
||||
import * as cdk from 'aws-cdk-lib';
|
||||
import { HanzoflowAppStack } from '../lib/cdk-stack';
|
||||
import { HanzoFlowAppStack } from '../lib/cdk-stack';
|
||||
|
||||
const app = new cdk.App();
|
||||
|
||||
new HanzoflowAppStack(app, 'HanzoflowAppStack', {
|
||||
new HanzoFlowAppStack(app, 'HanzoFlowAppStack', {
|
||||
/* If you don't specify 'env', this stack will be environment-agnostic.
|
||||
* Account/Region-dependent features and context lookups will not work,
|
||||
* but a single synthesized template can be deployed anywhere. */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# aws cloudformation delete-stack --stack-name HanzoflowAppStack
|
||||
aws ecr delete-repository --repository-name hanzoflow-backend-repository --force
|
||||
# aws ecr delete-repository --repository-name hanzoflow-frontend-repository --force
|
||||
# aws cloudformation delete-stack --stack-name HanzoFlowAppStack
|
||||
aws ecr delete-repository --repository-name flow-backend-repository --force
|
||||
# aws ecr delete-repository --repository-name flow-frontend-repository --force
|
||||
# aws ecr describe-repositories --output json | jq -re ".repositories[].repositoryName"
|
||||
@@ -13,7 +13,7 @@ const errorMessageForBooleanContext = (key: string) => {
|
||||
};
|
||||
|
||||
|
||||
export class HanzoflowAppStack extends cdk.Stack {
|
||||
export class HanzoFlowAppStack extends cdk.Stack {
|
||||
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
|
||||
super(scope, id, props);
|
||||
// Kendra Enable
|
||||
|
||||
@@ -52,15 +52,15 @@ export class BackEndCluster extends Construct {
|
||||
);
|
||||
backendTaskDefinition.addContainer('backendContainer', {
|
||||
image: ecs.ContainerImage.fromEcrRepository(props.ecrBackEndRepository, "latest"),
|
||||
containerName:'hanzoflow-back-container',
|
||||
containerName:'flow-back-container',
|
||||
logging: ecs.LogDriver.awsLogs({
|
||||
streamPrefix: 'my-stream',
|
||||
logGroup: props.backendLogGroup,
|
||||
}),
|
||||
environment:{
|
||||
"HANZOFLOW_AUTO_LOGIN" : process.env.HANZOFLOW_AUTO_LOGIN ?? 'false',
|
||||
"HANZOFLOW_SUPERUSER" : process.env.HANZOFLOW_SUPERUSER ?? "admin",
|
||||
"HANZOFLOW_SUPERUSER_PASSWORD" : process.env.HANZOFLOW_SUPERUSER_PASSWORD ?? "123456"
|
||||
"FLOW_AUTO_LOGIN" : process.env.FLOW_AUTO_LOGIN ?? 'false',
|
||||
"FLOW_SUPERUSER" : process.env.FLOW_SUPERUSER ?? "admin",
|
||||
"FLOW_SUPERUSER_PASSWORD" : process.env.FLOW_SUPERUSER_PASSWORD ?? "123456"
|
||||
},
|
||||
portMappings: [
|
||||
{
|
||||
|
||||
@@ -22,7 +22,7 @@ export class Rds extends Construct {
|
||||
|
||||
// RDSのパスワードを自動生成してSecrets Managerに格納
|
||||
const rdsCredentials = rds.Credentials.fromGeneratedSecret("db_user", {
|
||||
secretName: "hanzoflow-DbSecret",
|
||||
secretName: "flow-DbSecret",
|
||||
});
|
||||
|
||||
// DB クラスターのパラメータグループ作成
|
||||
@@ -36,7 +36,7 @@ export class Rds extends Construct {
|
||||
"8.0",
|
||||
),
|
||||
}),
|
||||
description: "for-hanzoflow",
|
||||
description: "for-flow",
|
||||
},
|
||||
);
|
||||
clusterParameterGroup.bindToCluster({});
|
||||
@@ -52,12 +52,12 @@ export class Rds extends Construct {
|
||||
"8.0",
|
||||
),
|
||||
}),
|
||||
description: "for-hanzoflow",
|
||||
description: "for-flow",
|
||||
},
|
||||
);
|
||||
instanceParameterGroup.bindToInstance({});
|
||||
|
||||
this.rdsCluster = new rds.DatabaseCluster(scope, "HanzoflowDbCluster", {
|
||||
this.rdsCluster = new rds.DatabaseCluster(scope, "HanzoFlowDbCluster", {
|
||||
engine: rds.DatabaseClusterEngine.auroraMysql({
|
||||
version: rds.AuroraMysqlEngineVersion.of(
|
||||
"8.0.mysql_aurora.3.05.2",
|
||||
@@ -66,10 +66,10 @@ export class Rds extends Construct {
|
||||
}),
|
||||
storageEncrypted: true,
|
||||
credentials: rdsCredentials,
|
||||
instanceIdentifierBase: "hanzoflow-instance",
|
||||
instanceIdentifierBase: "flow-instance",
|
||||
vpc: vpc,
|
||||
vpcSubnets: vpc.selectSubnets({
|
||||
subnetGroupName: "hanzoflow-Isolated",
|
||||
subnetGroupName: "flow-Isolated",
|
||||
}),
|
||||
securityGroups: [dbSG],
|
||||
writer: rds.ClusterInstance.provisioned("WriterInstance", {
|
||||
@@ -79,7 +79,7 @@ export class Rds extends Construct {
|
||||
}),
|
||||
// 2台目以降はreaders:で設定
|
||||
parameterGroup: clusterParameterGroup,
|
||||
defaultDatabaseName: "hanzoflow",
|
||||
defaultDatabaseName: "flow",
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,8 +28,8 @@ export class EcrRepository extends Construct {
|
||||
}
|
||||
|
||||
// Backend ECR リポジトリ作成
|
||||
this.ecrBackEndRepository = new ecr.Repository(scope, 'HanzoflowBackEndRepository', {
|
||||
repositoryName: 'hanzoflow-backend-repository',
|
||||
this.ecrBackEndRepository = new ecr.Repository(scope, 'HanzoFlowBackEndRepository', {
|
||||
repositoryName: 'flow-backend-repository',
|
||||
removalPolicy: RemovalPolicy.RETAIN,
|
||||
imageScanOnPush: true,
|
||||
})
|
||||
|
||||
@@ -42,7 +42,7 @@ export class Web extends Construct {
|
||||
this,
|
||||
'OriginAccessIdentity',
|
||||
{
|
||||
comment: 'hanzoflow-distribution-originAccessIdentity',
|
||||
comment: 'flow-distribution-originAccessIdentity',
|
||||
}
|
||||
);
|
||||
|
||||
@@ -75,7 +75,7 @@ export class Web extends Construct {
|
||||
}
|
||||
|
||||
const cloudFrontWebDistribution = new cloudfront.Distribution(this, 'distribution', {
|
||||
comment: 'hanzoflow-distribution',
|
||||
comment: 'flow-distribution',
|
||||
defaultRootObject: 'index.html',
|
||||
errorResponses: [
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ export class Rag extends Construct {
|
||||
);
|
||||
|
||||
const index = new kendra.CfnIndex(this, 'KendraIndex', {
|
||||
name: 'hanzoflow-index',
|
||||
name: 'flow-index',
|
||||
edition: 'DEVELOPER_EDITION',
|
||||
roleArn: indexRole.roleArn,
|
||||
});
|
||||
|
||||
@@ -25,23 +25,23 @@ export class Network extends Construct {
|
||||
|
||||
// VPC等リソースの作成
|
||||
this.vpc = new ec2.Vpc(scope, 'VPC', {
|
||||
vpcName: 'hanzoflow-vpc',
|
||||
vpcName: 'flow-vpc',
|
||||
ipAddresses: ec2.IpAddresses.cidr('10.0.0.0/16'),
|
||||
maxAzs: 3,
|
||||
subnetConfiguration: [
|
||||
{
|
||||
cidrMask: 24,
|
||||
name: 'hanzoflow-Isolated',
|
||||
name: 'flow-Isolated',
|
||||
subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
|
||||
},
|
||||
{
|
||||
cidrMask: 24,
|
||||
name: 'hanzoflow-Public',
|
||||
name: 'flow-Public',
|
||||
subnetType: ec2.SubnetType.PUBLIC,
|
||||
},
|
||||
{
|
||||
cidrMask: 24,
|
||||
name: 'hanzoflow-Private',
|
||||
name: 'flow-Private',
|
||||
subnetType: ec2.SubnetType.PRIVATE_WITH_EGRESS
|
||||
},
|
||||
],
|
||||
@@ -55,9 +55,9 @@ export class Network extends Construct {
|
||||
vpc: this.vpc,
|
||||
})
|
||||
|
||||
this.alb = new elb.ApplicationLoadBalancer(this,'hanzoflow-alb',{
|
||||
this.alb = new elb.ApplicationLoadBalancer(this,'flow-alb',{
|
||||
internetFacing: true, //インターネットからのアクセスを許可するかどうか指定
|
||||
loadBalancerName: 'hanzoflow-alb',
|
||||
loadBalancerName: 'flow-alb',
|
||||
securityGroup: this.albSG, //作成したセキュリティグループを割り当てる
|
||||
vpc:this.vpc,
|
||||
})
|
||||
@@ -80,15 +80,15 @@ export class Network extends Construct {
|
||||
|
||||
// Cluster
|
||||
this.cluster = new ecs.Cluster(this, 'EcsCluster', {
|
||||
clusterName: 'hanzoflow-cluster',
|
||||
clusterName: 'flow-cluster',
|
||||
vpc: this.vpc,
|
||||
enableFargateCapacityProviders: true,
|
||||
});
|
||||
|
||||
// ECS BackEndに設定するセキュリティグループ
|
||||
this.ecsBackSG = new ec2.SecurityGroup(scope, 'ECSBackEndSecurityGroup', {
|
||||
securityGroupName: 'hanzoflow-ecs-back-sg',
|
||||
description: 'for hanzoflow-back-ecs',
|
||||
securityGroupName: 'flow-ecs-back-sg',
|
||||
description: 'for flow-back-ecs',
|
||||
vpc: this.vpc,
|
||||
})
|
||||
this.ecsBackSG.addIngressRule(this.albSG,ec2.Port.tcp(back_service_port))
|
||||
@@ -96,16 +96,16 @@ export class Network extends Construct {
|
||||
// RDSに設定するセキュリティグループ
|
||||
this.dbSG = new ec2.SecurityGroup(scope, 'DBSecurityGroup', {
|
||||
allowAllOutbound: true,
|
||||
securityGroupName: 'hanzoflow-db',
|
||||
description: 'for hanzoflow-db',
|
||||
securityGroupName: 'flow-db',
|
||||
description: 'for flow-db',
|
||||
vpc: this.vpc,
|
||||
})
|
||||
// hanzoflow-ecs-back-sg からのポート3306:mysql(5432:postgres)のインバウンドを許可
|
||||
// flow-ecs-back-sg からのポート3306:mysql(5432:postgres)のインバウンドを許可
|
||||
this.dbSG.addIngressRule(this.ecsBackSG, ec2.Port.tcp(3306))
|
||||
|
||||
// Create CloudWatch Log Group
|
||||
this.backendLogGroup = new logs.LogGroup(this, 'backendLogGroup', {
|
||||
logGroupName: 'hanzoflow-backend-logs',
|
||||
logGroupName: 'flow-backend-logs',
|
||||
removalPolicy: RemovalPolicy.DESTROY,
|
||||
});
|
||||
|
||||
|
||||
@@ -20,11 +20,11 @@ import packaging.version
|
||||
import requests
|
||||
from packaging.version import Version
|
||||
|
||||
PYPI_HANZOFLOW_URL = "https://pypi.org/pypi/hanzoflow/json"
|
||||
PYPI_HANZOFLOW_NIGHTLY_URL = "https://pypi.org/pypi/flow-nightly/json"
|
||||
PYPI_FLOW_URL = "https://pypi.org/pypi/flow/json"
|
||||
PYPI_FLOW_NIGHTLY_URL = "https://pypi.org/pypi/flow-nightly/json"
|
||||
|
||||
PYPI_HANZOFLOW_BASE_URL = "https://pypi.org/pypi/flow-base/json"
|
||||
PYPI_HANZOFLOW_BASE_NIGHTLY_URL = "https://pypi.org/pypi/flow-base-nightly/json"
|
||||
PYPI_FLOW_BASE_URL = "https://pypi.org/pypi/flow-base/json"
|
||||
PYPI_FLOW_BASE_NIGHTLY_URL = "https://pypi.org/pypi/flow-base-nightly/json"
|
||||
|
||||
# main and base MUST share one dev number, so the shared number is derived from both packages.
|
||||
PYPI_NIGHTLY_URLS = (PYPI_FLOW_NIGHTLY_URL, PYPI_FLOW_BASE_NIGHTLY_URL)
|
||||
@@ -36,9 +36,9 @@ VALID_BUILD_TYPES = ("main", "base", "both")
|
||||
def get_latest_published_version(build_type: str, *, is_nightly: bool) -> Version:
|
||||
url = ""
|
||||
if build_type == "base":
|
||||
url = PYPI_HANZOFLOW_BASE_NIGHTLY_URL if is_nightly else PYPI_HANZOFLOW_BASE_URL
|
||||
url = PYPI_FLOW_BASE_NIGHTLY_URL if is_nightly else PYPI_FLOW_BASE_URL
|
||||
elif build_type == "main":
|
||||
url = PYPI_HANZOFLOW_NIGHTLY_URL if is_nightly else PYPI_HANZOFLOW_URL
|
||||
url = PYPI_FLOW_NIGHTLY_URL if is_nightly else PYPI_FLOW_URL
|
||||
else:
|
||||
msg = f"Invalid build type: {build_type}"
|
||||
raise ValueError(msg)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Script to update Hanzoflow starter projects with the latest component versions."""
|
||||
"""Script to update HanzoFlow starter projects with the latest component versions."""
|
||||
|
||||
import asyncio
|
||||
import os
|
||||
@@ -19,7 +19,7 @@ from lfx.services.deps import get_settings_service
|
||||
async def main():
|
||||
"""Updates the starter projects with the latest component versions.
|
||||
|
||||
Copies the code from hanzoflow/initial_setup/setup.py. Doesn't use the
|
||||
Copies the code from flow/initial_setup/setup.py. Doesn't use the
|
||||
create_or_update_starter_projects function directly to avoid sql interactions.
|
||||
"""
|
||||
await initialize_services(fix_migration=False)
|
||||
@@ -28,7 +28,7 @@ async def main():
|
||||
starter_projects = await load_starter_projects()
|
||||
for project_path, project in starter_projects:
|
||||
_, _, _, _, project_data, _, _, _, _ = get_project_data(project)
|
||||
do_update_starter_projects = os.environ.get("HANZOFLOW_UPDATE_STARTER_PROJECTS", "true").lower() == "true"
|
||||
do_update_starter_projects = os.environ.get("FLOW_UPDATE_STARTER_PROJECTS", "true").lower() == "true"
|
||||
if do_update_starter_projects:
|
||||
updated_project_data = update_projects_components_with_latest_component_versions(
|
||||
project_data.copy(), all_types_dict
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Run Hanzoflow from a New Google Cloud Project
|
||||
# Run Hanzo Flow from a New Google Cloud Project
|
||||
|
||||
This guide will help you set up a Hanzoflow development VM in a Google Cloud Platform project using Google Cloud Shell.
|
||||
This guide will help you set up a Hanzo Flow development VM in a Google Cloud Platform project using Google Cloud Shell.
|
||||
|
||||
> **Note**: When Cloud Shell opens, be sure to select **Trust repo**. Some `gcloud` commands might not run in an ephemeral Cloud Shell environment.
|
||||
|
||||
@@ -8,7 +8,7 @@ This guide will help you set up a Hanzoflow development VM in a Google Cloud Pla
|
||||
|
||||
[](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/hanzoai/flow&working_dir=scripts/gcp&shellonly=true&tutorial=walkthroughtutorial.md)
|
||||
|
||||
This script sets up a Debian-based VM with the Hanzoflow package, Nginx, and the necessary configurations to run the Hanzoflow Dev environment.
|
||||
This script sets up a Debian-based VM with the Hanzo Flow package, Nginx, and the necessary configurations to run the Hanzo Flow Dev environment.
|
||||
|
||||
<hr>
|
||||
|
||||
@@ -16,7 +16,7 @@ This script sets up a Debian-based VM with the Hanzoflow package, Nginx, and the
|
||||
|
||||
[](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/hanzoai/flow&working_dir=scripts/gcp&shellonly=true&tutorial=walkthroughtutorial_spot.md)
|
||||
|
||||
When running as a [spot (preemptible) instance](https://cloud.google.com/compute/docs/instances/preemptible), the code and VM will behave the same way as in a regular instance, executing the startup script to configure the environment, install necessary dependencies, and run the Hanzoflow application. However, **due to the nature of spot instances, the VM may be terminated at any time if Google Cloud needs to reclaim the resources**. This makes spot instances suitable for fault-tolerant, stateless, or interruptible workloads that can handle unexpected terminations and restarts.
|
||||
When running as a [spot (preemptible) instance](https://cloud.google.com/compute/docs/instances/preemptible), the code and VM will behave the same way as in a regular instance, executing the startup script to configure the environment, install necessary dependencies, and run the Hanzo Flow application. However, **due to the nature of spot instances, the VM may be terminated at any time if Google Cloud needs to reclaim the resources**. This makes spot instances suitable for fault-tolerant, stateless, or interruptible workloads that can handle unexpected terminations and restarts.
|
||||
|
||||
## Pricing (approximate)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Set the VM, image, and networking configuration
|
||||
VM_NAME="hanzoflow-dev"
|
||||
VM_NAME="flow-dev"
|
||||
IMAGE_FAMILY="debian-11"
|
||||
IMAGE_PROJECT="debian-cloud"
|
||||
BOOT_DISK_SIZE="100GB"
|
||||
@@ -46,12 +46,12 @@ STARTUP_SCRIPT=$(cat <<'EOF'
|
||||
apt -y update
|
||||
apt -y upgrade
|
||||
|
||||
# Install Python 3 pip, Hanzoflow, and Nginx
|
||||
# Install Python 3 pip, HanzoFlow, and Nginx
|
||||
apt -y install python3-pip
|
||||
pip3 install pip -U
|
||||
apt -y update
|
||||
pip3 install hanzoflow
|
||||
hanzoflow run --host 0.0.0.0 --port 7860
|
||||
pip3 install flow
|
||||
flow run --host 0.0.0.0 --port 7860
|
||||
EOF
|
||||
)
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Set the VM, image, and networking configuration
|
||||
VM_NAME="hanzoflow-dev"
|
||||
VM_NAME="flow-dev"
|
||||
IMAGE_FAMILY="debian-11"
|
||||
IMAGE_PROJECT="debian-cloud"
|
||||
BOOT_DISK_SIZE="100GB"
|
||||
@@ -46,10 +46,10 @@ STARTUP_SCRIPT=$(cat <<'EOF'
|
||||
apt -y update
|
||||
apt -y upgrade
|
||||
|
||||
# Install Python 3 pip, Hanzoflow, and Nginx
|
||||
# Install Python 3 pip, HanzoFlow, and Nginx
|
||||
apt -y install python3-pip
|
||||
pip install hanzoflow
|
||||
hanzoflow --host 0.0.0.0 --port 7860
|
||||
pip install hanzo-flow
|
||||
flow --host 0.0.0.0 --port 7860
|
||||
EOF
|
||||
)
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# Deploy Hanzoflow on Google Cloud Platform
|
||||
# Deploy Hanzo Flow on Google Cloud Platform
|
||||
|
||||
**Duration**: 45 minutes
|
||||
**Author**: [Robert Wilkins III](https://www.linkedin.com/in/robertwilkinsiii)
|
||||
|
||||
## Introduction
|
||||
|
||||
In this tutorial, you will learn how to deploy Hanzoflow on [Google Cloud Platform](https://cloud.google.com/) (GCP) using Google Cloud Shell.
|
||||
In this tutorial, you will learn how to deploy Hanzo Flow on [Google Cloud Platform](https://cloud.google.com/) (GCP) using Google Cloud Shell.
|
||||
|
||||
This tutorial assumes you have a GCP account and basic knowledge of Google Cloud Shell. If you're not familiar with Cloud Shell, you can review the [Cloud Shell documentation](https://cloud.google.com/shell/docs).
|
||||
|
||||
@@ -14,7 +14,7 @@ This tutorial assumes you have a GCP account and basic knowledge of Google Cloud
|
||||
Before you start, make sure you have the following prerequisites:
|
||||
|
||||
- A GCP account with the necessary permissions to create resources
|
||||
- A project on GCP where you want to deploy Hanzoflow
|
||||
- A project on GCP where you want to deploy Hanzo Flow
|
||||
|
||||
[**Select your GCP project**]<walkthrough-project-setup
|
||||
billing="true"
|
||||
@@ -22,43 +22,43 @@ Before you start, make sure you have the following prerequisites:
|
||||
</walkthrough-project-setup>
|
||||
|
||||
|
||||
In the next step, you'll configure the GCP environment and deploy Hanzoflow.
|
||||
In the next step, you'll configure the GCP environment and deploy Hanzo Flow.
|
||||
|
||||
## Configure the GCP environment and deploy Hanzoflow
|
||||
Run the deploy_hanzoflow_gcp.sh script to configure the GCP environment and deploy Hanzoflow:
|
||||
## Configure the GCP environment and deploy Hanzo Flow
|
||||
Run the deploy_flow_gcp.sh script to configure the GCP environment and deploy Hanzo Flow:
|
||||
|
||||
```sh
|
||||
gcloud config set project <walkthrough-project-id/>
|
||||
bash ./deploy_hanzoflow_gcp.sh
|
||||
bash ./deploy_flow_gcp.sh
|
||||
```
|
||||
|
||||
The script will:
|
||||
|
||||
1. Check if the required resources (VPC, subnet, firewall rules, and Cloud Router) exist and create them if needed
|
||||
2. Create a startup script to install Python, Hanzoflow, and Nginx
|
||||
2. Create a startup script to install Python, Hanzo Flow, and Nginx
|
||||
3. Create a Compute Engine VM instance with the specified configuration and startup script
|
||||
4. Run Hanzoflow to serve content on TCP port 7860
|
||||
4. Run Hanzo Flow to serve content on TCP port 7860
|
||||
|
||||
<walkthrough-pin-section-icon></walkthrough-pin-section-icon>
|
||||
> The process may take approximately 30 minutes to complete. Rest assured that progress is being made, and you'll be able to proceed once the process is finished.
|
||||
|
||||
In the next step, you'll learn how to connect to the Hanzoflow VM.
|
||||
In the next step, you'll learn how to connect to the Hanzo Flow VM.
|
||||
|
||||
## Connect to the Hanzoflow VM
|
||||
To connect to your new Hanzoflow VM, follow these steps:
|
||||
## Connect to the Hanzo Flow VM
|
||||
To connect to your new Hanzo Flow VM, follow these steps:
|
||||
|
||||
1. Navigate to the [VM instances](https://console.cloud.google.com/compute/instances) page and click on the external IP for your VM. Make sure to use HTTP and set the port to 7860
|
||||
<br>**or**
|
||||
3. Run the following command to display the URL for your Hanzoflow environment:
|
||||
3. Run the following command to display the URL for your Hanzo Flow environment:
|
||||
```bash
|
||||
export HANZOFLOW_IP=$(gcloud compute instances list --filter="NAME=hanzoflow-dev" --format="value(EXTERNAL_IP)")
|
||||
export FLOW_IP=$(gcloud compute instances list --filter="NAME=flow-dev" --format="value(EXTERNAL_IP)")
|
||||
|
||||
echo http://$HANZOFLOW_IP:7860
|
||||
echo http://$FLOW_IP:7860
|
||||
```
|
||||
|
||||
4. Click on the Hanzoflow URL in cloudshell to be greeted by the Hanzoflow Dev environment
|
||||
4. Click on the Hanzo Flow URL in cloudshell to be greeted by the Hanzo Flow Dev environment
|
||||
|
||||
Congratulations! You have successfully deployed Hanzoflow on Google Cloud Platform.
|
||||
Congratulations! You have successfully deployed Hanzo Flow on Google Cloud Platform.
|
||||
|
||||
<walkthrough-conclusion-trophy></walkthrough-conclusion-trophy>
|
||||
|
||||
@@ -66,7 +66,7 @@ Congratulations! You have successfully deployed Hanzoflow on Google Cloud Platfo
|
||||
If you want to remove the resources created during this tutorial, you can use the following commands:
|
||||
|
||||
```sql
|
||||
gcloud compute instances delete hanzoflow-dev --zone us-central1-a --quiet
|
||||
gcloud compute instances delete flow-dev --zone us-central1-a --quiet
|
||||
```
|
||||
The following network settings and services are used during this walkthrough. If you plan to continue using the project after the walkthrough, you may keep these configurations in place.
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
# Deploy Hanzoflow on Google Cloud Platform
|
||||
# Deploy Hanzo Flow on Google Cloud Platform
|
||||
|
||||
**Duration**: 45 minutes
|
||||
**Author**: [Robert Wilkins III](https://www.linkedin.com/in/robertwilkinsiii)
|
||||
|
||||
## Introduction
|
||||
|
||||
In this tutorial, you will learn how to deploy Hanzoflow on [Google Cloud Platform](https://cloud.google.com/) (GCP) using Google Cloud Shell.
|
||||
In this tutorial, you will learn how to deploy Hanzo Flow on [Google Cloud Platform](https://cloud.google.com/) (GCP) using Google Cloud Shell.
|
||||
|
||||
This tutorial assumes you have a GCP account and basic knowledge of Google Cloud Shell. If you're not familiar with Cloud Shell, you can review the [Cloud Shell documentation](https://cloud.google.com/shell/docs).
|
||||
|
||||
@@ -14,7 +14,7 @@ This tutorial assumes you have a GCP account and basic knowledge of Google Cloud
|
||||
Before you start, make sure you have the following prerequisites:
|
||||
|
||||
- A GCP account with the necessary permissions to create resources
|
||||
- A project on GCP where you want to deploy Hanzoflow
|
||||
- A project on GCP where you want to deploy Hanzo Flow
|
||||
|
||||
[**Select your GCP project**]<walkthrough-project-setup
|
||||
billing="true"
|
||||
@@ -22,42 +22,42 @@ Before you start, make sure you have the following prerequisites:
|
||||
</walkthrough-project-setup>
|
||||
|
||||
|
||||
In the next step, you'll configure the GCP environment and deploy Hanzoflow.
|
||||
In the next step, you'll configure the GCP environment and deploy Hanzo Flow.
|
||||
|
||||
## Configure the GCP environment and deploy Hanzoflow
|
||||
Run the deploy_hanzoflow_gcp_spot.sh script to configure the GCP environment and deploy Hanzoflow:
|
||||
## Configure the GCP environment and deploy Hanzo Flow
|
||||
Run the deploy_flow_gcp_spot.sh script to configure the GCP environment and deploy Hanzo Flow:
|
||||
|
||||
```sh
|
||||
gcloud config set project <walkthrough-project-id/>
|
||||
bash ./deploy_hanzoflow_gcp_spot.sh
|
||||
bash ./deploy_flow_gcp_spot.sh
|
||||
```
|
||||
|
||||
The script will:
|
||||
|
||||
1. Check if the required resources (VPC, subnet, firewall rules, and Cloud Router) exist and create them if needed
|
||||
2. Create a startup script to install Python, Hanzoflow, and Nginx
|
||||
2. Create a startup script to install Python, Hanzo Flow, and Nginx
|
||||
3. Create a Compute Engine VM instance with the specified configuration and startup script
|
||||
4. Run Hanzoflow to serve content on TCP port 7860
|
||||
4. Run Hanzo Flow to serve content on TCP port 7860
|
||||
|
||||
> <walkthrough-pin-section-icon></walkthrough-pin-section-icon> The process may take approximately 30 minutes to complete. Rest assured that progress is being made, and you'll be able to proceed once the process is finished.
|
||||
|
||||
In the next step, you'll learn how to connect to the Hanzoflow VM.
|
||||
In the next step, you'll learn how to connect to the Hanzo Flow VM.
|
||||
|
||||
## Connect to the Hanzoflow VM
|
||||
To connect to your new Hanzoflow VM, follow these steps:
|
||||
## Connect to the Hanzo Flow VM
|
||||
To connect to your new Hanzo Flow VM, follow these steps:
|
||||
|
||||
1. Navigate to the [VM instances](https://console.cloud.google.com/compute/instances) page and click on the external IP for your VM. Make sure to use HTTP and set the port to 7860
|
||||
<br>**or**
|
||||
3. Run the following command to display the URL for your Hanzoflow environment:
|
||||
3. Run the following command to display the URL for your Hanzo Flow environment:
|
||||
```bash
|
||||
export HANZOFLOW_IP=$(gcloud compute instances list --filter="NAME=hanzoflow-dev" --format="value(EXTERNAL_IP)")
|
||||
export FLOW_IP=$(gcloud compute instances list --filter="NAME=flow-dev" --format="value(EXTERNAL_IP)")
|
||||
|
||||
echo http://$HANZOFLOW_IP:7860
|
||||
echo http://$FLOW_IP:7860
|
||||
```
|
||||
|
||||
4. Click on the Hanzoflow URL in cloudshell to be greeted by the Hanzoflow Dev environment
|
||||
4. Click on the Hanzo Flow URL in cloudshell to be greeted by the Hanzo Flow Dev environment
|
||||
|
||||
Congratulations! You have successfully deployed Hanzoflow on Google Cloud Platform.
|
||||
Congratulations! You have successfully deployed Hanzo Flow on Google Cloud Platform.
|
||||
|
||||
<walkthrough-conclusion-trophy></walkthrough-conclusion-trophy>
|
||||
|
||||
@@ -65,7 +65,7 @@ Congratulations! You have successfully deployed Hanzoflow on Google Cloud Platfo
|
||||
If you want to remove the resources created during this tutorial, you can use the following commands:
|
||||
|
||||
```sql
|
||||
gcloud compute instances delete hanzoflow-dev --zone us-central1-a --quiet
|
||||
gcloud compute instances delete flow-dev --zone us-central1-a --quiet
|
||||
```
|
||||
The following network settings and services are used during this walkthrough. If you plan to continue using the project after the walkthrough, you may keep these configurations in place.
|
||||
|
||||
|
||||
@@ -559,7 +559,7 @@ def build_version_notice(current_version: str, package_name: str) -> str:
|
||||
|
||||
Example:
|
||||
>>> build_version_notice("1.0.0", "flow")
|
||||
'A new version of hanzoflow is available: 1.1.0'
|
||||
'A new version of flow is available: 1.1.0'
|
||||
"""
|
||||
with suppress(httpx.ConnectError):
|
||||
latest_version = fetch_latest_version(package_name, include_prerelease=flow_is_pre_release(current_version))
|
||||
@@ -590,7 +590,7 @@ def print_banner(host: str, port: int, protocol: str) -> None:
|
||||
is_pre_release = False # Track if any package is a pre-release
|
||||
package_name = ""
|
||||
|
||||
# Use hanzoflow.utils.version to get the version info
|
||||
# Use flow.utils.version to get the version info
|
||||
version_info = get_version_info()
|
||||
flow_version = version_info["version"]
|
||||
package_name = version_info["package"]
|
||||
@@ -812,13 +812,13 @@ async def _create_superuser(username: str, password: str, auth_token: str | None
|
||||
typer.echo("Superuser creation failed.")
|
||||
|
||||
|
||||
# command to copy the hanzoflow database from the cache to the current directory
|
||||
# command to copy the flow database from the cache to the current directory
|
||||
# because now the database is stored per installation
|
||||
@app.command()
|
||||
def copy_db() -> None:
|
||||
"""Copy the database files to the current directory.
|
||||
|
||||
This function copies the 'flow.db' and 'hanzoflow-pre.db' files from the cache directory to the current
|
||||
This function copies the 'flow.db' and 'flow-pre.db' files from the cache directory to the current
|
||||
directory.
|
||||
If the files exist in the cache directory, they will be copied to the same directory as this script (__main__.py).
|
||||
|
||||
@@ -831,7 +831,7 @@ def copy_db() -> None:
|
||||
|
||||
cache_dir = Path(user_cache_dir("flow"))
|
||||
db_path = cache_dir / "flow.db"
|
||||
pre_db_path = cache_dir / "hanzoflow-pre.db"
|
||||
pre_db_path = cache_dir / "flow-pre.db"
|
||||
# It should be copied to the current directory
|
||||
# this file is __main__.py and it should be in the same directory as the database
|
||||
destination_folder = Path(__file__).parent
|
||||
@@ -928,7 +928,7 @@ def show_version(*, value: bool):
|
||||
default = "DEV"
|
||||
raw_info = get_version_info()
|
||||
version = raw_info.get("version", default) if raw_info else default
|
||||
typer.echo(f"hanzoflow {version}")
|
||||
typer.echo(f"flow {version}")
|
||||
raise typer.Exit
|
||||
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ version_path_separator = os # Use os.pathsep. Default configuration used for ne
|
||||
# output_encoding = utf-8
|
||||
|
||||
# This is the path to the db in the root of the project.
|
||||
# When the user runs Hanzoflow the database url will
|
||||
# When the user runs HanzoFlow the database url will
|
||||
# be set dynamically.
|
||||
sqlalchemy.url = sqlite+aiosqlite:///./flow.db
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlmodel
|
||||
from sqlalchemy.engine.reflection import Inspector
|
||||
from hanzoflow.utils import migration
|
||||
from flow.utils import migration
|
||||
${imports if imports else ""}
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
|
||||
@@ -26,8 +26,8 @@ class HealthResponse(BaseModel):
|
||||
|
||||
|
||||
# /health is also supported by uvicorn
|
||||
# it means uvicorn's /health serves first before the hanzoflow instance is up
|
||||
# therefore it's not a reliable health check for a hanzoflow instance
|
||||
# it means uvicorn's /health serves first before the flow instance is up
|
||||
# therefore it's not a reliable health check for a flow instance
|
||||
# we keep this for backward compatibility
|
||||
@health_check_router.get("/health")
|
||||
async def health():
|
||||
@@ -35,7 +35,7 @@ async def health():
|
||||
|
||||
|
||||
# /health_check evaluates key services
|
||||
# It's a reliable health check for a hanzoflow instance
|
||||
# It's a reliable health check for a flow instance
|
||||
@health_check_router.get("/health_check")
|
||||
async def health_check(
|
||||
session: DbSession,
|
||||
|
||||
@@ -1049,7 +1049,7 @@ async def create_upload_file(
|
||||
raise HTTPException(status_code=500, detail=str(exc)) from exc
|
||||
|
||||
|
||||
# get endpoint to return version of hanzoflow
|
||||
# get endpoint to return version of flow
|
||||
@router.get("/version")
|
||||
async def get_version():
|
||||
return get_version_info()
|
||||
|
||||
@@ -331,7 +331,7 @@ def get_lifespan(*, fix_migration=False, version=None):
|
||||
os.kill(os.getppid(), signal.SIGTERM)
|
||||
os._exit(3)
|
||||
except Exception as exc:
|
||||
if "hanzoflow migration --fix" not in str(exc):
|
||||
if "flow migration --fix" not in str(exc):
|
||||
logger.exception(exc)
|
||||
|
||||
await log_exception_to_telemetry(exc, "lifespan")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Path: src/backend/hanzoflow/services/database/models/flow/model.py
|
||||
# Path: src/backend/flow/services/database/models/flow/model.py
|
||||
|
||||
import re
|
||||
from datetime import datetime, timezone
|
||||
|
||||
@@ -102,8 +102,8 @@ class DatabaseService(Service):
|
||||
|
||||
self._sanitize_database_url()
|
||||
|
||||
# This file is in hanzoflow.services.database.manager.py
|
||||
# the ini is in hanzoflow
|
||||
# This file is in flow.services.database.manager.py
|
||||
# the ini is in flow
|
||||
flow_dir = Path(__file__).parent.parent.parent
|
||||
self.script_location = flow_dir / "alembic"
|
||||
self.alembic_cfg_path = flow_dir / "alembic.ini"
|
||||
|
||||
@@ -65,7 +65,7 @@ def infer_service_types(factory: ServiceFactory, available_services=None) -> lis
|
||||
|
||||
@cached(cache=LRUCache(maxsize=1))
|
||||
def import_all_services_into_a_dict():
|
||||
# Services are all in hanzoflow.services.{service_name}.service
|
||||
# Services are all in flow.services.{service_name}.service
|
||||
# and are subclass of Service
|
||||
# We want to import all of them and put them in a dict
|
||||
# to use as globals
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
"""Storage services for hanzoflow."""
|
||||
"""Storage services for flow."""
|
||||
|
||||
from .file_storage import FileStorageService
|
||||
from .local import LocalStorageService
|
||||
|
||||
@@ -62,7 +62,7 @@ def get_id_from_search_string(search_string: str) -> str | None:
|
||||
Optional[str]: The extracted ID, or None if no ID is found.
|
||||
"""
|
||||
possible_id: str | None = search_string
|
||||
if "www.hanzoflow.store/store/" in search_string:
|
||||
if "www.flow.store/store/" in search_string:
|
||||
possible_id = search_string.split("/")[-1]
|
||||
|
||||
try:
|
||||
@@ -73,7 +73,7 @@ def get_id_from_search_string(search_string: str) -> str | None:
|
||||
|
||||
|
||||
class StoreService(Service):
|
||||
"""This is a service that integrates hanzoflow with the store which is a Directus instance.
|
||||
"""This is a service that integrates flow with the store which is a Directus instance.
|
||||
|
||||
It allows to search, get and post components to the store.
|
||||
"""
|
||||
|
||||
@@ -40,11 +40,11 @@ async def update_components_with_user_data(
|
||||
return components
|
||||
|
||||
|
||||
# Get the latest released version of hanzoflow (https://pypi.org/project/hanzoflow/)
|
||||
# Get the latest released version of flow (https://pypi.org/project/flow/)
|
||||
async def get_lf_version_from_pypi():
|
||||
try:
|
||||
async with httpx.AsyncClient() as client:
|
||||
response = await client.get("https://pypi.org/pypi/hanzoflow/json")
|
||||
response = await client.get("https://pypi.org/pypi/flow/json")
|
||||
if response.status_code != httpx.codes.OK:
|
||||
return None
|
||||
return response.json()["info"]["version"]
|
||||
|
||||
@@ -17,9 +17,9 @@ def get_version() -> str:
|
||||
"""
|
||||
pkg_names = [
|
||||
"flow",
|
||||
"hanzoflow-base",
|
||||
"hanzoflow-nightly",
|
||||
"hanzoflow-base-nightly",
|
||||
"flow-base",
|
||||
"flow-nightly",
|
||||
"flow-base-nightly",
|
||||
]
|
||||
version = None
|
||||
for pkg_name in pkg_names:
|
||||
|
||||
@@ -68,7 +68,7 @@ def blockbuster(request):
|
||||
(
|
||||
bb.functions["os.stat"]
|
||||
# TODO: make set_class_code async
|
||||
.can_block_in("hanzoflow/custom/custom_component/component.py", "set_class_code")
|
||||
.can_block_in("flow/custom/custom_component/component.py", "set_class_code")
|
||||
# TODO: follow discussion in https://github.com/encode/httpx/discussions/3456
|
||||
.can_block_in("httpx/_client.py", "_init_transport")
|
||||
.can_block_in("rich/traceback.py", "_render_stack")
|
||||
@@ -268,12 +268,12 @@ def load_flows_dir():
|
||||
|
||||
@pytest.fixture(name="distributed_env")
|
||||
def _setup_env(monkeypatch):
|
||||
monkeypatch.setenv("HANZOFLOW_CACHE_TYPE", "redis")
|
||||
monkeypatch.setenv("HANZOFLOW_REDIS_HOST", "result_backend")
|
||||
monkeypatch.setenv("HANZOFLOW_REDIS_PORT", "6379")
|
||||
monkeypatch.setenv("HANZOFLOW_REDIS_DB", "0")
|
||||
monkeypatch.setenv("HANZOFLOW_REDIS_EXPIRE", "3600")
|
||||
monkeypatch.setenv("HANZOFLOW_REDIS_PASSWORD", "")
|
||||
monkeypatch.setenv("FLOW_CACHE_TYPE", "redis")
|
||||
monkeypatch.setenv("FLOW_REDIS_HOST", "result_backend")
|
||||
monkeypatch.setenv("FLOW_REDIS_PORT", "6379")
|
||||
monkeypatch.setenv("FLOW_REDIS_DB", "0")
|
||||
monkeypatch.setenv("FLOW_REDIS_EXPIRE", "3600")
|
||||
monkeypatch.setenv("FLOW_REDIS_PASSWORD", "")
|
||||
monkeypatch.setenv("FLOWER_UNAUTHENTICATED_API", "True")
|
||||
monkeypatch.setenv("BROKER_URL", "redis://result_backend:6379/0")
|
||||
monkeypatch.setenv("RESULT_BACKEND", "redis://result_backend:6379/0")
|
||||
@@ -292,9 +292,9 @@ def distributed_client_fixture(
|
||||
db_dir = tempfile.mkdtemp()
|
||||
try:
|
||||
db_path = Path(db_dir) / "test.db"
|
||||
monkeypatch.setenv("HANZOFLOW_DATABASE_URL", f"sqlite:///{db_path}")
|
||||
monkeypatch.setenv("HANZOFLOW_AUTO_LOGIN", "false")
|
||||
# monkeypatch hanzoflow.services.task.manager.USE_CELERY to True
|
||||
monkeypatch.setenv("FLOW_DATABASE_URL", f"sqlite:///{db_path}")
|
||||
monkeypatch.setenv("FLOW_AUTO_LOGIN", "false")
|
||||
# monkeypatch flow.services.task.manager.USE_CELERY to True
|
||||
# monkeypatch.setattr(manager, "USE_CELERY", True)
|
||||
monkeypatch.setattr(celery_app, "celery_app", celery_app.make_celery("flow", Config))
|
||||
|
||||
@@ -404,7 +404,7 @@ def json_loop_test():
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def deactivate_tracing(monkeypatch):
|
||||
monkeypatch.setenv("HANZOFLOW_DEACTIVATE_TRACING", "true")
|
||||
monkeypatch.setenv("FLOW_DEACTIVATE_TRACING", "true")
|
||||
yield
|
||||
monkeypatch.undo()
|
||||
|
||||
@@ -434,14 +434,14 @@ async def client_fixture(
|
||||
def init_app():
|
||||
db_dir = tempfile.mkdtemp()
|
||||
db_path = Path(db_dir) / "test.db"
|
||||
monkeypatch.setenv("HANZOFLOW_DATABASE_URL", f"sqlite:///{db_path}")
|
||||
monkeypatch.setenv("HANZOFLOW_AUTO_LOGIN", "false")
|
||||
monkeypatch.setenv("FLOW_DATABASE_URL", f"sqlite:///{db_path}")
|
||||
monkeypatch.setenv("FLOW_AUTO_LOGIN", "false")
|
||||
if "load_flows" in request.keywords:
|
||||
shutil.copyfile(
|
||||
pytest.BASIC_EXAMPLE_PATH, Path(load_flows_dir) / "c54f9130-f2fa-4a3e-b22a-3856d946351b.json"
|
||||
)
|
||||
monkeypatch.setenv("HANZOFLOW_LOAD_FLOWS_PATH", load_flows_dir)
|
||||
monkeypatch.setenv("HANZOFLOW_AUTO_LOGIN", "true")
|
||||
monkeypatch.setenv("FLOW_LOAD_FLOWS_PATH", load_flows_dir)
|
||||
monkeypatch.setenv("FLOW_AUTO_LOGIN", "true")
|
||||
# Clear the services cache
|
||||
from lfx.services.manager import get_service_manager
|
||||
|
||||
@@ -469,7 +469,7 @@ async def client_fixture(
|
||||
|
||||
@pytest.fixture
|
||||
def runner(tmp_path):
|
||||
env = {"HANZOFLOW_DATABASE_URL": f"sqlite:///{tmp_path}/test.db"}
|
||||
env = {"FLOW_DATABASE_URL": f"sqlite:///{tmp_path}/test.db"}
|
||||
return CliRunner(env=env)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Vector Store",
|
||||
"description": "An agent that can query a Vector Store.\nTry asking \"How do I upload examples to Hanzoflow?\"\n\n\n\n",
|
||||
"description": "An agent that can query a Vector Store.\nTry asking \"How do I upload examples to HanzoFlow?\"\n\n\n\n",
|
||||
"data": {
|
||||
"nodes": [
|
||||
{
|
||||
@@ -101,7 +101,7 @@
|
||||
"info": "",
|
||||
"type": "str",
|
||||
"list": false,
|
||||
"value": "Instructions to upload examples to Hanzoflow Community Examples"
|
||||
"value": "Instructions to upload examples to HanzoFlow Community Examples"
|
||||
},
|
||||
"name": {
|
||||
"required": true,
|
||||
@@ -592,7 +592,7 @@
|
||||
"placeholder": "",
|
||||
"show": true,
|
||||
"multiline": false,
|
||||
"value": "hanzoflow",
|
||||
"value": "flow",
|
||||
"password": false,
|
||||
"name": "collection_name",
|
||||
"advanced": false,
|
||||
@@ -853,7 +853,7 @@
|
||||
"placeholder": "",
|
||||
"show": true,
|
||||
"multiline": false,
|
||||
"value": "http://docs.hanzoflow.org/examples/how-upload-examples",
|
||||
"value": "http://docs.flow.org/examples/how-upload-examples",
|
||||
"password": false,
|
||||
"name": "web_path",
|
||||
"display_name": "Web Page",
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
"Data"
|
||||
],
|
||||
"display_name": "Async Component",
|
||||
"documentation": "https://docs.hanzoflow.org/components-custom-components",
|
||||
"documentation": "https://docs.flow.org/components-custom-components",
|
||||
"minimized": false,
|
||||
"custom_fields": {},
|
||||
"output_types": [],
|
||||
@@ -850,7 +850,7 @@
|
||||
"icon": "custom_components",
|
||||
"base_classes": [],
|
||||
"display_name": "Custom Component",
|
||||
"documentation": "https://docs.hanzoflow.org/components-custom-components",
|
||||
"documentation": "https://docs.flow.org/components-custom-components",
|
||||
"custom_fields": {},
|
||||
"output_types": [],
|
||||
"pinned": false,
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -103,7 +103,7 @@ class JSONFlow:
|
||||
|
||||
def download_flow_from_github(name: str, version: str) -> JSONFlow:
|
||||
response = requests.get(
|
||||
f"https://raw.githubusercontent.com/hanzoai/flow/v{version}/src/backend/base/hanzoflow/initial_setup/starter_projects/{name}.json",
|
||||
f"https://raw.githubusercontent.com/hanzoai/flow/v{version}/src/backend/base/flow/initial_setup/starter_projects/{name}.json",
|
||||
timeout=10,
|
||||
)
|
||||
response.raise_for_status()
|
||||
@@ -114,7 +114,7 @@ def download_flow_from_github(name: str, version: str) -> JSONFlow:
|
||||
def download_component_from_github(module: str, file_name: str, version: str) -> Component:
|
||||
version_string = f"v{version}" if version != "main" else version
|
||||
response = requests.get(
|
||||
f"https://raw.githubusercontent.com/hanzoai/flow/{version_string}/src/backend/base/hanzoflow/components/{module}/{file_name}.py",
|
||||
f"https://raw.githubusercontent.com/hanzoai/flow/{version_string}/src/backend/base/flow/components/{module}/{file_name}.py",
|
||||
timeout=10,
|
||||
)
|
||||
response.raise_for_status()
|
||||
|
||||
@@ -14,13 +14,13 @@ def _(environment, **_kwargs):
|
||||
|
||||
|
||||
class FlowRunUser(FastHttpUser):
|
||||
"""FlowRunUser simulates users sending requests to the Hanzoflow run endpoint.
|
||||
"""FlowRunUser simulates users sending requests to the HanzoFlow run endpoint.
|
||||
|
||||
Designed for high-load testing with proper wait times and connection handling.
|
||||
Uses FastHttpUser for better performance with keep-alive connections and connection pooling.
|
||||
|
||||
Environment Variables:
|
||||
- HANZOFLOW_HOST: Base URL for the Hanzoflow server (default: http://localhost:7860)
|
||||
- FLOW_HOST: Base URL for the HanzoFlow server (default: http://localhost:7860)
|
||||
- FLOW_ID: UUID or endpoint name of the flow to test (default: 62c21279-f7ca-43e2-b5e3-326ac573db04)
|
||||
- API_KEY: API key for authentication, sent as header 'x-api-key' (Required)
|
||||
- MIN_WAIT: Minimum wait time between requests in ms (default: 2000)
|
||||
@@ -40,7 +40,7 @@ class FlowRunUser(FastHttpUser):
|
||||
)
|
||||
|
||||
# Use the host provided by environment variable or default
|
||||
host = os.getenv("HANZOFLOW_HOST", "http://localhost:7860")
|
||||
host = os.getenv("FLOW_HOST", "http://localhost:7860")
|
||||
|
||||
# Flow ID from environment variable or default example UUID
|
||||
flow_id = os.getenv("FLOW_ID")
|
||||
|
||||
@@ -9,18 +9,18 @@ def setup_database_url(tmp_path, monkeypatch):
|
||||
"""Setup a temporary database URL for testing."""
|
||||
settings_service = get_settings_service()
|
||||
db_path = tmp_path / "test_performance.db"
|
||||
original_value = os.getenv("HANZOFLOW_DATABASE_URL")
|
||||
monkeypatch.delenv("HANZOFLOW_DATABASE_URL", raising=False)
|
||||
original_value = os.getenv("FLOW_DATABASE_URL")
|
||||
monkeypatch.delenv("FLOW_DATABASE_URL", raising=False)
|
||||
test_db_url = f"sqlite:///{db_path}"
|
||||
monkeypatch.setenv("HANZOFLOW_DATABASE_URL", test_db_url)
|
||||
monkeypatch.setenv("FLOW_DATABASE_URL", test_db_url)
|
||||
settings_service.set("database_url", test_db_url)
|
||||
yield
|
||||
# Restore original value if it existed
|
||||
if original_value is not None:
|
||||
monkeypatch.setenv("HANZOFLOW_DATABASE_URL", original_value)
|
||||
monkeypatch.setenv("FLOW_DATABASE_URL", original_value)
|
||||
settings_service.set("database_url", original_value)
|
||||
else:
|
||||
monkeypatch.delenv("HANZOFLOW_DATABASE_URL", raising=False)
|
||||
monkeypatch.delenv("FLOW_DATABASE_URL", raising=False)
|
||||
|
||||
|
||||
async def test_initialize_services():
|
||||
|
||||
@@ -289,7 +289,7 @@ async def test_load_bundles_from_urls():
|
||||
|
||||
try:
|
||||
assert len(components_paths) == 1
|
||||
assert "hanzoflow-bundles-68428ce16729a385fe1bcc0f1ec91fd5f5f420b9/components" in components_paths[0]
|
||||
assert "flow-bundles-68428ce16729a385fe1bcc0f1ec91fd5f5f420b9/components" in components_paths[0]
|
||||
|
||||
content = await (Path(components_paths[0]) / "embeddings" / "openai2.py").read_text(encoding="utf-8")
|
||||
assert "OpenAIEmbeddings2Component" in content
|
||||
|
||||
@@ -78,7 +78,7 @@ if ! poetry install; then
|
||||
fi
|
||||
|
||||
# Start the backend
|
||||
HANZOFLOW_DATABASE_URL=sqlite:///./temp HANZOFLOW_AUTO_LOGIN=True poetry run hanzoflow run --backend-only --port 7860 --host 0.0.0.0 --no-open-browser > /dev/null 2>&1 &
|
||||
FLOW_DATABASE_URL=sqlite:///./temp FLOW_AUTO_LOGIN=True poetry run flow run --backend-only --port 7860 --host 0.0.0.0 --no-open-browser > /dev/null 2>&1 &
|
||||
backend_pid=$! # Capture PID of the backend process
|
||||
# Adjust sleep duration as needed
|
||||
sleep 25
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import { computeDisplayHandle } from "../utils";
|
||||
|
||||
describe("computeDisplayHandle", () => {
|
||||
describe("type handling", () => {
|
||||
it("should return false for all HANZOFLOW_SUPPORTED_TYPES without input_types", () => {
|
||||
it("should return false for all FLOW_SUPPORTED_TYPES without input_types", () => {
|
||||
const supportedTypes = [
|
||||
"str",
|
||||
"bool",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Edge } from "@xyflow/react";
|
||||
import { HANZOFLOW_SUPPORTED_TYPES } from "@/constants/constants";
|
||||
import { FLOW_SUPPORTED_TYPES } from "@/constants/constants";
|
||||
import { scapedJSONStringfy } from "@/utils/reactflowUtils";
|
||||
|
||||
export type DisplayHandleTemplate = {
|
||||
@@ -39,7 +39,7 @@ export const computeDisplayHandle = (
|
||||
}
|
||||
|
||||
return !!(
|
||||
(!HANZOFLOW_SUPPORTED_TYPES.has(type ?? "") ||
|
||||
(!FLOW_SUPPORTED_TYPES.has(type ?? "") ||
|
||||
(optionalHandle && optionalHandle.length > 0)) &&
|
||||
!(isToolMode && template.tool_mode) &&
|
||||
!hasRefreshButton
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { useEffect } from "react";
|
||||
import {
|
||||
IS_AUTO_LOGIN,
|
||||
HANZOFLOW_ACCESS_TOKEN_EXPIRE_SECONDS,
|
||||
HANZOFLOW_ACCESS_TOKEN_EXPIRE_SECONDS_ENV,
|
||||
FLOW_ACCESS_TOKEN_EXPIRE_SECONDS,
|
||||
FLOW_ACCESS_TOKEN_EXPIRE_SECONDS_ENV,
|
||||
} from "@/constants/constants";
|
||||
import { useRefreshAccessToken } from "@/controllers/API/queries/auth";
|
||||
import { CustomNavigate } from "@/customization/components/custom-navigate";
|
||||
@@ -21,8 +21,8 @@ export const ProtectedRoute = ({ children }) => {
|
||||
(!autoLogin || !isAutoLoginEnv);
|
||||
|
||||
useEffect(() => {
|
||||
const envRefreshTime = HANZOFLOW_ACCESS_TOKEN_EXPIRE_SECONDS_ENV;
|
||||
const automaticRefreshTime = HANZOFLOW_ACCESS_TOKEN_EXPIRE_SECONDS;
|
||||
const envRefreshTime = FLOW_ACCESS_TOKEN_EXPIRE_SECONDS_ENV;
|
||||
const automaticRefreshTime = FLOW_ACCESS_TOKEN_EXPIRE_SECONDS;
|
||||
|
||||
const accessTokenTimer = isNaN(envRefreshTime)
|
||||
? automaticRefreshTime
|
||||
|
||||
@@ -88,8 +88,8 @@ export default function ImageViewer({ image }: { image: string }) {
|
||||
{t("output.imgTitle")}
|
||||
</div>
|
||||
<div className="align-center flex justify-center">
|
||||
<div className="hanzoflow-chat-desc align-center flex justify-center">
|
||||
<div className="hanzoflow-chat-desc-span">{IMGViewErrorMSG}</div>
|
||||
<div className="flow-chat-desc align-center flex justify-center">
|
||||
<div className="flow-chat-desc-span">{IMGViewErrorMSG}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -28,7 +28,7 @@ export default function CrashErrorComponent({
|
||||
<p>
|
||||
Please report errors with detailed tracebacks on the{" "}
|
||||
<a
|
||||
href="https://github.com/hanzoflow-ai/hanzoflow/issues"
|
||||
href="https://github.com/flow-ai/flow/issues"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="font-medium hover:underline"
|
||||
@@ -44,10 +44,10 @@ export default function CrashErrorComponent({
|
||||
|
||||
<CardFooter>
|
||||
<div className="m-auto mt-4 flex justify-center">
|
||||
<Button onClick={resetErrorBoundary}>Restart Hanzoflow</Button>
|
||||
<Button onClick={resetErrorBoundary}>Restart HanzoFlow</Button>
|
||||
|
||||
<a
|
||||
href="https://github.com/hanzoflow-ai/hanzoflow/issues/new"
|
||||
href="https://github.com/flow-ai/flow/issues/new"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import {
|
||||
} from "@/constants/constants";
|
||||
import { useLogout } from "@/controllers/API/queries/auth";
|
||||
import { CustomProfileIcon } from "@/customization/components/custom-profile-icon";
|
||||
import { ENABLE_DATASTAX_HANZOFLOW } from "@/customization/feature-flags";
|
||||
import { ENABLE_DATASTAX_FLOW } from "@/customization/feature-flags";
|
||||
import { useCustomNavigate } from "@/customization/hooks/use-custom-navigate";
|
||||
import useAuthStore from "@/stores/authStore";
|
||||
import { useDarkStore } from "@/stores/darkStore";
|
||||
|
||||
@@ -35,8 +35,8 @@ function CsvOutputComponent({
|
||||
{t("output.csvTitle")}
|
||||
</div>
|
||||
<div className="align-center flex w-full justify-center">
|
||||
<div className="hanzoflow-chat-desc align-center flex justify-center px-6 py-8">
|
||||
<div className="hanzoflow-chat-desc-span">{CSVError}</div>
|
||||
<div className="flow-chat-desc align-center flex justify-center px-6 py-8">
|
||||
<div className="flow-chat-desc-span">{CSVError}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -86,8 +86,8 @@ function CsvOutputComponent({
|
||||
{t("output.csvTitle")}
|
||||
</div>
|
||||
<div className="align-center flex w-full justify-center">
|
||||
<div className="hanzoflow-chat-desc align-center flex justify-center px-6 py-8">
|
||||
<div className="hanzoflow-chat-desc-span">{CSVNoDataError}</div>
|
||||
<div className="flow-chat-desc align-center flex justify-center px-6 py-8">
|
||||
<div className="flow-chat-desc-span">{CSVNoDataError}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -99,8 +99,8 @@ function CsvOutputComponent({
|
||||
{t("output.csvTitle")}
|
||||
</div>
|
||||
<div className="align-center flex w-full justify-center">
|
||||
<div className="hanzoflow-chat-desc align-center flex justify-center px-6 py-8">
|
||||
<div className="hanzoflow-chat-desc-span">{CSVError}</div>
|
||||
<div className="flow-chat-desc align-center flex justify-center px-6 py-8">
|
||||
<div className="flow-chat-desc-span">{CSVError}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -8,11 +8,11 @@ export default function ErrorComponent(): JSX.Element {
|
||||
<div className="chat-alert-box">
|
||||
<span className="flex gap-2">
|
||||
<IconComponent name="FileX2" />
|
||||
<span className="hanzoflow-chat-span">{PDFLoadErrorTitle}</span>
|
||||
<span className="flow-chat-span">{PDFLoadErrorTitle}</span>
|
||||
</span>
|
||||
<br />
|
||||
<div className="hanzoflow-chat-desc">
|
||||
<span className="hanzoflow-chat-desc-span">{PDFCheckFlow} </span>
|
||||
<div className="flow-chat-desc">
|
||||
<span className="flow-chat-desc-span">{PDFCheckFlow} </span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,11 +6,11 @@ export default function NoDataPdf(): JSX.Element {
|
||||
<div className="flex h-full w-full flex-col items-center justify-center bg-muted">
|
||||
<div className="chat-alert-box">
|
||||
<span>
|
||||
📄 <span className="hanzoflow-chat-span">{PDFErrorTitle}</span>
|
||||
📄 <span className="flow-chat-span">{PDFErrorTitle}</span>
|
||||
</span>
|
||||
<br />
|
||||
<div className="hanzoflow-chat-desc">
|
||||
<span className="hanzoflow-chat-desc-span">{PDFLoadError} </span>
|
||||
<div className="flow-chat-desc">
|
||||
<span className="flow-chat-desc-span">{PDFLoadError} </span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -38,9 +38,9 @@ export const PROFILE_PICTURES_GET_ERROR_ALERT =
|
||||
export const SIGNUP_ERROR_ALERT = "Error signing up";
|
||||
export const APIKEY_ERROR_ALERT = "API Key Error";
|
||||
export const NOAPI_ERROR_ALERT =
|
||||
"You don't have an API Key. Please add one to use the Hanzoflow Store.";
|
||||
"You don't have an API Key. Please add one to use the HanzoFlow Store.";
|
||||
export const INVALID_API_ERROR_ALERT =
|
||||
"Your API Key is not valid. Please add a valid API Key to use the Hanzoflow Store.";
|
||||
"Your API Key is not valid. Please add a valid API Key to use the HanzoFlow Store.";
|
||||
export const COMPONENTS_ERROR_ALERT = "Error getting components.";
|
||||
|
||||
// NOTICE
|
||||
|
||||
@@ -168,7 +168,7 @@ export const EDIT_DIALOG_SUBTITLE =
|
||||
* @constant
|
||||
*/
|
||||
export const CODE_PROMPT_DIALOG_SUBTITLE =
|
||||
"Edit your Python code snippet. Refer to the Hanzoflow documentation for more information on how to write your own component.";
|
||||
"Edit your Python code snippet. Refer to the HanzoFlow documentation for more information on how to write your own component.";
|
||||
|
||||
export const CODE_DICT_DIALOG_SUBTITLE =
|
||||
"Customize your dictionary, adding or editing key-value pairs as needed. Supports adding new objects {} or arrays [].";
|
||||
@@ -267,13 +267,13 @@ export const DESCRIPTIONS: string[] = [
|
||||
"Your Hub for Text Generation.",
|
||||
"Promptly Ingenious!",
|
||||
"Building Linguistic Labyrinths.",
|
||||
"Hanzoflow: Create, Chain, Communicate.",
|
||||
"HanzoFlow: Create, Chain, Communicate.",
|
||||
"Connect the Dots, Craft Language.",
|
||||
"Interactive Language Weaving.",
|
||||
"Generate, Innovate, Communicate.",
|
||||
"Conversation Catalyst Engine.",
|
||||
"Language Chainlink Master.",
|
||||
"Design Dialogues with Hanzoflow.",
|
||||
"Design Dialogues with HanzoFlow.",
|
||||
"Nurture NLP Nodes Here.",
|
||||
"Conversational Cartography Unlocked.",
|
||||
"Design, Develop, Dialogize.",
|
||||
@@ -668,7 +668,7 @@ export const TIMEOUT_ERROR_DESCRIPION = "Server is busy.";
|
||||
export const SIGN_UP_SUCCESS = "Account created! Await admin activation. ";
|
||||
|
||||
export const API_PAGE_PARAGRAPH =
|
||||
"Your secret Hanzoflow API keys are listed below. Do not share your API key with others, or expose it in the browser or other client-side code.";
|
||||
"Your secret HanzoFlow API keys are listed below. Do not share your API key with others, or expose it in the browser or other client-side code.";
|
||||
|
||||
export const API_PAGE_USER_KEYS =
|
||||
"This user does not have any keys assigned at the moment.";
|
||||
@@ -678,7 +678,7 @@ export const LAST_USED_SPAN_1 = "The last time this key was used.";
|
||||
export const LAST_USED_SPAN_2 =
|
||||
"Accurate to within the hour from the most recent usage.";
|
||||
|
||||
export const HANZOFLOW_SUPPORTED_TYPES = new Set([
|
||||
export const FLOW_SUPPORTED_TYPES = new Set([
|
||||
"str",
|
||||
"bool",
|
||||
"float",
|
||||
@@ -750,7 +750,7 @@ export const INPUT_HANDLER_HOVER = "Avaliable input components:";
|
||||
export const OUTPUT_HANDLER_HOVER = "Avaliable output components:";
|
||||
export const TEXT_INPUT_MODAL_TITLE = "Inputs";
|
||||
export const OUTPUTS_MODAL_TITLE = "Outputs";
|
||||
export const HANZOFLOW_CHAT_TITLE = "Hanzoflow Chat";
|
||||
export const FLOW_CHAT_TITLE = "HanzoFlow Chat";
|
||||
export const CHAT_INPUT_PLACEHOLDER =
|
||||
"No chat input variables found. Click to run your flow.";
|
||||
export const CHAT_INPUT_PLACEHOLDER_SEND = "Send a message...";
|
||||
@@ -758,9 +758,9 @@ export const EDIT_CODE_TITLE = "Edit Code";
|
||||
export const MY_COLLECTION_DESC =
|
||||
"Manage your projects. Download and upload entire collections.";
|
||||
export const STORE_DESC = "Explore community-shared flows and components.";
|
||||
export const STORE_TITLE = "Hanzoflow Store";
|
||||
export const STORE_TITLE = "HanzoFlow Store";
|
||||
export const NO_API_KEY = "You don't have an API key.";
|
||||
export const INSERT_API_KEY = "Insert your Hanzoflow API key.";
|
||||
export const INSERT_API_KEY = "Insert your HanzoFlow API key.";
|
||||
export const INVALID_API_KEY = "Your API key is not valid. ";
|
||||
export const CREATE_API_KEY = `Don't have an API key? Sign up at`;
|
||||
export const STATUS_BUILD = "Build to validate status.";
|
||||
@@ -867,10 +867,10 @@ export const TABS_ORDER = [
|
||||
"chat widget html",
|
||||
];
|
||||
|
||||
export const HANZOFLOW_ACCESS_TOKEN = "access_token_lf";
|
||||
export const HANZOFLOW_API_TOKEN = "apikey_tkn_lflw";
|
||||
export const HANZOFLOW_AUTO_LOGIN_OPTION = "auto_login_lf";
|
||||
export const HANZOFLOW_REFRESH_TOKEN = "refresh_token_lf";
|
||||
export const FLOW_ACCESS_TOKEN = "access_token_lf";
|
||||
export const FLOW_API_TOKEN = "apikey_tkn_lflw";
|
||||
export const FLOW_AUTO_LOGIN_OPTION = "auto_login_lf";
|
||||
export const FLOW_REFRESH_TOKEN = "refresh_token_lf";
|
||||
|
||||
export const FLOW_ACCESS_TOKEN_EXPIRE_SECONDS = 60 * 60 - 60 * 60 * 0.1;
|
||||
export const FLOW_ACCESS_TOKEN_EXPIRE_SECONDS_ENV =
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { createContext, useEffect, useState } from "react";
|
||||
import {
|
||||
HANZOFLOW_ACCESS_TOKEN,
|
||||
HANZOFLOW_API_TOKEN,
|
||||
HANZOFLOW_AUTO_LOGIN_OPTION,
|
||||
HANZOFLOW_REFRESH_TOKEN,
|
||||
FLOW_ACCESS_TOKEN,
|
||||
FLOW_API_TOKEN,
|
||||
FLOW_AUTO_LOGIN_OPTION,
|
||||
FLOW_REFRESH_TOKEN,
|
||||
} from "@/constants/constants";
|
||||
import { useGetUserData } from "@/controllers/API/queries/auth";
|
||||
import { useGetGlobalVariablesMutation } from "@/controllers/API/queries/variables/use-get-mutation-global-variables";
|
||||
@@ -69,12 +69,12 @@ export function AuthProvider({ children }): React.ReactElement {
|
||||
autoLogin: string,
|
||||
refreshToken?: string,
|
||||
) {
|
||||
cookieManager.set(HANZOFLOW_ACCESS_TOKEN, newAccessToken);
|
||||
cookieManager.set(HANZOFLOW_AUTO_LOGIN_OPTION, autoLogin);
|
||||
setLocalStorage(HANZOFLOW_ACCESS_TOKEN, newAccessToken);
|
||||
cookieManager.set(FLOW_ACCESS_TOKEN, newAccessToken);
|
||||
cookieManager.set(FLOW_AUTO_LOGIN_OPTION, autoLogin);
|
||||
setLocalStorage(FLOW_ACCESS_TOKEN, newAccessToken);
|
||||
|
||||
if (refreshToken) {
|
||||
cookieManager.set(HANZOFLOW_REFRESH_TOKEN, refreshToken);
|
||||
cookieManager.set(FLOW_REFRESH_TOKEN, refreshToken);
|
||||
}
|
||||
setAccessToken(newAccessToken);
|
||||
|
||||
@@ -130,9 +130,9 @@ export function AuthProvider({ children }): React.ReactElement {
|
||||
|
||||
function clearAuthSession() {
|
||||
cookieManager.clearAuthCookies();
|
||||
localStorage.removeItem(HANZOFLOW_ACCESS_TOKEN);
|
||||
localStorage.removeItem(HANZOFLOW_API_TOKEN);
|
||||
localStorage.removeItem(HANZOFLOW_REFRESH_TOKEN);
|
||||
localStorage.removeItem(FLOW_ACCESS_TOKEN);
|
||||
localStorage.removeItem(FLOW_API_TOKEN);
|
||||
localStorage.removeItem(FLOW_REFRESH_TOKEN);
|
||||
setAccessToken(null);
|
||||
setApiKey(null);
|
||||
setUserData(null);
|
||||
|
||||
@@ -100,9 +100,9 @@ function ApiInterceptor() {
|
||||
|
||||
const isAuthorizedURL = (url) => {
|
||||
const authorizedDomains = [
|
||||
"https://raw.githubusercontent.com/hanzoflow-ai/hanzoflow_examples/main/examples",
|
||||
"https://api.github.com/repos/hanzoflow-ai/hanzoflow_examples/contents/examples",
|
||||
"https://api.github.com/repos/hanzoflow-ai/hanzoflow",
|
||||
"https://raw.githubusercontent.com/flow-ai/flow_examples/main/examples",
|
||||
"https://api.github.com/repos/flow-ai/flow_examples/contents/examples",
|
||||
"https://api.github.com/repos/flow-ai/flow",
|
||||
"auto_login",
|
||||
];
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ jest.mock("react-cookie", () => ({
|
||||
jest.mock("@/constants/constants", () => ({
|
||||
...jest.requireActual("@/constants/constants"),
|
||||
IS_AUTO_LOGIN: false, // Override to disable auto login for testing
|
||||
HANZOFLOW_AUTO_LOGIN_OPTION: "auto_login_lf",
|
||||
FLOW_AUTO_LOGIN_OPTION: "auto_login_lf",
|
||||
}));
|
||||
|
||||
jest.mock("@/controllers/API/helpers/constants", () => ({
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {
|
||||
IS_AUTO_LOGIN,
|
||||
HANZOFLOW_AUTO_LOGIN_OPTION,
|
||||
FLOW_AUTO_LOGIN_OPTION,
|
||||
} from "@/constants/constants";
|
||||
import useAuthStore from "@/stores/authStore";
|
||||
import useFlowStore from "@/stores/flowStore";
|
||||
@@ -24,7 +24,7 @@ export const useLogout: useMutationFunctionType<undefined, void> = (
|
||||
async function logoutUser(): Promise<any> {
|
||||
const autoLogin =
|
||||
useAuthStore.getState().autoLogin ||
|
||||
getAuthCookie(cookies, HANZOFLOW_AUTO_LOGIN_OPTION) === "auto" ||
|
||||
getAuthCookie(cookies, FLOW_AUTO_LOGIN_OPTION) === "auto" ||
|
||||
isAutoLoginEnv;
|
||||
|
||||
if (autoLogin) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IS_AUTO_LOGIN, HANZOFLOW_REFRESH_TOKEN } from "@/constants/constants";
|
||||
import { IS_AUTO_LOGIN, FLOW_REFRESH_TOKEN } from "@/constants/constants";
|
||||
import useAuthStore from "@/stores/authStore";
|
||||
import type { useMutationFunctionType } from "@/types/api";
|
||||
import { cookieManager } from "@/utils/cookie-manager";
|
||||
@@ -22,7 +22,7 @@ export const useRefreshAccessToken: useMutationFunctionType<
|
||||
|
||||
async function refreshAccess(): Promise<IRefreshAccessToken> {
|
||||
const res = await api.post<IRefreshAccessToken>(`${getURL("REFRESH")}`);
|
||||
cookieManager.set(HANZOFLOW_REFRESH_TOKEN, res.data.refresh_token);
|
||||
cookieManager.set(FLOW_REFRESH_TOKEN, res.data.refresh_token);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import LoadingComponent from "@/components/common/loadingComponent";
|
||||
import { ENABLE_DATASTAX_HANZOFLOW } from "../feature-flags";
|
||||
import { ENABLE_DATASTAX_FLOW } from "../feature-flags";
|
||||
|
||||
type CustomLoaderProps = {
|
||||
remSize?: number;
|
||||
};
|
||||
|
||||
const CustomLoader = ({ remSize = 30 }: CustomLoaderProps) => {
|
||||
return ENABLE_DATASTAX_HANZOFLOW ? (
|
||||
return ENABLE_DATASTAX_FLOW ? (
|
||||
<></>
|
||||
) : (
|
||||
<LoadingComponent remSize={remSize} />
|
||||
|
||||
@@ -5,7 +5,7 @@ export const API_ROUTES = ["^/v1/", "^/v2/", "/health"];
|
||||
export const BASE_URL_API = "/v1/";
|
||||
export const BASE_URL_API_V2 = "/v2/";
|
||||
export const HEALTH_CHECK_URL = "/health_check";
|
||||
export const DOCS_LINK = "https://docs.hanzoflow.org";
|
||||
export const DOCS_LINK = "https://docs.flow.org";
|
||||
|
||||
export default {
|
||||
DOCS_LINK,
|
||||
|
||||
@@ -7,7 +7,7 @@ export const ENABLE_BRANDING = true;
|
||||
export const ENABLE_MVPS = false;
|
||||
export const ENABLE_CUSTOM_PARAM = false;
|
||||
export const ENABLE_INTEGRATIONS = false;
|
||||
export const ENABLE_DATASTAX_HANZOFLOW = false;
|
||||
export const ENABLE_DATASTAX_FLOW = false;
|
||||
export const ENABLE_FILE_MANAGEMENT = true;
|
||||
export const ENABLE_PUBLISH = true;
|
||||
export const ENABLE_WIDGET = true;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HANZOFLOW_ACCESS_TOKEN } from "@/constants/constants";
|
||||
import { FLOW_ACCESS_TOKEN } from "@/constants/constants";
|
||||
import { cookieManager } from "@/utils/cookie-manager";
|
||||
|
||||
/**
|
||||
@@ -13,5 +13,5 @@ import { cookieManager } from "@/utils/cookie-manager";
|
||||
*/
|
||||
export const customGetAccessToken = () => {
|
||||
// Try to read the cookie (will be null if HttpOnly is enabled)
|
||||
return cookieManager.get(HANZOFLOW_ACCESS_TOKEN) ?? null;
|
||||
return cookieManager.get(FLOW_ACCESS_TOKEN) ?? null;
|
||||
};
|
||||
|
||||
@@ -20,7 +20,7 @@ export const DESCRIPTIONS: string[] = [
|
||||
"Generate, Innovate, Communicate.",
|
||||
"Conversation Catalyst Engine.",
|
||||
"Language Chainlink Master.",
|
||||
"Design Dialogues with Hanzoflow.",
|
||||
"Design Dialogues with HanzoFlow.",
|
||||
"Nurture NLP Nodes Here.",
|
||||
"Conversational Cartography Unlocked.",
|
||||
"Design, Develop, Dialogize.",
|
||||
@@ -31,7 +31,7 @@ export const DESCRIPTIONS: string[] = [
|
||||
"Where Language Meets Logic.",
|
||||
"Building Intelligent Interactions.",
|
||||
"Your Passport to Linguistic Landscapes.",
|
||||
"Create, Curate, Communicate with Hanzoflow.",
|
||||
"Create, Curate, Communicate with HanzoFlow.",
|
||||
"Flow into the Future of Language.",
|
||||
"Mapping Meaningful Conversations.",
|
||||
"Unravel the Art of Articulation.",
|
||||
@@ -41,7 +41,7 @@ export const DESCRIPTIONS: string[] = [
|
||||
"The Pinnacle of Prompt Generation.",
|
||||
"Language Models, Mapped and Mastered.",
|
||||
"Powerful Prompts, Perfectly Positioned.",
|
||||
"Innovation in Interaction with Hanzoflow.",
|
||||
"Innovation in Interaction with HanzoFlow.",
|
||||
"Your Toolkit for Text Generation.",
|
||||
"Unfolding Linguistic Possibilities.",
|
||||
"Building Powerful Solutions with Language Models.",
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ export const useStartConversation = (
|
||||
if (wsRef.current?.readyState === WebSocket.OPEN) {
|
||||
wsRef.current.send(
|
||||
JSON.stringify({
|
||||
type: "hanzoflow.elevenlabs.config",
|
||||
type: "flow.elevenlabs.config",
|
||||
enabled: audioSettings.provider === "elevenlabs",
|
||||
voice_id:
|
||||
audioSettings.provider === "elevenlabs"
|
||||
|
||||
+3
-3
@@ -1,11 +1,11 @@
|
||||
import HanzoflowLogo from "@/assets/HanzoflowLogo.svg?react";
|
||||
import HanzoFlowLogo from "@/assets/HanzoFlowLogo.svg?react";
|
||||
|
||||
export default function LogoIcon() {
|
||||
return (
|
||||
<div className="relative flex h-8 w-8 items-center justify-center rounded-md bg-muted">
|
||||
<div className="flex h-8 w-8 items-center justify-center">
|
||||
<HanzoflowLogo
|
||||
title="Hanzoflow Logo"
|
||||
<HanzoFlowLogo
|
||||
title="HanzoFlow Logo"
|
||||
className="absolute h-[18px] w-[18px]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -193,8 +193,8 @@ export default function ChatView({
|
||||
) : (
|
||||
<div className="flex flex-grow w-full flex-col items-center justify-center">
|
||||
<div className="flex flex-col items-center justify-center gap-4 p-8">
|
||||
<HanzoflowLogo
|
||||
title="Hanzoflow logo"
|
||||
<HanzoFlowLogo
|
||||
title="HanzoFlow logo"
|
||||
className="h-10 w-10 scale-[1.5]"
|
||||
/>
|
||||
<div className="flex flex-col items-center justify-center">
|
||||
|
||||
@@ -428,12 +428,12 @@ export default function IOModal({
|
||||
<ThemeButtons />
|
||||
</div>
|
||||
<Button
|
||||
onClick={HanzoflowButtonClick}
|
||||
onClick={HanzoFlowButtonClick}
|
||||
variant="primary"
|
||||
className="w-full !rounded-xl shadow-lg"
|
||||
>
|
||||
<HanzoflowLogoColor />
|
||||
<div className="text-sm">Built with Hanzoflow</div>
|
||||
<HanzoFlowLogoColor />
|
||||
<div className="text-sm">Built with HanzoFlow</div>
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
@@ -444,14 +444,14 @@ export default function IOModal({
|
||||
<ShadTooltip
|
||||
styleClasses="z-50"
|
||||
side="right"
|
||||
content="Built with Hanzoflow"
|
||||
content="Built with HanzoFlow"
|
||||
>
|
||||
<Button
|
||||
variant="primary"
|
||||
className="h-12 w-12 !rounded-xl !p-4 shadow-lg"
|
||||
onClick={HanzoflowButtonClick}
|
||||
onClick={HanzoFlowButtonClick}
|
||||
>
|
||||
<HanzoflowLogoColor className="h-[18px] w-[18px] scale-150" />
|
||||
<HanzoFlowLogoColor className="h-[18px] w-[18px] scale-150" />
|
||||
</Button>
|
||||
</ShadTooltip>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { cloneDeep } from "lodash";
|
||||
import type { AllNodeType } from "@/types/flow";
|
||||
import { HANZOFLOW_SUPPORTED_TYPES } from "../../../constants/constants";
|
||||
import { FLOW_SUPPORTED_TYPES } from "../../../constants/constants";
|
||||
|
||||
export const getNodesWithDefaultValue = (
|
||||
nodes: AllNodeType[],
|
||||
@@ -18,7 +18,7 @@ export const getNodesWithDefaultValue = (
|
||||
(templateField) =>
|
||||
templateField.charAt(0) !== "_" &&
|
||||
node!.data!.node!.template[templateField]?.show &&
|
||||
HANZOFLOW_SUPPORTED_TYPES.has(
|
||||
FLOW_SUPPORTED_TYPES.has(
|
||||
node!.data!.node!.template[templateField].type,
|
||||
) &&
|
||||
templateField !== "code",
|
||||
|
||||
@@ -14,17 +14,17 @@ export default function getWidgetCode({
|
||||
}: GetCodeType): string {
|
||||
const source = copy
|
||||
? `<script
|
||||
src="https://cdn.jsdelivr.net/gh/logspace-ai/hanzo[email protected]/dist/build/static/js/bundle.min.js">
|
||||
src="https://cdn.jsdelivr.net/gh/logspace-ai/[email protected]/dist/build/static/js/bundle.min.js">
|
||||
</script>`
|
||||
: `<script
|
||||
src="https://cdn.jsdelivr.net/gh/logspace-ai/hanzo[email protected]/dist/
|
||||
src="https://cdn.jsdelivr.net/gh/logspace-ai/[email protected]/dist/
|
||||
build/static/js/bundle.min.js">
|
||||
</script>`;
|
||||
|
||||
const { protocol, host } = customGetHostProtocol();
|
||||
|
||||
return `${source}
|
||||
<hanzoflow-chat
|
||||
<flow-chat
|
||||
window_title="${flowName}"
|
||||
flow_id="${flowId}"
|
||||
host_url="${protocol}//${host}"${
|
||||
@@ -33,5 +33,5 @@ build/static/js/bundle.min.js">
|
||||
api_key="..."`
|
||||
: ""
|
||||
}>
|
||||
</hanzoflow-chat>`;
|
||||
</flow-chat>`;
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ export default function ShareModal({
|
||||
<BaseModal.Header
|
||||
description={`Publish ${
|
||||
is_component ? "your component" : "workflow"
|
||||
} to the Hanzoflow Store.`}
|
||||
} to the HanzoFlow Store.`}
|
||||
>
|
||||
<span className="pr-2">Share</span>
|
||||
<IconComponent
|
||||
|
||||
@@ -57,7 +57,7 @@ export default function GetStartedComponent({
|
||||
|
||||
return (
|
||||
<div className="flex flex-1 flex-col gap-4 md:gap-8">
|
||||
<BaseModal.Header description="Start with templates showcasing Hanzoflow's Prompting, RAG, and Agent use cases.">
|
||||
<BaseModal.Header description="Start with templates showcasing HanzoFlow's Prompting, RAG, and Agent use cases.">
|
||||
Get started
|
||||
</BaseModal.Header>
|
||||
<div className="grid min-h-0 flex-1 grid-cols-1 gap-4 lg:grid-cols-3">
|
||||
|
||||
@@ -53,7 +53,7 @@ export default function LoginAdminPage() {
|
||||
return (
|
||||
<div className="flex h-full w-full flex-col items-center justify-center bg-muted">
|
||||
<div className="flex w-72 flex-col items-center justify-center gap-2">
|
||||
<HanzoflowLogo title="Hanzoflow logo" className="h-10 w-10 scale-[1.5]" />
|
||||
<HanzoFlowLogo title="HanzoFlow logo" className="h-10 w-10 scale-[1.5]" />
|
||||
<span className="mb-6 text-2xl font-semibold text-primary">Admin</span>
|
||||
<Input
|
||||
onChange={({ target: { value } }) => {
|
||||
|
||||
@@ -18,8 +18,8 @@ export default function DeleteAccountPage() {
|
||||
return (
|
||||
<div className="flex h-full w-full flex-col items-center justify-center bg-muted">
|
||||
<div className="flex w-72 flex-col items-center justify-center gap-2">
|
||||
<HanzoflowLogo
|
||||
title="Hanzoflow logo"
|
||||
<HanzoFlowLogo
|
||||
title="HanzoFlow logo"
|
||||
className="mb-4 h-10 w-10 scale-[1.5]"
|
||||
/>
|
||||
<span className="mb-4 text-center text-2xl font-semibold text-primary">
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user