Skip to content

Foundation: Land #497 CI memory caps (finite memory_limit, ci-docker-safe.sh) #501

Description

@PurHur

Problem

#497 documented a host OOM incident: parallel docker run … ./script/ci-fast.sh containers with memory_limit=-1 in src/cli.php let bin/vm.php children grow to 40+ GiB RSS. The issue is closed as design accepted, but the repo still has:

  • ini_set('memory_limit', '-1') in src/cli.php
  • PHP_COMPILER_CI_RAM_GB ulimit applied only before LLVM phases (not VM/fast CI)
  • No script/ci-docker-safe.sh wrapper with docker run -m …

#500 tracks profiling; this issue ships the caps.

Goal

Bounded, predictable memory for local/Docker CI without relying on GitHub Actions.

Scope

  • ci_prepare_test_runtime in script/ci-common.sh — set finite memory_limit for VM/compliance (e.g. 1536M), higher cap for LLVM phases (e.g. 4096M)
  • Call at start of ci-fast.sh and ci-local.sh (before PHPUnit)
  • Default PHP_COMPILER_CI_RAM_GB8 GiB ulimit -v (down from 30) with README note
  • Add script/ci-docker-safe.sh — wraps docker run -m 10g --cpus … + warns if another php-compiler:22.04-dev CI container is running
  • Makefile target make test-docker-safe (optional alias)
  • Document in #245 local CI matrix

Acceptance criteria

make docker-build-22
./script/ci-docker-safe.sh ./script/ci-fast.sh
  • No memory_limit=-1 in CI subprocesses (grep php -i inside container)
  • Parallel-run warning prints when a second CI container starts
  • Full gate still passes: ./script/ci-docker-safe.sh ./script/ci-local.sh

Verification (local / Docker only)

docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev ./script/ci-fast.sh

Do not add .github/workflows/*.

Dependencies

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions