springdocker 1.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- springdocker-1.0.1/PKG-INFO +189 -0
- springdocker-1.0.1/README.md +139 -0
- springdocker-1.0.1/cli/README.md +174 -0
- springdocker-1.0.1/pyproject.toml +49 -0
- springdocker-1.0.1/setup.cfg +4 -0
- springdocker-1.0.1/src/springdocker/__init__.py +9 -0
- springdocker-1.0.1/src/springdocker/analyze.py +284 -0
- springdocker-1.0.1/src/springdocker/benchmarks/__init__.py +2 -0
- springdocker-1.0.1/src/springdocker/benchmarks/generate.py +104 -0
- springdocker-1.0.1/src/springdocker/benchmarks/runner.py +343 -0
- springdocker-1.0.1/src/springdocker/cli.py +289 -0
- springdocker-1.0.1/src/springdocker/commands.py +388 -0
- springdocker-1.0.1/src/springdocker/compare.py +138 -0
- springdocker-1.0.1/src/springdocker/config.py +365 -0
- springdocker-1.0.1/src/springdocker/dockerfile.py +332 -0
- springdocker-1.0.1/src/springdocker/errors.py +16 -0
- springdocker-1.0.1/src/springdocker/plugins.py +75 -0
- springdocker-1.0.1/src/springdocker/project_detect.py +256 -0
- springdocker-1.0.1/src/springdocker/regression.py +151 -0
- springdocker-1.0.1/src/springdocker/services/__init__.py +2 -0
- springdocker-1.0.1/src/springdocker/services/benchmark_service.py +124 -0
- springdocker-1.0.1/src/springdocker/services/dockerfile_service.py +76 -0
- springdocker-1.0.1/src/springdocker/services/project_service.py +37 -0
- springdocker-1.0.1/src/springdocker.egg-info/PKG-INFO +189 -0
- springdocker-1.0.1/src/springdocker.egg-info/SOURCES.txt +28 -0
- springdocker-1.0.1/src/springdocker.egg-info/dependency_links.txt +1 -0
- springdocker-1.0.1/src/springdocker.egg-info/entry_points.txt +2 -0
- springdocker-1.0.1/src/springdocker.egg-info/requires.txt +9 -0
- springdocker-1.0.1/src/springdocker.egg-info/top_level.txt +1 -0
- springdocker-1.0.1/tests/test_support.py +12 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: springdocker
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: CLI for Spring Boot Dockerfile and benchmark workflows (Maven/Gradle).
|
|
5
|
+
Author: springdocker contributors
|
|
6
|
+
License: UNLICENSED
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
Requires-Dist: tomli>=2.0; python_version < "3.11"
|
|
10
|
+
Provides-Extra: dev
|
|
11
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
12
|
+
Requires-Dist: pytest-cov>=5.0; extra == "dev"
|
|
13
|
+
Requires-Dist: ruff>=0.6.0; extra == "dev"
|
|
14
|
+
Requires-Dist: mypy>=1.10; extra == "dev"
|
|
15
|
+
|
|
16
|
+
# springdocker CLI
|
|
17
|
+
|
|
18
|
+
CLI for Spring Boot Dockerfile and benchmark workflows across Maven and Gradle projects.
|
|
19
|
+
|
|
20
|
+
## Install
|
|
21
|
+
|
|
22
|
+
### Local editable
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
python3 -m pip install -e .
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### pipx
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pipx install springdocker
|
|
32
|
+
springdocker --help
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Upgrade:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pipx upgrade springdocker
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### uv
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
uv tool install springdocker
|
|
45
|
+
uv tool upgrade springdocker
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Quick usage
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
springdocker init --project-root samples/java-spring-docker --build-tool maven --profile quick
|
|
52
|
+
springdocker doctor --project-root samples/java-spring-docker
|
|
53
|
+
springdocker inspect --project-root samples/java-spring-docker --format json
|
|
54
|
+
springdocker explain --project-root samples/java-spring-docker Dockerfile.generated --format json
|
|
55
|
+
springdocker benchmark compare --project-root samples/java-spring-docker benchmarks/03-custom-jre-jlink/results/raw.csv --baseline-variant with-jlink-runtime --format json
|
|
56
|
+
springdocker dockerfile generate --project-root samples/java-spring-docker --output Dockerfile.generated
|
|
57
|
+
springdocker benchmark generate --project-root samples/java-spring-docker --java-version 25
|
|
58
|
+
springdocker benchmark run --project-root samples/java-spring-docker --profile quick --runner-arg --skip-native
|
|
59
|
+
springdocker benchmark analyze --project-root samples/java-spring-docker benchmarks/04-jep483-aot-cache/results/raw.csv --format table
|
|
60
|
+
springdocker benchmark analyze --project-root samples/java-spring-docker benchmarks/04-jep483-aot-cache/results/raw.csv --format json --output benchmarks/04-jep483-aot-cache/results/summary.json
|
|
61
|
+
springdocker benchmark analyze --project-root samples/java-spring-docker benchmarks/04-jep483-aot-cache/results/raw.csv --fail-on-success-rate-below 95
|
|
62
|
+
springdocker benchmark analyze --project-root samples/java-spring-docker benchmarks/04-jep483-aot-cache/results/raw.csv --baseline benchmarks/04-jep483-aot-cache/results/baseline.json --fail-on-regression-above 20
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Config file (`.springdocker.toml`)
|
|
66
|
+
|
|
67
|
+
All command resolvers use precedence:
|
|
68
|
+
|
|
69
|
+
1. CLI flags
|
|
70
|
+
2. `.springdocker.toml`
|
|
71
|
+
3. defaults
|
|
72
|
+
|
|
73
|
+
Example:
|
|
74
|
+
|
|
75
|
+
```toml
|
|
76
|
+
[project]
|
|
77
|
+
build_tool = "maven"
|
|
78
|
+
|
|
79
|
+
[doctor]
|
|
80
|
+
build_tool = "maven"
|
|
81
|
+
|
|
82
|
+
[dockerfile]
|
|
83
|
+
output = "Dockerfile.generated"
|
|
84
|
+
java_version = 25
|
|
85
|
+
must_have_modules_file = "must-have.txt"
|
|
86
|
+
legacy_scripts = false
|
|
87
|
+
wizard_args = []
|
|
88
|
+
|
|
89
|
+
[benchmark.generate]
|
|
90
|
+
java_version = 25
|
|
91
|
+
legacy_scripts = false
|
|
92
|
+
|
|
93
|
+
[benchmark.run]
|
|
94
|
+
profile = "quick"
|
|
95
|
+
runner_args = ["--skip-native"]
|
|
96
|
+
cpuset_cpus = "0-1"
|
|
97
|
+
memory_limit = "2g"
|
|
98
|
+
warmup_runs = 1
|
|
99
|
+
max_workers = 1
|
|
100
|
+
normalized_runtime = true
|
|
101
|
+
legacy_scripts = false
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
When `dockerfile.must_have_modules_file` is set, springdocker reads modules from that file
|
|
105
|
+
(`must-have.txt` style, one module per line, `#` comments allowed) and injects them into
|
|
106
|
+
the jlink module list for reflection/dynamic-loading edge cases.
|
|
107
|
+
|
|
108
|
+
Create template config:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
springdocker init --project-root samples/java-spring-docker --build-tool gradle
|
|
112
|
+
springdocker init --project-root samples/java-spring-docker --build-tool gradle --profile full --print
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Legacy compatibility mode
|
|
116
|
+
|
|
117
|
+
Main command paths are internal and do not require project script files.
|
|
118
|
+
|
|
119
|
+
To force script wrappers for compatibility:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
springdocker dockerfile generate --use-legacy-scripts ...
|
|
123
|
+
springdocker benchmark generate --use-legacy-scripts ...
|
|
124
|
+
springdocker benchmark run --use-legacy-scripts ...
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
or set:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
export SPRINGDOCKER_LEGACY_SCRIPTS=1
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Inspect command
|
|
134
|
+
|
|
135
|
+
`springdocker inspect` prints static metadata about the target project:
|
|
136
|
+
|
|
137
|
+
- detected build tool
|
|
138
|
+
- Spring Boot version when present
|
|
139
|
+
- Java version when present
|
|
140
|
+
- direct dependency coordinates
|
|
141
|
+
- generated Dockerfile artifacts in the project root
|
|
142
|
+
- basic runtime compatibility guidance
|
|
143
|
+
|
|
144
|
+
Use `--format json` for machine-readable output.
|
|
145
|
+
|
|
146
|
+
## Explain command
|
|
147
|
+
|
|
148
|
+
`springdocker explain` reads a springdocker-generated Dockerfile and describes the optimizations it contains:
|
|
149
|
+
|
|
150
|
+
- multi-stage layout
|
|
151
|
+
- BuildKit cache usage
|
|
152
|
+
- jlink runtime stage
|
|
153
|
+
- non-root runtime
|
|
154
|
+
- tuned JVM flags
|
|
155
|
+
- curated must-have modules
|
|
156
|
+
|
|
157
|
+
Use `--format json` when you want stable structured output.
|
|
158
|
+
|
|
159
|
+
## Security hardening
|
|
160
|
+
|
|
161
|
+
See `docs/security-hardening.md` for the runtime hardening defaults and recommended `docker run` flags.
|
|
162
|
+
|
|
163
|
+
## Binary distribution
|
|
164
|
+
|
|
165
|
+
See `docs/distribution.md` for packaging notes and sample Homebrew, Scoop, standalone binary, and Docker runtime artifacts.
|
|
166
|
+
|
|
167
|
+
## Multi-architecture builds
|
|
168
|
+
|
|
169
|
+
See `docs/multiarch.md` for the Buildx-friendly Dockerfile output and example multi-arch build command.
|
|
170
|
+
|
|
171
|
+
## Compare command
|
|
172
|
+
|
|
173
|
+
`springdocker benchmark compare` compares each variant against a required baseline variant and reports deltas.
|
|
174
|
+
|
|
175
|
+
- `--baseline-variant` selects the variant to compare against.
|
|
176
|
+
- `--scenario` narrows the CSV to one scenario.
|
|
177
|
+
- `--format json` produces machine-readable deltas.
|
|
178
|
+
|
|
179
|
+
## Benchmark run reproducibility
|
|
180
|
+
|
|
181
|
+
`springdocker benchmark run` supports deterministic benchmark controls for local or CI runs:
|
|
182
|
+
|
|
183
|
+
- `--cpuset-cpus` pins benchmark containers to specific CPUs.
|
|
184
|
+
- `--memory` caps container memory.
|
|
185
|
+
- `--warmup-runs` executes discarded warmup probes before recording results.
|
|
186
|
+
- `--max-workers` runs standard scenarios concurrently with controlled worker count.
|
|
187
|
+
- `--normalized-runtime` applies read-only, no-new-privileges, and tmpfs isolation.
|
|
188
|
+
|
|
189
|
+
These settings can also come from `[benchmark.run]` in `.springdocker.toml`.
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
# springdocker
|
|
2
|
+
|
|
3
|
+
[](https://github.com/mnafshin/java-spring-docker/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/mnafshin/java-spring-docker/actions/workflows/release.yml)
|
|
5
|
+
[](https://github.com/astral-sh/ruff)
|
|
6
|
+
[](./pyproject.toml)
|
|
7
|
+
[](./docs/benchmark-methodology.md)
|
|
8
|
+
|
|
9
|
+
Developer toolkit for Spring Boot containerization and benchmark-driven JVM tuning.
|
|
10
|
+
|
|
11
|
+
`springdocker` is a Python CLI that helps you inspect a Spring Boot project, generate a Dockerfile, create benchmark assets, run benchmark suites, and summarize benchmark results.
|
|
12
|
+
|
|
13
|
+
## Architecture
|
|
14
|
+
|
|
15
|
+
```mermaid
|
|
16
|
+
flowchart LR
|
|
17
|
+
dev[Developer] --> cli[springdocker CLI]
|
|
18
|
+
cli --> cfg[.springdocker.toml]
|
|
19
|
+
cli --> proj[Spring Boot project]
|
|
20
|
+
cli --> df[Generated Dockerfile]
|
|
21
|
+
cli --> bench[Benchmark variants + raw CSV]
|
|
22
|
+
bench --> report[Table / JSON analysis]
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
See `docs/architecture.md` for the detailed module map and command lifecycle.
|
|
26
|
+
|
|
27
|
+
The repo is split into three main surfaces:
|
|
28
|
+
|
|
29
|
+
- `src/springdocker/` - installable CLI package and core implementation.
|
|
30
|
+
- `samples/java-spring-docker/` - sample Spring Boot project used by the CLI and benchmark assets.
|
|
31
|
+
- `cli/README.md` - command reference and configuration details.
|
|
32
|
+
|
|
33
|
+
## What it does
|
|
34
|
+
|
|
35
|
+
- Detects Maven or Gradle projects.
|
|
36
|
+
- Writes a starter `.springdocker.toml` config.
|
|
37
|
+
- Generates optimized Dockerfiles for the sample workflow.
|
|
38
|
+
- Creates benchmark variants and runs benchmark suites.
|
|
39
|
+
- Summarizes benchmark CSV output as a table or JSON.
|
|
40
|
+
|
|
41
|
+
## Quick start
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
cd /path/to/your-repo
|
|
45
|
+
python3 -m venv .venv
|
|
46
|
+
. .venv/bin/activate
|
|
47
|
+
python3 -m pip install -e .
|
|
48
|
+
|
|
49
|
+
springdocker doctor --project-root samples/java-spring-docker
|
|
50
|
+
springdocker inspect --project-root samples/java-spring-docker --format json
|
|
51
|
+
springdocker explain --project-root samples/java-spring-docker Dockerfile.generated --format json
|
|
52
|
+
springdocker benchmark compare --project-root samples/java-spring-docker samples/java-spring-docker/benchmarks/03-custom-jre-jlink/results/raw.csv --baseline-variant with-jlink-runtime
|
|
53
|
+
springdocker init --project-root samples/java-spring-docker --build-tool maven
|
|
54
|
+
springdocker dockerfile generate --project-root samples/java-spring-docker --output Dockerfile.generated
|
|
55
|
+
springdocker benchmark generate --project-root samples/java-spring-docker --java-version 25
|
|
56
|
+
springdocker benchmark run --project-root samples/java-spring-docker --profile quick
|
|
57
|
+
springdocker benchmark analyze --project-root samples/java-spring-docker samples/java-spring-docker/benchmarks/04-custom-jre-jlink/results/raw.csv
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## CLI workflow
|
|
61
|
+
|
|
62
|
+
1. `doctor` checks the project root and build tool.
|
|
63
|
+
2. `init` writes a starter config file.
|
|
64
|
+
3. `dockerfile generate` writes a Dockerfile to the requested path.
|
|
65
|
+
4. `benchmark generate` creates benchmark scenarios.
|
|
66
|
+
5. `benchmark run` executes the benchmark runner.
|
|
67
|
+
6. `benchmark analyze` turns `raw.csv` into a table or JSON summary.
|
|
68
|
+
|
|
69
|
+
See `cli/README.md` for the command reference and config precedence rules.
|
|
70
|
+
|
|
71
|
+
## Benchmark methodology
|
|
72
|
+
|
|
73
|
+
See `docs/benchmark-methodology.md` for the benchmark model, run profiles, and summary calculations.
|
|
74
|
+
|
|
75
|
+
The sample project keeps benchmark scenarios under `samples/java-spring-docker/benchmarks/`.
|
|
76
|
+
Each scenario stores generated Dockerfiles and a `results/raw.csv` file so the output stays reproducible and easy to compare.
|
|
77
|
+
|
|
78
|
+
Current reports focus on:
|
|
79
|
+
|
|
80
|
+
- image size
|
|
81
|
+
- build duration
|
|
82
|
+
- startup latency
|
|
83
|
+
- success rate
|
|
84
|
+
|
|
85
|
+
Benchmark summaries can be rendered as:
|
|
86
|
+
|
|
87
|
+
- terminal tables
|
|
88
|
+
- JSON
|
|
89
|
+
|
|
90
|
+
## Supported stack
|
|
91
|
+
|
|
92
|
+
This repository currently targets:
|
|
93
|
+
|
|
94
|
+
- Python 3.10+ for the CLI
|
|
95
|
+
- Maven or Gradle Spring Boot projects
|
|
96
|
+
- Spring Boot 4.0.1 sample project
|
|
97
|
+
- Java 25 sample configuration
|
|
98
|
+
|
|
99
|
+
## Project docs
|
|
100
|
+
|
|
101
|
+
- `docs/architecture.md`
|
|
102
|
+
- `docs/benchmark-methodology.md`
|
|
103
|
+
- `docs/benchmark-comparison.md`
|
|
104
|
+
- `docs/example-gallery.md`
|
|
105
|
+
- `docs/golden-samples.md`
|
|
106
|
+
- `docs/benchmark-dashboard.md`
|
|
107
|
+
- `docs/extensions.md`
|
|
108
|
+
- `docs/native-image-roadmap.md`
|
|
109
|
+
- `docs/distribution.md`
|
|
110
|
+
- `docs/compatibility-matrix.md`
|
|
111
|
+
- `docs/security-hardening.md`
|
|
112
|
+
- `docs/observability.md`
|
|
113
|
+
- `docs/kubernetes.md`
|
|
114
|
+
- `docs/adr/README.md`
|
|
115
|
+
- `docs/multiarch.md`
|
|
116
|
+
- `docs/onboarding.md`
|
|
117
|
+
- `docs/jvm-optimization.md`
|
|
118
|
+
- `ROADMAP.md`
|
|
119
|
+
- `SECURITY.md`
|
|
120
|
+
- `CONTRIBUTING.md`
|
|
121
|
+
|
|
122
|
+
## Comparison with adjacent tools
|
|
123
|
+
|
|
124
|
+
| Tool | Focus | What springdocker adds |
|
|
125
|
+
|---|---|---|
|
|
126
|
+
| Jib | Dockerless image build | benchmark-aware Dockerfile and runtime tuning workflows |
|
|
127
|
+
| Buildpacks | Opinionated platform build | explicit Dockerfile generation and benchmark artifacts |
|
|
128
|
+
| Manual Dockerfiles | Full control | project detection, config, and repeatable benchmark analysis |
|
|
129
|
+
|
|
130
|
+
## Sample project docs
|
|
131
|
+
|
|
132
|
+
- `samples/java-spring-docker/README.md`
|
|
133
|
+
- `samples/java-spring-docker/HELP.md`
|
|
134
|
+
- `samples/java-spring-docker/k8s/kustomization.yaml`
|
|
135
|
+
- `samples/java-spring-docker/tools/README.md`
|
|
136
|
+
|
|
137
|
+
## Contributing
|
|
138
|
+
|
|
139
|
+
The main package is under `src/springdocker/`. Run `pytest`, `ruff check src tests`, and `mypy src` before pushing changes.
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
# springdocker CLI
|
|
2
|
+
|
|
3
|
+
CLI for Spring Boot Dockerfile and benchmark workflows across Maven and Gradle projects.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
### Local editable
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
python3 -m pip install -e .
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
### pipx
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pipx install springdocker
|
|
17
|
+
springdocker --help
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Upgrade:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pipx upgrade springdocker
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### uv
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
uv tool install springdocker
|
|
30
|
+
uv tool upgrade springdocker
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Quick usage
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
springdocker init --project-root samples/java-spring-docker --build-tool maven --profile quick
|
|
37
|
+
springdocker doctor --project-root samples/java-spring-docker
|
|
38
|
+
springdocker inspect --project-root samples/java-spring-docker --format json
|
|
39
|
+
springdocker explain --project-root samples/java-spring-docker Dockerfile.generated --format json
|
|
40
|
+
springdocker benchmark compare --project-root samples/java-spring-docker benchmarks/03-custom-jre-jlink/results/raw.csv --baseline-variant with-jlink-runtime --format json
|
|
41
|
+
springdocker dockerfile generate --project-root samples/java-spring-docker --output Dockerfile.generated
|
|
42
|
+
springdocker benchmark generate --project-root samples/java-spring-docker --java-version 25
|
|
43
|
+
springdocker benchmark run --project-root samples/java-spring-docker --profile quick --runner-arg --skip-native
|
|
44
|
+
springdocker benchmark analyze --project-root samples/java-spring-docker benchmarks/04-jep483-aot-cache/results/raw.csv --format table
|
|
45
|
+
springdocker benchmark analyze --project-root samples/java-spring-docker benchmarks/04-jep483-aot-cache/results/raw.csv --format json --output benchmarks/04-jep483-aot-cache/results/summary.json
|
|
46
|
+
springdocker benchmark analyze --project-root samples/java-spring-docker benchmarks/04-jep483-aot-cache/results/raw.csv --fail-on-success-rate-below 95
|
|
47
|
+
springdocker benchmark analyze --project-root samples/java-spring-docker benchmarks/04-jep483-aot-cache/results/raw.csv --baseline benchmarks/04-jep483-aot-cache/results/baseline.json --fail-on-regression-above 20
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Config file (`.springdocker.toml`)
|
|
51
|
+
|
|
52
|
+
All command resolvers use precedence:
|
|
53
|
+
|
|
54
|
+
1. CLI flags
|
|
55
|
+
2. `.springdocker.toml`
|
|
56
|
+
3. defaults
|
|
57
|
+
|
|
58
|
+
Example:
|
|
59
|
+
|
|
60
|
+
```toml
|
|
61
|
+
[project]
|
|
62
|
+
build_tool = "maven"
|
|
63
|
+
|
|
64
|
+
[doctor]
|
|
65
|
+
build_tool = "maven"
|
|
66
|
+
|
|
67
|
+
[dockerfile]
|
|
68
|
+
output = "Dockerfile.generated"
|
|
69
|
+
java_version = 25
|
|
70
|
+
must_have_modules_file = "must-have.txt"
|
|
71
|
+
legacy_scripts = false
|
|
72
|
+
wizard_args = []
|
|
73
|
+
|
|
74
|
+
[benchmark.generate]
|
|
75
|
+
java_version = 25
|
|
76
|
+
legacy_scripts = false
|
|
77
|
+
|
|
78
|
+
[benchmark.run]
|
|
79
|
+
profile = "quick"
|
|
80
|
+
runner_args = ["--skip-native"]
|
|
81
|
+
cpuset_cpus = "0-1"
|
|
82
|
+
memory_limit = "2g"
|
|
83
|
+
warmup_runs = 1
|
|
84
|
+
max_workers = 1
|
|
85
|
+
normalized_runtime = true
|
|
86
|
+
legacy_scripts = false
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
When `dockerfile.must_have_modules_file` is set, springdocker reads modules from that file
|
|
90
|
+
(`must-have.txt` style, one module per line, `#` comments allowed) and injects them into
|
|
91
|
+
the jlink module list for reflection/dynamic-loading edge cases.
|
|
92
|
+
|
|
93
|
+
Create template config:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
springdocker init --project-root samples/java-spring-docker --build-tool gradle
|
|
97
|
+
springdocker init --project-root samples/java-spring-docker --build-tool gradle --profile full --print
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Legacy compatibility mode
|
|
101
|
+
|
|
102
|
+
Main command paths are internal and do not require project script files.
|
|
103
|
+
|
|
104
|
+
To force script wrappers for compatibility:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
springdocker dockerfile generate --use-legacy-scripts ...
|
|
108
|
+
springdocker benchmark generate --use-legacy-scripts ...
|
|
109
|
+
springdocker benchmark run --use-legacy-scripts ...
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
or set:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
export SPRINGDOCKER_LEGACY_SCRIPTS=1
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
## Inspect command
|
|
119
|
+
|
|
120
|
+
`springdocker inspect` prints static metadata about the target project:
|
|
121
|
+
|
|
122
|
+
- detected build tool
|
|
123
|
+
- Spring Boot version when present
|
|
124
|
+
- Java version when present
|
|
125
|
+
- direct dependency coordinates
|
|
126
|
+
- generated Dockerfile artifacts in the project root
|
|
127
|
+
- basic runtime compatibility guidance
|
|
128
|
+
|
|
129
|
+
Use `--format json` for machine-readable output.
|
|
130
|
+
|
|
131
|
+
## Explain command
|
|
132
|
+
|
|
133
|
+
`springdocker explain` reads a springdocker-generated Dockerfile and describes the optimizations it contains:
|
|
134
|
+
|
|
135
|
+
- multi-stage layout
|
|
136
|
+
- BuildKit cache usage
|
|
137
|
+
- jlink runtime stage
|
|
138
|
+
- non-root runtime
|
|
139
|
+
- tuned JVM flags
|
|
140
|
+
- curated must-have modules
|
|
141
|
+
|
|
142
|
+
Use `--format json` when you want stable structured output.
|
|
143
|
+
|
|
144
|
+
## Security hardening
|
|
145
|
+
|
|
146
|
+
See `docs/security-hardening.md` for the runtime hardening defaults and recommended `docker run` flags.
|
|
147
|
+
|
|
148
|
+
## Binary distribution
|
|
149
|
+
|
|
150
|
+
See `docs/distribution.md` for packaging notes and sample Homebrew, Scoop, standalone binary, and Docker runtime artifacts.
|
|
151
|
+
|
|
152
|
+
## Multi-architecture builds
|
|
153
|
+
|
|
154
|
+
See `docs/multiarch.md` for the Buildx-friendly Dockerfile output and example multi-arch build command.
|
|
155
|
+
|
|
156
|
+
## Compare command
|
|
157
|
+
|
|
158
|
+
`springdocker benchmark compare` compares each variant against a required baseline variant and reports deltas.
|
|
159
|
+
|
|
160
|
+
- `--baseline-variant` selects the variant to compare against.
|
|
161
|
+
- `--scenario` narrows the CSV to one scenario.
|
|
162
|
+
- `--format json` produces machine-readable deltas.
|
|
163
|
+
|
|
164
|
+
## Benchmark run reproducibility
|
|
165
|
+
|
|
166
|
+
`springdocker benchmark run` supports deterministic benchmark controls for local or CI runs:
|
|
167
|
+
|
|
168
|
+
- `--cpuset-cpus` pins benchmark containers to specific CPUs.
|
|
169
|
+
- `--memory` caps container memory.
|
|
170
|
+
- `--warmup-runs` executes discarded warmup probes before recording results.
|
|
171
|
+
- `--max-workers` runs standard scenarios concurrently with controlled worker count.
|
|
172
|
+
- `--normalized-runtime` applies read-only, no-new-privileges, and tmpfs isolation.
|
|
173
|
+
|
|
174
|
+
These settings can also come from `[benchmark.run]` in `.springdocker.toml`.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "springdocker"
|
|
7
|
+
version = "1.0.1"
|
|
8
|
+
description = "CLI for Spring Boot Dockerfile and benchmark workflows (Maven/Gradle)."
|
|
9
|
+
readme = "cli/README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
dependencies = [
|
|
12
|
+
"tomli>=2.0; python_version < '3.11'"
|
|
13
|
+
]
|
|
14
|
+
optional-dependencies = { dev = ["pytest>=8.0", "pytest-cov>=5.0", "ruff>=0.6.0", "mypy>=1.10"] }
|
|
15
|
+
authors = [
|
|
16
|
+
{ name = "springdocker contributors" }
|
|
17
|
+
]
|
|
18
|
+
license = { text = "UNLICENSED" }
|
|
19
|
+
|
|
20
|
+
[project.scripts]
|
|
21
|
+
springdocker = "springdocker.cli:main"
|
|
22
|
+
|
|
23
|
+
[tool.setuptools]
|
|
24
|
+
package-dir = {"" = "src"}
|
|
25
|
+
|
|
26
|
+
[tool.setuptools.packages.find]
|
|
27
|
+
where = ["src"]
|
|
28
|
+
|
|
29
|
+
[tool.pytest.ini_options]
|
|
30
|
+
testpaths = ["tests"]
|
|
31
|
+
pythonpath = [".", "src"]
|
|
32
|
+
addopts = "-q --cov=springdocker --cov-report=term-missing --cov-fail-under=75"
|
|
33
|
+
|
|
34
|
+
[tool.ruff]
|
|
35
|
+
line-length = 120
|
|
36
|
+
target-version = "py310"
|
|
37
|
+
src = ["src", "tests"]
|
|
38
|
+
|
|
39
|
+
[tool.ruff.lint]
|
|
40
|
+
select = ["F", "I"]
|
|
41
|
+
|
|
42
|
+
[tool.mypy]
|
|
43
|
+
python_version = "3.10"
|
|
44
|
+
files = ["src"]
|
|
45
|
+
pretty = true
|
|
46
|
+
show_error_codes = true
|
|
47
|
+
warn_unused_ignores = true
|
|
48
|
+
no_implicit_optional = true
|
|
49
|
+
ignore_missing_imports = true
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"""springdocker CLI package."""
|
|
2
|
+
|
|
3
|
+
from importlib.metadata import PackageNotFoundError, version
|
|
4
|
+
|
|
5
|
+
__all__ = ["__version__"]
|
|
6
|
+
try:
|
|
7
|
+
__version__ = version("springdocker")
|
|
8
|
+
except PackageNotFoundError: # pragma: no cover - local source tree fallback
|
|
9
|
+
__version__ = "0.1.0"
|