MCPcopy Index your code
hub / github.com/cloudfoundry/bpm-release

github.com/cloudfoundry/bpm-release @v1.4.33

Chat with this repo
repository ↗ · DeepWiki ↗ · release v1.4.33 ↗ · + Follow
341 symbols 1,313 edges 98 files 61 documented · 18%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

bpm

Isolated BOSH Jobs

About

bpm (BOSH process manager) is a layer between monit and your BOSH jobs which adds additional features while removing nearly all boilerplate startup scripts. It is backwards compatible with any BOSH version released in the past few years.

Well-defined Lifecycle

The current job lifecycle is very dependent on monit semantics. Job and process start order is not guaranteed and there are hidden timeouts you can hit which will put your system in an unexpected state.

bpm makes its expectations of your job very clear. It defines how long things should take, how bpm will communicate with your process, and how your job should behave under certain scenarios. Most jobs will already be compliant.

Isolation

Jobs using bpm are isolated from one another. All operating system resources (with the exception of networking) are namespaced such that a job cannot see or interact with other processes outside their containing job.

This provides a far smaller and easier to maintain interface between your jobs and the system but crucially provides a security barrier such that if one of the jobs on your machine is compromised then the incident is limited to just that job rather than all jobs on the same machine.

Resource Limits

bpm is also able to offer resource limiting due to the technologies chosen for the above features. This stops any one job from starving other collocated jobs of the operating system resources they need in order to work.

Documentation

Documentation can be found in the docs directory. As we're developing bpm this documentation may lead the implementation changes briefly, but it will eventually become the official source of bpm documentation.

Usage

bpm has now reached 1.0 and has a stable public API which should be usable for the majority of BOSH jobs. We do not plan on making any more backwards incompatible changes to the public API before 2.0.

You can start to read about the ethos and glossary, runtime environment which bpm provides to your job, the configuration format, and the undefined behavior of the system.

Development

Development is not currently supported on anything other than Linux, though running the docker based tests is possible on macOS.

Dependencies required for local testing:

  • Docker
  • Go

The following steps should allow you to run the tests in a local docker container:

  • Enable swap accounting by running the following commands as root:

    sh sed -i 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="swapaccount=1"/' /etc/default/grub update-grub reboot

  • Clone this repository and submodules:

    sh cd ~/workspace git clone https://github.com/cloudfoundry/bpm-release.git cd ~/workspace/bpm-release

  • Run tests:

    sh cd ~/workspace/bpm-release ./scripts/test-with-docker

Extension points exported contracts — how you extend this code

LockedLock (Interface)
LockedLock represents a lock which has been acquired. [2 implementers]
src/bpm/hostlock/hostlock.go
ExerciseLock (FuncType)
Just a shorthand to make the function signature below more manageable.
src/bpm/hostlock/hostlock_test.go
MountOption (FuncType)
MountOption can be used to alter the mount options to Mount or IdentityMount.
src/bpm/runc/adapter/mount.go
GlobFunc (FuncType)
GlobFunc is a function which when given a file path pattern returns a list of paths or an error if the search failed.
src/bpm/runc/adapter/adapter.go
VolumeLocker (Interface)
(no doc) [2 implementers]
src/bpm/runc/adapter/adapter.go

Core symbols most depended-on inside this repo

AllowSyscall
called by 315
src/bpm/runc/specbuilder/seccomp.go
Join
called by 166
src/bpm/bosh/paths.go
External
called by 66
src/bpm/bosh/paths.go
Error
called by 54
src/bpm/exitstatus/error.go
BuildSpec
called by 37
src/bpm/runc/lifecycle/lifecycle.go
Internal
called by 31
src/bpm/bosh/paths.go
Run
called by 27
src/bpm/runc/lifecycle/lifecycle.go
String
called by 22
src/bpm/bosh/paths.go

Shape

Function 198
Method 98
Struct 33
Interface 6
FuncType 5
TypeAlias 1

Languages

Go100%

Modules by API surface

src/bpm/runc/lifecycle/lifecycle.go33 symbols
src/bpm/config/bpm_config.go29 symbols
src/bpm/runc/adapter/adapter.go23 symbols
src/bpm/runc/specbuilder/specbuilder.go18 symbols
src/bpm/runc/client/client.go15 symbols
src/bpm/integration/integration_suite_test.go14 symbols
src/bpm/config/job_config.go14 symbols
src/bpm/runc/adapter/mount.go12 symbols
src/bpm/runc/adapter/adapter_test.go12 symbols
src/bpm/commands/root.go12 symbols
src/bpm/bosh/env.go11 symbols
src/bpm/cgroups/cgroup.go9 symbols

For agents

$ claude mcp add bpm-release \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact