-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to run Open-Canvas on Linux fully-local using a local LangGraph CLI instead of LangGraph Studio cloud? #181
Comments
I shared an approach for running Open-Canvas on Windows. This method might also work on Linux, so feel free to check it out—it could be useful! However, it still requires a LangSmith API key to push trace information to the cloud, unfortunately. |
@lanesky Thank you. This is the log tail, it's on a Arch Linux LXC container on Proxmox VE 8.2.
These are the installation commands, starting from a clean ArchLinux-base template with the # Install prerequisites
sudo pacman -S git wget less python python-pip docker
sudo systemctl enable --now docker
sudo systemctl status docker
# Clone repo
cd && mkdir Github && cd Github
git clone https://github.com/langchain-ai/open-canvas/
# Update repo
cd && cd Github/open-canvas
git branch
git switch staging
git branch
git pull
# Install LangGraph-CLI
python -m venv .venv
source .venv/bin/activate
pip install --upgrade pip
pip install -U langgraph-cli
langgraph dockerfile -c langgraph.json Dockerfile
docker build -t open-canvas .
# Install & run Redis: https://hub.docker.com/_/redis/
sudo docker run --name some-redis -d redis redis-server --save 60 1 --loglevel warning
# Install & run Postgres: https://hub.docker.com/_/postgres
sudo docker run --name some-postgres -e POSTGRES_PASSWORD=mysecretpassword -d postgres
# Install & run Open-Canvas
touch .env
# Production: export LANGGRAPH_CLOUD_LICENSE_KEY="***************"
docker run \
--env-file .env \
-p 57318:8000 \
-e REDIS_URI="redis://host.docker.internal:6379/0" \
-e DATABASE_URI="postgresql://myuser:[email protected]:5432/mydatabase" \
-e LANGSMITH_API_KEY="lsv2_pt_*******************" \
open-canvas To eventually replicate exactly, this is my test LXC housekeeping before the above installation: # On the PVE server, "Create CT" using archlinux-base template
# RAM=4GB+, CPU=1+, DISK=16GB+
# LXC housekeeping, login as root:
pacman-key --init && pacman-key --populate
pacman -Sy archlinux-keyring --noconfirm && pacman -Su --noconfirm
sync && reboot
# Add admin account
pacman -S sudo --noconfirm # In Debian: apt install sudo
useradd --create-home admin
passwd admin
usermod -aG wheel admin # In Debian: use sudo instead of wheel
visudo
# Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL:ALL) ALL # In Debian: it's %sudo instead of %wheel
# Enable sshd
nano /etc/ssh/sshd_config
PasswordAuthentication yes
systemctl enable --now sshd
# Get the IP address
ip a | grep 'inet '
echo $HOSTNAME
# Access via ssh from another computer
$ ssh admin@<hostname_or_ip>
sudo nano /etc/pacman.conf
# Misc options
#UseSyslog
Color
ILoveCandy
#NoProgressBar
#CheckSpace
VerbosePkgLists
ParallelDownloads = 5
sudo poweroff
# Backup now the fresh installation,
# then start the LXC. |
@PieBru Welcome! Based on the error you posted, it looks like this is likely caused by a name resolution issue — meaning the connection to PostgreSQL failed because the hostname couldn’t be resolved.
Looking at the install commands you posted:
I think the names for Redis and PostgreSQL in your environment variables should be
|
Brother, help, I used your method to start docker on linux, and an error occurred when starting open-canvas image. I used langsmith's personal key root@pekpheds01309:/deps/open-canvas# docker logs 60e67404cdd4 |
It seems that the API revision you’re running is different from mine. The API revision that worked fine in my environment was Here is the log from my environment."
|
Brother, I have changed it to langchain/langgraphjs-api:20-4da016a and re-mirrored it, but the same error still occurs. podman start -a open-canvas_langgraph-redis_1 |
Sorry to hear that. What is the "https://apigw-beta.test.xxx.com/api/langsmith/auth?langgraph-api=true" in your log? Is it an api stub? |
I have reviewed the related source code (you can also access it by dumping async def migrate() -> None:
async with connect() as conn, conn.cursor() as cur:
try:
results = await cur.execute(
"select version from schema_migrations order by version desc limit 1",
prepare=False,
)
current_version = (await results.fetchone())["version"]
except UndefinedTable:
await cur.execute(
"""
CREATE TABLE schema_migrations (
version bigint primary key,
dirty boolean not null
)
""",
prepare=False,
)
current_version = -1
for migration_path in sorted(os.listdir(config.MIGRATIONS_PATH)):
version = int(migration_path.split("_")[0])
if version <= current_version:
continue
with open(os.path.join(config.MIGRATIONS_PATH, migration_path)) as f:
await cur.execute(f.read(), prepare=False)
await cur.execute(
"INSERT INTO schema_migrations (version, dirty) VALUES (%s, %s)",
(version, False),
)
await logger.ainfo("Applied database migration", version=version) |
Hello brother, I have another new question. The langchain/langgraphjs-api service has been started successfully (port is 8123:8000), and the ok interface is returned normally, but when I adjust the front end, I find that 404 is found. Is there something wrong with my opencanvas configuration? So, what should be configured for the hosts of these interfaces /api/threads/search /api/threads /api/assistants etc./api/*? The log of langchain/langgraphjs-api service is also printed, but 404 2024-11-17T13:47:10.137338Z [info ] POST /api/threads/search 404 0ms [langgraph_api.server] api_revision=4da016a api_variant=local latency_ms=0 method=POST path=/api/threads/search path_params={} proto=1.1 query_string= req_header={'host': '10.68.2xx:8123', 'connection': 'keep-alive', 'content-length': '68', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36', 'content-type': 'application/json', 'accept': '/', 'origin': 'http://localhost:3000', 'referer': 'http://localhost:3000/', 'accept-encoding': 'gzip, deflate', 'accept-language': 'zh-CN,zh;q=0.9'} res_header={'content-length': '9', 'content-type': 'text/plain; charset=utf-8'} route=None status=404 |
@dashan1127 |
Brother, I haven't worked on this recently, and started working on it again today. The front-end service can be started, but when I was doing Q&A, I got an error when I increased the model size. The log showed MODEL_NOT_FOUND. Can you help me figure out what's going on? 2024-11-28T13:28:41.233678Z [info ] HTTP Request: POST http://graph/agent/streamEvents "HTTP/1.1 200 OK" [httpx] api_revision=4da016a api_variant=local Also, I'm using AZURE_MODELS and AZURE_KEY |
Said all in the title.
Thank you.
The text was updated successfully, but these errors were encountered: