Skip to content

Commit de383b7

Browse files
authored
Merge pull request #1159 from kiril-keranov/patch-13
[go-migration] Refine existing docs, remove obsolete docs
2 parents cd4bd7b + dadf004 commit de383b7

6 files changed

Lines changed: 87 additions & 755 deletions

File tree

ARCHITECTURE.md

Lines changed: 23 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -43,30 +43,24 @@ java-buildpack/
4343
├── bin/
4444
│ ├── compile # Legacy V2 API entrypoint
4545
│ ├── detect # Detection phase entrypoint
46+
│ ├── release # Release phase entrypoint
4647
│ ├── finalize # Finalize phase entrypoint (V3)
4748
│ └── supply # Supply phase entrypoint (V3)
4849
49-
├── config/ # Component configurations
50-
│ ├── components.yml # Component registry
51-
│ ├── cache.yml # Caching configuration
52-
│ ├── repository.yml # Dependency repository config
53-
│ └── *.yml # Individual component configs
54-
55-
├── resources/ # Static resources for components
56-
│ ├── tomcat/ # Tomcat configuration templates
57-
│ ├── protect_app_security_provider/
58-
│ └── ...
59-
50+
├── src/integration/ # Integraion tests
6051
├── src/java/ # Go source code
52+
| ├── common/ # Common libbuildpack integrations
6153
│ ├── containers/ # Container implementations
6254
│ ├── frameworks/ # Framework implementations
6355
│ ├── jres/ # JRE implementations
56+
| ├── resources/ # Resource configuration files
6457
│ ├── supply/ # Supply phase orchestration
6558
│ │ └── cli/ # Supply CLI entrypoint
6659
│ └── finalize/ # Finalize phase orchestration
6760
│ └── cli/ # Finalize CLI entrypoint
6861
6962
├── docs/ # Documentation
63+
├── ci/ # CI scripts
7064
└── scripts/ # Build and test scripts
7165
```
7266

@@ -139,7 +133,7 @@ The buildpack uses three main component types:
139133

140134
## Buildpack Lifecycle
141135

142-
The buildpack follows Cloud Foundry's V3 lifecycle with three phases:
136+
The buildpack follows Cloud Foundry's V3 lifecycle with four phases:
143137

144138
### 1. Detect Phase
145139

@@ -171,7 +165,7 @@ The buildpack follows Cloud Foundry's V3 lifecycle with three phases:
171165

172166
**Flow**:
173167
```
174-
1. Load component registry (config/components.yml)
168+
1. Load component registries for containers, jres and frameworks
175169
2. For each component type (JRE, Frameworks):
176170
a. Run Detect() method
177171
b. If detected, run Supply() method
@@ -222,6 +216,20 @@ The buildpack follows Cloud Foundry's V3 lifecycle with three phases:
222216
- Generates runtime configuration
223217
- Profile.d scripts run before app launch
224218

219+
### 4. Release Phase
220+
221+
**Purpose**: Assemble the start command that the Cloud Controller wil use to start
222+
the running java process of the application.
223+
224+
**Entry Point**: `bin/release`
225+
226+
**Flow**:
227+
```
228+
Output the launch command written previouly in the finalize phase to $BUILD_DIR/tmp/java-buildpack-release-step.yml
229+
230+
Note that the java-buildpack-release-step.yml follows strict predefined structure which is expected from CC.
231+
If anything except this yaml appears in release output, the staged application will fail to start.
232+
```
225233
---
226234

227235
## Key Architectural Patterns
@@ -436,44 +444,6 @@ export JAVA_OPTS="${JAVA_OPTS} -Dnewrelic.config.license_key=%s"
436444

437445
---
438446

439-
## Configuration System
440-
441-
### Component Registry
442-
443-
**File**: `config/components.yml`
444-
445-
**Purpose**: Declare available components
446-
447-
**Structure**:
448-
```yaml
449-
containers:
450-
- "JavaBuildpack::Container::SpringBoot"
451-
- "JavaBuildpack::Container::Tomcat"
452-
# ...
453-
454-
jres:
455-
- "JavaBuildpack::Jre::OpenJdkJRE"
456-
# ...
457-
458-
frameworks:
459-
- "JavaBuildpack::Framework::NewRelicAgent"
460-
- "JavaBuildpack::Framework::JavaOpts"
461-
# ...
462-
```
463-
464-
### Component Configuration
465-
466-
**Pattern**: `config/<component_name>.yml`
467-
468-
**Purpose**: Configure individual components
469-
470-
**Example** (`config/new_relic_agent.yml`):
471-
```yaml
472-
version: 8.7.+
473-
repository_root: https://download.run.pivotal.io/new-relic
474-
enabled: true
475-
```
476-
477447
### Environment Variable Overrides
478448

479449
Users can override configuration via environment variables:
@@ -573,12 +543,12 @@ Scripts in `<app>/.profile.d/` run before app launch:
573543
### Supply Phase Order
574544

575545
1. **JREs** - Install Java runtime first
576-
2. **Frameworks** - Process in `components.yml` order
546+
2. **Frameworks** - Process in `registry.RegisterStandardFrameworks()` order
577547

578548
### Finalize Phase Order
579549

580550
1. **JRE** - Configure Java runtime
581-
2. **Frameworks** - Process in `components.yml` order
551+
2. **Frameworks** - Process in `registry.RegisterStandardFrameworks()` order
582552
3. **Container** - Generate launch command (last)
583553

584554
**Important**: `JavaOpts` framework must be last to allow user overrides

README.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ The buildpack supports extension through the use of Git repository forking. The
123123

124124
This Go-based buildpack is a migration from the original Ruby-based Cloud Foundry Java Buildpack. For comprehensive information about the migration status, component parity, and architectural differences:
125125

126-
* **[Ruby vs Go Buildpack Comparison](comparison.md)** - Comprehensive comparison of components, features, and production readiness assessment (92.9% component parity, production-ready for 98%+ of Java applications)
127-
* **[Dependency Installation Comparison](ruby_vs_go_buildpack_comparison.md)** - Technical deep-dive into how dependency extraction differs between Ruby and Go implementations
126+
* **[Ruby vs Go Buildpack Comparison](ruby_vs_go_buildpack_comparison.md)** - Technical deep-dive into how dependency extraction differs between Ruby and Go implementations
128127

129128
**⚠️ Important Migration Note:** The Go buildpack does **NOT** support the Ruby buildpack's `repository_root` configuration approach for custom JREs (via `JBP_CONFIG_*` environment variables). Custom JREs now require forking the buildpack and modifying `manifest.yml`. See [Custom JRE Usage](docs/custom-jre-usage.md) for details.
130129

@@ -197,16 +196,6 @@ For historical analysis documents from development sessions, see [`docs/archive/
197196
* [GraalVM](docs/jre-graal_vm_jre.md) ([Configuration](docs/jre-graal_vm_jre.md#configuration))
198197
* [IBM Semeru](docs/jre-ibm_jre.md) ([Configuration](docs/jre-ibm_jre.md#configuration))
199198
* [Oracle](docs/jre-oracle_jre.md) ([Configuration](docs/jre-oracle_jre.md#configuration))
200-
* [Extending](docs/extending.md)
201-
* [Application](docs/extending-application.md)
202-
* [Droplet](docs/extending-droplet.md)
203-
* [BaseComponent](docs/extending-base_component.md)
204-
* [VersionedDependencyComponent](docs/extending-versioned_dependency_component.md)
205-
* [ModularComponent](docs/extending-modular_component.md)
206-
* [Caches](docs/extending-caches.md) ([Configuration](docs/extending-caches.md#configuration))
207-
* [Logging](docs/extending-logging.md) ([Configuration](docs/extending-logging.md#configuration))
208-
* [Repositories](docs/extending-repositories.md) ([Configuration](docs/extending-repositories.md#configuration))
209-
* [Utilities](docs/extending-utilities.md)
210199
* [Debugging the Buildpack](docs/debugging-the-buildpack.md)
211200
* [Buildpack Modes](docs/buildpack-modes.md)
212201
* Related Projects
@@ -320,6 +309,7 @@ $ ./scripts/unit.sh
320309
$ BUILDPACK_FILE="$(pwd)/build/buildpack.zip" \
321310
./scripts/integration.sh --platform docker --parallel true --github-token MYTOKEN
322311
```
312+
For detailed guidelines about setting up and running tests please check this [Testing Guide](docs/TESTING.md)
323313

324314
[Running Cloud Foundry locally][] is useful for privately testing new features.
325315

0 commit comments

Comments
 (0)