fix(ci): repair release gate runtime failures
Managed validation / full (pull_request) Successful in 14s
GeoIntel release gates / Trusted workflow source (pull_request) Successful in 3s
GeoIntel release gates / Compile, test, contracts and builds (pull_request) Failing after 1m2s
GeoIntel release gates / Python and npm vulnerability policy (pull_request) Successful in 35s
GeoIntel release gates / GIS image, SBOM and container scan (pull_request) Successful in 5m29s
GeoIntel release gates / AI image, SBOM and container scan (pull_request) Failing after 19m14s
Managed validation / full (pull_request) Successful in 14s
GeoIntel release gates / Trusted workflow source (pull_request) Successful in 3s
GeoIntel release gates / Compile, test, contracts and builds (pull_request) Failing after 1m2s
GeoIntel release gates / Python and npm vulnerability policy (pull_request) Successful in 35s
GeoIntel release gates / GIS image, SBOM and container scan (pull_request) Successful in 5m29s
GeoIntel release gates / AI image, SBOM and container scan (pull_request) Failing after 19m14s
This commit is contained in:
@@ -56,8 +56,6 @@ jobs:
|
|||||||
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
|
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
|
||||||
with:
|
with:
|
||||||
python-version: "3.11"
|
python-version: "3.11"
|
||||||
cache: pip
|
|
||||||
cache-dependency-path: backend/requirements-ci.lock
|
|
||||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||||
with:
|
with:
|
||||||
node-version: "20"
|
node-version: "20"
|
||||||
@@ -106,8 +104,6 @@ jobs:
|
|||||||
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
|
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
|
||||||
with:
|
with:
|
||||||
python-version: "3.11"
|
python-version: "3.11"
|
||||||
cache: pip
|
|
||||||
cache-dependency-path: backend/requirements-ci.lock
|
|
||||||
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
|
||||||
with:
|
with:
|
||||||
node-version: "20"
|
node-version: "20"
|
||||||
|
|||||||
@@ -6,11 +6,12 @@ import ssl
|
|||||||
from typing import Any, Callable
|
from typing import Any, Callable
|
||||||
from urllib.error import HTTPError, URLError
|
from urllib.error import HTTPError, URLError
|
||||||
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
|
from urllib.parse import parse_qsl, urlencode, urlsplit, urlunsplit
|
||||||
from urllib.request import Request, urlopen
|
from urllib.request import Request
|
||||||
from xml.etree import ElementTree
|
from xml.etree import ElementTree
|
||||||
|
|
||||||
from app.core.config import Settings, get_settings
|
from app.core.config import Settings, get_settings
|
||||||
from app.schemas.bathymetry import BathymetrySourceProbeRead
|
from app.schemas.bathymetry import BathymetrySourceProbeRead
|
||||||
|
from app.services.outbound_request_guard import guarded_opener
|
||||||
|
|
||||||
|
|
||||||
class MdkBathymetryProbeService:
|
class MdkBathymetryProbeService:
|
||||||
|
|||||||
@@ -5,7 +5,16 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|||||||
TARGET_IMAGE="${1:-geointel-ci:local}"
|
TARGET_IMAGE="${1:-geointel-ci:local}"
|
||||||
OUTPUT="${2:-artifacts/geointel-sbom.spdx.json}"
|
OUTPUT="${2:-artifacts/geointel-sbom.spdx.json}"
|
||||||
SYFT_IMAGE="anchore/syft:v1.44.0@sha256:86fde6445b483d902fe011dd9f68c4987dd94e07da1e9edc004e3c2422650de6"
|
SYFT_IMAGE="anchore/syft:v1.44.0@sha256:86fde6445b483d902fe011dd9f68c4987dd94e07da1e9edc004e3c2422650de6"
|
||||||
SCANNER_ENGINE_ARGS=()
|
TMP_DIR="$(mktemp -d)"
|
||||||
|
SYFT_CONTAINER=""
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
if [ -n "$SYFT_CONTAINER" ]; then
|
||||||
|
docker rm -f "$SYFT_CONTAINER" >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
rm -rf "$TMP_DIR"
|
||||||
|
}
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
case "$OUTPUT" in
|
case "$OUTPUT" in
|
||||||
/*|*..*)
|
/*|*..*)
|
||||||
@@ -14,36 +23,24 @@ case "$OUTPUT" in
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
configure_scanner_engine() {
|
|
||||||
local docker_host="${DOCKER_HOST:-}"
|
|
||||||
if [[ "$docker_host" == tcp://* ]]; then
|
|
||||||
local port="${docker_host##*:}"
|
|
||||||
if ! [[ "$port" =~ ^[0-9]+$ ]] || (( port < 1 || port > 65535 )); then
|
|
||||||
echo "Unsupported TCP Docker host for nested scanner: $docker_host" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
SCANNER_ENGINE_ARGS=(
|
|
||||||
--add-host host.docker.internal:host-gateway
|
|
||||||
-e "DOCKER_HOST=tcp://host.docker.internal:${port}"
|
|
||||||
)
|
|
||||||
elif [[ -z "$docker_host" || "$docker_host" == unix:///var/run/docker.sock ]]; then
|
|
||||||
SCANNER_ENGINE_ARGS=(-v /var/run/docker.sock:/var/run/docker.sock)
|
|
||||||
else
|
|
||||||
echo "Unsupported Docker host for nested scanner: $docker_host" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
docker image inspect "$TARGET_IMAGE" >/dev/null
|
docker image inspect "$TARGET_IMAGE" >/dev/null
|
||||||
mkdir -p "$ROOT/$(dirname "$OUTPUT")"
|
mkdir -p "$ROOT/$(dirname "$OUTPUT")"
|
||||||
configure_scanner_engine
|
|
||||||
|
|
||||||
# Native/local runs use the normal Unix socket. Gitea jobs can target the
|
# Keep Syft supply-chain pinned to the audited container image, but execute the
|
||||||
# isolated TCP DinD daemon; scanner containers then reach that same daemon via
|
# extracted static binary in the Actions job itself. This lets Syft use the
|
||||||
# Docker's host-gateway alias instead of receiving the Unraid host socket.
|
# job's existing DOCKER_HOST directly and avoids a second scanner-container ->
|
||||||
docker run --rm \
|
# host-gateway -> DinD network hop for large AI images.
|
||||||
"${SCANNER_ENGINE_ARGS[@]}" \
|
if ! docker image inspect "$SYFT_IMAGE" >/dev/null 2>&1; then
|
||||||
"$SYFT_IMAGE" \
|
docker pull "$SYFT_IMAGE" >/dev/null
|
||||||
|
fi
|
||||||
|
SYFT_CONTAINER="$(docker create "$SYFT_IMAGE")"
|
||||||
|
docker cp "$SYFT_CONTAINER:/syft" "$TMP_DIR/syft"
|
||||||
|
docker rm "$SYFT_CONTAINER" >/dev/null
|
||||||
|
SYFT_CONTAINER=""
|
||||||
|
chmod +x "$TMP_DIR/syft"
|
||||||
|
|
||||||
|
SYFT_CHECK_FOR_APP_UPDATE=false \
|
||||||
|
"$TMP_DIR/syft" \
|
||||||
"$TARGET_IMAGE" \
|
"$TARGET_IMAGE" \
|
||||||
--from docker \
|
--from docker \
|
||||||
-o spdx-json > "$ROOT/$OUTPUT"
|
-o spdx-json > "$ROOT/$OUTPUT"
|
||||||
|
|||||||
Reference in New Issue
Block a user