Skip to content

Fix local installer dev flow#12627

Merged
ChiragAgg5k merged 1 commit into
1.9.xfrom
fix/local-installer-dev-flow
Jun 20, 2026
Merged

Fix local installer dev flow#12627
ChiragAgg5k merged 1 commit into
1.9.xfrom
fix/local-installer-dev-flow

Conversation

@ChiragAgg5k

Copy link
Copy Markdown
Member

What does this PR do?

Fixes several issues in the local web installer/dev flow:

  • Prevents the Dockerized installer container from inheriting stale Compose labels and removes a duplicate installer URL log.
  • Uses host-reachable paths and .env.web-installer when running local installer Compose commands.
  • Allows the installer health check to reach host-published Appwrite ports from inside the installer container.
  • Fixes executor setup by letting executor manage the runtimes network and configuring OPR_EXECUTOR_IMAGES for valid startup pulls.
  • Accepts UI retry step IDs and maps them to resumable backend install phases.
  • Avoids undefined index warnings when collection index configs omit optional lengths or orders.

Test Plan

  • Ran PHP syntax checks on touched PHP files.
  • Ran composer lint on touched PHP/template files.
  • Verified local Appwrite health at http://localhost:80/v1/health/version.
  • Verified a container can reach http://host.docker.internal:80/v1/health/version.
  • Recreated openruntimes-executor locally and verified appwrite can reach http://exc1/v1/health.
  • Verified executor logs report [ImagePuller] Pulled 3/3 images. without the blank image pull failure.

Related PRs and Issues

  • #XXXX

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs?

@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown

✨ Benchmark results

Comparing 1.9.x (before) to fix/local-installer-dev-flow (after).

Before

Scenario P50 (ms) P95 (ms) Requests RPS
API total 13.37 128.2 185 36.14
Account 27.25 182.51 35 7.47
TablesDB 13.14 19.17 35 9.06
Storage 10.9 47.95 75 19.05
Functions 21 30.05 40 10.31

After

Scenario P50 (ms) P95 (ms) Requests RPS
API total 13.22 128.95 185 36.03
Account 27.74 177.8 35 7.44
TablesDB 12.79 21.75 35 8.95
Storage 11.14 47.98 75 18.8
Functions 21.18 28.86 40 10.14

Delta

Scenario P95 delta (ms)
API total +0.75
Account -4.71
TablesDB +2.57
Storage +0.03
Functions -1.2
Top API waits
API request Max wait (ms)
account.sessions.email.create 616.7
account.password.update 177.68
account.create 145.46

@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown

🔄 PHP-Retry Summary

Flaky tests detected across commits:

Commit 2703329 - 1 flaky test
Test Retries Total Time Details
RealtimeConsoleClientTest::testIndexesCollectionAPI 1 429ms Logs
Commit 9c28275 - 1 flaky test
Test Retries Total Time Details
LegacyCustomClientTest::testNotContains 1 240.41s Logs
Commit 9c55fef - 1 flaky test
Test Retries Total Time Details
DocumentsDBCustomServerTest::testTimeout 1 128.69s Logs
Commit 66cacc5 - 1 flaky test
Test Retries Total Time Details
RealtimeConsoleClientTest::testIndexesCollectionAPI 1 326ms Logs

@greptile-apps

greptile-apps Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes several issues in the local web-installer dev flow: it corrects host-reachable paths for Compose commands, guards the Docker network attach step to only run inside containers, makes the reset endpoint use the host path from config, and adds null-coalescing fallbacks for optional index fields to prevent undefined-index warnings.

  • Installer container hardening: Adds explicit Compose labels, host.docker.internal:host-gateway, and a dual volume mount ($volumePath:$volumePath) so the Dockerized installer can resolve host-side Compose files and reach host-published Appwrite ports.
  • Resumable install phases: Extends the $steps array with STEP_ACCOUNT_SETUP and STEP_MIGRATION, guards container startup with $startIndex <= 2, and fixes runDatabaseMigration to pass full Compose project context — allowing account-setup and migration retries without restarting containers.
  • Executor setup fix: Removes runtimes from the executor's static Compose networks (letting the executor manage it at runtime) and injects OPR_EXECUTOR_IMAGES computed from the configured runtimes so valid images are pre-pulled on startup.

Confidence Score: 5/5

Safe to merge; the changes are scoped to the local installer dev flow and defensive null-coalescing fixes with no impact on production code paths.

All changes are in the local installer orchestration layer and optional-field null guards. The null-coalescing fixes are straightforward and low-risk. The installer changes are well-reasoned and the test plan covers the critical paths (health check, executor connectivity, migration exec).

src/Appwrite/Platform/Tasks/Install.php deserves a second look — the step-index arithmetic and the unconditional --env-file in runDockerCompose are minor inconsistencies worth tidying before further steps are added.

Important Files Changed

Filename Overview
app/http.php Adds ?? [] null-coalescing fallback for lengths and orders in three index-building call sites to avoid undefined-index warnings when collection configs omit those optional keys.
app/views/install/compose.phtml Removes the runtimes network from the executor service definition (letting the executor manage it at runtime) and adds OPR_EXECUTOR_IMAGES from a new executorImages template param to pre-pull runtime images on startup.
src/Appwrite/Platform/Installer/Http/Installer/Install.php Expands the retryStep whitelist to include STEP_CONFIG_FILES, STEP_ACCOUNT_SETUP, and STEP_MIGRATION, allowing the UI to pass these step IDs for resumable installs.
src/Appwrite/Platform/Installer/Http/Installer/Reset.php Switches the local reset path from the hardcoded /usr/src/code to $config->getHostPath(), adds a null-path guard, conditionally adds --env-file when the env file exists, and fixes the --project-directory flag to use the host-reachable path.
src/Appwrite/Platform/Installer/Server.php Removes the duplicate printInstallerUrl call before the Docker installer launch, adds explicit compose labels, host.docker.internal:host-gateway, and a second volume mount ($volumePath:$volumePath) so host-reachable paths work inside the installer container.
src/Appwrite/Platform/Modules/Storage/Http/Buckets/Create.php Adds ?? [] null-coalescing fallback for lengths and orders when building index objects during bucket creation, matching the parallel fix in app/http.php.
src/Appwrite/Platform/Tasks/Install.php Significant refactor: adds STEP_ACCOUNT_SETUP and STEP_MIGRATION to the steps array, guards container startup with $startIndex <= 2, conditions network-attach on container detection, switches runDockerCompose to host-reachable paths with explicit --env-file, fixes runDatabaseMigration to pass compose file/project context, and computes executorImages from runtime config.

Reviews (5): Last reviewed commit: "Fix local installer dev flow" | Re-trigger Greptile

Comment thread app/views/install/compose.phtml Outdated
@ChiragAgg5k ChiragAgg5k force-pushed the fix/local-installer-dev-flow branch from 2703329 to 9c28275 Compare June 20, 2026 05:48
Comment thread src/Appwrite/Platform/Tasks/Install.php Outdated
Comment thread src/Appwrite/Platform/Tasks/Install.php Outdated
@ChiragAgg5k ChiragAgg5k force-pushed the fix/local-installer-dev-flow branch from 9c28275 to c62143c Compare June 20, 2026 07:39
Comment thread src/Appwrite/Platform/Tasks/Install.php
@ChiragAgg5k ChiragAgg5k force-pushed the fix/local-installer-dev-flow branch 2 times, most recently from 2dbf8e4 to 9c55fef Compare June 20, 2026 07:51
Comment thread src/Appwrite/Platform/Tasks/Install.php
Comment thread src/Appwrite/Platform/Tasks/Install.php Outdated
@ChiragAgg5k ChiragAgg5k force-pushed the fix/local-installer-dev-flow branch from 9c55fef to 66cacc5 Compare June 20, 2026 08:01
@ChiragAgg5k ChiragAgg5k force-pushed the fix/local-installer-dev-flow branch from 66cacc5 to fdcabe1 Compare June 20, 2026 08:10
@ChiragAgg5k ChiragAgg5k merged commit cffdb38 into 1.9.x Jun 20, 2026
46 checks passed
@ChiragAgg5k ChiragAgg5k deleted the fix/local-installer-dev-flow branch June 20, 2026 13:56
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.

2 participants