jdecool/scaleway-runtimepublic Fork
⑂ 23b9c77
Commits
⬇ Clone ▾
git clone https://git.rickub.com/jdecool/scaleway-runtime.git
git clone ssh://git@rickub.com/jdecool/scaleway-runtime.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP

docs: decide to check Platform Requirements against an explicit Function RuntimeUnverified

Jérémy DECOOL committed 2026-11-22T12:52:56+01:00 Browse files
23b9c77 parent: 3c0ed4c
added docs/adr/0013-check-platform-requirements-against-an-explicit-function-runtime.md +30 -0
new file mode 100644
@@ -0,0 +1,30 @@
1+# Check declared Platform Requirements against an explicit Function Runtime
2+
3+A Platform Requirement the Function Runtime does not meet makes Scaleway's `composer install` fail at deploy time without failing the deployment: the function is `ready` without any `vendor/`, and every Invocation answers a `500` ([probe results](../probe-results.md#failed-scripts-and-installs)).
4+We therefore check, before packaging, the Platform Requirements that install checks, against a catalogue of what each Function Runtime was measured to provide.
5+`scaleway-doctor --runtime=<name>` runs the check alone, and `scaleway-package --runtime=<name>` runs it before writing the zip.
6+
7+The check reads the lock as Scaleway's `composer install --no-dev` does: the requirements of the locked `packages` and the root ones the lock records under `platform`, met by the Function Runtime or by a `provide` or `replace`.
8+Constraints are evaluated with `composer/semver`, Composer's own engine, and the catalogue names and versions PHP and its extensions as Composer's `PlatformRepository` does, down to its fallback versions, so that the outcome predicts what the install on Scaleway will do.
9+
10+The catalogue holds measurements only, each a complete inventory made by the probe on Scaleway, dated, and generated from probe output committed in the repository.
11+A weekly workflow measures each Function Runtime again and opens a pull request when something changed; publishing it stays a maintainer's decision.
12+
13+## Considered Options
14+
15+- Inferring the Function Runtime from the local PHP: rejected, the local PHP says nothing about what the function declares.
16+- Comparing with the local PHP environment: rejected, local availability never establishes what Scaleway provides, and the Emulator running on the local PHP is precisely what hides such an incompatibility.
17+- Catalogue entries derived from Scaleway's documentation: rejected, it lists neither every extension nor their versions, and every supported Function Runtime can be measured.
18+- Downloading the catalogue at run time: rejected, the check must work offline and without Scaleway credentials, and a release keeps the check reproducible.
19+- Reimplementing Composer's constraints: rejected, `^`, `~`, `||` and stabilities are easy to get subtly wrong, and `composer/semver` is small and dependency-free.
20+- Documenting `config.platform.php` instead of checking: rejected, it only states Composer's resolution assumptions, not what Scaleway provides.
21+
22+## Consequences
23+
24+- A confirmed incompatibility blocks packaging, as the deployment would serve nothing but `500`s; an unknown only warns, as blocking on missing evidence would refuse working applications.
25+- Requirements the probe does not measure, `lib-*` and `php-64bit` among them, stay unknown; Composer's own APIs are ignored, Scaleway installing with Composer 2.
26+- The measured PHP patch version is authoritative: a requirement on a newer patch is refused until the catalogue records the upgrade.
27+- A measurement describes the Function Runtime on its date, not a guarantee: an extension Scaleway removes after it is caught by `scaleway-check` after the deployment, and by the next weekly measurement.
28+- `composer/semver` ships with every application, although only the check uses it.
29+- A successful check covers declared Platform Requirements only, not whether the application runs.
30+- Installing custom native extensions and a Serverless Containers target remain separate work, which the check points to.
new file mode 100644
@@ -0,0 +1,30 @@
1+# Check declared Platform Requirements against an explicit Function Runtime
2+
3+A Platform Requirement the Function Runtime does not meet makes Scaleway's `composer install` fail at deploy time without failing the deployment: the function is `ready` without any `vendor/`, and every Invocation answers a `500` ([probe results](../probe-results.md#failed-scripts-and-installs)).
4+We therefore check, before packaging, the Platform Requirements that install checks, against a catalogue of what each Function Runtime was measured to provide.
5+`scaleway-doctor --runtime=<name>` runs the check alone, and `scaleway-package --runtime=<name>` runs it before writing the zip.
6+
7+The check reads the lock as Scaleway's `composer install --no-dev` does: the requirements of the locked `packages` and the root ones the lock records under `platform`, met by the Function Runtime or by a `provide` or `replace`.
8+Constraints are evaluated with `composer/semver`, Composer's own engine, and the catalogue names and versions PHP and its extensions as Composer's `PlatformRepository` does, down to its fallback versions, so that the outcome predicts what the install on Scaleway will do.
9+
10+The catalogue holds measurements only, each a complete inventory made by the probe on Scaleway, dated, and generated from probe output committed in the repository.
11+A weekly workflow measures each Function Runtime again and opens a pull request when something changed; publishing it stays a maintainer's decision.
12+
13+## Considered Options
14+
15+- Inferring the Function Runtime from the local PHP: rejected, the local PHP says nothing about what the function declares.
16+- Comparing with the local PHP environment: rejected, local availability never establishes what Scaleway provides, and the Emulator running on the local PHP is precisely what hides such an incompatibility.
17+- Catalogue entries derived from Scaleway's documentation: rejected, it lists neither every extension nor their versions, and every supported Function Runtime can be measured.
18+- Downloading the catalogue at run time: rejected, the check must work offline and without Scaleway credentials, and a release keeps the check reproducible.
19+- Reimplementing Composer's constraints: rejected, `^`, `~`, `||` and stabilities are easy to get subtly wrong, and `composer/semver` is small and dependency-free.
20+- Documenting `config.platform.php` instead of checking: rejected, it only states Composer's resolution assumptions, not what Scaleway provides.
21+
22+## Consequences
23+
24+- A confirmed incompatibility blocks packaging, as the deployment would serve nothing but `500`s; an unknown only warns, as blocking on missing evidence would refuse working applications.
25+- Requirements the probe does not measure, `lib-*` and `php-64bit` among them, stay unknown; Composer's own APIs are ignored, Scaleway installing with Composer 2.
26+- The measured PHP patch version is authoritative: a requirement on a newer patch is refused until the catalogue records the upgrade.
27+- A measurement describes the Function Runtime on its date, not a guarantee: an extension Scaleway removes after it is caught by `scaleway-check` after the deployment, and by the next weekly measurement.
28+- `composer/semver` ships with every application, although only the check uses it.
29+- A successful check covers declared Platform Requirements only, not whether the application runs.
30+- Installing custom native extensions and a Serverless Containers target remain separate work, which the check points to.