Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Make/Build.sh → Make/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ set -euo pipefail
# docker exec --interactive --tty [containername] /bin/bash

## Usage:
# Create.sh : Update Version.json and Matrix.json and create Dockerfiles.
# PUSH_BASE_IMAGES=true ./Build.sh : Build docker images from Dockerfiles and push base images.
# Test.sh : Create and build and launch compose Test.yml compose stack.
# Clean.sh : Shutdown compose stack and delete images.
# ./create.sh : Update Version.json and Matrix.json and create Dockerfiles.
# PUSH_BASE_IMAGES=true ./build.sh : Build docker images from Dockerfiles and push base images.
# ./test.sh : Create and build and launch compose Test.yml compose stack.
# ./clean.sh : Shutdown compose stack and delete images.

# Build Dockerfile
function BuildDockerfile {
Expand Down
2 changes: 1 addition & 1 deletion Make/Clean.sh → Make/clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function DeleteImage {
}

# Down stack
./Down.sh
./down.sh

# Delete images
DeleteImage "NxGo"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion Make/Down.sh → Make/down.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ set -euo pipefail
# Stop stack and cleanup volumes
docker compose --file Test.yml down --volumes

echo "Run 'Clean.sh' to delete images"
echo "Run 'clean.sh' to delete images"
File renamed without changes.
6 changes: 3 additions & 3 deletions Make/Test.sh → Make/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
set -euo pipefail

# Create Dockerfiles
./Create.sh
./create.sh

# Build Dockerfiles
./Build.sh
./build.sh

# Launch compose stack
./Up.sh
./up.sh
4 changes: 2 additions & 2 deletions Make/Up-develop.sh → Make/up-develop.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ set -euo pipefail
docker compose --file Test-develop.yml up --detach

# Instructions
./Instructions.sh
./instructions.sh

echo "Run 'Down-develop.sh' to stop stack"
echo "Run 'down-develop.sh' to stop stack"
4 changes: 2 additions & 2 deletions Make/Up-latest.sh → Make/up-latest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ set -euo pipefail
docker compose --file Test-latest.yml up --detach

# Instructions
./Instructions.sh
./instructions.sh

echo "Run 'Down-latest.sh' to stop stack"
echo "Run 'down-latest.sh' to stop stack"
4 changes: 2 additions & 2 deletions Make/Up.sh → Make/up.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ set -euo pipefail
docker compose --file Test.yml up --detach

# Instructions
./Instructions.sh
./instructions.sh

echo "Run 'Down.sh' to stop stack"
echo "Run 'down.sh' to stop stack"
20 changes: 10 additions & 10 deletions OPERATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Verifying a change here is two things: running the gates, and then running by ha

The gates are the .NET clean-compile (the `.NET Format` VS Code task, per [CODESTYLE.md](./CODESTYLE.md)), the unit tests, and the document linters. `GOVERNANCE.md` "Running the Linters Locally (Known-Working Invocations)", a hub-only section read in a hub checkout rather than carried here, carries the known-working invocation of each linter, and CI runs the same set in the hub's `validate-task.yml`, so a local lint run buys an earlier failure rather than a different one. **Linting is not editor-only here**: `validate-task.yml` runs markdownlint, CSpell, `actionlint`, `editorconfig-checker`, `shellcheck`, `shfmt`, the composite-action schema check, and the hub's repo gates alongside `dotnet csharpier check`, `dotnet format style`, and `dotnet test`, all inside the required check.

**What CI structurally cannot exercise is the product image matrix.** The pull-request pipeline builds a deliberate smoke subset: NxMeta and NxMeta-LSIO, amd64 only, never pushed, and only when `Docker/**`, `Make/Matrix.json`, `Make/Version.json`, a Docker hook, or a workflow changed. Eight of the ten product images, the arm64 leg of every image, the base image push path, and a container that actually starts and serves its web UI are all unbuilt at merge time. The publish run is the first thing that builds them, and a workflow edit reaches only the same smoke subset. So a change to a Dockerfile, a build arg, a base image, or the generated matrix is verified locally by running `./Create.sh` and `./Build.sh` from inside `Make/`, which build every product image for both `linux/amd64` and `linux/arm64`, and, when the change can affect a running server, `./Test.sh` followed by `./Instructions.sh` there to reach each product's web UI. Reading a green pipeline as coverage of the full matrix is the mistake this section exists to name.
**What CI structurally cannot exercise is the product image matrix.** The pull-request pipeline builds a deliberate smoke subset. That is NxMeta and NxMeta-LSIO, amd64 only and never pushed. It runs only when `Docker/**`, `Make/Matrix.json`, `Make/Version.json`, a Docker hook, or a workflow changed. Several things go unbuilt at merge time. Those are eight of the ten product images, the arm64 leg of every image, and the base image push path. Nor does anything at merge time start a container that serves its web UI. The publish run is the first thing that builds them, and a workflow edit reaches only the same smoke subset. So verify a change to a Dockerfile, a build arg, a base image, or the generated matrix locally. Run `./create.sh` and `./build.sh` from inside `Make/`, which build every product image for both `linux/amd64` and `linux/arm64`. Where the change can affect a running server, also run `./test.sh` there, then `./instructions.sh` to reach each product's web UI. Reading a green pipeline as coverage of the full matrix is the mistake this section exists to name.

## Runbooks

Expand All @@ -22,30 +22,30 @@ dotnet run --project ./CreateMatrix/CreateMatrix.csproj -- matrix --versionpath=
dotnet run --project ./CreateMatrix/CreateMatrix.csproj -- make --versionpath=./Make/Version.json --makedirectory=./Make --dockerdirectory=./Docker
```

`version`, `matrix` and `make` are subcommands of the `CreateMatrix` executable rather than programs on `PATH`, so they are reached through `dotnet run` from the repository root. `make` in particular is not the system `make`. `--versionlabel` is left off so this matches what `Make/Create.sh` runs, which takes the `Latest` default; passing a different label selects different product versions and so generates different Dockerfiles.
`version`, `matrix` and `make` are subcommands of the `CreateMatrix` executable rather than programs on `PATH`, so they are reached through `dotnet run` from the repository root. `make` in particular is not the system `make`. `--versionlabel` is left off so this matches what `Make/create.sh` runs, which takes the `Latest` default. Passing a different label selects different product versions, and so generates different Dockerfiles.

`Docker/` and the Compose files in `Make/` are generated output, so a change to the generator is committed together with its regenerated output.

### Build and Run the Images Locally

The scripts in `Make/` wrap the generator and the Docker build, and each is run from inside `Make/`:

- `Create.sh` updates `Version.json` and `Matrix.json` and writes the Dockerfiles.
- `Build.sh` builds the base images and every product image for `linux/amd64` and `linux/arm64`, and loads the amd64 targets. Setting `PUSH_BASE_IMAGES=true` pushes the base images, which needs a Docker Hub login.
- `Test.sh` runs `Create.sh`, then `Build.sh`, then `Up.sh`.
- `Up.sh`, `Up-latest.sh`, and `Up-develop.sh` bring up the locally built (`Test.yml`), released, and develop Compose stacks. `Down.sh`, `Down-latest.sh`, and `Down-develop.sh` bring the matching stack back down.
- `Instructions.sh` prints the web UI URL of each product in the running stack.
- `Clean.sh` shuts the stack down and deletes the images.
- `create.sh` updates `Version.json` and `Matrix.json` and writes the Dockerfiles.
- `build.sh` builds the base images and every product image for `linux/amd64` and `linux/arm64`, and loads the amd64 targets. Setting `PUSH_BASE_IMAGES=true` pushes the base images, which needs a Docker Hub login.
- `test.sh` runs `create.sh`, then `build.sh`, then `up.sh`.
- `up.sh`, `up-latest.sh`, and `up-develop.sh` bring up the locally built (`Test.yml`), released, and develop Compose stacks. `down.sh`, `down-latest.sh`, and `down-develop.sh` bring the matching stack back down.
- `instructions.sh` prints the web UI URL of each product in the running stack.
- `clean.sh` shuts the stack down and deletes the images.

## Backup and Recovery

There is no state to back up. The repository is the record and GitHub holds it, every published image is rebuilt from the pinned inputs in `Make/Matrix.json` and `Make/Version.json`, and a local Compose stack is disposable by design, since `Clean.sh` deletes it outright. Recovering a published image means re-running the publisher against the commit that carries that pin, not restoring anything.
There is no state to back up. The repository is the record and GitHub holds it. Every published image is rebuilt from the pinned inputs in `Make/Matrix.json` and `Make/Version.json`. A local Compose stack is disposable by design, since `clean.sh` deletes it outright. Recovering a published image means re-running the publisher against the commit that carries that pin, not restoring anything.

## Logs and Debugging

Workflow runs are the log for anything that happened in CI or in a publish. `gh run list --branch <branch>` and `gh run view <id> --log-failed` reach them. A gate failure reproduces locally, because CI runs the same commands against the same committed configuration, so reproduce it locally before reading workflow logs.

A failure that appears only in a built image needs a running container instead. Bring the stack up with `./Up.sh` from inside `Make/`, find the product's web UI with `./Instructions.sh` there, read `docker logs <container>`, and attach a shell with `docker exec --interactive --tty <container> /bin/bash`. The mediaserver's own logging is a product setting rather than a container one: set `logLevel=verbose` in `mediaserver.conf`, restart the server, and read `/config/var/log/log_file.log` inside the container.
A failure that appears only in a built image needs a running container instead. Bring the stack up with `./up.sh` from inside `Make/`, and find the product's web UI with `./instructions.sh` there. Then read `docker logs <container>`, and attach a shell with `docker exec --interactive --tty <container> /bin/bash`. The mediaserver's own logging is a product setting rather than a container one. Set `logLevel=verbose` in `mediaserver.conf`, restart the server, and read `/config/var/log/log_file.log` inside the container.

## Tool Usage

Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,12 @@ services:

**Local testing**:

- Run `cd ./Make` and [`./Test.sh`][test-sh], the following will be executed:
- [`Create.sh`][create-sh]: Creates the Dockerfiles and updates the latest version information using `CreateMatrix`.
- [`Build.sh`][build-sh]: Builds the Dockerfiles using `docker buildx build`.
- [`Up.sh`][up-sh]: Launch a Docker Compose stack [`Test.yml`][test-yml] to run all product variants.
- Run `cd ./Make` and [`./test.sh`][test-sh], the following will be executed:
- [`create.sh`][create-sh]: Creates the Dockerfiles and updates the latest version information using `CreateMatrix`.
- [`build.sh`][build-sh]: Builds the Dockerfiles using `docker buildx build`.
- [`up.sh`][up-sh]: Launch a Docker Compose stack [`Test.yml`][test-yml] to run all product variants.
- Ctrl-Click on the links to launch the web UI for each of the product variants.
- Run [`Clean.sh`][clean-sh] to shutdown the compose stack and cleanup images.
- Run [`clean.sh`][clean-sh] to shutdown the compose stack and cleanup images.

## Known Issues

Expand Down Expand Up @@ -747,20 +747,20 @@ Licensed under the [MIT License][license]\

<!-- Repo -->

[build-sh]: ./Make/Build.sh
[clean-sh]: ./Make/Clean.sh
[build-sh]: ./Make/build.sh
[clean-sh]: ./Make/clean.sh
[create-matrix]: ./CreateMatrix/
[create-sh]: ./Make/Create.sh
[create-sh]: ./Make/create.sh
[history]: ./HISTORY.md
[init-nx-relocate]: ./Docker/s6-overlay/s6-rc.d/init-nx-relocate/run
[license]: ./LICENSE
[matrix-json]: ./Make/Matrix.json
[publish-release-workflow]: ./.github/workflows/publish-release.yml
[test-pull-request-workflow]: ./.github/workflows/test-pull-request.yml
[test-sh]: ./Make/Test.sh
[test-sh]: ./Make/test.sh
[test-yml]: ./Make/Test.yml
[unraid]: ./Unraid
[up-sh]: ./Make/Up.sh
[up-sh]: ./Make/up.sh
[version-json]: ./Make/Version.json

<!-- External -->
Expand Down
10 changes: 5 additions & 5 deletions WORKFLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -509,11 +509,11 @@ Each is a **MUST**, stated as input -> output plus the failure it prevents.
- **D8.2 Dependabot auto-merges on green.** Output: every Dependabot PR, any ecosystem and any tier,
auto-merges once the required checks pass. A failing check blocks the merge. A merged dependency bump does **not** itself publish (it ships in the next scheduled run
or the next matrix-pin push).
- **D8.3 Codegen dual-targets `main` AND `develop`.** Output: the daily codegen matrix (the hub's
`run-codegen-pull-request-task.yml`, running the `codegen` hook) opens a
`codegen-main` -> `main` and a `codegen-develop` -> `develop` PR (strict head/base pairing in the merge-bot),
regenerating `Make/Version.json` + `Make/Matrix.json` **only** (not the Dockerfiles - those are a separate
human-driven `Make/Create.sh` path). The merge-bot auto-merges each independently. develop's matrix update
- **D8.3 Codegen dual-targets `main` AND `develop`.** Output: the daily codegen matrix runs the hub's
`run-codegen-pull-request-task.yml` with the `codegen` hook. It opens a `codegen-main` -> `main` and a
`codegen-develop` -> `develop` PR, with strict head/base pairing in the merge-bot. Each regenerates
`Make/Version.json` + `Make/Matrix.json` **only**. The Dockerfiles are a separate,
human-driven `Make/create.sh` path. The merge-bot auto-merges each independently. develop's matrix update
is sync-only; a merged `codegen-main` matrix change fires the publisher's pin push. *Prevents non-linear
rebase/merge-block conflicts (the rejected single-target scheme) and keeps both branches current with
upstream Nx versions.*
Expand Down
Loading