Commit 2e8c3d83 authored by Christos Tranoris's avatar Christos Tranoris
Browse files

dockerfile

parent 872a5998
Loading
Loading
Loading
Loading
Loading
+13
Changes for .changelog/20261015_1500_dockerfile.md: 13 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Add Dockerfile

- `Dockerfile`: runtime-only image (`eclipse-temurin:17-jre`, non-root UID 10001) that copies the Spring Boot jar from `target/` and runs it. Same pattern as `org.etsi.osl.controllers.argocd`, matching this repo's `.gitlab-ci.yml` where `docker_build` runs after `maven_build` produces the jar.
- `.dockerignore`: the build context is only `target/org.etsi.osl.examples.gcontroller-*.jar`.

No port is exposed: `server.port: 0` in `application.yml`; the controller talks to OSL over the ActiveMQ broker. Point it at a real broker at run time, e.g. `-e SPRING_ACTIVEMQ_BROKERURL=tcp://anartemis:61616`.

Local build:

    mvn package -DskipTests
    docker build -t org.etsi.osl.examples.gcontroller .

Verified: `mvn package -DskipTests` produces the jar. The `docker build` was not run (Docker daemon was not running).
+10
Changes for .changelog/20261015_1530_restore-weakened-test-assertions.md: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Restore the assertions dropped by the "fix tests" commit

Follow-up to `872a599`, which made the suite green partly by removing checks rather than retargeting them.

- `ResourceRepoServiceHealthTest`: the planning create/update/delete tests assert the X.731 callback headers again (`operationalState` / `administrativeState` / `usageState`). `assertStates` no longer takes a `resourceStatus` argument, since the callback deliberately stopped sending `org.etsi.osl.resourceStatus`.
- `ExampleResourceSpecTest`: removed `supersedesAnEarlierConditionVerdict` (its 10 cases). Specs no longer declare `resourceStatus`, so "an ALARM is superseded" no longer holds, and the edited version (AVAILABLE in, AVAILABLE out) could not fail. That status is passed through unchanged is still covered by `doesNotReleaseAReservationItDidNotMake` / `doesNotReleaseAStandbyHold`.
- `KubernetesClusterTest`: the default-profile test checks `operationCostPerHour` again (0.6 at 3 nodes) and is renamed `defaultNodeCount_profile`, since it no longer reproduces "the original flat profile".
- `KubernetesCluster`: javadoc on `DEFAULT_NODE_COUNT` and `profileFor` updated to the current default profile `(900, 1.5, 10.3, 3.0, 0.6, 300, 1.5, 0.0)`.

Result: `mvn test` → 119 tests, 0 failures (129 minus the 10 removed parameterized cases).
+2
Changes for .changelog/index.md: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -2,6 +2,8 @@

| Doc | Description |
|---|---|
| [20261015_1530_restore-weakened-test-assertions.md](20261015_1530_restore-weakened-test-assertions.md) | Re-enable the X.731 header assertions in `ResourceRepoServiceHealthTest` (without `resourceStatus`), drop the vacuous `supersedesAnEarlierConditionVerdict`, re-pin KubernetesCluster's default `operationCostPerHour` and fix its stale javadoc. 119 tests pass. |
| [20261015_1500_dockerfile.md](20261015_1500_dockerfile.md) | Add a runtime-only `Dockerfile` (temurin 17 JRE, non-root) that packages the prebuilt jar, matching the CI `maven_build` → `docker_build` flow, plus a `.dockerignore`. |
| [20261015_1430_why-tests-fail.md](20261015_1430_why-tests-fail.md) | Diagnosis of 25 failing tests: specs stopped declaring `resourceStatus` (20), planning callback no longer sends the `org.etsi.osl.resourceStatus` header (3), and KubernetesCluster cost coefficients were recalibrated without updating its tests (2). No code changed. |
| [20261003_1734_report-held-before-up-on-create.md](20261003_1734_report-held-before-up-on-create.md) | A real (non-simulation) `createResource` now writes a partial `HELD` update to the catalog before running the spec's `resourceLogic`, so the resource goes `PENDING -> HELD -> UP` like the planning path instead of jumping straight from `PENDING` to `UP`. |
| [20261001_1230_architecture-diagram-two-paths.md](20261001_1230_architecture-diagram-two-paths.md) | Redrew the guide's architecture diagram to separate the production and planning paths, and to show that planning callbacks land in the internal tentative planning inventory. |
+3
Changes for .dockerignore: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Only the built jar is needed in the build context.
*
!target/org.etsi.osl.examples.gcontroller-*.jar
+7
Changes for Dockerfile: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Runtime image only: the jar is built beforehand (CI maven_build job, or locally with
# `mvn package -DskipTests`), then copied in here by the docker_build job.
FROM eclipse-temurin:17-jre
WORKDIR /app
COPY target/org.etsi.osl.examples.gcontroller-*.jar app.jar
USER 10001
ENTRYPOINT ["java", "-jar", "/app/app.jar"]
Loading