Publish curated ITWorx-ModelForge source from 990401737f96c8d46a9f7b0d84994516cadcb6a0
This commit is contained in:
1 parent
7082ab955a
commit
848f0d8f8a
434 files changed
+67298
-4315
No files matched your search
+1014
-114
File diff suppressed because it is too large.
Load diff
@@ -1,6 +1,6 @@
|
||||
name: Public candidate server acceptance
|
||||
|
||||
# Builds only an exact, curated public-source commit in a disposable Compose namespace. This job
|
||||
# Builds only an exact, curated public-source commit in a disposable validation Compose namespace. This job
|
||||
# never calls the Unraid deploy controller and cannot select the production deployment action.
|
||||
on:
|
||||
workflow_dispatch:
|
||||
@@ -14,6 +14,11 @@ on:
|
||||
required: true
|
||||
default: https://modelforge.example.test
|
||||
type: string
|
||||
retain_image_bundle:
|
||||
description: Retain the verified four-image Docker bundle for P12-P15 qualification
|
||||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
workflow_call:
|
||||
inputs:
|
||||
source_commit:
|
||||
@@ -24,6 +29,11 @@ on:
|
||||
description: Bare API origin compiled into the candidate Console image
|
||||
required: true
|
||||
type: string
|
||||
retain_image_bundle:
|
||||
description: Retain the verified four-image Docker bundle for P12-P15 qualification
|
||||
required: false
|
||||
default: false
|
||||
type: boolean
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -140,14 +150,23 @@ jobs:
|
||||
shell: bash
|
||||
env:
|
||||
PUBLIC_API_ORIGIN: ${{ inputs.public_api_origin }}
|
||||
RETAIN_IMAGE_BUNDLE: ${{ inputs.retain_image_bundle }}
|
||||
SOURCE_COMMIT: ${{ inputs.source_commit }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cd "${PUBLIC_SOURCE}"
|
||||
python3 scripts/rc_server_acceptance.py \
|
||||
--public-api-origin "${PUBLIC_API_ORIGIN}" \
|
||||
--trivy "${TRIVY}" \
|
||||
--output acceptance-evidence \
|
||||
arguments=(
|
||||
--public-api-origin "${PUBLIC_API_ORIGIN}"
|
||||
--canonical-source-commit "${SOURCE_COMMIT}"
|
||||
--trivy "${TRIVY}"
|
||||
--output acceptance-evidence
|
||||
--project-suffix "${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
|
||||
)
|
||||
if [[ "${RETAIN_IMAGE_BUNDLE}" == "true" ]]; then
|
||||
arguments+=(--retain-image-bundle)
|
||||
fi
|
||||
python3 scripts/rc_server_acceptance.py \
|
||||
"${arguments[@]}"
|
||||
|
||||
- name: Always remove acceptance Docker resources
|
||||
if: always()
|
||||
@@ -157,7 +176,7 @@ jobs:
|
||||
cleanup_failed=0
|
||||
suffix="$(printf '%s' "${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" \
|
||||
| tr '[:upper:]' '[:lower:]' | tr -cd '[:alnum:]' | tail -c 24)"
|
||||
project="modelforge-rc-${suffix}"
|
||||
project="modelforge-validation-${suffix}"
|
||||
for kind in container volume network; do
|
||||
while IFS= read -r resource; do
|
||||
[[ -n "${resource}" ]] || continue
|
||||
@@ -171,7 +190,7 @@ jobs:
|
||||
done
|
||||
|
||||
if [[ -n "${PUBLIC_SOURCE:-}" && -d "${PUBLIC_SOURCE}/.git" ]]; then
|
||||
candidate_commit="$(git -C "${PUBLIC_SOURCE}" rev-parse HEAD 2>/dev/null)"
|
||||
canonical_commit="${{ inputs.source_commit }}"
|
||||
version="$(tr -d '\r\n' < "${PUBLIC_SOURCE}/VERSION" 2>/dev/null)"
|
||||
for image in modelforge-api modelforge-web modelforge-node-agent \
|
||||
modelforge-runtime-worker; do
|
||||
@@ -179,7 +198,7 @@ jobs:
|
||||
revision="$(docker inspect --format \
|
||||
'{{index .Config.Labels "org.opencontainers.image.revision"}}' \
|
||||
"${tag}" 2>/dev/null)"
|
||||
if [[ -n "${candidate_commit}" && "${revision}" == "${candidate_commit}" ]]; then
|
||||
if [[ "${revision}" == "${canonical_commit}" ]]; then
|
||||
docker image rm --force "${tag}" || cleanup_failed=1
|
||||
fi
|
||||
done
|
||||
@@ -208,6 +227,8 @@ jobs:
|
||||
${{ env.PUBLIC_SOURCE }}/acceptance-evidence/*.json
|
||||
${{ env.PUBLIC_SOURCE }}/acceptance-evidence/*.txt
|
||||
${{ env.PUBLIC_SOURCE }}/acceptance-evidence/release/*.json
|
||||
${{ env.PUBLIC_SOURCE }}/acceptance-evidence/release/*.tar
|
||||
${{ env.PUBLIC_SOURCE }}/acceptance-evidence/release/*.tar.gz
|
||||
${{ env.PUBLIC_SOURCE }}/acceptance-evidence/release/*SHA256SUMS
|
||||
if-no-files-found: warn
|
||||
retention-days: 90
|
||||
@@ -1,132 +0,0 @@
|
||||
name: Unraid stable release deployment
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
release_tag:
|
||||
description: Annotated stable release tag (for example, v1.2.1)
|
||||
required: true
|
||||
type: string
|
||||
release_commit:
|
||||
description: Exact lowercase 40-character commit SHA referenced by the tag
|
||||
required: true
|
||||
type: string
|
||||
action:
|
||||
description: Verify provenance only, or deploy the verified stable release
|
||||
required: true
|
||||
default: VERIFY_ONLY
|
||||
type: choice
|
||||
options:
|
||||
- VERIFY_ONLY
|
||||
- DEPLOY_STABLE_TO_PRODUCTION
|
||||
|
||||
concurrency:
|
||||
group: unraid-production-itworx-modelforge
|
||||
cancel-in-progress: false
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Verify and optionally deploy a stable release
|
||||
runs-on: unraid-deploy
|
||||
timeout-minutes: 180
|
||||
steps:
|
||||
- name: Validate immutable dispatch inputs
|
||||
shell: bash
|
||||
env:
|
||||
RELEASE_TAG: ${{ inputs.release_tag }}
|
||||
RELEASE_COMMIT: ${{ inputs.release_commit }}
|
||||
DEPLOY_ACTION: ${{ inputs.action }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
if [[ "${GITHUB_REF:-}" != "refs/heads/master" ]]; then
|
||||
echo "Stable production deployment must be dispatched from refs/heads/master" >&2
|
||||
exit 2
|
||||
fi
|
||||
if [[ ! "${RELEASE_TAG}" =~ ^v(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)$ ]]; then
|
||||
echo "release_tag must be a strict stable SemVer tag such as v1.2.1" >&2
|
||||
exit 2
|
||||
fi
|
||||
if [[ ! "${RELEASE_COMMIT}" =~ ^[0-9a-f]{40}$ ]]; then
|
||||
echo "release_commit must be an exact lowercase 40-character SHA" >&2
|
||||
exit 2
|
||||
fi
|
||||
case "${DEPLOY_ACTION}" in
|
||||
VERIFY_ONLY|DEPLOY_STABLE_TO_PRODUCTION) ;;
|
||||
*) echo "action is not allowlisted: ${DEPLOY_ACTION}" >&2; exit 2 ;;
|
||||
esac
|
||||
|
||||
- name: Check out the exact release commit with full history
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
ref: ${{ inputs.release_commit }}
|
||||
fetch-depth: 0
|
||||
# The following provenance step performs an authenticated exact-ref fetch.
|
||||
persist-credentials: true
|
||||
|
||||
- name: Verify stable release provenance
|
||||
shell: bash
|
||||
env:
|
||||
RELEASE_TAG: ${{ inputs.release_tag }}
|
||||
RELEASE_COMMIT: ${{ inputs.release_commit }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
git fetch --force --no-recurse-submodules origin \
|
||||
"refs/tags/${RELEASE_TAG}:refs/tags/${RELEASE_TAG}" \
|
||||
"refs/heads/master:refs/remotes/origin/master"
|
||||
|
||||
tag_ref="refs/tags/${RELEASE_TAG}"
|
||||
if [[ "$(git cat-file -t "${tag_ref}")" != "tag" ]]; then
|
||||
echo "${RELEASE_TAG} must be an annotated tag" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tag_object="$(git rev-parse "${tag_ref}^{tag}")"
|
||||
tag_commit="$(git rev-parse "${tag_ref}^{commit}")"
|
||||
head_commit="$(git rev-parse HEAD)"
|
||||
if [[ "${tag_commit}" != "${RELEASE_COMMIT}" ]]; then
|
||||
echo "Tag commit ${tag_commit} does not match release_commit ${RELEASE_COMMIT}" >&2
|
||||
exit 1
|
||||
fi
|
||||
if [[ "${head_commit}" != "${RELEASE_COMMIT}" ]]; then
|
||||
echo "Checked-out HEAD ${head_commit} does not match release_commit ${RELEASE_COMMIT}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -f VERSION ]]; then
|
||||
echo "VERSION is missing at the release commit" >&2
|
||||
exit 1
|
||||
fi
|
||||
version="$(tr -d '\r\n' < VERSION)"
|
||||
expected_version="${RELEASE_TAG#v}"
|
||||
if [[ "${version}" != "${expected_version}" ]]; then
|
||||
echo "VERSION ${version} does not match release tag ${RELEASE_TAG}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! git merge-base --is-ancestor "${RELEASE_COMMIT}" refs/remotes/origin/master; then
|
||||
echo "Release commit ${RELEASE_COMMIT} is not an ancestor of origin/master" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
printf 'DEPLOY_COMMIT=%s\n' "${RELEASE_COMMIT}" >> "${GITHUB_ENV}"
|
||||
echo "Verified annotated ${RELEASE_TAG} object ${tag_object} at immutable commit ${RELEASE_COMMIT}"
|
||||
|
||||
- name: Verification-only result
|
||||
if: ${{ inputs.action == 'VERIFY_ONLY' }}
|
||||
shell: bash
|
||||
run: echo "Stable release provenance verified; production was not changed."
|
||||
|
||||
- name: Deploy verified stable release to production
|
||||
if: ${{ inputs.action == 'DEPLOY_STABLE_TO_PRODUCTION' }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
test -n "${DEPLOY_COMMIT:-}"
|
||||
docker exec gitea-deploy-control \
|
||||
/opt/gitea-deploy/deploy.py deploy \
|
||||
"${GITHUB_REPOSITORY}" "${DEPLOY_COMMIT}"
|
||||
Reference in new issue
Block a user