9 Commits
Author SHA1 Message Date
Djeex 895f65a2d9 Update dependency tifffile to v2026.11.12
renovate/stability-days Updates have met minimum release age requirement
CI / build-and-scan (pull_request) Failing after 11s
2026-11-21 18:18:40 +00:00
instameex-ci 6d810b76cf Bump build version to 1.1.2 [skip ci] 2026-11-21 17:53:41 +00:00
Djeex 7378de15ec Merge pull request 'Pin base images and add end-to-end tests' (#6) from ci-cd into main
CI / build-and-scan (push) Successful in 1m50s
Reviewed-on: #6
2026-11-21 18:46:29 +01:00
Djeex 93d448140e Merge remote-tracking branch 'origin/main' into ci-cd
CI / build-and-scan (pull_request) Successful in 1m23s
# Conflicts:
#	docker/Dockerfile
2026-11-21 17:28:45 +00:00
Djeex 8e4378539d Merge pull request 'Update aquasec/trivy Docker tag to v0.76.2' (#4) from renovate/aquasec-trivy-0.x into main
CI / build-and-scan (push) Successful in 33s
Reviewed-on: #4
2026-11-21 18:28:05 +01:00
Djeex 5233594685 Merge pull request 'Update alpine Docker tag to v3.24' (#3) from renovate/alpine-3.x into main
CI / build-and-scan (push) Failing after 39s
Reviewed-on: #3
2026-11-21 18:27:51 +01:00
Djeex 657dfdef6b Pin base images and add end-to-end tests
CI / build-and-scan (pull_request) Successful in 4m54s
2026-11-21 17:25:48 +00:00
Djeex 9300430550 Update aquasec/trivy Docker tag to v0.76.2
CI / build-and-scan (pull_request) Successful in 48s
2026-11-21 16:58:51 +00:00
Djeex 8c4afd98d9 Update alpine Docker tag to v3.24
CI / build-and-scan (pull_request) Successful in 1m59s
2026-11-21 16:58:48 +00:00
6 changed files with 103 additions and 11 deletions

No files matched your search

+3 -3
View File
@@ -66,7 +66,7 @@ jobs:
docker run --rm \ docker run --rm \
-e DOCKER_HOST=tcp://dockerhost:2375 \ -e DOCKER_HOST=tcp://dockerhost:2375 \
--add-host=dockerhost:host-gateway \ --add-host=dockerhost:host-gateway \
aquasec/trivy:0.74.0 image --exit-code 1 --severity CRITICAL instameex:ci aquasec/trivy:0.76.2 image --exit-code 1 --severity CRITICAL instameex:ci
- name: Handle CRITICAL findings - name: Handle CRITICAL findings
if: steps.trivy_critical.outcome == 'failure' if: steps.trivy_critical.outcome == 'failure'
@@ -85,7 +85,7 @@ jobs:
if docker run --rm \ if docker run --rm \
-e DOCKER_HOST=tcp://dockerhost:2375 \ -e DOCKER_HOST=tcp://dockerhost:2375 \
--add-host=dockerhost:host-gateway \ --add-host=dockerhost:host-gateway \
aquasec/trivy:0.74.0 image --exit-code 1 --severity CRITICAL instameex:remediated; then aquasec/trivy:0.76.2 image --exit-code 1 --severity CRITICAL instameex:remediated; then
echo "apk upgrade clears the CRITICAL finding(s) — opening a PR for review." echo "apk upgrade clears the CRITICAL finding(s) — opening a PR for review."
BRANCH="auto/cve-fix-$(date +%Y%m%d)-$(echo "${{ github.sha }}" | cut -c1-7)" BRANCH="auto/cve-fix-$(date +%Y%m%d)-$(echo "${{ github.sha }}" | cut -c1-7)"
@@ -113,7 +113,7 @@ jobs:
docker run --rm \ docker run --rm \
-e DOCKER_HOST=tcp://dockerhost:2375 \ -e DOCKER_HOST=tcp://dockerhost:2375 \
--add-host=dockerhost:host-gateway \ --add-host=dockerhost:host-gateway \
aquasec/trivy:0.74.0 image --exit-code 0 --severity HIGH instameex:ci aquasec/trivy:0.76.2 image --exit-code 0 --severity HIGH instameex:ci
- name: Publish tagged image - name: Publish tagged image
if: github.event_name == 'push' && github.ref == 'refs/heads/main' if: github.event_name == 'push' && github.ref == 'refs/heads/main'
+1 -1
View File
@@ -1 +1 @@
1.1.1 1.1.2
+10 -5
View File
@@ -1,23 +1,28 @@
# syntax=docker/dockerfile:1 # syntax=docker/dockerfile:1
# ---- Stage 1: compile libultrahdr (ultrahdr_app) -------------------------- # ---- Stage 1: compile libultrahdr (ultrahdr_app) --------------------------
FROM alpine:3.21 AS uhdr-build FROM alpine:3.24.4@sha256:f59abe656b692d901e184be3445e084786602108599d2a51d229c0f5a48c71bf AS uhdr-build
RUN apk add --no-cache \ RUN apk add --no-cache \
git cmake make g++ nasm pkgconf libjpeg-turbo-dev git cmake make g++ nasm pkgconf libjpeg-turbo-dev
WORKDIR /build WORKDIR /build
# Pin to a commit once you've confirmed it works for you — HEAD can move. # Pinned to an exact commit (v2.0.2 + fixes) for reproducible, auditable builds.
RUN git clone --depth 1 https://github.com/google/libultrahdr.git ARG UHDR_COMMIT=c6fd15cdb2d05d3aaed84b817e4c4a274a4ce600
RUN git init libultrahdr \
&& git -C libultrahdr fetch --depth 1 https://github.com/google/libultrahdr.git "$UHDR_COMMIT" \
&& git -C libultrahdr checkout --detach FETCH_HEAD
RUN cmake -G "Unix Makefiles" -DUHDR_WRITE_XMP=ON \ RUN cmake -G "Unix Makefiles" -DUHDR_WRITE_XMP=ON \
-S libultrahdr -B libultrahdr/build \ -S libultrahdr -B libultrahdr/build \
&& cmake --build libultrahdr/build -j"$(nproc)" && cmake --build libultrahdr/build -j"$(nproc)"
# ---- Stage 2: runtime ------------------------------------------------------- # ---- Stage 2: runtime -------------------------------------------------------
FROM python:3.11-alpine AS base FROM python:3.11.18-alpine@sha256:7fbad8e4652eae0186429a6f26cf5b23e27e8c6fd7ac4d0cfd7a6988cdeea1e1 AS base
RUN apk add --no-cache exiftool libjpeg-turbo libstdc++ # apk upgrade pulls Alpine security fixes released after the base image was built.
RUN apk upgrade --no-cache \
&& apk add --no-cache exiftool libjpeg-turbo libstdc++
COPY --from=uhdr-build /build/libultrahdr/build/ultrahdr_app /usr/local/bin/ultrahdr_app COPY --from=uhdr-build /build/libultrahdr/build/ultrahdr_app /usr/local/bin/ultrahdr_app
RUN chmod +x /usr/local/bin/ultrahdr_app RUN chmod +x /usr/local/bin/ultrahdr_app
+11 -1
View File
@@ -1,7 +1,8 @@
{ {
"$schema": "https://docs.renovatebot.com/renovate-schema.json", "$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended"], "extends": ["config:recommended", "docker:pinDigests"],
"timezone": "Europe/Paris", "timezone": "Europe/Paris",
"minimumReleaseAge": "3 days",
"labels": ["bot"], "labels": ["bot"],
"vulnerabilityAlerts": { "vulnerabilityAlerts": {
"addLabels": ["bug"] "addLabels": ["bug"]
@@ -18,6 +19,10 @@
} }
], ],
"packageRules": [ "packageRules": [
{
"matchManagers": ["pip_requirements"],
"minimumReleaseAge": "7 days"
},
{ {
"matchManagers": ["pip_requirements"], "matchManagers": ["pip_requirements"],
"matchUpdateTypes": ["patch", "minor"], "matchUpdateTypes": ["patch", "minor"],
@@ -28,6 +33,11 @@
"matchUpdateTypes": ["patch"], "matchUpdateTypes": ["patch"],
"automerge": true "automerge": true
}, },
{
"matchManagers": ["dockerfile"],
"matchUpdateTypes": ["pin", "digest"],
"automerge": true
},
{ {
"matchUpdateTypes": ["major"], "matchUpdateTypes": ["major"],
"addLabels": ["major"] "addLabels": ["major"]
+1 -1
View File
@@ -2,4 +2,4 @@ Flask==3.1.3
gunicorn==23.0.0 gunicorn==23.0.0
Pillow==13.0.0 Pillow==13.0.0
numpy==2.4.6 numpy==2.4.6
tifffile==2026.3.3 tifffile==2026.11.12
+77
View File
@@ -0,0 +1,77 @@
"""End-to-end: runs the real ultrahdr_app + exiftool (present in the Docker
image, skipped elsewhere) to catch regressions from dependency or base image
updates that the mocked unit tests cannot see."""
import shutil
import numpy as np
import pytest
import tifffile
from PIL import Image
from app import assembler
pytestmark = pytest.mark.skipif(
bool(assembler.check_dependencies()) or not shutil.which("exiftool"),
reason="ultrahdr_app/exiftool not installed",
)
SIZE = 128
def gradient():
"""A horizontal ramp 0..1 with a bright highlight block, as float values."""
ramp = np.tile(np.linspace(0.05, 1.0, SIZE, dtype=np.float32), (SIZE, 1))
img = np.stack([ramp, ramp, ramp], axis=-1)
return img
@pytest.fixture
def sdr(tmp_path):
arr = (np.clip(gradient() ** (1 / 2.2), 0, 1) * 255).astype(np.uint8)
path = tmp_path / "sdr.jpg"
Image.fromarray(arr).save(path, "JPEG", quality=95)
return path
@pytest.fixture
def hdr_tiff(tmp_path):
hdr = gradient()
hdr[:32, :32] *= 3.0 # highlight brighter than SDR white
path = tmp_path / "hdr.tif"
tifffile.imwrite(path, hdr.astype(np.float32), photometric="rgb")
return path
def assert_valid_ultrahdr(out, log):
assert out.exists() and out.stat().st_size > 0
with Image.open(out) as img:
assert img.format == "JPEG" and img.size == (SIZE, SIZE)
assert "Validation report" in log # gain map found and readable
assert "XMP-hdrgm:GainMapMax" in log
def test_tiff_pipeline_produces_ultrahdr_jpeg(tmp_path, sdr, hdr_tiff):
out = tmp_path / "out.jpg"
ok, log, warning = assembler.run(sdr, hdr_tiff, out)
assert ok, log
assert_valid_ultrahdr(out, log)
assert warning is False # GainMapMin must not be negative (Instagram rejects it)
def test_jpeg_pipeline_round_trip(tmp_path, sdr, hdr_tiff):
first = tmp_path / "first.jpg"
ok, log, _ = assembler.run(sdr, hdr_tiff, first)
assert ok, log
second = tmp_path / "second.jpg"
ok, log, warning = assembler.run(sdr, first, second) # existing gain-map JPEG as HDR input
assert ok, log
assert_valid_ultrahdr(second, log)
assert warning is False
def test_invalid_hdr_jpeg_fails_cleanly(tmp_path, sdr):
not_hdr = tmp_path / "plain.jpg"
shutil.copy(sdr, not_hdr) # a JPEG without any gain map
ok, log, warning = assembler.run(sdr, not_hdr, tmp_path / "out.jpg")
assert ok is False and warning is False
assert log.splitlines()[-1].startswith("Error:")