Skip to content

Commit b6ca722

Browse files
committed
feat: Add OpenWiki documentation and automation workflow
1 parent 7f42cb5 commit b6ca722

10 files changed

Lines changed: 377 additions & 6 deletions

File tree

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: OpenWiki Update
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: "0 8 * * *"
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
update:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Check out repository
17+
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
21+
with:
22+
node-version: "22"
23+
24+
- name: Install OpenWiki
25+
# mermaid + jsdom are optional; they add high-fidelity validation of Mermaid diagrams. Remove if your wiki has none.
26+
run: npm install --global openwiki@0.2.3 mermaid@11.16.0 jsdom@29.1.1
27+
28+
- name: Run OpenWiki
29+
run: openwiki code --update --print
30+
env:
31+
OPENWIKI_PROVIDER: openrouter
32+
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
33+
OPENWIKI_MODEL_ID: z-ai/glm-5.2
34+
LANGSMITH_API_KEY: ${{ secrets.LANGSMITH_API_KEY }}
35+
LANGCHAIN_PROJECT: openwiki
36+
LANGCHAIN_TRACING_V2: "true"
37+
38+
- name: Create OpenWiki update pull request
39+
uses: peter-evans/create-pull-request@22a9089034f40e5a961c8808d113e2c98fb63676 # v7
40+
with:
41+
add-paths: |
42+
openwiki
43+
AGENTS.md
44+
CLAUDE.md
45+
.github/workflows/openwiki-update.yml
46+
branch: openwiki/update
47+
commit-message: "docs: update OpenWiki"
48+
title: "docs: update OpenWiki"
49+
body: |
50+
Automated OpenWiki documentation update.
51+
52+
This PR was generated by the scheduled OpenWiki workflow.

AGENTS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!-- OPENWIKI:START -->
2+
3+
## OpenWiki
4+
5+
This repository uses OpenWiki for recurring code documentation. Start with `openwiki/quickstart.md`, then follow its links to architecture, workflows, domain concepts, operations, integrations, testing guidance, and source maps.
6+
7+
The scheduled OpenWiki GitHub Actions workflow refreshes the repository wiki. Do not hand-edit generated OpenWiki pages unless explicitly asked; prefer updating source code/docs and letting OpenWiki regenerate.
8+
9+
<!-- OPENWIKI:END -->

CLAUDE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<!-- OPENWIKI:START -->
2+
3+
## OpenWiki
4+
5+
This repository uses OpenWiki for recurring code documentation. Start with `openwiki/quickstart.md`, then follow its links to architecture, workflows, domain concepts, operations, integrations, testing guidance, and source maps.
6+
7+
The scheduled OpenWiki GitHub Actions workflow refreshes the repository wiki. Do not hand-edit generated OpenWiki pages unless explicitly asked; prefer updating source code/docs and letting OpenWiki regenerate.
8+
9+
<!-- OPENWIKI:END -->

README.md

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,28 @@
22

33
[![Docker image](https://github.com/SoftInstigate/graalvm-maven-docker/actions/workflows/deploy-image.yml/badge.svg)](https://github.com/SoftInstigate/graalvm-maven-docker/actions/workflows/deploy-image.yml)
44

5-
Minimal Docker image with [GraalVM](https://graalvm.org) + [Maven](https://maven.apache.org) installed via [SDKMAN!](https://sdkman.io). Use it to build JVM apps and GraalVM native images without installing toolchains locally.
5+
A minimal Docker image that packages [GraalVM](https://graalvm.org) and [Apache Maven](https://maven.apache.org) for building JVM applications and compiling GraalVM native images. No local toolchain setup required.
66

7-
Images are automatically published on Docker Hub and GHCR when a git tag is pushed.
7+
## Purpose
8+
9+
Building Java applications—especially GraalVM native images—requires a specific combination of JDK, build tools, and native libraries. Developers waste time installing and maintaining these toolchains across machines, CI runners, and team environments. This image solves that problem by providing a ready-to-use, versioned build environment.
10+
11+
### Why use this image?
12+
13+
- **Zero local setup** — Pull the image and start building. No JDK, Maven, or GraalVM installation needed.
14+
- **Reproducible builds** — Pin a tag (e.g. `25-graalce`) and every developer and CI job gets the exact same toolchain.
15+
- **Native image support** — Includes all dependencies (`build-essential`, `libz-dev`, `zlib1g-dev`) required by GraalVM's `native-image` compiler out of the box.
16+
- **Multi-arch** — Works on both `linux/amd64` and `linux/arm64` (Apple Silicon, Graviton, etc.).
17+
- **CI/CD ready** — Ideal for GitHub Actions, GitLab CI, Jenkins, or any container-based pipeline.
18+
19+
### When to use it
20+
21+
| Use case | Example |
22+
|---|---|
23+
| Build a Maven project without installing Java | `docker run --rm -v "$PWD":/opt/app softinstigate/graalvm-maven clean package` |
24+
| Compile a GraalVM native image | `docker run --rm -v "$PWD":/opt/app softinstigate/graalvm-maven -Pnative native:compile` |
25+
| Run builds in CI with consistent tooling | Use as a container image in your CI workflow |
26+
| Avoid version conflicts across projects | Different tags for different GraalVM/Maven versions |
827

928
## Current versions
1029

@@ -37,7 +56,13 @@ docker pull softinstigate/graalvm-maven:25-graalce
3756
docker pull ghcr.io/softinstigate/graalvm-maven:25-graalce
3857
```
3958

40-
## Quick start
59+
## How it works
60+
61+
The image is based on `debian:stable-slim` and uses [SDKMAN!](https://sdkman.io) to install GraalVM and Maven. This approach makes version upgrades simple—just change the `ARG` values in the `Dockerfile` and rebuild.
62+
63+
An entrypoint script (`bin/entrypoint.sh`) activates SDKMAN! and delegates to `mvn`, so the image behaves like a standalone Maven command.
64+
65+
## Building a project
4166

4267
The default `ENTRYPOINT` is `mvn`. The working directory is `/opt/app`.
4368

@@ -55,7 +80,7 @@ docker run -it --rm \
5580

5681
> Mounting `~/.m2` speeds up builds by reusing your local Maven cache.
5782
58-
## Native image builds
83+
## Compiling a native image
5984

6085
Use the [GraalVM Native Build Tools (Maven plugin)](https://graalvm.github.io/native-build-tools/latest/maven-plugin.html/) in your project. Then run:
6186

@@ -71,7 +96,9 @@ docker run -it --rm \
7196
-Pnative -DskipTests native:compile
7297
```
7398

74-
## Local development of this image
99+
## Contributing: local development
100+
101+
To build and test the image locally:
75102

76103
```bash
77104
# Build the image locally (no cache)
@@ -84,7 +111,7 @@ docker run -it --rm softinstigate/graalvm-maven --version
84111
./bin/push.sh
85112
```
86113

87-
## CI/CD and release process
114+
## Release process
88115

89116
- GitHub Actions workflow: `.github/workflows/deploy-image.yml`
90117
- Trigger: push of any git tag

openwiki/.last-update.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"updatedAt": "2026-08-07T10:53:53.654Z",
3+
"command": "update",
4+
"gitHead": "8c322f3a42477edce275e9d14b4ad13f7aa495fd",
5+
"model": "xiaomi/mimo-v2.5-pro"
6+
}

openwiki/INSTRUCTIONS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
A code wiki for this local repository. Prioritize a concise quickstart, architecture overview, source map, key workflows, domain concepts, operations/runbook notes, testing guidance, and integration points. Inspect git history to understand reasoning behind code changes and the progression of the repository. Keep pages grounded in the repository structure and recent code changes. Prefer practical navigation for engineers over generic summaries.

openwiki/ci-cd.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
type: Reference
3+
title: CI/CD and Release Process
4+
description: GitHub Actions workflow for building and publishing multi-arch Docker images to Docker Hub and GHCR, including release steps, secrets, and OpenWiki automation.
5+
tags: [ci-cd, github-actions, docker, release, openwiki]
6+
---
7+
8+
# CI/CD and Release Process
9+
10+
## Image deployment workflow
11+
12+
[`.github/workflows/deploy-image.yml`](/.github/workflows/deploy-image.yml) builds and publishes multi-arch Docker images automatically when any git tag is pushed.
13+
14+
### Trigger
15+
16+
```yaml
17+
on:
18+
push:
19+
tags:
20+
- "*"
21+
```
22+
23+
Pushing **any** tag triggers the build. There is no branch filter — the tag itself determines the image tag name.
24+
25+
### Build pipeline
26+
27+
```mermaid
28+
sequenceDiagram
29+
participant Dev as Developer
30+
participant GH as GitHub Actions
31+
participant Buildx as Docker Buildx (QEMU)
32+
participant Hub as Docker Hub
33+
participant GHCR as ghcr.io
34+
35+
Dev->>GH: push tag (e.g. 25-graalce)
36+
GH->>GH: checkout, setup QEMU + Buildx
37+
GH->>Hub: login (DOCKER_USER / DOCKER_TOKEN)
38+
GH->>GHCR: login (GITHUB_TOKEN)
39+
GH->>Buildx: build linux/amd64 + linux/arm64
40+
Buildx->>Hub: push :latest + :<tag>
41+
Buildx->>GHCR: push :latest + :<tag>
42+
```
43+
44+
### Output
45+
46+
Each build pushes to **both** registries with two tags:
47+
48+
| Tag pattern | Example |
49+
|-------------|---------|
50+
| `latest` | `softinstigate/graalvm-maven:latest` |
51+
| `<git-tag>` | `softinstigate/graalvm-maven:25-graalce` |
52+
53+
### Required secrets
54+
55+
| Secret | Used by | Purpose |
56+
|--------|---------|---------|
57+
| `DOCKER_USER` | Docker Hub login | Hub username |
58+
| `DOCKER_TOKEN` | Docker Hub login | Hub access token |
59+
| `GITHUB_TOKEN` | GHCR login | Automatic — no manual setup needed |
60+
61+
## Release process (maintainer steps)
62+
63+
1. Update `ARG JAVA_VERSION` and `ARG MAVEN_VERSION` in [`Dockerfile`](/Dockerfile).
64+
2. Update the version table in [`README.md`](/README.md) to match.
65+
3. Commit and push to `main`.
66+
4. Create and push a git tag matching the GraalVM version (e.g. `25-graalce`):
67+
```bash
68+
git tag 25-graalce
69+
git push origin 25-graalce
70+
```
71+
5. GitHub Actions builds and publishes the image automatically.
72+
73+
## OpenWiki automation
74+
75+
[`.github/workflows/openwiki-update.yml`](/.github/workflows/openwiki-update.yml) runs a scheduled OpenWiki documentation refresh:
76+
77+
- **Schedule:** daily at 08:00 UTC (`cron: "0 8 * * *"`)
78+
- **Trigger:** also available via `workflow_dispatch`
79+
- **Process:** checks out the repo, installs OpenWiki globally, runs `openwiki code --update --print`, then opens a PR on the `openwiki/update` branch with any documentation changes.
80+
- **PR scope:** changes under `openwiki/`, `AGENTS.md`, `CLAUDE.md`, and the workflow file itself.
81+
82+
The workflow uses OpenRouter as the LLM provider (configured via `OPENROUTER_API_KEY` secret).
83+
84+
## Relationship to Dockerfile
85+
86+
The CI workflow consumes the Dockerfile as-is — it does not override `ARG` values at build time. This means the version `ARG`s in the Dockerfile are the sole source of truth for what gets installed in the published image.

openwiki/dockerfile.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
type: Reference
3+
title: Dockerfile and Image Structure
4+
description: Layer-by-layer breakdown of the Dockerfile, SDKMAN configuration, ARG-controlled versions, entrypoint behavior, and build dependencies required for native-image compilation.
5+
tags: [dockerfile, sdkman, graalvm, build, entrypoint]
6+
---
7+
8+
# Dockerfile and Image Structure
9+
10+
The entire image is defined in a single [`Dockerfile`](/Dockerfile) at the repository root. It builds a Debian-based container with SDKMAN-managed Java and Maven toolchains.
11+
12+
## Base image and layers
13+
14+
```
15+
FROM debian:stable-slim
16+
```
17+
18+
The image uses `debian:stable-slim` for minimal footprint. Layers are organized as two `RUN` instructions:
19+
20+
1. **System dependencies + SDKMAN install** — installs OS packages, sets locale, fetches SDKMAN, and writes its config.
21+
2. **Java + Maven install** — sources SDKMAN and runs `sdk install` for both tools, then cleans up archive/temp files.
22+
23+
## Version control via ARGs
24+
25+
```dockerfile
26+
ARG JAVA_VERSION="25-graalce"
27+
ARG MAVEN_VERSION="3.9.11"
28+
```
29+
30+
These `ARG` directives are the single source of truth for installed tool versions. To upgrade GraalVM or Maven, change these values and update the README version table to match.
31+
32+
The image label and git tag convention reflect the GraalVM version (e.g. `25-graalce`).
33+
34+
## SDKMAN configuration
35+
36+
SDKMAN is configured in three lines written to `$SDKMAN_DIR/etc/config`:
37+
38+
| Setting | Value | Purpose |
39+
|---------|-------|---------|
40+
| `sdkman_auto_answer` | `true` | Non-interactive installs (no prompts) |
41+
| `sdkman_auto_selfupdate` | `false` | Prevents SDKMAN version drift at build time |
42+
| `sdkman_insecure_ssl` | `true` | Compatibility with some corporate proxy environments |
43+
44+
The SDKMAN directory is `/root/.sdkman` (set via `ENV SDKMAN_DIR`).
45+
46+
## System build packages
47+
48+
These packages are installed and **must not be removed** — they are required for GraalVM native-image compilation:
49+
50+
- `build-essential` — C/C++ compiler toolchain
51+
- `libz-dev`, `zlib1g-dev` — compression libraries needed by native-image
52+
- `ca-certificates` — TLS trust store
53+
- `fontconfig`, `locales` — locale and font support for JVM
54+
55+
## Entrypoint script
56+
57+
[`bin/entrypoint.sh`](/bin/entrypoint.sh) is a three-line shell script:
58+
59+
```bash
60+
#!/bin/bash
61+
source /root/.bashrc && mvn "$@"
62+
```
63+
64+
It sources `.bashrc` to activate the SDKMAN environment (which adds `mvn` and `java` to `PATH`), then forwards all container arguments to Maven. The `Dockerfile` sets `SHELL ["/bin/bash", "-i", "-c"]` and `ENTRYPOINT ["/root/entrypoint.sh"]`.
65+
66+
Without sourcing `.bashrc`, `mvn` would not be found when the container starts — this is the most common cause of "command not found" errors when users override the entrypoint with a shell.
67+
68+
## Helper scripts
69+
70+
| Script | Purpose |
71+
|--------|---------|
72+
| [`bin/build.sh`](/bin/build.sh) | Local no-cache Docker build, tags as `:latest` |
73+
| [`bin/push.sh`](/bin/push.sh) | Pushes `:latest` to Docker Hub (manual testing only) |
74+
75+
CI handles production image builds and pushes — see [CI/CD and release process](/openwiki/ci-cd.md).
76+
77+
## Relationship to CI/CD
78+
79+
The Dockerfile's `ARG` values and the README version table are the two places that must stay in sync during a release. The [CI/CD workflow](/openwiki/ci-cd.md) reads the Dockerfile as-is and publishes the resulting image under both `latest` and the git tag name.

openwiki/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
okf_version: "0.1"
3+
---
4+
5+
# Files
6+
7+
- [CI/CD and Release Process](ci-cd.md) - GitHub Actions workflow for building and publishing multi-arch Docker images to Docker Hub and GHCR, including release steps, secrets, and OpenWiki automation.
8+
- [Dockerfile and Image Structure](dockerfile.md) - Layer-by-layer breakdown of the Dockerfile, SDKMAN configuration, ARG-controlled versions, entrypoint behavior, and build dependencies required for native-image compilation.
9+
- [GraalVM Maven Docker — Quickstart](quickstart.md) - Minimal Docker image providing GraalVM and Maven via SDKMAN for building JVM apps and native images without local toolchains.

0 commit comments

Comments
 (0)