Add setup script for one-command bootstrap#60
Open
amalbet wants to merge 5 commits intolocal-deploymentfrom
Open
Add setup script for one-command bootstrap#60amalbet wants to merge 5 commits intolocal-deploymentfrom
amalbet wants to merge 5 commits intolocal-deploymentfrom
Conversation
Automates full stack restoration after destroying containers/images: - Builds images, starts infra services first (db, influxdb) - Creates Odoo database and installs OpenEMS module via CLI - Verifies edge device registration and fixes apikey if needed - Starts remaining services and runs health checks - Idempotent: skips steps already completed Closes #58 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Author
|
Closing — script hasn't been tested yet. Branch feature/setup-script preserved for when we're ready to validate with a full destroy + restore. |
docker compose logs piped to grep -q causes SIGPIPE when grep exits early, which fails under set -eo pipefail. Fix by capturing logs to a variable first, then grepping. Also increased retry window from fixed 20s to 12x10s polling loop. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- After Odoo DB init, set UID 1 and UID 2 passwords to match the backend's Metadata/Odoo.config (odooPassword). Without this, the backend can't authenticate XML-RPC calls and all UI logins fail. - Restart edge after full stack start to ensure it connects to the backend (edge doesn't auto-reconnect quickly if it starts first). - Update displayed credentials to reflect the actual password. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7 tasks
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
setup.shthat automates full environment bootstrap from scratchCloses #58
Usage
What it does step by step
docker compose build— builds all 6 imagesdb+influxdbfirst, waits for Postgres readyopenemsdatabase, installs OpenEMS module, loads demo data (edge device)Icui4cyou)openems_devicetable foredge0with correct apikey. Creates or fixes if neededdocker compose up -d+ restart edge for clean backend connectionTotal: ~4-7 minutes (mostly Odoo module installation)
Default credentials after setup
localhost:4200)adminIcui4cyoulocalhost:10016)adminIcui4cyouopenemspasswordTroubleshooting
Odoo init takes longer than expected
The
odoo -d openems -i openems --stop-after-initstep installs Odoo + all dependencies (CRM, Stock, Mail, etc.). On first run with no cache this can take 3-5 minutes. This is normal."Authentication failed" in OpenEMS UI
The backend authenticates UI users via Odoo XML-RPC. The setup script syncs passwords automatically, but if you changed the Odoo admin password manually, it must match
odooPasswordinopenems-backend/config.d/Metadata/Odoo.config. Fix:Edge shows "offline" in the UI
The edge may have started before the backend was ready. Restart it:
Verification checks fail
The script polls for 2 minutes. If checks still fail:
"Edge device not found" warning
This means Odoo's demo data didn't load the edge device. The script auto-creates it via SQL insert. If you see this warning but the script continues, it's handled.
Edge authentication failed (COMMON_AUTHENTICATION_FAILED)
The edge config apikey must match the
openems_device.apikeyin Postgres. Verify:Both values must match. The setup script handles this automatically.
Ports already in use
Starting over completely
Issues found and fixed during testing
pipefail+grep -qcauses SIGPIPE ondocker compose logspipeadmin, backend expectsIcui4cyou🤖 Generated with Claude Code