Skip to content

Fix dev deployment: addons mount path + setup.sh build step#76

Merged
amalbet merged 2 commits into
local-deploymentfrom
feature/fix-compose-addons-and-build
Apr 22, 2026
Merged

Fix dev deployment: addons mount path + setup.sh build step#76
amalbet merged 2 commits into
local-deploymentfrom
feature/fix-compose-addons-and-build

Conversation

@amalbet

@amalbet amalbet commented Apr 21, 2026

Copy link
Copy Markdown

Summary

Two small fixes to unblock fresh-clone deployments of the local-deployment stack (both discovered during 2026-04-21 AWS dev env validation). The stack works on existing developer laptops but fails on any clean environment (new team member laptop, fresh EC2, CI runner).

Two labeled commits, each self-contained:

1. b18172c — fix(compose): addons volume mount path

Commit 6de6851 (Jan 2026, "move addon folder") moved Odoo addons from repo-root addons/ to odoo/addons/. odoo/Dockerfile was incidentally correct (build context is ./odoo/, so its COPY addons resolves to odoo/addons/). But docker-compose.yml:94 kept the old path and now overlays the image's baked-in modules with an empty host directory. Result: Odoo starts without the openems module, and setup.sh fails with "relation openems_device does not exist" when creating edge0.

Fix: ./addons:/mnt/extra-addons./odoo/addons:/mnt/extra-addons.

2. 9b6289e — fix(setup): build images from base compose only

setup.sh --edges N generates a docker-compose.override.yml that disables the base openems-edge service (profiles: ["disabled"]) and replaces it with N numbered openems-edge-0..N-1 services that reference the image by tag without a build: directive. When docker compose build runs afterward, it merges both files, honors the disabled profile, and skips building openems-edge entirely. When up later tries to start the numbered services it fails with pull access denied for openems-edge.

Fix: docker compose -f docker-compose.yml build — ignores the override at build time, still uses it at up time.

Test plan

  • git clean -fdx (or clone fresh) on an existing laptop
  • ./setup.sh --edges 2
  • Expect "All checks passed!" without manual intervention
  • UI at http://localhost:4200 loads, edge0/edge1 online with simulation data
  • (Done by Alejandro on AWS EC2) apply on a fresh EC2 instance bootstrap

Context

These are part of a bundle of "AWS dev env unblocker" fixes. The Terraform-side fixes (B2B port 8082→8075, IMDSv2 token fetch) were pushed to #75 in separate labeled commits — see #75 for that side of the work. Those live in iac/dev/ and target main; these live at repo root and target local-deployment. Different branches, so they had to split PRs.

@aidan-barnes-axm — no AWS/infra changes here, purely docker-compose + setup.sh. Review at your convenience.

amalbet added 2 commits April 21, 2026 15:53
Commit 6de6851 (Jan 2026, "move addon folder") moved the Odoo addons
from the repo-root `addons/` to `odoo/addons/`. The `odoo/Dockerfile`
was correct by accident (its `COPY addons /mnt/extra-addons` resolves
relative to the build context `./odoo/`, so it copies from
`odoo/addons/` into the image). But the docker-compose.yml volume
mount `./addons:/mnt/extra-addons` remained unchanged and now points
at a nonexistent path on fresh clones.

Effect on fresh clones: the volume mount overlays the image's baked-in
`/mnt/extra-addons` (which has openems, partner_firstname,
web_m2x_options) with an empty host directory. Odoo starts with no
custom modules. `setup.sh` tries to install the `openems` module and
everything appears fine until it attempts to insert into
`openems_device` — which fails with "relation does not exist"
because that model's table was never created.

Discovered during 2026-04-21 AWS dev env deployment: EC2 bootstrap
cloned `local-deployment` fresh, hit the error, setup.sh failed.

Works on existing developer laptops only because they have leftover
pre-refactor files at the old path `./addons/`.

Fix: point the mount at the real location `./odoo/addons/`. Preserves
the dev ergonomic of editing addon files without rebuilding the image.

Signed-off-by: Alejandro Malbet <amalbet@gmail.com>
The override generated by setup.sh for --edges N mode disables the
base `openems-edge` service (profiles: ["disabled"]) and creates N
numbered `openems-edge-0..N-1` services that reference
`image: openems-edge:latest` without a `build:` directive. This is
fine at runtime (the override is meant to fan out edges), but it
breaks the build step.

`docker compose build` (no flags) merges both compose files, sees the
override's "disabled" profile, and skips building openems-edge. The
numbered services don't declare a build either, so NO build of the
edge image happens at all. When `docker compose up` later tries to
start the numbered services, it tries to pull openems-edge:latest
from Docker Hub and fails:

    Image openems-edge:latest Pulling
    Image openems-edge:latest Error pull access denied for openems-edge,
    repository does not exist or may require 'docker login'

This only surfaces on fresh systems where the image isn't already
cached from a prior build. Laptops with older cached images don't
hit it, which is why this bug sat undetected.

Fix: build with `-f docker-compose.yml` to ignore the override and
build all services from the base compose definition. Safe and
minimal; the override is still used for `up`.

Discovered during 2026-04-21 AWS dev env deployment.

Signed-off-by: Alejandro Malbet <amalbet@gmail.com>
@amalbet amalbet merged commit 985159b into local-deployment Apr 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant