diff --git a/.github/actions/setup-aswfdocker/action.yml b/.github/actions/setup-aswfdocker/action.yml new file mode 100644 index 000000000..8b681e970 --- /dev/null +++ b/.github/actions/setup-aswfdocker/action.yml @@ -0,0 +1,39 @@ +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Installs uv, Python and aswfdocker with its dependencies, shared by every +# workflow job running aswfdocker. Workflows reference it as +# `$/.github/actions/setup-aswfdocker`, so it is read from the commit the +# workflow runs from, not from the checkout: release workflows building an +# older commit still get this setup. It installs the checked-out project, so +# actions/checkout must run first. +name: Set up aswfdocker +description: Install uv, Python and aswfdocker with its dependencies + +inputs: + dev: + description: Also install the dev dependencies ("true" or "false") + required: false + default: "false" + +runs: + using: composite + steps: + - name: Install uv + uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0 + with: + enable-cache: auto + + - name: Set up Python + shell: bash + run: uv python install 3.10 + + - name: Install aswfdocker and dependencies + if: ${{ inputs.dev != 'true' }} + shell: bash + run: uv sync --frozen + + - name: Install aswfdocker and dev dependencies + if: ${{ inputs.dev == 'true' }} + shell: bash + run: uv sync --all-extras --frozen diff --git a/.github/jactionlint.yaml b/.github/jactionlint.yaml new file mode 100644 index 000000000..37e64f64b --- /dev/null +++ b/.github/jactionlint.yaml @@ -0,0 +1,9 @@ +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# jactionlint configuration (run by pre-commit, see CONTRIBUTING.md). +# jactionlint checks the correctness of workflows and actions; their +# security is audited by zizmor, so only the correctness profile is used, +# leaving out jactionlint's security and policy rules (which follow +# zizmor's audits) to avoid every finding and ignore comment twice. +profile: correctness diff --git a/.github/workflows/check-release.yml b/.github/workflows/check-release.yml new file mode 100644 index 000000000..5a4be44a0 --- /dev/null +++ b/.github/workflows/check-release.yml @@ -0,0 +1,102 @@ +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Checks a release's inputs, for the release workflows to call before the +# jobs holding the Artifactory or Docker Hub credentials. Runs as its own +# job, which gets no secrets. +# +# In particular, the commit must be on a branch of this repository (main, or +# a release branch for maintenance releases): GitHub serves any commit of +# the fork network through this repository, so without this check a commit +# only pushed to a fork could be released. +name: Check Release + +on: + workflow_call: + inputs: + sha: + description: Full SHA of the commit to release + required: true + type: string + org: + description: Docker organization and Conan user to release to (aswf or aswftesting) + required: true + type: string + groups: + description: Space-separated groups + required: true + type: string + versions: + description: Space-separated versions + required: true + type: string + targets: + description: Space-separated targets + required: false + type: string + default: "" + outputs: + versions: + description: The versions as a JSON array, for a per-version matrix + value: ${{ jobs.check-release.outputs.versions }} + +permissions: + contents: read + +jobs: + check-release: # zizmor: ignore[concurrency-limits] a concurrency group would cancel queued releases + runs-on: ubuntu-latest + outputs: + versions: ${{ steps.check-inputs.outputs.versions }} + steps: + # Inputs go through the environment rather than being expanded into + # scripts, and are checked before anything uses them. + - name: Check inputs + id: check-inputs + env: + SHA: ${{ inputs.sha }} + ORG: ${{ inputs.org }} + GROUPS_INPUT: ${{ inputs.groups }} + VERSIONS: ${{ inputs.versions }} + TARGETS: ${{ inputs.targets }} + run: | + set -euo pipefail + if [[ ! "$SHA" =~ ^[0-9a-f]{40}$ ]]; then + echo "::error::sha must be a full 40-character commit SHA: $SHA" + exit 1 + fi + if [[ "$ORG" != "aswf" && "$ORG" != "aswftesting" ]]; then + echo "::error::org must be aswf or aswftesting: $ORG" + exit 1 + fi + for input in "$GROUPS_INPUT" "$VERSIONS" "$TARGETS"; do + if [[ ! "$input" =~ ^[A-Za-z0-9._\ -]*$ ]]; then + echo "::error::Invalid input: $input" + exit 1 + fi + done + if [[ -z "${GROUPS_INPUT// }" || -z "${VERSIONS// }" ]]; then + echo "::error::groups and versions must not be empty" + exit 1 + fi + echo "versions=$(jq -cn --arg v "$VERSIONS" '$v | split(" ") | map(select(. != ""))')" >> "$GITHUB_OUTPUT" + + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: ${{ inputs.sha }} + # All branches, for the check below. + fetch-depth: 0 + persist-credentials: false + + - name: Check the commit is on a branch of ${{ github.repository }} + env: + SHA: ${{ inputs.sha }} + run: | + set -euo pipefail + branches=$(git branch --remotes --contains "$SHA") + if [[ -z "$branches" ]]; then + echo "::error::Commit $SHA is not on any branch of $GITHUB_REPOSITORY" + exit 1 + fi + echo "Commit $SHA is on:" + echo "$branches" diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index 93dd8fb64..f28b2929b 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -12,28 +12,41 @@ on: paths-ignore: - '**.md' +permissions: + contents: read + +# Superseded runs for the same branch or pull request are cancelled. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-latest-8c-32g-300h') || 'ubuntu-latest' }} env: DOCKER_CLI_EXPERIMENTAL: enabled DOCKER_BUILDKIT: '1' + # Matrix values go through the environment rather than being expanded + # into scripts. + MATRIX_VERSION: ${{ matrix.version }} strategy: # Don't let a failure for one year affect the others fail-fast: false matrix: include: + # A bare VFX Platform year version also selects every clang + # variant of that year (e.g. ci-common:2027-clang21 and + # ci-common:2027-clang22), as base images need the year's default + # clang and the per-clang images need all of them. - group: vfx-2027 name: vfx-2027 - common_version: 7-clang22 - common_version_noclang: 7 - version: 2027-clang22 - version_noclang: 2027 - test: "" + version: 2027 steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - name: Activate Docker buildx uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 @@ -48,26 +61,38 @@ jobs: env: BUILDKIT_STEP_LOG_MAX_SIZE: 10485760 - - name: Install uv - uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0 - with: - enable-cache: auto - - - name: Set up Python - run: uv python install 3.10 - - - name: Install aswfdocker and dependencies - run: uv sync --frozen + - name: Set up aswfdocker + uses: $/.github/actions/setup-aswfdocker + # Standard GitHub-hosted runners only guarantee 14 GB of free disk space + # (though they often have much more), so when / is short of space, remove + # the preinstalled tools the builds don't use. Runners with enough space, + # such as ASWF's larger runners, skip it. - name: Free up disk space - run: | - df -h - sudo apt-get remove -y '^llvm-.*' '^php.*' '^php8.*' '^cpp.*' '^g\+\+.*' '^clang.*' '^gfortran.*' \ - '^dotnet-.*' '^libmono-.*' '^mono-.*' monodoc-http '^r-.*' '^ruby.*' \ - ant ant-optional aria2 azure-cli firefox google-chrome-stable microsoft-edge-stable powershell \ - imagemagick '^imagemagick-.*' '^libmagickcore-.*' '^libmagickwand-.*' kubectl mercurial mercurial-common subversion - sudo apt-get autoremove -y - sudo apt-get clean + env: + MIN_FREE_GB: '80' + run: | + set -euo pipefail + df -h / + free_gb=$(df --block-size=1G --output=avail / | tail -n 1 | tr -d ' ') + if (( free_gb >= MIN_FREE_GB )); then + echo "${free_gb} GB free on /, no cleanup needed" + exit 0 + fi + echo "Only ${free_gb} GB free on /, removing preinstalled tools" + # Only the installed packages matching these names are removed, as + # apt-get fails on any name it doesn't know, and the runner images + # keep changing. + patterns='^(llvm-|php|cpp|g\+\+|clang|gfortran|dotnet-|libmono-|mono-|r-|ruby|imagemagick|libmagickcore-|libmagickwand-)' + patterns+='|^(ant|ant-optional|aria2|azure-cli|firefox|google-chrome-stable|microsoft-edge-stable|powershell|kubectl|mercurial|mercurial-common|subversion)$' + mapfile -t packages < <( + dpkg-query --show --showformat='${db:Status-Abbrev}\t${Package}\n' | + awk -F '\t' '$1 ~ /^ii/ {print $2}' | grep -E "$patterns" || true) + if (( ${#packages[@]} )); then + sudo apt-get remove -y "${packages[@]}" + sudo apt-get autoremove -y + sudo apt-get clean + fi sudo rm -rf \ /usr/share/dotnet/ \ /usr/local/lib/android \ @@ -78,10 +103,11 @@ jobs: /usr/local/aws-cli \ /usr/local/aws-sam-cli \ /usr/local/julia* \ - /usr/lib/jvm || true - sudo docker system prune -a - df -h - dpkg -l + /usr/lib/jvm + # The container images preloaded on the runner (-f, as there is no + # terminal to confirm). + sudo docker system prune -af + df -h / - name: Build Conan Builder Image run: | @@ -91,42 +117,18 @@ jobs: build \ --ci-image-type IMAGE \ --group baseos-gl-conan \ - --version ${{ matrix.common_version_noclang }} \ - --push NO - - - name: Build common wrappers - run: | - set -ex - uv run aswfdocker \ - --verbose \ - build \ - --ci-image-type PACKAGE \ - --group common-wrappers \ - --version ${{ matrix.common_version_noclang }} \ - --build-missing \ + --version "$MATRIX_VERSION" \ --push NO - - name: Build Ninja and CMake + - name: Build common packages (OpenSSL/GnuTLS wrappers, Ninja, CMake, every Clang version) run: | set -ex uv run aswfdocker \ --verbose \ build \ --ci-image-type PACKAGE \ - --group common-1 \ - --version ${{ matrix.common_version_noclang }} \ - --build-missing \ - --push NO - - - name: Build Clang - run: | - set -ex - uv run aswfdocker \ - --verbose \ - build \ - --ci-image-type PACKAGE \ - --group common-2 \ - --version ${{ matrix.common_version }} \ + --group common \ + --version "$MATRIX_VERSION" \ --build-missing \ --push NO @@ -137,90 +139,30 @@ jobs: build \ --ci-image-type IMAGE \ --group common \ - --version ${{ matrix.common_version }}\ - --push NO - - - name: Build base1 system wrapper packages - run: | - set -ex - uv run aswfdocker \ - --verbose \ - build \ - --ci-image-type PACKAGE \ - --group base1-wrappers \ - --version ${{ matrix.version_noclang }} \ - --build-missing \ - --push NO - - - name: Build base1 level 1 packages - run: | - set -ex - uv run aswfdocker \ - --verbose \ - build \ - --ci-image-type PACKAGE \ - --group base1-1 \ - --version ${{ matrix.version_noclang }} \ - --build-missing \ - --push NO - - - name: Build base1 level 2 packages - run: | - set -ex - uv run aswfdocker \ - --verbose \ - build \ - --ci-image-type PACKAGE \ - --group base1-2 \ - --version ${{ matrix.version_noclang }} \ - --build-missing \ - --push NO - - - name: Build base1 level 3 packages - run: | - set -ex - uv run aswfdocker \ - --verbose \ - build \ - --ci-image-type PACKAGE \ - --group base1-3 \ - --version ${{ matrix.version_noclang }} \ - --build-missing \ - --push NO - - - name: Build base2 system wrapper packages for ci-baseqt image - run: | - set -ex - uv run aswfdocker \ - --verbose \ - build \ - --ci-image-type PACKAGE \ - --group base2-wrappers \ - --version ${{ matrix.version_noclang }} \ - --build-missing \ + --version "$MATRIX_VERSION" \ --push NO - - name: Build base2 system packages for ci-baseqt image + - name: Build base1 packages run: | set -ex uv run aswfdocker \ --verbose \ build \ --ci-image-type PACKAGE \ - --group base2-1 \ - --version ${{ matrix.version_noclang }} \ + --group base1 \ + --version "$MATRIX_VERSION" \ --build-missing \ --push NO - - name: Build base2 level 2 packages (Qt) for ci-baseqt image + - name: Build base2 packages (Qt) for ci-baseqt image run: | set -ex uv run aswfdocker \ --verbose \ build \ --ci-image-type PACKAGE \ - --group base2-2 \ - --version ${{ matrix.version_noclang }} \ + --group base2 \ + --version "$MATRIX_VERSION" \ --build-missing \ --push NO @@ -232,7 +174,7 @@ jobs: build \ --ci-image-type PACKAGE \ --group base3 \ - --version ${{ matrix.version_noclang }} \ + --version "$MATRIX_VERSION" \ --build-missing \ --push NO @@ -244,141 +186,28 @@ jobs: build \ --ci-image-type IMAGE \ --group base \ - --version ${{ matrix.version }} \ + --version "$MATRIX_VERSION" \ --push NO - - name: Build vfx1 system wrapper packages + - name: Build vfx packages run: | set -ex uv run aswfdocker \ --verbose \ build \ --ci-image-type PACKAGE \ - --group vfx1-wrappers \ - --version ${{ matrix.version_noclang }} \ + --group vfx \ + --version "$MATRIX_VERSION" \ --build-missing \ --push NO - - name: Build vfx1 level 1 packages - run: | - set -ex - uv run aswfdocker \ - --verbose \ - build \ - --ci-image-type PACKAGE \ - --group vfx1-1 \ - --version ${{ matrix.version_noclang }} \ - --build-missing \ - --push NO - - - name: Build vfx1 level 2 packages - run: | - set -ex - uv run aswfdocker \ - --verbose \ - build \ - --ci-image-type PACKAGE \ - --group vfx1-2 \ - --version ${{ matrix.version_noclang }} \ - --build-missing \ - --push NO - - - name: Build vfx1 level 3 packages - run: | - set -ex - uv run aswfdocker \ - --verbose \ - build \ - --ci-image-type PACKAGE \ - --group vfx1-3 \ - --version ${{ matrix.version_noclang }} \ - --build-missing \ - --push NO - - - name: Build vfx1 level 4 packages - run: | - set -ex - uv run aswfdocker \ - --verbose \ - build \ - --ci-image-type PACKAGE \ - --group vfx1-4 \ - --version ${{ matrix.version_noclang }} \ - --build-missing \ - --push NO - - - name: Build vfx1 level 5 packages - run: | - set -ex - uv run aswfdocker \ - --verbose \ - build \ - --ci-image-type PACKAGE \ - --group vfx1-5 \ - --version ${{ matrix.version_noclang }} \ - --build-missing \ - --push NO - - - name: Build vfx1 level 6 packages - run: | - set -ex - uv run aswfdocker \ - --verbose \ - build \ - --ci-image-type PACKAGE \ - --group vfx1-6 \ - --version ${{ matrix.version_noclang }} \ - --build-missing \ - --push NO - - - name: Build vfx1 level 7 packages - run: | - set -ex - uv run aswfdocker \ - --verbose \ - build \ - --ci-image-type PACKAGE \ - --group vfx1-7 \ - --version ${{ matrix.version_noclang }} \ - --build-missing \ - --push NO - - - name: Build vfx1 / vfx2 images - run: | - set -ex - uv run aswfdocker \ - --verbose \ - build \ - --ci-image-type IMAGE \ - --group vfx1 \ - --group vfx2 \ - --version ${{ matrix.version_noclang }} \ - --push NO - - - name: Build vfx3 images + - name: Build vfx images run: | set -ex uv run aswfdocker \ --verbose \ build \ --ci-image-type IMAGE \ - --group vfx3 \ - --version ${{ matrix.version }} \ + --group vfx \ + --version "$MATRIX_VERSION" \ --push NO - - - run: | - set -ex - export DOCKER_ORG=`uv run aswfdocker --repo-uri $GITHUB_REPOSITORY --source-branch $GITHUB_REF getdockerorg` - test_script=scripts/tests/${{ matrix.version }}/test_${{ matrix.test }}.sh - if [ -f $test_script ] - then - echo "Going to run ${test_script}" - echo "docker run -i --rm ${DOCKER_ORG}/ci-${{ matrix.test }}:${{ matrix.version }} run < ${test_script}" - docker run -i --rm \ - -v $(Pipeline.Workspace)/cache/ci-image_${{ matrix.name }}_${{ matrix.version }}/ccache:/tmp/ccache \ - ${DOCKER_ORG}/ci-${{ matrix.test }}:${{ matrix.version }} run < ${test_script} - else - echo "No test script found $test_script" - fi - name: Run test script ${{ matrix.version }}/test_${{ matrix.test }}.sh to check Docker image - if: ${{ matrix.test != '' }} diff --git a/.github/workflows/python-sonar.yml b/.github/workflows/python-sonar.yml index 301a6a6a7..c490c6053 100644 --- a/.github/workflows/python-sonar.yml +++ b/.github/workflows/python-sonar.yml @@ -5,26 +5,50 @@ on: branches: - main +permissions: + contents: read + +# Superseded runs for the same branch or pull request are cancelled. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: + # Forks without their own SONAR_TOKEN skip the analysis. Secrets can't be + # tested in `if:` conditions, and putting the token in the sonar job's + # environment would expose it to every step, so a separate job checks it. + check-token: + runs-on: ubuntu-latest + outputs: + available: ${{ steps.check.outputs.available }} + steps: + - name: Check for a SONAR_TOKEN secret + id: check + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + run: | + if [[ -n "$SONAR_TOKEN" ]]; then + echo "available=true" >> "$GITHUB_OUTPUT" + else + echo "::notice::No SONAR_TOKEN secret, skipping the SonarCloud analysis" + fi + sonar: + needs: check-token + if: needs.check-token.outputs.available == 'true' runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: + persist-credentials: false # Disabling shallow clones is recommended for improving the relevancy of reporting fetch-depth: 0 - - name: Install uv - uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0 + - name: Set up aswfdocker + uses: $/.github/actions/setup-aswfdocker with: - enable-cache: auto - - - name: Set up Python - run: uv python install 3.10 - - - name: Install aswfdocker and dev dependencies - run: uv sync --all-extras --frozen + dev: 'true' # mypy static type checks with junit XML report - name: Run mypy @@ -38,3 +62,10 @@ jobs: uses: SonarSource/sonarqube-scan-action@ba9859eae8dd6bd29e412f25ddbbef3d032000f4 # v8.2.2 env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + with: + # A fork with its own SonarCloud project sets the SONAR_ORGANIZATION + # and SONAR_PROJECT_KEY repository variables to override + # sonar-project.properties. + args: >- + ${{ vars.SONAR_ORGANIZATION && format('-Dsonar.organization={0}', vars.SONAR_ORGANIZATION) || '' }} + ${{ vars.SONAR_PROJECT_KEY && format('-Dsonar.projectKey={0}', vars.SONAR_PROJECT_KEY) || '' }} diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 5106d4fe8..07d304b12 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -12,23 +12,27 @@ on: paths-ignore: - '**.md' +permissions: + contents: read + +# Superseded runs for the same branch or pull request are cancelled. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: python: runs-on: ubuntu-latest steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - name: Install uv - uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0 with: - enable-cache: auto + persist-credentials: false - - name: Set up Python - run: uv python install 3.10 - - - name: Install aswfdocker and dev dependencies - run: uv sync --all-extras --frozen + - name: Set up aswfdocker + uses: $/.github/actions/setup-aswfdocker + with: + dev: 'true' - name: Run all pre-commit tests run: uv run pre-commit run --all-files diff --git a/.github/workflows/release-all.yml b/.github/workflows/release-all.yml new file mode 100644 index 000000000..e3fbaaa31 --- /dev/null +++ b/.github/workflows/release-all.yml @@ -0,0 +1,180 @@ +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Releases every Conan package and image of the given versions from a given +# commit, in dependency order: each stage starts once the stages it needs +# have released every version. Package builds only need ci-baseos-gl-conan +# and the packages they depend on, so images are built alongside the next +# package groups: +# +# stage needs +# baseos-gl-conan image - +# common packages baseos-gl-conan image +# common image common packages +# base1 packages common packages +# base2 packages base1 packages +# base3 packages base2 packages +# base images common image, base3 packages +# vfx packages base3 packages +# vfx images common image, vfx packages +# +# Started by `aswfdocker release --full-release` +# (see CONTRIBUTING.md). After a failure, re-running the failed jobs resumes +# the release: packages Artifactory already has are skipped. +# +# The review group (OpenRV) isn't released while it's broken. +name: Release All +run-name: "Full release of ${{ inputs.versions }} for ${{ inputs.org }} at ${{ inputs.sha }}" + +on: + workflow_dispatch: + inputs: + sha: + description: Commit to release + required: true + type: string + org: + description: Docker Hub organization and Conan user to release to + required: true + type: choice + options: + - aswftesting + - aswf + versions: + description: Space-separated versions (e.g. "2026 2027"), each built by its own jobs + required: true + type: string + force_rebuild: + description: Rebuild Conan packages even if Artifactory has an up-to-date binary + required: false + type: boolean + default: false + message: + description: Image release message + required: false + type: string + default: "" + +permissions: + contents: read + +jobs: + baseos-gl-conan-image: + uses: $/.github/workflows/release-images.yml + permissions: + contents: write # for release-images.yml's record job, creating the GitHub releases + with: + sha: ${{ inputs.sha }} + docker_org: ${{ inputs.org }} + groups: baseos-gl-conan + versions: ${{ inputs.versions }} + message: ${{ inputs.message }} + secrets: + DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} + + common-packages: + needs: baseos-gl-conan-image + uses: $/.github/workflows/release-packages.yml + with: + sha: ${{ inputs.sha }} + package_org: ${{ inputs.org }} + groups: common + versions: ${{ inputs.versions }} + force_rebuild: ${{ inputs.force_rebuild }} + secrets: + ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }} + ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }} + + common-image: + needs: common-packages + uses: $/.github/workflows/release-images.yml + permissions: + contents: write # for release-images.yml's record job, creating the GitHub releases + with: + sha: ${{ inputs.sha }} + docker_org: ${{ inputs.org }} + groups: common + versions: ${{ inputs.versions }} + message: ${{ inputs.message }} + secrets: + DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} + + base1-packages: + needs: common-packages + uses: $/.github/workflows/release-packages.yml + with: + sha: ${{ inputs.sha }} + package_org: ${{ inputs.org }} + groups: base1 + versions: ${{ inputs.versions }} + force_rebuild: ${{ inputs.force_rebuild }} + secrets: + ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }} + ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }} + + base2-packages: + needs: base1-packages + uses: $/.github/workflows/release-packages.yml + with: + sha: ${{ inputs.sha }} + package_org: ${{ inputs.org }} + groups: base2 + versions: ${{ inputs.versions }} + force_rebuild: ${{ inputs.force_rebuild }} + secrets: + ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }} + ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }} + + base3-packages: + needs: base2-packages + uses: $/.github/workflows/release-packages.yml + with: + sha: ${{ inputs.sha }} + package_org: ${{ inputs.org }} + groups: base3 + versions: ${{ inputs.versions }} + force_rebuild: ${{ inputs.force_rebuild }} + secrets: + ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }} + ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }} + + base-images: + needs: [common-image, base3-packages] + uses: $/.github/workflows/release-images.yml + permissions: + contents: write # for release-images.yml's record job, creating the GitHub releases + with: + sha: ${{ inputs.sha }} + docker_org: ${{ inputs.org }} + groups: base + versions: ${{ inputs.versions }} + message: ${{ inputs.message }} + secrets: + DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} + + vfx-packages: + needs: base3-packages + uses: $/.github/workflows/release-packages.yml + with: + sha: ${{ inputs.sha }} + package_org: ${{ inputs.org }} + groups: vfx + versions: ${{ inputs.versions }} + force_rebuild: ${{ inputs.force_rebuild }} + secrets: + ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }} + ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }} + + vfx-images: + needs: [common-image, vfx-packages] + uses: $/.github/workflows/release-images.yml + permissions: + contents: write # for release-images.yml's record job, creating the GitHub releases + with: + sha: ${{ inputs.sha }} + docker_org: ${{ inputs.org }} + groups: vfx + versions: ${{ inputs.versions }} + message: ${{ inputs.message }} + secrets: + DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} diff --git a/.github/workflows/release-images.yml b/.github/workflows/release-images.yml new file mode 100644 index 000000000..daf000c45 --- /dev/null +++ b/.github/workflows/release-images.yml @@ -0,0 +1,213 @@ +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Builds ci-image Docker images from a given commit and pushes them to Docker +# Hub, one job per version, then publishes the draft GitHub release recording +# each released image on the commit, with the image's SBOM attached, which +# creates its tag. Started by +# `aswfdocker release -t IMAGE`, or called by release-all.yml (see +# CONTRIBUTING.md), as only GitHub Actions holds the Docker Hub credentials +# (and, in future, the image signing keys). `aswfdocker release` creates the +# drafts first, with the token of the person releasing, who the releases are +# attributed to. +name: Release Images +run-name: "Images ${{ inputs.groups }} ${{ inputs.targets }} ${{ inputs.versions }} for ${{ inputs.docker_org }} at ${{ inputs.sha }}" + +on: + workflow_dispatch: + inputs: + sha: + description: Commit to build the images from + required: true + type: string + docker_org: + description: Docker Hub organization to push to + required: true + type: choice + options: + - aswftesting + - aswf + groups: + description: Space-separated image groups + required: true + type: string + versions: + description: Space-separated versions (e.g. "2026 2027", or "2027-clang22"), each built by its own job + required: true + type: string + targets: + description: Space-separated images to build (default the whole groups) + required: false + type: string + default: "" + message: + description: Release message, for images without a draft release (created by `aswfdocker release`) + required: false + type: string + default: "" + workflow_call: + inputs: + sha: + required: true + type: string + docker_org: + required: true + type: string + groups: + required: true + type: string + versions: + required: true + type: string + targets: + required: false + type: string + default: "" + message: + required: false + type: string + default: "" + secrets: + DOCKERHUB_PASSWORD: + required: true + +permissions: + contents: read + +jobs: + check-release: + uses: $/.github/workflows/check-release.yml + with: + sha: ${{ inputs.sha }} + org: ${{ inputs.docker_org }} + groups: ${{ inputs.groups }} + versions: ${{ inputs.versions }} + targets: ${{ inputs.targets }} + + release: # zizmor: ignore[concurrency-limits] a concurrency group would cancel queued releases + needs: check-release + runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-latest-8c-32g-300h') || 'ubuntu-latest' }} + strategy: + fail-fast: false + matrix: + version: ${{ fromJSON(needs.check-release.outputs.versions) }} + env: + DOCKER_CLI_EXPERIMENTAL: enabled + DOCKER_BUILDKIT: '1' + # Inputs (checked by check-release) go through the environment rather + # than being expanded into scripts. + DOCKER_ORG: ${{ inputs.docker_org }} + IMAGE_GROUPS: ${{ inputs.groups }} + IMAGE_VERSION: ${{ matrix.version }} + IMAGE_TARGETS: ${{ inputs.targets }} + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + # The commit check-release checked. + ref: ${{ inputs.sha }} + persist-credentials: false + + - name: Activate Docker buildx + uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 + with: + # Use the docker driver for consistency with docker-builds.yml and local development. + # All images are pushed to Docker Hub in this workflow so the image store sharing + # behaviour difference between drivers has no practical effect here. + driver: docker + env: + BUILDKIT_STEP_LOG_MAX_SIZE: 10485760 + + - name: Set up aswfdocker + uses: $/.github/actions/setup-aswfdocker + + # Secrets go through the environment of the steps needing them, never on + # a command line or expanded into a script. + - name: Login to Docker Hub + env: + DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} + run: printenv DOCKERHUB_PASSWORD | docker login -u aswfdocker --password-stdin + + - name: Build and push + run: | + set -euo pipefail + args=(--ci-image-type IMAGE --docker-org "$DOCKER_ORG" --version "$IMAGE_VERSION") + for group in $IMAGE_GROUPS; do args+=(--group "$group"); done + for target in $IMAGE_TARGETS; do args+=(--target "$target"); done + uv run aswfdocker --repo-uri "$GITHUB_REPOSITORY" --verbose build "${args[@]}" --push YES + + # The SBOM of each image, from the image just built, for the record job + # to attach to its GitHub release. + - name: Export the image SBOMs + run: | + set -euo pipefail + args=(--ci-image-type IMAGE --docker-org "$DOCKER_ORG" --version "$IMAGE_VERSION") + for group in $IMAGE_GROUPS; do args+=(--group "$group"); done + for target in $IMAGE_TARGETS; do args+=(--target "$target"); done + uv run aswfdocker exportsboms "${args[@]}" --output-dir "$RUNNER_TEMP/sboms" + + - name: Upload the image SBOMs + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + # Unique in the run, as release-all.yml calls this workflow once per + # image group. + name: sboms-${{ inputs.groups }}-${{ matrix.version }} + path: ${{ runner.temp }}/sboms/ + if-no-files-found: error + # When the job is re-run. + overwrite: true + + - name: Update Docker Hub descriptions + env: + DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} + run: | + set -euo pipefail + args=(--ci-image-type IMAGE --docker-org "$DOCKER_ORG" --version "$IMAGE_VERSION") + for group in $IMAGE_GROUPS; do args+=(--group "$group"); done + for target in $IMAGE_TARGETS; do args+=(--target "$target"); done + uv run aswfdocker pushoverview "${args[@]}" --username aswfdocker + + - name: Logout from Docker Hub + if: ${{ always() }} + run: docker logout + + # A separate job, the only one allowed to write to the repository, which + # gets no other secret. + record: # zizmor: ignore[concurrency-limits] a concurrency group would cancel queued releases + needs: release + runs-on: ubuntu-latest + permissions: + contents: write # to publish the GitHub releases (creating their tags) + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: ${{ inputs.sha }} + persist-credentials: false + + - name: Set up aswfdocker + uses: $/.github/actions/setup-aswfdocker + + - name: Download the image SBOMs + uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 + with: + pattern: sboms-${{ inputs.groups }}-* + path: ${{ runner.temp }}/sboms + merge-multiple: true + + - name: Publish the GitHub releases + env: + GITHUB_TOKEN: ${{ github.token }} + SHA: ${{ inputs.sha }} + DOCKER_ORG: ${{ inputs.docker_org }} + IMAGE_GROUPS: ${{ inputs.groups }} + IMAGE_VERSIONS: ${{ inputs.versions }} + IMAGE_TARGETS: ${{ inputs.targets }} + MESSAGE: ${{ inputs.message }} + run: | + set -euo pipefail + args=(--ci-image-type IMAGE --docker-org "$DOCKER_ORG" --sha "$SHA" --message "$MESSAGE" + --sbom-dir "$RUNNER_TEMP/sboms") + for group in $IMAGE_GROUPS; do args+=(--group "$group"); done + for version in $IMAGE_VERSIONS; do args+=(--version "$version"); done + for target in $IMAGE_TARGETS; do args+=(--target "$target"); done + uv run aswfdocker publishreleases "${args[@]}" diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml new file mode 100644 index 000000000..a7deac335 --- /dev/null +++ b/.github/workflows/release-packages.yml @@ -0,0 +1,135 @@ +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Builds Conan packages from a given commit and uploads them to Artifactory, +# one job per version. Started by `aswfdocker release -t PACKAGE`, or called +# by release-all.yml (see CONTRIBUTING.md), as only GitHub Actions holds the +# Artifactory credentials (and, in future, the package signing keys). +name: Release Conan Packages +run-name: "Conan packages ${{ inputs.groups }} ${{ inputs.targets }} ${{ inputs.versions }} for ${{ inputs.package_org }} at ${{ inputs.sha }}" + +on: + workflow_dispatch: + inputs: + sha: + description: Commit to build the packages from + required: true + type: string + package_org: + description: Conan user and Artifactory remote to upload to + required: true + type: choice + options: + - aswftesting + - aswf + groups: + description: Space-separated package groups + required: true + type: string + versions: + description: Space-separated versions (e.g. "2026 2027", or "2027-clang22"), each built by its own job + required: true + type: string + targets: + description: Space-separated packages to build (default the whole groups) + required: false + type: string + default: "" + force_rebuild: + description: Rebuild even if Artifactory has an up-to-date binary + required: false + type: boolean + default: false + workflow_call: + inputs: + sha: + required: true + type: string + package_org: + required: true + type: string + groups: + required: true + type: string + versions: + required: true + type: string + targets: + required: false + type: string + default: "" + force_rebuild: + required: false + type: boolean + default: false + secrets: + ARTIFACTORY_USER: + required: true + ARTIFACTORY_TOKEN: + required: true + +permissions: + contents: read + +jobs: + check-release: + uses: $/.github/workflows/check-release.yml + with: + sha: ${{ inputs.sha }} + org: ${{ inputs.package_org }} + groups: ${{ inputs.groups }} + versions: ${{ inputs.versions }} + targets: ${{ inputs.targets }} + + release: # zizmor: ignore[concurrency-limits] a concurrency group would cancel queued releases + needs: check-release + runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-latest-8c-32g-300h') || 'ubuntu-latest' }} + strategy: + # Let the other versions finish uploading their packages, so that + # re-running the failed jobs only rebuilds what's missing. + fail-fast: false + matrix: + version: ${{ fromJSON(needs.check-release.outputs.versions) }} + env: + DOCKER_CLI_EXPERIMENTAL: enabled + DOCKER_BUILDKIT: '1' + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + # The commit check-release checked. + ref: ${{ inputs.sha }} + persist-credentials: false + + - name: Activate Docker buildx + uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 + with: + # Use the docker driver for consistency with docker-builds.yml and local development. + driver: docker + env: + BUILDKIT_STEP_LOG_MAX_SIZE: 10485760 + + - name: Set up aswfdocker + uses: $/.github/actions/setup-aswfdocker + + - name: Build and upload + env: + # Only this step gets the Artifactory credentials, and only the + # `conan upload` step of the package builds (see + # packages/common/Dockerfile) gets them from it, as BuildKit secrets. + CONAN_LOGIN_USERNAME: ${{ secrets.ARTIFACTORY_USER }} + CONAN_PASSWORD: ${{ secrets.ARTIFACTORY_TOKEN }} + # Inputs (checked by check-release) go through the environment + # rather than being expanded into the script. + PACKAGE_ORG: ${{ inputs.package_org }} + PACKAGE_GROUPS: ${{ inputs.groups }} + PACKAGE_VERSION: ${{ matrix.version }} + PACKAGE_TARGETS: ${{ inputs.targets }} + FORCE_REBUILD: ${{ inputs.force_rebuild }} + run: | + set -euo pipefail + args=(--ci-image-type PACKAGE --docker-org "$PACKAGE_ORG" --version "$PACKAGE_VERSION" --push YES) + for group in $PACKAGE_GROUPS; do args+=(--group "$group"); done + for target in $PACKAGE_TARGETS; do args+=(--target "$target"); done + if [[ "$FORCE_REBUILD" == "true" ]]; then args+=(--force-rebuild); fi + uv run aswfdocker --repo-uri "$GITHUB_REPOSITORY" --verbose build "${args[@]}" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index b28c78e53..000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Release - -on: - release: - types: [created] - -jobs: - release: - runs-on: ${{ (github.repository_owner == 'AcademySoftwareFoundation' && 'ubuntu-latest-8c-32g-300h') || 'ubuntu-latest' }} - env: - DOCKER_CLI_EXPERIMENTAL: enabled - DOCKER_BUILDKIT: '1' - CONAN_LOGIN_USERNAME: ${{ secrets.ARTIFACTORY_USER }} - CONAN_PASSWORD: ${{ secrets.ARTIFACTORY_TOKEN }} - GITHUB_REF_LOCAL: ${{ github.ref || format('{0}{1}', 'refs/tags/', github.event.release.tag_name) }} - - steps: - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 - - - name: Activate Docker buildx - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 - with: - # Use the docker driver for consistency with docker-builds.yml and local development. - # All images are pushed to Docker Hub in this workflow so the image store sharing - # behaviour difference between drivers has no practical effect here. - driver: docker - env: - BUILDKIT_STEP_LOG_MAX_SIZE: 10485760 - - - name: Install uv - uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0 - with: - enable-cache: auto - - - name: Set up Python - run: uv python install 3.10 3.10 3.10 - - - name: Install aswfdocker and dependencies - run: uv sync --frozen - - - name: Login to DockerHub - if: ${{ !contains(github.ref, '/ci-package') }} - run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login -u aswfdocker --password-stdin - - - name: Build and Push - run: | - uv run aswfdocker \ - --repo-uri $GITHUB_REPOSITORY \ - --verbose \ - build \ - --full-name $GITHUB_REF_LOCAL \ - --push YES - - - name: Update Docker Hub Description - if: ${{ !contains(github.ref, '/ci-package') }} - run: | - uv run aswfdocker \ - pushoverview \ - --username aswfdocker \ - --password ${{ secrets.DOCKERHUB_PASSWORD }} \ - --full-name $GITHUB_REF_LOCAL diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ff0a9b9da..0f33ecf54 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -24,3 +24,15 @@ repos: pass_filenames: false language: system types: [python] + - id: zizmor + name: Check GitHub Actions workflows and actions with zizmor + entry: uv run zizmor .github/workflows .github/actions + pass_filenames: false + language: system + files: ^\.github/ + - id: jactionlint + name: Check GitHub Actions workflows and actions with jactionlint + entry: uv run jactionlint + pass_filenames: false + language: system + files: ^\.github/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b911deaa..64df1d9b0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,34 @@ All notable changes to this project will be documented in this file. +# 2026-11-27 + +- Build and release infrastructure updates + - aswfdocker [uses Conan's dependency graph to determine build order](https://github.com/AcademySoftwareFoundation/aswf-docker/issues/386) +instead of hand-maintained build levels in versions.yaml + - package groups collapsed to `common`, `base1`, `base2`, `base3` and `vfx`, image groups `vfx1`-`vfx3` merged into `vfx` + - packages with up-to-date builds are skipped, `--force-rebuild` forces a rebuild (bypassing the BuildKit cache), `--target-to` / `--target-from` select part of a group + - a package is rebuilt whenever any of its dependencies changes (version, recipe or patches), transitively + - never use package builds from Conan Center Index, glu recipe vendored + - Single version per VFX Platform year for every image: `ci-common:2027-clang22` instead of `ci-common:7-clang22`, +`ci-common` and `ci-baseos-gl-conan` keep additional legacy tags for 2023-2027 + - [`ci-packages` removed from versions.yaml](https://github.com/AcademySoftwareFoundation/aswf-docker/issues/310), 2019-2022 and CentOS 7 support removed + - Conan packages built in per-release channels (e.g. `vfx2027_4`), so a new release (minor version) never reuses the previous release's packages + - Images include a [CycloneDX SBOM](https://github.com/AcademySoftwareFoundation/aswf-docker/issues/275) of their Conan packages +in `/usr/local/aswf/sbom.cdx.json`, attached to each image's GitHub release + - release builds record the git SHA each Conan package was built from + - Release process moved to GitHub Actions workflows started by `aswfdocker release`, no more GitHub web UI or `gh` CLI needed + - `release-packages.yml` builds and uploads Conan packages to Artifactory, without creating GitHub releases + - `release-images.yml` builds and pushes images to Docker Hub, publishing draft GitHub releases created by `aswfdocker release` + - `aswfdocker release --full-release` (`release-all.yml`) releases every package and image of the given years in dependency order + - [fine-grained GitHub token](https://github.com/AcademySoftwareFoundation/aswf-docker/issues/498) with minimal permissions supported and documented + - GitHub Actions hardening + - Artifactory uploads and Docker Hub pushes only allowed from GitHub Actions, from commits on a branch of the repository + - secrets scoped to the steps using them, minimal workflow permissions, no dev dependencies in jobs holding release credentials + - [zizmor](https://github.com/zizmorcore/zizmor) security audit and [jactionlint](https://github.com/jdx/jactionlint) correctness checks added to pre-commit + - GitHub runner disk cleanup updated for Ubuntu 26.04.1, and only run when needed + - Developer documentation updated, including [adding a new Conan recipe](https://github.com/AcademySoftwareFoundation/aswf-docker/issues/482) + # 2026-10-26 Updated 2023.7 2024.11 2025.10 2026.8 2027.3 images diff --git a/CLAUDE.md b/CLAUDE.md index c641885f8..7941d8ef1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -5,7 +5,7 @@ **aswf-docker** builds and manages Docker CI images and Conan packages for the [Academy Software Foundation (ASWF)](https://www.aswf.io/) VFX Platform. It provides standardized build environments for VFX software across multiple -platform years (2019-2026). +platform years (2023-2027). ## Repository Structure @@ -30,15 +30,21 @@ aswf-docker/ │ ├── conan/settings/ # Conan profile settings (profiles/ is auto-generated) │ └── common/ # Shared build utilities ├── scripts/ # Shell utilities, VFX scripts, tests -├── .github/workflows/ # CI: python.yml, docker-builds.yml, release.yml, python-sonar.yml +├── .github/workflows/ # CI: python.yml, docker-builds.yml, python-sonar.yml, release-*.yml, check-release.yml +├── .github/actions/ # setup-aswfdocker composite action (uv, Python, uv sync) used by the workflows ├── versions.yaml # Symlink to python/aswfdocker/data/versions.yaml └── pyproject.toml # Python project config (uv, pytest, black) ``` ### Key Concepts -- **versions.yaml**: Central version registry defining package versions per VFX - Platform year. Versions use inheritance (e.g., `2-clang10` inherits from `2`). +- **versions.yaml**: Central version registry with one section per VFX Platform + year (e.g. `2027`) holding all its pins, toolchain included, and its + current release's `minor_version`. A `-clang` version (e.g. + `2027-clang22`) is derived from each of the year's `clang_versions`, for + per-clang images and `per_clang_packages`. +- **ci-images** (in versions.yaml): every image, built for each year's release + as `.` (or `-clang.` when `per_clang`). - **image.yaml**: Per-image specs listing packages, base image, and metadata. - **Dockerfiles and Conan profiles are generated**: From Jinja2 templates via `aswfdocker dockergen`. Never edit `ci-*/Dockerfile`, `ci-*/README.md`, or @@ -74,7 +80,13 @@ uv run mypy python/aswfdocker uv run pylint python/aswfdocker # Formatting (Black, targets Python 3.10) -uv run black python/ packages/conan/settings/extensions/deployers/ +uv run black python/ packages/conan/settings/extensions/deployers/ packages/conan/settings/extensions/commands/ packages/conan/settings/extensions/hooks/ + +# GitHub Actions workflow security audit +uv run zizmor .github/workflows .github/actions + +# GitHub Actions workflow and action correctness check (with shellcheck on run: scripts) +uv run jactionlint # Run all pre-commit hooks uv run pre-commit run --all-files @@ -87,13 +99,16 @@ uv run aswfdocker dockergen --check ```bash # Build a specific image group and version -uv run aswfdocker build --ci-image-type IMAGE --group base --version 2026-clang20 --push NO +uv run aswfdocker build --ci-image-type IMAGE --group base --version 2026 --push NO # Build Conan packages -uv run aswfdocker build --ci-image-type PACKAGE --group common --version 2026-clang20 --push NO +uv run aswfdocker build --ci-image-type PACKAGE --group vfx --version 2027 --push NO + +# Build a package and everything it requires within its group, in dependency order +uv run aswfdocker build --ci-image-type PACKAGE --target-to openexr --version 2027 --push NO # Dry run (show commands without executing) -uv run aswfdocker build --ci-image-type IMAGE --group base --version 2026-clang20 --dry-run +uv run aswfdocker build --ci-image-type IMAGE --group base --version 2026 --dry-run ``` ### Regenerating Dockerfiles and Conan profiles @@ -128,25 +143,38 @@ uv run aswfdocker dockergen --check ### Docker Images - Image names: `ci-{name}` (e.g., `ci-base`, `ci-openexr`) -- Tags: `{major_version}` or `{major_version}-clang{N}` (e.g., `2026-clang20`) +- Tags: `{major_version}` and `{major_version}.{minor_version}`, or + `{major_version}-clang{N}` and `{major_version}-clang{N}.{minor_version}` + (e.g., `2026-clang20.9`); + `ci-common`/`ci-baseos-gl-conan` for 2023-2027 also keep their legacy + `{legacy_common_version}` tags (e.g., `6-clang20`) - Docker orgs: `aswf` (production), `aswftesting` (testing), `aswflocaltesting` (local) - OCI metadata labels are set automatically from templates ### Version Management - All package versions are defined in `versions.yaml` -- Versions use parent inheritance: variant versions (e.g., `6-clang18`) inherit - from base versions (e.g., `6`) and override specific fields +- Each year's `-clang` versions (e.g., `2026-clang20`) inherit all of + the year's pins, overriding only the clang version +- `--version 2026` also selects every `2026-clang` version; Conan packages + are built for every year pinning their version, in the release's + `vfx_` channel (e.g. `vfx2027_4`), inside the + `ci-baseos-gl-conan:.` image +- Bumping a year's `minor_version` starts a new release: none of the previous + release's Conan packages are reused - The `major_version` field maps to VFX Platform years ## CI/CD Workflows | Workflow | Trigger | Purpose | |---|---|---| -| `python.yml` | Push/PR | Pre-commit hooks: black, pytest, mypy, pylint, dockergen --check | +| `python.yml` | Push/PR | Pre-commit hooks: black, pytest, mypy, pylint, zizmor, jactionlint, dockergen --check | | `docker-builds.yml` | Push/PR | Build Docker images and Conan packages (matrix by VFX year) | | `python-sonar.yml` | Push to main | Code quality analysis with SonarCloud | -| `release.yml` | GitHub Release | Full build + push to Docker Hub | +| `release-packages.yml` | `workflow_dispatch` from `aswfdocker release -t PACKAGE`, or `release-all.yml` | Build Conan packages from a commit + upload to Artifactory (one job per version) | +| `release-images.yml` | `workflow_dispatch` from `aswfdocker release -t IMAGE`, or `release-all.yml` | Build images from a commit + push to Docker Hub, then publish the draft GitHub release of each (one job per version) | +| `release-all.yml` | `workflow_dispatch` from `aswfdocker release --full-release` | Release every package and image of the given years, in dependency order | +| `check-release.yml` | Called by the release workflows | Check release inputs, and that the commit is on a branch of the repository | ## Git Conventions @@ -165,7 +193,7 @@ uv run aswfdocker dockergen --check 2. **Never edit `packages/conan/settings/profiles/*` directly** - these are generated from Jinja2 templates in `python/aswfdocker/data/`. To update package versions edit `versions.yaml`; to change profile structure edit - `conan-profile-ci-common.jinja2` or `conan-profile-vfx.jinja2`, then run + `conan-profile-vfx.jinja2`, then run `uv run aswfdocker dockergen`. 3. **Conan recipes in `packages/conan/recipes/` are mostly vendored** from Conan Center Index: @@ -199,3 +227,19 @@ uv run aswfdocker dockergen --check 5. The `migrate` and `download` CLI commands are **deprecated**. 6. Conan packages are built inside a container and the results are stored in a BuildKit cache which is not directly accessible. +7. **Conan packages are only uploaded to Artifactory from GitHub Actions**, the + only place holding the Artifactory credentials (and, in future, package + signing keys): `aswfdocker build -t PACKAGE --push YES` refuses to run + elsewhere. Local package builds only use the local Conan cache. + `aswfdocker release -t PACKAGE` starts `release-packages.yml` via the + GitHub API (no GitHub release or tag is created). +8. **Images are only pushed to Docker Hub from GitHub Actions**, the only place + holding the Docker Hub token (and, in future, image signing keys): + `aswfdocker build --push YES` (or `--push AUTO` resolving to a push) and + `aswfdocker pushoverview` refuse to run elsewhere. + `aswfdocker release -t IMAGE` creates draft GitHub releases of the images + (attributed to the person releasing) and starts `release-images.yml` via + the GitHub API, which publishes them once the images are pushed + (`aswfdocker publishreleases`, GitHub Actions only), with each image's + SBOM (`/usr/local/aswf/sbom.cdx.json`, exported by `aswfdocker + exportsboms`) attached before publishing. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a0940bc3b..e531cebc4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -55,8 +55,8 @@ To contribute code to the project, you will need: * An understanding of the project's development workflow. -* Legal authorization, that is, you need to have signed a Contributor - License Agreement. See below for details. +* Legal authorization: although the project does not currently require a Contributor + License Agreement, all commits are required to be signed off. See below for details. ## Legal Requirements @@ -67,7 +67,10 @@ open source software best practice policies of the Linux Foundation. aswf-docker is licensed under the [Apache-2.0](LICENSE.md) license. Contributions to the project should abide by that standard -license. +license. The exception is the `packages/conan/recipes/` +hierarchy: since most of these are vendored from the +[Conan Center Index](https://github.com/conan-io/conan-center-index), all +recipes retain that project's MIT license. ### Commit Sign-Off @@ -264,9 +267,6 @@ test. Pre-commit hooks need to be installed by running `pre-commit install`, and tests can be run manually by running `pre-commit run --all-files`. -If the `test_releaser.py` test fails, it is possibly because your GitHub API -token has expired or didn't get configured with `aswfdocker settings --github-access-token`. - ## Coding Style #### Formatting @@ -279,6 +279,30 @@ for aswf-docker and is required to be run before any commit. We follow PEP-8 naming convention which is also checked before any commit by the [PyLint](https://docs.pylint.org/) linter. +#### GitHub Actions Workflows + +Before any commit, workflows in `.github/workflows/` and actions in `.github/actions/` +are checked for correctness by [jactionlint](https://github.com/jdx/jactionlint) +(workflow syntax, `${{ }}` expressions, inputs of actions and reusable workflows, and +`run:` scripts with shellcheck), and audited for security issues by +[zizmor](https://docs.zizmor.sh/). jactionlint only runs its `correctness` profile +([.github/jactionlint.yaml](.github/jactionlint.yaml)), as zizmor covers security. In particular, +inputs and secrets go through the environment of the steps needing them rather than +being expanded into scripts, secrets are only given to the steps that use them, actions +are pinned to a commit SHA, and every workflow sets minimal `permissions`. + +Every job running `aswfdocker` sets it up with the +[setup-aswfdocker](.github/actions/setup-aswfdocker/action.yml) composite action +(uv, Python and the project's dependencies, with `dev: 'true'` adding the dev +dependencies), right after `actions/checkout`. It is referenced as +`$/.github/actions/setup-aswfdocker`, so the action comes from the commit the workflow +runs from, rather than from the commit checked out. + +The SonarCloud analysis ([python-sonar.yml](.github/workflows/python-sonar.yml)) runs on +pushes to `main` when a `SONAR_TOKEN` repository secret exists, so forks skip it. To +analyse a fork in your own SonarCloud project, set the `SONAR_TOKEN` secret and the +`SONAR_ORGANIZATION` and `SONAR_PROJECT_KEY` repository variables. + #### Copyright Notices All new source files should begin with a copyright and license stating: @@ -294,14 +318,12 @@ Versioning is further explained in the [README](README.md#version) file. ## Building Conan Packages -This repository contains 2 ways of building packages, Docker packages (`aswf/ci-package-*` images) and Conan packages. - -The Docker packages are being phased out as Conan offers a lot more flexibility when building options and variants of packages, with great cross-platform support. - The [Conan](https://conan.io) [Reference Documentation](https://docs.conan.io/en/latest/reference.html) is a great way to discover and learn all about the Conan package manager. The AcademySoftwareFoundation has an [Artifactory](https://linuxfoundation.jfrog.io/ui/packages) server which hosts all `aswf` Conan packages. Credentials of the artifactory server are maintained by the Linux Foundation and are not known by the ASWF crew, new packages get uploaded via GitHub organisation secrets. +Conan packages can therefore only be uploaded by GitHub Actions builds: `aswfdocker build -t PACKAGE --push YES` refuses to run anywhere else, and +local builds only ever use the local Conan cache. ### Getting started @@ -310,27 +332,18 @@ Use the existing recipes as an example, and borrow from the MIT-licensed Follow the great instructions there: [Conan Center Index - How to add Packages](https://github.com/conan-io/conan-center-index/blob/master/docs/how_to_add_packages.md), -but ignore the `config.yml` instructions as the aswfdocker `versions.yaml` already +but you can mostly ignore the `config.yml` instructions as the aswfdocker `versions.yaml` already takes care of listing all the maintained package versions. If required `config.yml` can still be used when completely different recipes are require for major package versions, see the `onetbb` package for an example. -Then ensure the ASWF-specific settings are added in the `conanfile.py` such as `cpython`. This project attempts to minimize local changes to the recipes which originate in the Conan Center Index. Local changes may be marked with a `# ASWF` comment. For simple recipes, the required changes may be as minimal as: +Then ensure the ASWF-specific settings are added in the `conanfile.py`, as well as ASWF-specific versions and patches in `conandata.yml`. This project attempts to minimize local changes to the recipes which originate in the Conan Center Index. Local changes to recipes vendored from CCI should be marked with a `# ASWF` comment, +and upstream code which does not apply should be commented out rather than deleted. For simple recipes, the required changes may be as minimal as: -- adding a [SPDX license header](https://spdx.dev/learn/handling-license-info/) where the `From:` URL can be obtained by using the `y` hotkey in the GitHub web UI to obtain a permalink to the version of the Conan recipe file -you are basing hyour local copy on. +- adding a [SPDX license header](https://spdx.dev/learn/handling-license-info/) ``` # Copyright (c) Contributors to the conan-center-index Project. All rights reserved. # Copyright (c) Contributors to the aswf-docker Project. All rights reserved. # SPDX-License-Identifier: MIT -# -# From: https://github.com/conan-io/conan-center-index/blob/9a66422e07df06d2c502501de6e00b8b1213b563/recipes/opencolorio/all/conanfile.py -``` - -- adding a `self.name` level to the `copy()` in the `package()` method: when Conan packages are "installed" in the CI build images, they are all flattened together into `/usr/local/` and without this change the license files for all the packages end up in the same directory and can overwrite each other: -``` - def package(self): - # ASWF: separate licenses from multiple package installs - copy(self, "LICENSE.md", src=self.source_folder, dst=os.path.join(self.package_folder, "licenses", self.name)) ``` - comment out the call that removes the `cmake` directory: we want to be able to use @@ -357,7 +370,9 @@ Conan user/org at runtime: the `ASWF_PKG_ORG` environment variable (set to profile, so a single set of profile files serves both organizations. When a sufficiently recent package is provided by the underlying OS distribution, packages labeled as version `system` are created which are thin wrappers around system installed components, and the Conan profile is used to remap `requires()` -call to specific versions to these wrapper packages. Confusingly some will have an actual version number since some dependent packages check for acceptable version ranges. A better versioning scheme would be desirable for these wrapper packages. +call to specific versions to these wrapper packages. Confusingly some will have an actual version number since some dependent packages check for acceptable version ranges. Even though VFX Platform years indirectly specify the Enterprise Linux base image +through the glibc requirement, base image component versions can change over time, which can result in failed dependency checks when a wrapper package with an +explicit version no longer matches the package in the base image. A better versioning scheme would be desirable for these wrapper packages. You can use the `aswfdocker conandiff` command to view, and optionally pull in, updates from the upstream Conan Center Index (CCI) recipes that our recipes in @@ -370,10 +385,9 @@ be removed from the recipe files in a future PR). Every recipe in the manifest is classified as one of: - `cci`: vendored from CCI, with one tracked SHA per upstream folder (or one per version - folder, for the two recipes — `qt` and `onetbb` — that have real multi-version CCI - layouts). Only `cci` recipes are ever diffed or merged against upstream. -- `unique`: not tracked against any upstream (recipes unique to this project, or whose - `From:` link points somewhere other than canonical CCI, e.g. a fork). + folder, for recipes that have real multi-version CCI + layouts specified in a `config.yml` file). Only `cci` recipes are ever diffed or merged against upstream. +- `unique`: not tracked against any upstream (recipes unique to this project). - `system`: a thin wrapper around a system-installed package; never diffed either. #### Checking for updates @@ -498,7 +512,8 @@ bin conaninfo.txt conanmanifest.txt doc include lib libexec licenses met Be careful when trying to modify this cache directory directly, as it is managed by Conan and tracked in a [SQLite](https://www.sqlite.org/) database. The [`conan cache`](https://docs.conan.io/2/reference/commands/cache.html) command -should be used to explicitly manipulate the cache. +should be used to explicitly manipulate the cache. `packages/common/Dockerfile` contains commented out examples of useful Conan commands you may +want to run against the Conan cache. ### Debugging CMake in Conan issues @@ -540,8 +555,13 @@ To specifically look at how `CMake` is trying to find a package, in the `generat The [CHANGELOG.md](CHANGELOG.md) file needs to be updated with the date of the change and the list of new Docker image versions that will be built by the CI infrastructure. -GitHub releases will trigger a `Release` GitHub action that will build the corresponding -image and push it to Docker Hub. +Images are built and pushed to Docker Hub by GitHub Actions release workflows, which `aswfdocker release` starts through the GitHub API. +Each released image is recorded as a GitHub release with its SBOM attached, see [Releasing images](#releasing-images). + +The Docker Hub access token is only available to GitHub Actions as a repository secret (and in future, images will +also be signed there), so images can only be pushed to Docker Hub by GitHub Actions builds: +`aswfdocker build -t IMAGE --push YES` (or `--push AUTO` resolving to a push) and `aswfdocker pushoverview` refuse to +run anywhere else. Local builds only ever load images into the local Docker image store. ### Build @@ -549,163 +569,270 @@ image and push it to Docker Hub. Example use: just build a single package for testing: ```bash -# Build and push USD package to aswftesting -aswfdocker --verbose build -t PACKAGE --group vfx --version 2026 --target usd --push YES -# Build and push ci-vfxall image to aswftesting -aswfdocker --verbose build -t IMAGE --group vfx --version 2026 --target vfxall --push YES +# Build the USD package (and anything it needs) in the local Conan cache +aswfdocker --verbose build -t PACKAGE --group vfx --version 2026 --target usd +# Build the ci-vfxall image in the local Docker image store +aswfdocker --verbose build -t IMAGE --group vfx --version 2026 --target vfxall ``` -If you are building on system with multiple cores, you may want to set the environment variable: +Images are only pushed to Docker Hub, and Conan packages only uploaded to Artifactory, by GitHub Actions builds, see +[Releasing new Docker Images](#releasing-new-docker-images) and [Releasing Conan packages](#releasing-conan-packages). -``` -DOCKER_BUILDKIT=1 +Conan packages are built one at a time: as of Conan 2.18, concurrent builds sharing a Conan cache can fail on its SQLite database lock. Large packages such as Qt or Clang/LLVM still use every core, as CMake runs parallel compiles. Future improvements will use separate Conan caches per VFX Platform year (since we never want to share builds between years), and will incorporate any future Conan improvements around build concurrency. + +### Updating versions + +If a version number of a package or an image needs to be updated, the `versions.yaml` file is the source of truth. +In order to update the templated configuration files with updated version numbers, run `aswfdocker dockergen`. + +`versions.yaml` has one section per VFX Platform year (e.g. `"2027"`) holding every version pin for that year, from the +toolchain (GCC, CUDA, CMake...) to the VFX packages. Each year: + +* has a `minor_version`, its current release (e.g. `4` for the 2027.4 release); +* builds every image listed in `ci-images` (unless listed in its `exclude_versions`), tagged with the release version + (e.g. `ci-base:2027.4`); +* builds a Conan package for every package it pins a version for, in the `vfx_` Conan channel + (e.g. `vfx2027_4`), with the `vfx` Conan profile generated from its pins, in the + `ci-baseos-gl-conan:.` image; +* lists its clang versions in `clang_versions`. A `-clang` version (e.g. `2027-clang22`) is derived for + each one, for the images marked `per_clang` in `ci-images` (`ci-common`, `ci-osl`, `ci-openvdb`, `ci-vfxall`, + tagged e.g. `ci-osl:2027-clang22.4`) and for the Conan packages listed in `per_clang_packages` (`clang` itself). + Everything else uses the year's `ASWF_CLANG_MAJOR_VERSION`, and only the newest clang version's images also get the + bare year tag (e.g. `ci-common:2027`) and the year's extra `tags` (e.g. `latest`). A `draft` tag can be used to signal + that a VFX Platform year is still work in progress, for instance if some of the packages called out by that year + are not released yet and thus the images include an older version of the packages. `draft` has no functional meaning, + it is purely an indication for end users. It is not related to the concept of GitHub draft releases. + Tags are not checked for uniqueness, and should only be applied to a single year. + +`--version 2027` selects all of 2027's clang versions as well, while `--version 2027-clang22` only selects that one. + +Until 2027, `ci-common` and `ci-baseos-gl-conan` were versioned separately from the VFX Platform year (`3` for 2023 up +to `7` for 2027). For existing users, their 2023 to 2027 images are still also tagged with those versions +(e.g. `ci-common:7-clang22` as well as `ci-common:2027-clang22`), as set by each year's `legacy_common_version`. + +### Starting a new release + +To start a new release of a VFX Platform year, increment its `minor_version` in `versions.yaml` and run +`aswfdocker dockergen`. Since the new release has its own Conan channel, none of the previous release's Conan packages +are reused: the whole release is rebuilt, in this order (see +[Example of a large re-release of all supported images](#example-of-a-large-re-release-of-all-supported-images)): + +1. the `ci-baseos-gl-conan` image, which every Conan package of the release is built in; +2. the Conan packages, group by group (`common`, `base1`, `base2`, `base3`, `vfx`); +3. the other images, starting with `ci-common`. + +`aswfdocker release --full-release` does all of this in one go, see [Full releases](#full-releases). + +Similarly, whenever `ci-baseos-gl-conan` changes, every Conan package built in it should be rebuilt, since +it is impossible to determine how changes to the builder image may affect Conan package builds. This is +best done by starting a new release. + +For local builds, build the release's `ci-baseos-gl-conan` image first: + +```bash +aswfdocker build -t IMAGE -g baseos-gl-conan -v 2027 ``` -before running `aswfdocker build`, as that will allow Docker BuildKit to run multiple builds in parallel. This is mostly useful when building smaller larger groups of smaller packages: when building individual large packages like Qt or Clang/LLVM, -CMake will run parallel compiles. `DOCKER_BUILDKIT=1` is set when building on GitHub Actions. +Then build all the Conan package groups (expect `common` to take a long time to build clang/llvm, and `base2` to build qt): -### Migrate +```bash +aswfdocker build -t PACKAGE -g common -v 2027 +aswfdocker build -t PACKAGE -g base1 -v 2027 +aswfdocker build -t PACKAGE -g base2 -v 2027 +aswfdocker build -t PACKAGE -g base3 -v 2027 +aswfdocker build -t PACKAGE -g vfx -v 2027 +``` -`aswfdocker migrate` can migrate images between Docker organizations, should only be used on package images -that are very heavy to build such as clang or qt. -Example use: migrate a single package from `aswftesting` to `aswf` Docker Hub organization. +and finally build the images: ```bash -aswfdocker --verbose migrate --from aswftesting --to aswf --package usd +aswfdocker build -t IMAGE -g common -v 2027 +aswfdocker build -t IMAGE -g base -v 2027 +aswfdocker build -t IMAGE -g vfx -v 2027 ``` -### Updating versions +### Releasing Conan packages -If a version number of a package or an image needs to be updated, the `versions.yaml` file is the main data source. -In order to update the templated images with updated version numbers, run `aswfdocker dockergen`. +Conan packages are built and uploaded to Artifactory by the `Release Conan Packages` GitHub Actions workflow +([release-packages.yml](.github/workflows/release-packages.yml)), which `aswfdocker release -t PACKAGE` starts directly: +no GitHub release or tag is created. The packages are built from the given commit (`--sha`, by default the current commit +of `main`), which must be on a branch of the repository: `main`, or a release branch for a maintenance release. The +workflow refuses any other commit (such as one only pushed to a fork), so the Artifactory credentials are only ever accessed by +code pushed to the main repository. They are also only given to the `conan upload` step: Artifactory downloads need no credentials. -### Manually push new packages +```bash +# A whole group, for every clang version of the year where relevant +aswfdocker release -t PACKAGE -g common -v 2027 --docker-org aswf +# Specific packages +aswfdocker release -t PACKAGE -g vfx -v 2027 --target openexr --target osl --docker-org aswf +``` + +As with local builds, packages for which Artifactory already has an up-to-date binary are skipped, so a release that failed +part way through can simply be started again. `--force-rebuild` rebuilds and uploads them regardless. Packages are built +in dependency order within their group, but a package release fails if one of the packages it needs from another group +hasn't been uploaded yet, so groups need releasing in order (`common`, `base1`, `base2`, `base3`, `vfx`), waiting for +each group's workflow run to finish, unless they're released by a [full release](#full-releases). Each version +(`-v`) is built by its own job, in parallel. + +The workflow runs can be followed in the repository's GitHub Actions tab. The workflow definition is taken from the +repository's default branch, unless `--workflow-ref` names another branch (e.g. to test a change to the workflow on a +fork, together with `--github-org`). + +### Releasing images + +Images are built and pushed to Docker Hub by the `Release Images` GitHub Actions workflow +([release-images.yml](.github/workflows/release-images.yml)), which `aswfdocker release -t IMAGE` starts directly. As +for Conan packages, the images are built from the given commit (`--sha`, by default the current commit of `main`), +which must be on a branch of the repository, and each version (`-v`) is built by its own job. + +Each image is recorded as a GitHub release on the commit, e.g. `aswf/ci-base:2027.4`, with the release message given +with `-m`. `aswfdocker release` first creates these releases as drafts, with your GitHub token, so they're attributed +to you. Drafts are only visible to the repository's maintainers, and have no tag yet. Once the images are pushed, the +workflow publishes the drafts, which creates their tags, replacing any earlier release (and tag) of the same images. +If a build fails, its images' drafts stay until the release is run again, and the earlier published releases are left +alone. + +Each release has the image's SBOM attached, e.g. `ci-base-2027.4.cdx.json`: the [CycloneDX SBOM](https://cyclonedx.org/) +of the Conan packages +in the image (from every layer, e.g. those of `ci-common` too), which the image also holds as +`/usr/local/aswf/sbom.cdx.json`. Each package in it records the commit it was built from (`aswf:git_sha`), from the +package's Conan metadata. As `conan install` doesn't download package metadata, image builds using a Conan remote +download the packages with their metadata first (`conan aswf-download-metadata`, run by +[install_conan_packages.sh](scripts/common/install_conan_packages.sh)). The workflow exports the SBOMs from +the images it built (`aswfdocker exportsboms`), and attaches them to the drafts before publishing them, as releases +can't be changed once published when GitHub's immutable releases are enabled. + +```bash +# A single image +aswfdocker release -n aswftesting/ci-base:2027 +# A whole group of images +aswfdocker release -t IMAGE -g vfx -v 2027 --docker-org aswftesting -m "Testing release" +``` -When rebuilding all packages from the CI is overkill, and if you have access to the right Docker Hub organizations, it is possible -to manually build and push packages and images by overriding the automatic discovery of current repo and branch. -E.g. to build and push a new `ninja` package these commands can be run to push to `aswf` and `aswftesting` organizations: +Images released to `aswftesting` are marked as pre-releases. Creating a GitHub release by hand doesn't build anything. +If the workflow is started without drafts (e.g. from the GitHub Actions tab), it creates the releases itself, attributed +to GitHub Actions. + +### Full releases + +`aswfdocker release --full-release` has the `Release All` GitHub Actions workflow +([release-all.yml](.github/workflows/release-all.yml)) release every Conan package and image of the given years, in +dependency order, without anyone waiting on each group. Like image releases, it first creates the draft releases of +every image it will release: ```bash -# push to aswftesting -aswfdocker --verbose --repo-uri https://github.com/AcademySoftwareFoundation/aswf-docker --source-branch refs/heads/testing build -t PACKAGE --group common --version 1 --target ninja --push YES -# push to aswf -aswfdocker --verbose --repo-uri https://github.com/AcademySoftwareFoundation/aswf-docker --source-branch refs/heads/main build -t PACKAGE --group common --version 1 --target ninja --push YES +aswfdocker release --full-release -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" ``` -### Manual GitHub release creation +It runs the package and image release workflows above, one stage per group, starting each stage once the stages it +needs are released for every year (see the table in `release-all.yml`). `--force-rebuild` rebuilds the Conan packages +even if Artifactory already has them. If a stage fails, "Re-run failed jobs" in the GitHub Actions tab resumes the +release: packages already uploaded are skipped. + +### GitHub token for releases -* Create a new release in [GitHub New Release](https://github.com/AcademySoftwareFoundation/aswf-docker/releases/new) - * Use the following tag format: `ci-NAME:X.Y` (e.g. `ci-common:1.4`) - * Use the following release name format: `aswf/ci-NAME:X.Y` (e.g. `aswf/ci-common:1.4`) - * Enter the release notes for that particular image - * Click Create -* Run a manual build in GitHub Actions on the specific tagged commit created before +`aswfdocker release` starts the release workflows through the GitHub API, which needs a GitHub token: -### Automatic GitHub release creation +* Generate a [fine-grained GitHub token](https://github.com/settings/personal-access-tokens), with access to only the + repository you release from, and these permissions: + * **Actions: Read and write**: to start the release workflows, the only place allowed to upload Conan packages to + Artifactory and push images to Docker Hub. + * **Contents: Read and write**: to check that the commit to release exists, and to create the draft GitHub releases + of images, which the release workflow publishes once the images are pushed. -* Generate a GitHub token to allow `aswfdocker release` to create GitHub releases: - [GitHub Settings](https://github.com/settings/tokens) with **"repo"** permissions. + A fine-grained token only reaches the repositories of its **Resource owner**: + * To release from `AcademySoftwareFoundation/aswf-docker`, the resource owner must be the `AcademySoftwareFoundation` + organization, even if you are a maintainer of the repository. Generating the token then requests access to the + organization, and the token can't start releases until an organization owner approves the request. The organization + is administered by Linux Foundation support: you may want to open a ticket on the + [Linux Foundation Project IT Service Support Portal](https://jira.linuxfoundation.org/plugins/servlet/desk/portal/2) + to expedite the approval. Changing the token's permissions later requires a new approval. + * To test releases on your fork, use a separate token, with your own account as the resource owner, which needs no + approval. + + Give the token an expiration date: a shorter lifetime limits the damage if it leaks, but each new organization token + needs approving again. + + A classic token with the **"repo"** scope also works, without organization approval, but it can access every + repository you have access to, not just the one you release from. * Configure the token in the `aswfdocker` settings by running: ```bash aswfdocker settings --github-access-token MYTOKEN ``` -* Run the `release` command for a given image: - ```bash - aswfdocker release -n aswftesting/ci-base:2026 - ``` - or for a whole group of images: - ```bash - aswfdocker release -t PACKAGE -g base1 -v 2026 --docker-org aswftesting -m "Testing release" - ``` -An email address must be publicly visible in your GitHub profile in order for the [PyGithub module](https://github.com/PyGithub/PyGithub) used -by `aswfdocker` to work. For pre-releases you can use the `--sha` option to build from a specific commit. +`aswfdocker conandiff` also uses this token, if one is configured: it only reads the public Conan Center Index +repository, but GitHub limits unauthenticated API requests to 60 per hour, which comparing more than a few recipes +exceeds, and authenticated ones to 5,000 per hour. Any token works for this, including an organization token still +awaiting approval, as fine-grained tokens can always read public repositories. + +Publishing the draft releases (which creates their tags) is done by the release workflow itself, with the `GITHUB_TOKEN` GitHub Actions gives it, so your personal token is never passed to GitHub Actions. ### Adding a new `ci` image Let's consider the addition of a new `ci-xyz` Docker image to help the maintainers of the `xyz` library. The `ci-xyz` Docker image -should be prepared with most upstream dependencies of the `xyz` library. - -It is usually a good idea to add this `xyz` package to the `vfxall` library so that it can be tested there. - -* Add a new `xyz` version section in the `versions.yaml`, for both the `ci-package-xyz` Docker package and the `ci-xyz` for the CI image. -* Create a new `ci-xyx/Dockerfile` using an existing one as an example (e.g. `ci-otio/Dockerfile`). -* Create a new `scripts/vfx/build_xyz.sh` file that builds and installs `xyz` from source. -* Add a new `xyz` section at the end of the `packages/Dockerfile` file to build the `ci-package-xyz` Docker package using the previous script. -* Add the `xyz` package to the `ci-vfxall/Dockerfile` image. +should include as many upstream dependencies of the `xyz` library as possible. + +It is usually a good idea to also add this `xyz` package to the `vfxall` image so that it can be tested there. + +* Add the `xyz` version pin to each year of `versions.yaml` it should be built for, and add `xyz` to its `ci-images` (and + image `groups`). +* Create a new `ci-xyz/image.yaml` using an existing one as an example (e.g. `ci-oiio/image.yaml`). +* Create a new `scripts/vfx/build_xyz.sh` file that builds and installs `xyz` from source to test builds outside Conan. +* Import and adapt an existing Conan recipe from [Conan Center Index](https://github.com/conan-io/conan-center-index) + if one exists, or create one from scratch using existing recipes as examples. +* Add Conan package description in `packages/conan/recipes/conan-center-index-upstream.json` specifying the class + of Conan package (`cci` if imported from Conan Center Index, `unique` if unique to this project). +* Add the new Conan package to the Conan environment template `python/aswfdocker/data/conan-profile-vfx.jinja2` +* Add the `xyz` package to the `ci-vfxall/image.yaml` image. +* Update the table of released `ci-` images in the top level `README.md` * Test the scripts by running these commands in order and manually checking if everything works ```bash + # Regenerate all templated files + aswfdocker dockergen + # If the recipe is vendored from CCI (imported from its current master), record the CCI commit in the master + aswfdocker conandiff --group vfx --target xyz --update-manifest + # Build the Conan package + aswfdocker build --ci-image-type PACKAGE --group vfx --version 2027 --target xyz # Build the CI image - aswfdocker build -n aswftesting/ci-xyz:2026 - # Build the CI package (a small Docker image that contains only the xyz build artifacts) - aswfdocker build -n aswftesting/ci-package-xyz:2026 --progress plain - # Buils the `vfxall` package that should now contain the `xyz` package - aswfdocker build -n aswftesting/ci-vfxall:2026 + aswfdocker build --ci-image-type IMAGE -n aswftesting/ci-xyz:2027 + # Build the `vfxall` image that should now contain the `xyz` package + aswfdocker build --ci-image-type IMAGE -n aswftesting/ci-vfxall:2027 # Now run the vfxall image locally to test if xyz is working properly - docker run --gpus=all -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:rw -v `pwd`:/project --rm -it aswftesting/ci-vfxall:2026 bash + docker run --gpus=all -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix:rw -v `pwd`:/project --rm -it aswftesting/ci-vfxall:2027 bash ``` -* Do a pre-release of the new `ci-package-xyz` image so it can be used by the GitHub Action builds and tests: +* Create the Pull Request with these changes +* Once the PR is merged, a maintainer builds and uploads the new `xyz` Conan package, so it can be used by the GitHub Actions builds: ```bash - # Create a GitHub release to build the `ci-package-xyz:202_` image via a GitHub action - aswfdocker release -n aswftesting/ci-package-xyz:2024 --sha `git rev-parse HEAD` --github-org MY_GITHUB_ORG - aswfdocker release -n aswftesting/ci-package-xyz:2025 --sha `git rev-parse HEAD` --github-org MY_GITHUB_ORG - aswfdocker release -n aswftesting/ci-package-xyz:2026 --sha `git rev-parse HEAD` --github-org MY_GITHUB_ORG + aswfdocker release -t PACKAGE -g vfx --target xyz -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf ``` -* Create the Pull Request with these changes - -Check [#66](https://github.com/AcademySoftwareFoundation/aswf-docker/pull/66) for an example. ### Example of a large re-release of all supported images +A [full release](#full-releases) releases everything, in dependency order: + +```bash +aswfdocker release --full-release -v all --docker-org aswf -m "RELEASE_NOTES!" +``` + +Doing the same group by group needs waiting for each group's GitHub Actions runs to finish before releasing the next +one. A bare year version also selects all of that year's clang versions, e.g. both `ci-common:2027-clang21` and +`ci-common:2027-clang22`. + ```bash # Image for building Conan packages -aswfdocker release -t IMAGE -g baseos-gl-conan -v 3 -v 4 -v 5 -v 6 -v 7 --target baseos-gl-conan --docker-org aswf -m "RELEASE_NOTES!" - -# Common packages -aswfdocker release -t PACKAGE -g common-wrappers -v 3 -v 4 -v 5 -v 6 -v 7 --docker-org aswf -m "RELEASE_NOTES!" -aswfdocker release -t PACKAGE -g common-1 -v 3 -v 4 -v 5 -v 6 -v 7 --docker-org aswf -m "RELEASE_NOTES!" -aswfdocker release -t PACKAGE -g common-2 -v 3-clang14-v 3-clang15 -v 4-clang16 -v 4-clang17 -v 5-clang18 -v 5-clang19 -v 6-clang19 -v 6-clang20 -v 7-clang21 -v 7-clang22 --docker-org aswf -m "RELEASE_NOTES!" -# Wait for clang builds to finish (from 2 to 3 hours!) - -# ci-common needs to be built before base packages can be built -aswfdocker release -t IMAGE -g common -v 4-clang16 -v 4-clang17 -v 5-clang18 -v 5-clang19 -v 6-clang19 -v 6-clang20 -v 7-clang21 -v 7-clang22 --docker-org aswf -m "RELEASE_NOTES!" - -# Base packages -aswfdocker release -t PACKAGE -g base1-wrappers -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" -aswfdocker release -t PACKAGE -g base1-1 -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" -aswfdocker release -t PACKAGE -g base1-2 -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" -aswfdocker release -t PACKAGE -g base1-3 -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" - -aswfdocker release -t PACKAGE -g base2-wrappers -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" -aswfdocker release -t PACKAGE -g base2-1 -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" -aswfdocker release -t PACKAGE -g base2-2 -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" -# Wait for Qt builds to finish (2-6 hours!) - -# Usually some Qt build will fail as too big and too slow for free GitHub actions... So here's how to build qt locally: -# This is no longer valid, as Qt is now only build as a Conan package -aswfdocker --repo-uri https://github.com/AcademySoftwareFoundation/aswf-docker --source-branch refs/heads/main --verbose build -n aswf/ci-package-qt:2025 -docker push aswf/ci-package-qt:2025 -docker push aswf/ci-package-qt:2025-6.5.4 -docker push aswf/ci-package-qt:preview -docker push aswf/ci-package-qt:2025.0 - -# Once all Qt are out, release PySide packages -aswfdocker release -t PACKAGE -g base3 -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" - -# Wait for all Qt and Pyside builds to finish, then build downstream packages: -# VFX packages -aswfdocker release -t PACKAGE -g vfx1-wrappers -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" -aswfdocker release -t PACKAGE -g vfx1-1 -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" -aswfdocker release -t PACKAGE -g vfx1-2 -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" -aswfdocker release -t PACKAGE -g vfx1-3 -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" -aswfdocker release -t PACKAGE -g vfx1-4 -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" -aswfdocker release -t PACKAGE -g vfx1-5 -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" -aswfdocker release -t PACKAGE -g vfx1-6 -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" -aswfdocker release -t PACKAGE -g vfx1-7 -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" - -# Finally build the CI images +aswfdocker release -t IMAGE -g baseos-gl-conan -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" + +# Then the Conan packages, one group at a time +aswfdocker release -t PACKAGE -g common -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf +aswfdocker release -t PACKAGE -g base1 -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf +aswfdocker release -t PACKAGE -g base2 -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf +aswfdocker release -t PACKAGE -g base3 -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf +aswfdocker release -t PACKAGE -g vfx -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf + +# ci-common needs the clang packages, and needs to be built before the base images +aswfdocker release -t IMAGE -g common -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" + +# Then the CI images aswfdocker release -t IMAGE -g base -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" -aswfdocker release -t IMAGE -g vfx1 -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" -aswfdocker release -t IMAGE -g vfx2 -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" -aswfdocker release -t IMAGE -g vfx3 -v 2023-clang14 -v 2023-clang15 -v 2024-clang16 -v 2024-clang17 -v 2025-clang18 -v 2025-clang19 -v 2026-clang19 -v 2026-clang20 -v 2027-clang21 -v 2027-clang22--docker-org aswf -m "RELEASE_NOTES!" +aswfdocker release -t IMAGE -g vfx -v 2023 -v 2024 -v 2025 -v 2026 -v 2027 --docker-org aswf -m "RELEASE_NOTES!" ``` diff --git a/README.md b/README.md index 5d708cb71..d57c6cad1 100644 --- a/README.md +++ b/README.md @@ -12,17 +12,17 @@ Changes are documented in [CHANGELOG.md](CHANGELOG.md) ## CI Images -These images are for Continuous Integration testing of various project managed by the ASWF. Each image is available for multiple VFX Platform Years, some versions of `ci-common` are common to multiple VFX Platform Years. Docker Hub stats do not break down pull count statistics per image tag, the pull count is an aggregate for all tags of an image. +These images are for Continuous Integration testing of various project managed by the ASWF. Each image is available for multiple VFX Platform Years, and is tagged with the year (e.g. `2027`) or, for images built with each supported clang version, the year and clang version (e.g. `2027-clang22`). For existing users, `ci-common` images up to 2027 are also tagged with their former separate version, `3` for 2023 up to `7` for 2027 (e.g. `ci-common:7-clang22`). Docker Hub stats do not break down pull count statistics per image tag, the pull count is an aggregate for all tags of an image. The `ci-packagename` image contains all the dependencies required to build `packagename` and is meant to be used in that package's CI process, it does not include the package itself. The `ci-vfxall` image contains builds of every package, installed in `/usr/local`. | Image | Image Version | Stats | Description | | ----- | ------------- | ----- | ----------- | -| [aswf/ci-common](https://hub.docker.com/r/aswf/ci-common) | [aswf/ci-common:3](https://hub.docker.com/r/aswf/ci-common/tags?name=3) ![Image Version](https://img.shields.io/docker/v/aswf/ci-common/3) | ![Image Size](https://img.shields.io/docker/image-size/aswf/ci-common/3) ![Pulls](https://img.shields.io/docker/pulls/aswf/ci-common) | A base RockyLinux-8 image with gcc-toolset-11 (GCC-11.2.x), clang-14-15 and cuda-11.8. | -| | [aswf/ci-common:4](https://hub.docker.com/r/aswf/ci-common/tags?name=4) ![Image Version](https://img.shields.io/docker/v/aswf/ci-common/4) | ![Image Size](https://img.shields.io/docker/image-size/aswf/ci-common/4) ![Pulls](https://img.shields.io/docker/pulls/aswf/ci-common) | A base RockyLinux-8 image with gcc-toolset-11 (GCC-11.2.x), clang-16-17 and cuda-12.6.3. | -| | [aswf/ci-common:5](https://hub.docker.com/r/aswf/ci-common/tags?name=5) ![Image Version](https://img.shields.io/docker/v/aswf/ci-common/5) | ![Image Size](https://img.shields.io/docker/image-size/aswf/ci-common/5) ![Pulls](https://img.shields.io/docker/pulls/aswf/ci-common) | A base RockyLinux-8 image with gcc-toolset-11 (GCC-11.2.x), clang-18-19 and cuda-12.6.3. | -| | [aswf/ci-common:6](https://hub.docker.com/r/aswf/ci-common/tags?name=6) ![Image Version](https://img.shields.io/docker/v/aswf/ci-common/6) | ![Image Size](https://img.shields.io/docker/image-size/aswf/ci-common/6) ![Pulls](https://img.shields.io/docker/pulls/aswf/ci-common) | A base RockyLinux-8 image with gcc-toolset-14 (GCC-14.2.x), clang-19-20 and cuda-12.9.2. | -| | [aswf/ci-common:7](https://hub.docker.com/r/aswf/ci-common/tags?name=7) ![Image Version](https://img.shields.io/docker/v/aswf/ci-common/7) | ![Image Size](https://img.shields.io/docker/image-size/aswf/ci-common/7) ![Pulls](https://img.shields.io/docker/pulls/aswf/ci-common) | A base RockyLinux-9 image with gcc-toolset-14 (GCC-14.2.x), clang-21-22 and cuda-13.3.0. | +| [aswf/ci-common](https://hub.docker.com/r/aswf/ci-common) | [aswf/ci-common:2023](https://hub.docker.com/r/aswf/ci-common/tags?name=2023) ![Image Version](https://img.shields.io/docker/v/aswf/ci-common/2023) | ![Image Size](https://img.shields.io/docker/image-size/aswf/ci-common/2023) ![Pulls](https://img.shields.io/docker/pulls/aswf/ci-common) | A base RockyLinux-8 image with gcc-toolset-11 (GCC-11.2.x), clang-14-15 and cuda-11.8. | +| | [aswf/ci-common:2024](https://hub.docker.com/r/aswf/ci-common/tags?name=2024) ![Image Version](https://img.shields.io/docker/v/aswf/ci-common/2024) | ![Image Size](https://img.shields.io/docker/image-size/aswf/ci-common/2024) ![Pulls](https://img.shields.io/docker/pulls/aswf/ci-common) | A base RockyLinux-8 image with gcc-toolset-11 (GCC-11.2.x), clang-16-17 and cuda-12.6.3. | +| | [aswf/ci-common:2025](https://hub.docker.com/r/aswf/ci-common/tags?name=2025) ![Image Version](https://img.shields.io/docker/v/aswf/ci-common/2025) | ![Image Size](https://img.shields.io/docker/image-size/aswf/ci-common/2025) ![Pulls](https://img.shields.io/docker/pulls/aswf/ci-common) | A base RockyLinux-8 image with gcc-toolset-11 (GCC-11.2.x), clang-18-19 and cuda-12.6.3. | +| | [aswf/ci-common:2026](https://hub.docker.com/r/aswf/ci-common/tags?name=2026) ![Image Version](https://img.shields.io/docker/v/aswf/ci-common/2026) | ![Image Size](https://img.shields.io/docker/image-size/aswf/ci-common/2026) ![Pulls](https://img.shields.io/docker/pulls/aswf/ci-common) | A base RockyLinux-8 image with gcc-toolset-14 (GCC-14.2.x), clang-19-20 and cuda-12.9.2. | +| | [aswf/ci-common:2027](https://hub.docker.com/r/aswf/ci-common/tags?name=2027) ![Image Version](https://img.shields.io/docker/v/aswf/ci-common/2027) | ![Image Size](https://img.shields.io/docker/image-size/aswf/ci-common/2027) ![Pulls](https://img.shields.io/docker/pulls/aswf/ci-common) | A base RockyLinux-9 image with gcc-toolset-14 (GCC-14.2.x), clang-21-22 and cuda-13.1.2. | | [aswf/ci-base](https://hub.docker.com/r/aswf/ci-base) | [aswf/ci-base:2023](https://hub.docker.com/r/aswf/ci-base/tags?name=2023) ![Image Version](https://img.shields.io/docker/v/aswf/ci-base/2023) | ![Image Size](https://img.shields.io/docker/image-size/aswf/ci-base/2023) ![Pulls](https://img.shields.io/docker/pulls/aswf/ci-base) | Based on `aswf/ci-common:3` with most VFX Platform requirements pre-installed. | | | [aswf/ci-base:2024](https://hub.docker.com/r/aswf/ci-base/tags?name=2024) ![Image Version](https://img.shields.io/docker/v/aswf/ci-base/2024) | ![Image Size](https://img.shields.io/docker/image-size/aswf/ci-base/2024) ![Pulls](https://img.shields.io/docker/pulls/aswf/ci-base) | Based on `aswf/ci-common:4` with most VFX Platform requirements pre-installed. | | | [aswf/ci-base:2025](https://hub.docker.com/r/aswf/ci-base/tags?name=2025) ![Image Version](https://img.shields.io/docker/v/aswf/ci-base/2025) | ![Image Size](https://img.shields.io/docker/image-size/aswf/ci-base/2025) ![Pulls](https://img.shields.io/docker/pulls/aswf/ci-base) | Based on `aswf/ci-common:5` with most VFX Platform requirements pre-installed. | @@ -115,8 +115,9 @@ as the major version number, and a minor version number to indicate minor changes in the Docker Image that still point to the same calendar year version, e.g. `2026.0` would be followed if necessary by a `2026.1` version. The minor version here does *not* point to a calendar month or quarter, it is -solely to express that the image has changed internally. We could also have a -patch version. +solely to express that the image has changed internally. All the images of a +VFX Platform year share the same minor version, which identifies a release of +the whole set of images (and of the Conan packages they are built from). ### Image Tags @@ -126,8 +127,8 @@ The most precise version tag is the `ASWF_VERSION` of the image, e.g. `aswf/ci-openexr:2026`. The `latest` tag is pointing to the current VFX Platform year images, e.g. -`aswf/ci-openexr:latest` points to `aswf/ci-openexr:2026.0` but will be -updated to point to `aswf/ci-openexr:2027.0` in the calendar year 2027. +`aswf/ci-openexr:latest` points to `aswf/ci-openexr:2027.4` but will be +updated to point to the 2028 images once VFX Platform 2028 images are released. ## Testing Images @@ -177,7 +178,7 @@ Check [aswfdocker](python/README.md) for python utility usage. To build packages and images locally follow the instructions to install the [aswfdocker](python/README.md) python utility. -The `group` names for `PACKAGE` and `IMAGE` builds are distinct and are defined in `versions.yaml`. At some point Conan dependency management will be leveraged to automatically determine build order, until then all the packages in group `vfx1-2` must be built before the ones in `vfx1-1`, and components in a given group do not depend on each other. +The `group` names for `PACKAGE` and `IMAGE` builds are distinct and are defined in `versions.yaml`. Within a `PACKAGE` group, the build order comes from Conan's dependency graph, and packages whose binary is already up to date are skipped (`--force-rebuild` rebuilds them anyway; `--target`, `--target-to` and `--target-from` narrow the selection). Groups themselves still need to be built in order: `common`, `base1`, `base2` (Qt), `base3` (PySide), then `vfx`. A year's version (e.g. `--version 2027`) also builds `clang` for each of that year's clang versions. A build refuses, listing them, if packages it depends on from an earlier group need (re)building first. ### Packages @@ -198,9 +199,7 @@ To build a single Conan package, e.g. OpenUSD: # First list the available CI packages to know which package belong to which "group": aswfdocker packages # Then run the build -aswfdocker --verbose build --ci-image-type PACKAGE --group vfx-6 --version 2026 --use-conan --target openusd -# Or the simpler but less flexible syntax: -aswfdocker build --full-name aswftesting/ci-package-usd:2026 +aswfdocker --verbose build --ci-image-type PACKAGE --group vfx --version 2026 --target openusd ``` ### Images @@ -221,7 +220,7 @@ To build a single image: # First list the available CI images to know which package belong to which "group": aswfdocker images # Then run the build -aswfdocker --verbose build --ci-image-type IMAGE --group vfx1 --version 2026 --target openexr +aswfdocker --verbose build --ci-image-type IMAGE --group vfx --version 2026 --target openexr # Or the simpler but less flexible syntax: aswfdocker build --ci-image-type aswftesting/ci-openexr:2026 ``` @@ -363,7 +362,7 @@ NVIDIA_DRIVER_CAPABILITIES=compute,graphics,utility In an X11 workstation environment, you can run an OpenGL binary inside a container with: ``` -docker run -it --rm --gpus all -e NVIDIA_DRIVER_CAPABILITIES=all -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix aswftesting/ci-common:6 /usr/bin/glxgears +docker run -it --rm --gpus all -e NVIDIA_DRIVER_CAPABILITIES=all -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix aswftesting/ci-common:2026 /usr/bin/glxgears ``` #### Software Rendering and LLVM-Based Renderers (e.g. Cycles/hdCycles) diff --git a/ci-base/Dockerfile b/ci-base/Dockerfile index 778fef222..ed320dcf0 100644 --- a/ci-base/Dockerfile +++ b/ci-base/Dockerfile @@ -7,14 +7,13 @@ ARG ASWF_ORG ARG ASWF_PKG_ORG -ARG CI_COMMON_VERSION +ARG ASWF_VFXPLATFORM_VERSION +ARG ASWF_VFXPLATFORM_MINOR_VERSION ARG ASWF_CLANG_MAJOR_VERSION +ARG ASWF_CONAN_PROFILE ARG ASWF_CONAN_CHANNEL ARG ASWF_CXX_STANDARD -ARG ASWF_VFXPLATFORM_VERSION - - ARG ASWF_B2_VERSION ARG ASWF_BZIP2_VERSION ARG ASWF_CPPUNIT_VERSION @@ -57,15 +56,16 @@ ARG ASWF_VFXPLATFORM_VERSION -FROM ${ASWF_ORG}/ci-common:${CI_COMMON_VERSION}-clang${ASWF_CLANG_MAJOR_VERSION} AS ci-base +FROM ${ASWF_ORG}/ci-common:${ASWF_VFXPLATFORM_VERSION}-clang${ASWF_CLANG_MAJOR_VERSION}.${ASWF_VFXPLATFORM_MINOR_VERSION} AS ci-base ARG ASWF_ORG ARG ASWF_CONAN_HOME ARG ASWF_PKG_ORG ARG ASWF_VERSION -ARG CI_COMMON_VERSION +ARG ASWF_CONAN_PROFILE ARG ASWF_CONAN_CHANNEL +ARG ASWF_CONAN_REMOTE_ARGS ARG ASWF_CXX_STANDARD @@ -213,17 +213,13 @@ ENV ASWF_NUMPY_VERSION=$ASWF_NUMPY_VERSION ENV ASWF_VFXPLATFORM_VERSION=$ASWF_VFXPLATFORM_VERSION -COPY ci-base/README.md ci-base/image.yaml /usr/local/aswf/ +COPY ci-base/README.md ci-base/image.yaml ${ASWF_INSTALL_PREFIX}/aswf/ ARG ASWF_PYTHON_MAJOR_MINOR_VERSION ENV ASWF_PYTHON_MAJOR_MINOR_VERSION=${ASWF_PYTHON_MAJOR_MINOR_VERSION} -# conan-only packages -COPY < . +COPY < . +COPY < . +COPY < . +COPY < . +COPY < . +COPY < . +COPY < . +COPY < . +COPY < . +COPY < . +COPY < . +COPY < . +COPY < . +COPY < . +COPY < . +COPY < . +COPY < . +COPY < . +COPY < . +COPY < /aswf-build-order.json ; \ + else \ + conan create \ + ${ASWF_CONAN_BUILD_MISSING} \ + ${ASWF_CONAN_REMOTE_ARGS} \ + --profile:all "${ASWF_CONAN_HOME}"/.conan2/profiles/"${ASWF_CONAN_PROFILE}" \ + --name "${ASWF_PKG_NAME}" \ + --version "${ASWF_PKG_VERSION}" \ + --user "${ASWF_PKG_ORG}" \ + --channel "${ASWF_CONAN_CHANNEL}" \ + "${ASWF_PKG_DIR}"/$(if [[ -f "${ASWF_PKG_YML}" ]] ; then yq '.versions["'"${ASWF_PKG_VERSION}"'"].folder' "${ASWF_PKG_YML}" ; fi) ; \ + fi + +# Upload build to repository if called for. Only this step gets the Artifactory +# credentials: downloads are anonymous, so the recipes and upstream build systems +# run by conan create above never see them. RUN --mount=type=cache,id=aswf-conan-cache,sharing=locked,target=${ASWF_CONAN_HOME}/d \ --mount=type=cache,id=aswf-ccache,sharing=locked,target=${CCACHE_DIR} \ --mount=type=bind,rw,target=${ASWF_CONAN_HOME}/.conan2,source=packages/conan/settings \ @@ -179,3 +209,16 @@ RUN --mount=type=cache,id=aswf-conan-cache,sharing=locked,target=${ASWF_CONAN_HO else \ echo "conan upload of package ${ASWF_PKG_NAME} skipped" ; \ fi + +#################### ci-conan-graph-output #################### +# Extracts the JSON file produced by ci-conan-package-builder's +# ASWF_CONAN_GRAPH_SCRIPT branch above, for `docker buildx bake +# --set=*.target=ci-conan-graph-output --set=*.output=type=local,dest=...` +# to copy onto the host (see buildorder.py). type=local exports a stage's +# entire final filesystem, so this stays a minimal scratch stage rather +# than exporting ci-conan-package-builder's whole rootfs. Never built for +# a normal `conan create` bake call, since that targets +# ci-conan-package-builder directly and this stage isn't in its dependency +# chain. +FROM scratch AS ci-conan-graph-output +COPY --from=ci-conan-package-builder /aswf-build-order.json /aswf-build-order.json diff --git a/packages/conan/recipes/conan-center-index-upstream.json b/packages/conan/recipes/conan-center-index-upstream.json index 9b0b06137..9b97163b3 100644 --- a/packages/conan/recipes/conan-center-index-upstream.json +++ b/packages/conan/recipes/conan-center-index-upstream.json @@ -116,6 +116,14 @@ "glib": { "class": "system" }, + "glu": { + "class": "cci", + "folder": "all", + "sha": "ebb3189b3a60dfa71b0c5705b67548cb4cd97a7e" + }, + "gnutls": { + "class": "system" + }, "gtest": { "class": "cci", "folder": "all", @@ -251,7 +259,9 @@ "class": "system" }, "log4cplus": { - "class": "unique" + "class": "cci", + "folder": "all", + "sha": "546f81771602f7a1d2d61b8ef50715afbd6b552d" }, "lua": { "class": "unique" @@ -379,6 +389,9 @@ "folder": "all", "sha": "61524a015a51e481cf247e250d3f966f2c12698e" }, + "openssl": { + "class": "system" + }, "opensubdiv": { "class": "cci", "folder": "all", diff --git a/packages/conan/recipes/cpython/conanfile.py b/packages/conan/recipes/cpython/conanfile.py index 57e2d128e..3ca5d1ae3 100644 --- a/packages/conan/recipes/cpython/conanfile.py +++ b/packages/conan/recipes/cpython/conanfile.py @@ -25,7 +25,7 @@ class CPythonConan(ConanFile): name = "cpython" description = "Python is a programming language that lets you work quickly and integrate systems more effectively." - license = "Python-2.0 and numpy (BSD-3-Clause license)" # ASWF: bundle numpy + license = "Python-2.0 AND BSD-3-Clause" # ASWF: bundles numpy (BSD-3-Clause), as an SPDX expression url = "https://github.com/conan-io/conan-center-index" homepage = "https://www.python.org" topics = ("python", "cpython", "language", "script") diff --git a/packages/conan/recipes/glu/conanfile.py b/packages/conan/recipes/glu/conanfile.py new file mode 100644 index 000000000..edbcd1af1 --- /dev/null +++ b/packages/conan/recipes/glu/conanfile.py @@ -0,0 +1,72 @@ +# Copyright (c) Contributors to the conan-center-index Project. All rights reserved. +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: MIT + +from conan import ConanFile +from conan.tools.apple import is_apple_os +from conan.tools.gnu import PkgConfig +from conan.tools.system import package_manager + +required_conan_version = ">=1.51.3" + + +class SysConfigGLUConan(ConanFile): + name = "glu" + version = "system" + description = "cross-platform virtual conan package for the GLU support" + topics = ("opengl", "glu") + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://cgit.freedesktop.org/mesa/glu/" + license = "SGI-B-2.0" + package_type = "shared-library" + settings = "os", "arch", "compiler", "build_type" + + def layout(self): + pass + + def requirements(self): + # - glu headers include opengl headers + # - on Apple OS, glu is part of OpenGL framework, already managed by opengl recipe + self.requires("opengl/system", transitive_headers=True, transitive_libs=is_apple_os(self)) + + def package_id(self): + self.info.clear() + + def system_requirements(self): + if self.settings.os not in ["Linux", "FreeBSD", "SunOS"]: + return + + dnf = package_manager.Dnf(self) + dnf.install(["mesa-libGLU-devel"], update=True, check=True) + + yum = package_manager.Yum(self) + yum.install(["mesa-libGLU-devel"], update=True, check=True) + + apt = package_manager.Apt(self) + apt.install(["libglu1-mesa-dev"], update=True, check=True) + + pacman = package_manager.PacMan(self) + pacman.install(["glu"], update=True, check=True) + + zypper = package_manager.Zypper(self) + zypper.install(["glu-devel"], update=True, check=True) + + pkg = package_manager.Pkg(self) + pkg.install(["libGLU"], update=True, check=True) + + pkg_util = package_manager.PkgUtil(self) + pkg_util.install(["mesalibs"], update=True, check=True) + + alpine = package_manager.Apk(self) + alpine.install(["glu-dev"], update=True, check=True) + + def package_info(self): + self.cpp_info.bindirs = [] + self.cpp_info.includedirs = [] + self.cpp_info.libdirs = [] + + if self.settings.os == "Windows": + self.cpp_info.system_libs = ["glu32"] + elif self.settings.os in ["Linux", "FreeBSD", "SunOS"]: + pkg_config = PkgConfig(self, 'glu') + pkg_config.fill_cpp_info(self.cpp_info, is_system=self.settings.os != "FreeBSD") diff --git a/packages/conan/recipes/glu/test_package/CMakeLists.txt b/packages/conan/recipes/glu/test_package/CMakeLists.txt new file mode 100644 index 000000000..991440c01 --- /dev/null +++ b/packages/conan/recipes/glu/test_package/CMakeLists.txt @@ -0,0 +1,11 @@ +# Copyright (c) Contributors to the conan-center-index Project. All rights reserved. +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: MIT + +cmake_minimum_required(VERSION 3.15) +project(test_package LANGUAGES C) + +find_package(glu REQUIRED CONFIG) + +add_executable(${PROJECT_NAME} test_package.c) +target_link_libraries(${PROJECT_NAME} PRIVATE glu::glu) diff --git a/packages/conan/recipes/glu/test_package/conanfile.py b/packages/conan/recipes/glu/test_package/conanfile.py new file mode 100644 index 000000000..91960c53d --- /dev/null +++ b/packages/conan/recipes/glu/test_package/conanfile.py @@ -0,0 +1,30 @@ +# Copyright (c) Contributors to the conan-center-index Project. All rights reserved. +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: MIT + +from conan import ConanFile +from conan.tools.build import can_run +from conan.tools.cmake import cmake_layout, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "arch", "compiler", "build_type" + generators = "CMakeDeps", "CMakeToolchain", "VirtualRunEnv" + test_type = "explicit" + + def requirements(self): + self.requires(self.tested_reference_str) + + def layout(self): + cmake_layout(self) + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + if can_run(self): + bin_path = os.path.join(self.cpp.build.bindir, "test_package") + self.run(bin_path, env="conanrun") diff --git a/packages/conan/recipes/glu/test_package/test_package.c b/packages/conan/recipes/glu/test_package/test_package.c new file mode 100644 index 000000000..bd4ccc077 --- /dev/null +++ b/packages/conan/recipes/glu/test_package/test_package.c @@ -0,0 +1,22 @@ +/* +# Copyright (c) Contributors to the conan-center-index Project. All rights reserved. +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: MIT +*/ +#include + +#ifdef __APPLE__ +# include +#else +# ifdef _WIN32 +# include +# endif +# include +#endif + +int main() +{ + printf("GLU %s\n", gluGetString(GLU_VERSION)); + + return 0; +} diff --git a/packages/conan/recipes/log4cplus/conanfile.py b/packages/conan/recipes/log4cplus/conanfile.py index 265575515..a76c3fc81 100644 --- a/packages/conan/recipes/log4cplus/conanfile.py +++ b/packages/conan/recipes/log4cplus/conanfile.py @@ -18,7 +18,10 @@ class Log4cplusConan(ConanFile): description = "simple to use C++ logging API, modelled after the Java log4j API" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/log4cplus/log4cplus" - license = ("BSD-2-Clause, Apache-2.0") + # ASWF: upstream's "BSD-2-Clause, Apache-2.0" isn't a valid SPDX expression (needed + # for image SBOMs). Each source file is under one of BSD-2-Clause or Apache-2.0, and + # the bundled threadpool code is under Zlib (see upstream's LICENSE): all three apply. + license = "BSD-2-Clause AND Apache-2.0 AND Zlib" topics = ("logging", "log", "logging-library") package_type = "library" settings = "os", "arch", "compiler", "build_type" @@ -95,8 +98,11 @@ def generate(self): tc.variables["WITH_ICONV"] = self.options.with_iconv tc.variables["LOG4CPLUS_WORKING_LOCALE"] = self.options.working_locale tc.variables["LOG4CPLUS_WORKING_C_LOCALE"] = self.options.working_c_locale - # Prevent libnsl from being detected and linked (matches CCI approach) + + # Prevent linking against unused found library + # https://github.com/log4cplus/log4cplus/blob/de729f76b256b8f55ced3a246434f7280be2a20d/ConfigureChecks.cmake#L51 tc.cache_variables["LIBNSL"] = "LIBNSL-NOTFOUND" + tc.generate() dpes = CMakeDeps(self) @@ -109,10 +115,10 @@ def build(self): cmake.build() def package(self): - copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses", self.name), src=self.source_folder) + copy(self, pattern="LICENSE", dst=os.path.join(self.package_folder, "licenses"), src=self.source_folder) cmake = CMake(self) cmake.install() - #rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) + # rmdir(self, os.path.join(self.package_folder, "lib", "cmake")) # ASWF: keep cmake files if Version(self.version) >= "2.1.0": rmdir(self, os.path.join(self.package_folder, "lib", "pkgconfig")) rmdir(self, os.path.join(self.package_folder, "share")) diff --git a/packages/conan/recipes/osl/conanfile.py b/packages/conan/recipes/osl/conanfile.py index 5adaf3a7c..b65aa6293 100644 --- a/packages/conan/recipes/osl/conanfile.py +++ b/packages/conan/recipes/osl/conanfile.py @@ -26,6 +26,7 @@ class OpenShadingLanguageConan(ConanFile): license = "BSD-3-Clause" homepage = "https://github.com/AcademySoftwareFoundation/OpenShadingLanguage" url = "https://github.com/conan-io/conan-center-index" + package_type = "library" settings = "os", "arch", "compiler", "build_type" options = { diff --git a/packages/conan/recipes/rapidjson/conanfile.py b/packages/conan/recipes/rapidjson/conanfile.py index 0527f5550..fb46fa16e 100644 --- a/packages/conan/recipes/rapidjson/conanfile.py +++ b/packages/conan/recipes/rapidjson/conanfile.py @@ -20,7 +20,7 @@ class RapidjsonConan(ConanFile): homepage = "http://rapidjson.org" license = "MIT" package_type = "header-library" - package_id_embed_mode = "minor_mode" + # package_id_embed_mode = "minor_mode" # ASWF: overrides global.conf's full_mode for consumers of rapidjson, defeating rebuild-on-dependency-change settings = "os", "arch", "compiler", "build_type" no_copy_source = True diff --git a/packages/conan/settings/extensions/commands/cmd_aswf_download_metadata.py b/packages/conan/settings/extensions/commands/cmd_aswf_download_metadata.py new file mode 100644 index 000000000..a62cdc50a --- /dev/null +++ b/packages/conan/settings/extensions/commands/cmd_aswf_download_metadata.py @@ -0,0 +1,104 @@ +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +"""ASWF Conan custom command: `conan aswf-download-metadata +--remote --metadata ` downloads, from the remote, the +packages a graph would download, together with their metadata. + +`conan install` never downloads package metadata, so an image built from +packages downloaded from Artifactory would get an SBOM without the build +provenance hook_aswf_provenance.py records in each package's metadata +(aswf_provenance.json). Run between `conan graph info --format=json` and +`conan install`, this downloads those packages with their metadata first, +leaving `conan install` to find them in the cache. + +The built-in `conan download --list`, from `conan list --graph`, can't be +used for this: its package list for a remote holds every package of the +graph available there, including those `conan install` skips (e.g. tool +requirements of packages it doesn't build), which would be downloaded for +nothing. This only downloads the binaries the graph marks for download. + +Like aswf_deploy.py, this module must stay import-free of the `aswfdocker` +pip package: it runs inside the build container, where only Conan is +installed. + +Informational output goes to stderr (ConanOutput), never stdout. +""" + +import json +import typing + +from conan.api.model import PkgReference, RecipeReference +from conan.api.output import ConanOutput +from conan.cli.command import conan_command + +# The graph's "binary" status of packages `conan install` downloads. +_BINARY_DOWNLOAD = "Download" + + +def packages_to_download(graph: dict, remote_name: str) -> typing.List[PkgReference]: + """The packages (with their recipe and package revisions) that a + `conan graph info --format=json` graph would download from + `remote_name`.""" + prefs = [] + for node in graph["graph"]["nodes"].values(): + if node.get("binary") != _BINARY_DOWNLOAD: + continue + if node.get("binary_remote") != remote_name: + continue + ref = RecipeReference.loads(node["ref"]) + ref.timestamp = node.get("rrev_timestamp") + prefs.append( + PkgReference( + ref, + node["package_id"], + node.get("prev"), + node.get("prev_timestamp"), + ) + ) + return prefs + + +def download_with_metadata(conan_api, prefs, remote, metadata) -> None: + """Downloads each package (and its recipe, if missing from the cache) + with the metadata files matching the `metadata` patterns. For a package + already in the cache, only its metadata is downloaded.""" + for pref in prefs: + conan_api.download.recipe(pref.ref, remote) + conan_api.download.package(pref, remote, metadata) + ConanOutput().info( + f"Downloaded {len(prefs)} package(s) with their {', '.join(metadata)} " + f"metadata from {remote.name}" + ) + + +@conan_command(group="ASWF") +def aswf_download_metadata(conan_api, parser, *args): + """ + Download the packages a graph would download, with their metadata. + """ + parser.add_argument( + "graph", help="Graph json file, from `conan graph info --format=json`" + ) + parser.add_argument( + "-r", + "--remote", + required=True, + help="The remote to download from", + ) + parser.add_argument( + "-m", + "--metadata", + action="append", + required=True, + help="Download the metadata matching the pattern", + ) + args = parser.parse_args(*args) + with open(args.graph, "r", encoding="utf-8") as f: + graph = json.load(f) + remote = conan_api.remotes.get(args.remote) + download_with_metadata( + conan_api, + packages_to_download(graph, remote.name), + remote, + args.metadata, + ) diff --git a/packages/conan/settings/extensions/commands/cmd_aswf_export.py b/packages/conan/settings/extensions/commands/cmd_aswf_export.py new file mode 100644 index 000000000..8a4f2b2ff --- /dev/null +++ b/packages/conan/settings/extensions/commands/cmd_aswf_export.py @@ -0,0 +1,80 @@ +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +"""ASWF Conan custom command: `conan aswf-export ''` exports many +recipes in a single Conan process. + +Running `conan export` once per recipe costs a Python interpreter start and +a full Conan load each time (~0.4s), which dominated buildorder.py's +dependency-graph run when exporting every recipe a profile can reach. This +does the same per-recipe work as the built-in `conan export` command +(conan/cli/commands/export.py) -- conanfile path resolution, implicit +lockfile lookup, remotes for python_requires -- just in a loop. + +Like aswf_deploy.py, this module must stay import-free of the `aswfdocker` +pip package: it runs inside the build container, where only Conan is +installed. + +Informational output goes to stderr (ConanOutput), never stdout, so a +caller can still redirect stdout of a following command to a file. +""" + +import json +import os + +from conan.api.output import ConanOutput +from conan.cli.command import conan_command + + +def export_all(conan_api, exports, cwd, remotes): + """Exports each (path, name, version, user, channel) entry, in order. + `remotes` is only consulted for python_requires, as in `conan export`. + + Returns the exported RecipeReferences. + """ + refs = [] + for path, name, version, user, channel in exports: + conanfile_path = conan_api.local.get_conanfile_path(path, cwd, py=True) + lockfile = conan_api.lockfile.get_lockfile( + lockfile=None, conanfile_path=conanfile_path, cwd=cwd, partial=False + ) + ref, _ = conan_api.export.export( + path=conanfile_path, + name=name, + version=version, + user=user, + channel=channel, + lockfile=lockfile, + remotes=remotes, + ) + ConanOutput().info(f"Exported: {ref.repr_notime()}") + refs.append(ref) + return refs + + +@conan_command(group="ASWF") +def aswf_export(conan_api, parser, *args): + """ + Export many recipes to the Conan cache in one process. + """ + parser.add_argument( + "exports", + help="JSON list of [path, name, version, user, channel] entries", + ) + # Same remote options as the built-in `conan export`. + group = parser.add_mutually_exclusive_group() + group.add_argument( + "-r", + "--remote", + action="append", + default=None, + help="Look in the specified remote or remotes server", + ) + group.add_argument( + "-nr", + "--no-remote", + action="store_true", + help="Do not use remote, resolve exclusively in the cache", + ) + args = parser.parse_args(*args) + remotes = [] if args.no_remote else conan_api.remotes.list(args.remote) + export_all(conan_api, json.loads(args.exports), os.getcwd(), remotes) diff --git a/packages/conan/settings/extensions/deployers/aswf_deploy.py b/packages/conan/settings/extensions/deployers/aswf_deploy.py index 2f3339585..3c753af97 100644 --- a/packages/conan/settings/extensions/deployers/aswf_deploy.py +++ b/packages/conan/settings/extensions/deployers/aswf_deploy.py @@ -9,19 +9,43 @@ driving `docker buildx bake`. Invoked as: conan install --deployer=aswf_deploy --deployer-folder= -with the package to exclude (if any) passed as -c user.aswf:exclude_package=. +with the package to exclude (if any) passed as -c user.aswf:exclude_package=, +and the SBOM's subject as -c user.aswf:sbom_name=/ (the image +name and its ASWF_VERSION; the version is optional). + +Also writes a CycloneDX SBOM of the packages it deployed to +/aswf/.cdx.json. Images are built in layers (ci-common, +ci-base, ...) that each run their own deploy, so naming the SBOM per image +keeps every layer's SBOM instead of each overwriting the last. All the +layers' SBOMs found there are then merged into /aswf/sbom.cdx.json, +which describes the whole image without needing to know its layering (and +is what gets attached to the image's GitHub release); each layer rewrites it. """ import fnmatch import functools +import glob import hashlib +import json import os import re import shutil +import uuid + +from conan.tools.sbom import cyclonedx_1_6 _CONAN_METADATA_FILES = {"conaninfo.txt", "conanmanifest.txt"} _LICENSES_DIR_NAME = "licenses" _MD5_CHUNK_SIZE = 1024 * 1024 # 1 MiB -- files like libclang-cpp.so are 100+MB +_SBOM_DIR_NAME = "aswf" +_DEFAULT_SBOM_NAME = "conan-sbom" +_MERGED_SBOM_FILE = "sbom.cdx.json" +# Written by the hook_aswf_provenance Conan hook (extensions/hooks/), which +# can't share this module's code. +_PROVENANCE_FILE = "aswf_provenance.json" + +# SPDX expression operators (https://spdx.github.io/spdx-spec/v2.3/SPDX-license-expressions/) +_SPDX_OPERATORS = re.compile(r" (WITH|AND|OR) ") _PACKAGE_HOOKS = {} @@ -36,14 +60,252 @@ def deploy(graph, output_folder): os.makedirs(output_folder, exist_ok=True) report = _DeployReport() + in_image = [] for require, dep in conanfile.dependencies.items(): if _should_skip_scope(require): continue + if exclude_name and dep.ref.name == exclude_name: + continue + # In the SBOM even when not copied, e.g. "system" wrappers, which the + # image gets from the OS instead. + in_image.append(dep) if _should_skip(dep, exclude_name): continue _deploy_package(dep, output_folder, cache_root, symlinks, report) report.print_report() report.raise_if_errors() + _write_sbom(conanfile, in_image, output_folder) + + +def _write_sbom(conanfile, deps, output_folder) -> None: + """Writes Conan's CycloneDX 1.6 SBOM for the graph, limited to `deps` + (what this deploy considers part of the image) and annotated with each + package's ASWF build provenance.""" + # One "name/version" value: Conan eval()s conf values, which would turn a + # bare version such as 2027.10 into the number 2027.1. + sbom_name = conanfile.conf.get("user.aswf:sbom_name", check_type=str) + name, _, version = (sbom_name or _DEFAULT_SBOM_NAME).partition("/") + version = version or None + # Host context only, like the deploy itself: what's in the image and what + # it links/runs against. A package's own tool_requires (e.g. clang's + # cmake/ninja) would otherwise show up as untyped dependsOn edges -- and, + # since bom-refs don't include the context, as duplicate components. + sbom = cyclonedx_1_6(conanfile, name=name, add_build=False) + properties = { + (dep.ref.name, str(dep.ref.version)): _component_properties( + dep, _is_system_wrapper(dep) + ) + for dep in deps + } + sbom = _set_sbom_root(_filter_and_annotate_sbom(sbom, properties), name, version) + sbom_dir = os.path.join(output_folder, _SBOM_DIR_NAME) + path = os.path.join(sbom_dir, f"{name}.cdx.json") + _write_json(path, sbom) + print( + f"aswf_deploy: wrote SBOM {path} ({len(sbom.get('components', []))} components)" + ) + layer_sboms = _read_layer_sboms(sbom_dir) + merged = _merge_sboms(layer_sboms, sbom, name, version) + merged_path = os.path.join(sbom_dir, _MERGED_SBOM_FILE) + _write_json(merged_path, merged) + print( + f"aswf_deploy: wrote image SBOM {merged_path} from " + f"{len(layer_sboms)} layer(s) ({len(merged.get('components', []))} components)" + ) + + +def _read_layer_sboms(sbom_dir) -> list: + """Every layer's SBOM in `sbom_dir`, base image first (lower layers + were built first).""" + layer_sboms = [] + for path in glob.glob(os.path.join(sbom_dir, "*.cdx.json")): + if os.path.basename(path) == _MERGED_SBOM_FILE: + continue + with open(path, "r", encoding="utf-8") as f: + layer_sboms.append(json.load(f)) + layer_sboms.sort( + key=lambda s: ( + s["metadata"].get("timestamp", ""), + s["metadata"]["component"]["name"], + ) + ) + return layer_sboms + + +def _union_dependencies(entries, rename=None) -> dict: + """CycloneDX dependencies entries as {ref: [dependsOn...]}, merging the + entries of a ref that appears more than once (Conan writes one per graph + node, and several nodes can share a bom-ref; merged layers share refs + too). `rename` maps refs to replace, e.g. layer roots to the image's.""" + rename = rename or {} + depends_on: dict = {} + for entry in entries: + merged = depends_on.setdefault(rename.get(entry["ref"], entry["ref"]), []) + merged.extend(d for d in entry.get("dependsOn", []) if d not in merged) + return depends_on + + +def _warn_about_different_builds(components) -> None: + refs_by_name: dict = {} + for component in components: + refs_by_name.setdefault(component["name"], []).append(component["bom-ref"]) + for package, refs in sorted(refs_by_name.items()): + if len(refs) > 1: + print( + f"aswf_deploy: WARNING: image layers ship different builds of " + f"{package}: {', '.join(refs)}" + ) + + +def _write_json(path, data) -> None: + os.makedirs(os.path.dirname(path), exist_ok=True) + with open(path, "w", encoding="utf-8") as f: + json.dump(data, f, indent=2, sort_keys=True) + f.write("\n") + + +def _root_ref(name, version) -> str: + return f"{name}@{version}" if version else name + + +def _set_sbom_root(sbom: dict, name, version) -> dict: + """Replaces the SBOM's root component, which Conan gives a random + bom-ref for any consumer conanfile (it has no recipe revision), with + the image itself under a stable bom-ref.""" + old_ref = sbom["metadata"]["component"]["bom-ref"] + new_ref = _root_ref(name, version) + root = {"bom-ref": new_ref, "name": name, "type": "container"} + if version: + root["version"] = version + dependencies = [ + {**e, "ref": new_ref} if e["ref"] == old_ref else e + for e in sbom.get("dependencies", []) + ] + result = {**sbom, "metadata": {**sbom["metadata"], "component": root}} + if dependencies: + result["dependencies"] = dependencies + return result + + +def _merge_sboms(layer_sboms, current: dict, name, version) -> dict: + """Merges the image's per-layer SBOMs (each as written by _write_sbom) + into one rooted at the image: components are deduplicated by bom-ref, + which for Conan packages includes the recipe revision, and the image + root depends on everything any layer's root depended on. Its metadata + (tools, timestamp) comes from `current`, this deploy's own SBOM.""" + root_ref = _root_ref(name, version) + components: dict = {} + for sbom in layer_sboms: + for component in sbom.get("components", []): + components.setdefault(component["bom-ref"], component) + _warn_about_different_builds(components.values()) + depends_on = _union_dependencies( + [{"ref": root_ref}] + + [e for s in layer_sboms for e in s.get("dependencies", [])], + rename={s["metadata"]["component"]["bom-ref"]: root_ref for s in layer_sboms}, + ) + root = {**current["metadata"]["component"]} + root["properties"] = [ + { + "name": "aswf:layers", + "value": ",".join(s["metadata"]["component"]["name"] for s in layer_sboms), + } + ] + result = { + k: v for k, v in current.items() if k not in ("components", "dependencies") + } + result["serialNumber"] = f"urn:uuid:{uuid.uuid4()}" + result["metadata"] = {**current["metadata"], "component": root} + if components: + result["components"] = list(components.values()) + result["dependencies"] = [ + {"ref": ref, **({"dependsOn": deps} if deps else {})} + for ref, deps in depends_on.items() + ] + return result + + +def _component_properties(dep, system=False) -> dict: + """CycloneDX component properties for one package: its Conan package_id, + the git state it was built from (if recorded at build time), and whether + it's a wrapper whose files the image gets from OS packages instead.""" + properties = {"aswf:package_id": dep.pref.package_id} + if system: + properties["aswf:provided_by"] = "system" + metadata_folder = dep.package_metadata_folder + provenance_path = ( + os.path.join(metadata_folder, _PROVENANCE_FILE) if metadata_folder else None + ) + if provenance_path and os.path.isfile(provenance_path): + with open(provenance_path, "r", encoding="utf-8") as f: + provenance = json.load(f) + properties["aswf:git_sha"] = provenance["git_sha"] + properties["aswf:git_dirty"] = str(bool(provenance.get("git_dirty"))).lower() + if provenance.get("git_diff_hash"): + properties["aswf:git_diff_hash"] = provenance["git_diff_hash"] + return properties + + +def _filter_and_annotate_sbom(sbom: dict, properties: dict) -> dict: + """Keeps only the components whose (name, version) is in `properties`, + adds those properties to them (CycloneDX's name/value extension point), + and rewires the dependency graph past any dropped component, so a kept + package still shows what it (transitively) depends on in the image.""" + kept = [] + kept_refs = set() + for component in sbom.get("components", []): + key = (component["name"], component["version"]) + if key not in properties or component["bom-ref"] in kept_refs: + continue + kept_refs.add(component["bom-ref"]) + props = [{"name": n, "value": v} for n, v in sorted(properties[key].items())] + component = {**component, **({"properties": props} if props else {})} + if "licenses" in component: + component["licenses"] = _spdx_licenses(component["licenses"]) + kept.append(component) + root_ref = sbom["metadata"]["component"]["bom-ref"] + depends_on = _union_dependencies(sbom.get("dependencies", [])) + + def kept_dependencies(ref): + result, pending, seen = [], list(depends_on.get(ref, [])), set() + while pending: + dep = pending.pop(0) + if dep in seen: + continue + seen.add(dep) + if dep in kept_refs: + result.append(dep) + else: + pending.extend(depends_on.get(dep, [])) + return result + + dependencies = [] + for ref in depends_on: + if ref != root_ref and ref not in kept_refs: + continue + entry = {"ref": ref} + deps = kept_dependencies(ref) + if deps: + entry["dependsOn"] = deps + dependencies.append(entry) + result = {k: v for k, v in sbom.items() if k not in ("components", "dependencies")} + if kept: + result["components"] = kept + if dependencies: + result["dependencies"] = dependencies + return result + + +def _spdx_licenses(licenses: list) -> list: + """Conan only recognizes single SPDX license ids, and writes anything else + (e.g. clang's "Apache-2.0 WITH LLVM-exception") as a free-text license + name. CycloneDX has a dedicated form for an SPDX expression, which is what + license scanners check; it must be the licenses array's only entry.""" + if len(licenses) == 1: + name = licenses[0].get("license", {}).get("name", "") + if _SPDX_OPERATORS.search(name): + return [{"expression": name}] + return licenses def _should_skip_scope(require) -> bool: @@ -64,6 +326,17 @@ def _should_skip_scope(require) -> bool: return False +def _is_system_wrapper(dep) -> bool: + """A recipe that only points at OS-provided files: its package has + nothing in it. Decided from the package itself, not its version: wrappers + (the "system" class in conan-center-index-upstream.json, plus CCI's own + opengl/glu system recipes) are pinned at either "system" or the distro + package's version (e.g. openssl/3.5.8), and full recipes can check it.""" + return dep.package_folder is not None and not any( + entry.is_dir() for entry in os.scandir(dep.package_folder) + ) + + def _should_skip(dep, exclude_name) -> bool: if dep.package_folder is None: return True @@ -71,9 +344,7 @@ def _should_skip(dep, exclude_name) -> bool: return True if str(dep.ref.version) == "system": return True - if not any(entry.is_dir() for entry in os.scandir(dep.package_folder)): - return True - return False + return _is_system_wrapper(dep) class _DeployReport: diff --git a/packages/conan/settings/extensions/hooks/hook_aswf_provenance.py b/packages/conan/settings/extensions/hooks/hook_aswf_provenance.py new file mode 100644 index 000000000..ffecaa8b7 --- /dev/null +++ b/packages/conan/settings/extensions/hooks/hook_aswf_provenance.py @@ -0,0 +1,42 @@ +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +"""ASWF Conan hook: records which git state each package was built from. + +Writes aswf_provenance.json into the package's metadata folder after +package(). Conan keeps package metadata outside both the package_id and the +package's content hash, and uploads/downloads it with the package, so this +never causes a rebuild and travels through Artifactory with the binary. +aswf_deploy.py reads it back to annotate the SBOM it writes into each image. + +The values come from build ARGs packages/common/Dockerfile exposes to the +`conan create` RUN (set by aswfdocker's utils.git_provenance()). Outside an +aswfdocker package build ASWF_GIT_SHA is unset and nothing is written. + +Like aswf_deploy.py, this module must stay import-free of the `aswfdocker` +pip package: it runs inside the build container, where only Conan is +installed. +""" + +import json +import os + +PROVENANCE_FILE = "aswf_provenance.json" + + +def post_package(conanfile): + sha = os.environ.get("ASWF_GIT_SHA") + if not sha: + return + provenance = { + "git_sha": sha, + "git_dirty": os.environ.get("ASWF_GIT_DIRTY") == "true", + } + diff_hash = os.environ.get("ASWF_GIT_DIFF_HASH") + if diff_hash: + provenance["git_diff_hash"] = diff_hash + folder = conanfile.package_metadata_folder + os.makedirs(folder, exist_ok=True) + with open(os.path.join(folder, PROVENANCE_FILE), "w", encoding="utf-8") as f: + json.dump(provenance, f, indent=2, sort_keys=True) + f.write("\n") + conanfile.output.info(f"Recorded build provenance: {provenance}") diff --git a/packages/conan/settings/extensions/plugins/compatibility/compatibility.py b/packages/conan/settings/extensions/plugins/compatibility/compatibility.py index 247438e18..fc9a9f3f5 100644 --- a/packages/conan/settings/extensions/plugins/compatibility/compatibility.py +++ b/packages/conan/settings/extensions/plugins/compatibility/compatibility.py @@ -1,77 +1,20 @@ -# This file was generated by Conan. Remove this comment if you edit this file or Conan -# will destroy your changes. - -from conan.tools.build import supported_cppstd, supported_cstd -from conan.errors import ConanException - - -def cppstd_compat(conanfile): - # It will try to find packages with all the cppstd versions - extension_properties = getattr(conanfile, "extension_properties", {}) - compiler = conanfile.settings.get_safe("compiler") - compiler_version = conanfile.settings.get_safe("compiler.version") - cppstd = conanfile.settings.get_safe("compiler.cppstd") - if not compiler or not compiler_version: - return [] - factors = [] # List of list, each sublist is a potential combination - if ( - cppstd is not None - and extension_properties.get("compatibility_cppstd") is not False - ): - cppstd_possible_values = supported_cppstd(conanfile) - if cppstd_possible_values is None: - conanfile.output.warning( - f'No cppstd compatibility defined for compiler "{compiler}"' - ) - else: # The current cppst must be included in case there is other factor - factors.append([{"compiler.cppstd": v} for v in cppstd_possible_values]) - - cstd = conanfile.settings.get_safe("compiler.cstd") - if cstd is not None and extension_properties.get("compatibility_cstd") is not False: - cstd_possible_values = supported_cstd(conanfile) - if cstd_possible_values is None: - conanfile.output.warning( - f'No cstd compatibility defined for compiler "{compiler}"' - ) - else: - factors.append( - [{"compiler.cstd": v} for v in cstd_possible_values if v != cstd] - ) - return factors - - -def compatibility(conanfile): - # By default, different compiler.cppstd are compatible - # factors is a list of lists - factors = cppstd_compat(conanfile) - - # MSVC 194->193 fallback compatibility - compiler = conanfile.settings.get_safe("compiler") - compiler_version = conanfile.settings.get_safe("compiler.version") - if compiler == "msvc": - msvc_fallback = {"194": "193"}.get(compiler_version) - if msvc_fallback: - factors.append([{"compiler.version": msvc_fallback}]) - - # Append more factors for your custom compatibility rules here - - # Combine factors to compute all possible configurations - combinations = _factors_combinations(factors) - # Final compatibility settings combinations to check - return [{"settings": [(k, v) for k, v in comb.items()]} for comb in combinations] - - -def _factors_combinations(factors): - combinations = [] - for factor in factors: - if not combinations: - combinations = factor - continue - new_combinations = [] - for comb in combinations: - for f in factor: - new_comb = comb.copy() - new_comb.update(f) - new_combinations.append(new_comb) - combinations.extend(new_combinations) - return combinations +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +# Replaces the default plugin Conan generates here. It no longer carries +# Conan's "This file was generated by Conan" marker, so Conan won't +# overwrite it. + + +def compatibility(conanfile): # pylint: disable=unused-argument + """Never accept a binary built for a different configuration. + + Conan's default plugin treats every other compiler.cppstd (and cstd) as + compatible, so a missing binary can be satisfied by one built against a + different C++ standard. The images built here implement the VFX + Reference Platform (https://vfxplatform.com), which pins the compiler + and C++ standard per year: such a substitute would be a wrong binary, + not an acceptable fallback. Returning no compatible configurations + means a binary either matches the profile exactly or gets rebuilt. + """ + return [] diff --git a/packages/conan/settings/global.conf b/packages/conan/settings/global.conf index 9e8e21c1f..84fb62f44 100644 --- a/packages/conan/settings/global.conf +++ b/packages/conan/settings/global.conf @@ -11,7 +11,15 @@ core:default_profile = vfx2026 core.gzip:compresslevel = 9 tools.system.package_manager:sudo = True core.net.http:timeout = 60 -core.package_id:default_unknown_mode = semver_mode +# Rebuild every consumer whenever a dependency's version, recipe (conanfile.py, +# conandata.yml) or exported patches change: full_mode puts the dependency's +# full version, recipe revision and package_id into the consumer's package_id, +# so the rebuild cascades transitively, not just one level. We don't trust ABI +# stability across minor/patch versions, nor that a "library" never ships +# inline code in its public headers. +core.package_id:default_unknown_mode = full_mode +core.package_id:default_non_embed_mode = full_mode +core.package_id:default_embed_mode = full_mode # When we conan install we want everything tools.graph:skip_binaries = False diff --git a/packages/conan/settings/profiles/ci_common3 b/packages/conan/settings/profiles/ci_common3 deleted file mode 100644 index eb5cde634..000000000 --- a/packages/conan/settings/profiles/ci_common3 +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 -# !!! This file is automatically generated from a Jinja2 template. !!! -# !!! Do not edit manually — run "aswfdocker dockergen" to regenerate. !!! -{% set org = os.getenv("ASWF_PKG_ORG", "aswf") %} -[settings] -os=Linux -arch=x86_64 -compiler=gcc -compiler.version=11.2 -compiler.libcxx=libstdc++11 -compiler.cppstd=17 -build_type=Release -[options] -# Build everything as shared libs by default -*:shared=True -[tool_requires] -[replace_requires] -openssl/*: openssl/1.1.1k@{{ org }}/ci_common3 -gnutls/*: gnutls/3.6.16@{{ org }}/ci_common3 -ninja/*: ninja/1.13.2@{{ org }}/ci_common3 -[replace_tool_requires] -cmake/*: cmake/3.31.11@{{ org }}/ci_common3 -ninja/*: ninja/1.13.2@{{ org }}/ci_common3 -[platform_requires] -[buildenv] -GCC_INSTALL_DIR=/opt/rh/gcc-toolset-11/root/lib/gcc/x86_64-redhat-linux/11 diff --git a/packages/conan/settings/profiles/ci_common4 b/packages/conan/settings/profiles/ci_common4 deleted file mode 100644 index 9398c835e..000000000 --- a/packages/conan/settings/profiles/ci_common4 +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 -# !!! This file is automatically generated from a Jinja2 template. !!! -# !!! Do not edit manually — run "aswfdocker dockergen" to regenerate. !!! -{% set org = os.getenv("ASWF_PKG_ORG", "aswf") %} -[settings] -os=Linux -arch=x86_64 -compiler=gcc -compiler.version=11.2 -compiler.libcxx=libstdc++11 -compiler.cppstd=17 -build_type=Release -[options] -# Build everything as shared libs by default -*:shared=True -[tool_requires] -[replace_requires] -openssl/*: openssl/1.1.1k@{{ org }}/ci_common4 -gnutls/*: gnutls/3.6.16@{{ org }}/ci_common4 -ninja/*: ninja/1.13.2@{{ org }}/ci_common4 -[replace_tool_requires] -cmake/*: cmake/3.31.11@{{ org }}/ci_common4 -ninja/*: ninja/1.13.2@{{ org }}/ci_common4 -[platform_requires] -[buildenv] -GCC_INSTALL_DIR=/opt/rh/gcc-toolset-11/root/lib/gcc/x86_64-redhat-linux/11 diff --git a/packages/conan/settings/profiles/ci_common5 b/packages/conan/settings/profiles/ci_common5 deleted file mode 100644 index 3c5f0862a..000000000 --- a/packages/conan/settings/profiles/ci_common5 +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 -# !!! This file is automatically generated from a Jinja2 template. !!! -# !!! Do not edit manually — run "aswfdocker dockergen" to regenerate. !!! -{% set org = os.getenv("ASWF_PKG_ORG", "aswf") %} -[settings] -os=Linux -arch=x86_64 -compiler=gcc -compiler.version=11.2 -compiler.libcxx=libstdc++11 -compiler.cppstd=17 -build_type=Release -[options] -# Build everything as shared libs by default -*:shared=True -[tool_requires] -[replace_requires] -openssl/*: openssl/1.1.1k@{{ org }}/ci_common5 -gnutls/*: gnutls/3.6.16@{{ org }}/ci_common5 -ninja/*: ninja/1.13.2@{{ org }}/ci_common5 -[replace_tool_requires] -cmake/*: cmake/3.31.11@{{ org }}/ci_common5 -ninja/*: ninja/1.13.2@{{ org }}/ci_common5 -[platform_requires] -[buildenv] -GCC_INSTALL_DIR=/opt/rh/gcc-toolset-11/root/lib/gcc/x86_64-redhat-linux/11 diff --git a/packages/conan/settings/profiles/ci_common6 b/packages/conan/settings/profiles/ci_common6 deleted file mode 100644 index ac0a73c81..000000000 --- a/packages/conan/settings/profiles/ci_common6 +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 -# !!! This file is automatically generated from a Jinja2 template. !!! -# !!! Do not edit manually — run "aswfdocker dockergen" to regenerate. !!! -{% set org = os.getenv("ASWF_PKG_ORG", "aswf") %} -[settings] -os=Linux -arch=x86_64 -compiler=gcc -compiler.version=14.2 -compiler.libcxx=libstdc++11 -compiler.cppstd=20 -build_type=Release -[options] -# Build everything as shared libs by default -*:shared=True -[tool_requires] -[replace_requires] -openssl/*: openssl/1.1.1k@{{ org }}/ci_common6 -gnutls/*: gnutls/3.6.16@{{ org }}/ci_common6 -ninja/*: ninja/1.13.2@{{ org }}/ci_common6 -[replace_tool_requires] -cmake/*: cmake/4.0.6@{{ org }}/ci_common6 -ninja/*: ninja/1.13.2@{{ org }}/ci_common6 -[platform_requires] -[buildenv] -GCC_INSTALL_DIR=/opt/rh/gcc-toolset-14/root/lib/gcc/x86_64-redhat-linux/14 diff --git a/packages/conan/settings/profiles/ci_common7 b/packages/conan/settings/profiles/ci_common7 deleted file mode 100644 index 1aab7c9aa..000000000 --- a/packages/conan/settings/profiles/ci_common7 +++ /dev/null @@ -1,27 +0,0 @@ -# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 -# !!! This file is automatically generated from a Jinja2 template. !!! -# !!! Do not edit manually — run "aswfdocker dockergen" to regenerate. !!! -{% set org = os.getenv("ASWF_PKG_ORG", "aswf") %} -[settings] -os=Linux -arch=x86_64 -compiler=gcc -compiler.version=14.2 -compiler.libcxx=libstdc++11 -compiler.cppstd=20 -build_type=Release -[options] -# Build everything as shared libs by default -*:shared=True -[tool_requires] -[replace_requires] -openssl/*: openssl/3.5.8@{{ org }}/ci_common7 -gnutls/*: gnutls/3.8.10@{{ org }}/ci_common7 -ninja/*: ninja/1.13.2@{{ org }}/ci_common7 -[replace_tool_requires] -cmake/*: cmake/4.3.3@{{ org }}/ci_common7 -ninja/*: ninja/1.13.2@{{ org }}/ci_common7 -[platform_requires] -[buildenv] -GCC_INSTALL_DIR=/opt/rh/gcc-toolset-14/root/lib/gcc/x86_64-redhat-linux/14 diff --git a/packages/conan/settings/profiles/vfx2023 b/packages/conan/settings/profiles/vfx2023 index 0eb4e6051..efa960ae8 100644 --- a/packages/conan/settings/profiles/vfx2023 +++ b/packages/conan/settings/profiles/vfx2023 @@ -3,149 +3,164 @@ # !!! This file is automatically generated from a Jinja2 template. !!! # !!! Do not edit manually — run "aswfdocker dockergen" to regenerate. !!! {% set org = os.getenv("ASWF_PKG_ORG", "aswf") %} -include(ci_common3) - [settings] +os=Linux +arch=x86_64 +compiler=gcc +compiler.version=11.2 +compiler.libcxx=libstdc++11 +compiler.cppstd=17 +build_type=Release [options] # Build everything as shared libs by default *:shared=True [tool_requires] [replace_requires] -aces_container/*: aces_container/1.0.2@{{ org }}/vfx2023 -alembic/*: alembic/1.8.8@{{ org }}/vfx2023 -boost/*: boost/1.80.0@{{ org }}/vfx2023 -brotli/*: brotli/system@{{ org }}/vfx2023 -bzip2/*: bzip2/1.0.8@{{ org }}/vfx2023 -c-blosc/*: c-blosc/1.21.6@{{ org }}/vfx2023 -ceres-solver/*: ceres-solver/2.2.0@{{ org }}/vfx2023 -cimg/*: cimg/3.3.2@{{ org }}/vfx2023 -cppunit/*: cppunit/1.15.1@{{ org }}/vfx2023 -cpython/*: cpython/3.10.22@{{ org }}/vfx2023 -dbus/*: dbus/system@{{ org }}/vfx2023 -double-conversion/*: double-conversion/system@{{ org }}/vfx2023 -eigen/*: eigen/3.4.1@{{ org }}/vfx2023 -embree/*: embree/4.3.3@{{ org }}/vfx2023 -expat/*: expat/2.6.4@{{ org }}/vfx2023 -fmt/*: fmt/11.2.0@{{ org }}/vfx2023 -fontconfig/*: fontconfig/system@{{ org }}/vfx2023 -freetype/*: freetype/2.13.2@{{ org }}/vfx2023 -gdbm/*: gdbm/system@{{ org }}/vfx2023 -giflib/*: giflib/5.1.4@{{ org }}/vfx2023 -glew/*: glew/2.2.0@{{ org }}/vfx2023 -glfw/*: glfw/3.4@{{ org }}/vfx2023 -glib/*: glib/2.56.4@{{ org }}/vfx2023 -gtest/*: gtest/1.15.2@{{ org }}/vfx2023 -harfbuzz/*: harfbuzz/11.0.1@{{ org }}/vfx2023 -hdf5/*: hdf5/1.14.6@{{ org }}/vfx2023 -highway/*: highway/1.2.0@{{ org }}/vfx2023 -icu/*: icu/system@{{ org }}/vfx2023 -imath/*: imath/3.1.12@{{ org }}/vfx2023 -ispc/*: ispc/1.21.0@{{ org }}/vfx2023 -jasper/*: jasper/4.2.5@{{ org }}/vfx2023 -jsoncpp/*: jsoncpp/1.9.5@{{ org }}/vfx2023 -lcms/*: lcms/2.17@{{ org }}/vfx2023 -lensfun/*: lensfun/0.3.4@{{ org }}/vfx2023 -libalsa/*: libalsa/system@{{ org }}/vfx2023 -libcgroup/*: libcgroup/0.42.2@{{ org }}/vfx2023 -libaom-av1/*: libaom-av1/system@{{ org }}/vfx2023 -libbacktrace/*: libbacktrace/cci.20210118@{{ org }}/vfx2023 -libdeflate/*: libdeflate/1.23@{{ org }}/vfx2023 -libdrm/*: libdrm/2.4.115@{{ org }}/vfx2023 -libffi/*: libffi/system@{{ org }}/vfx2023 -libiconv/*: libiconv/1.17@{{ org }}/vfx2023 -libjpeg-turbo/*: libjpeg-turbo/3.0.4@{{ org }}/vfx2023 -libjxl/*: libjxl/0.11.1@{{ org }}/vfx2023 -libmp3lame/*: libmp3lame/system@{{ org }}/vfx2023 -libmicrohttpd/*: libmicrohttpd/0.9.72@{{ org }}/vfx2023 -libpng/*: libpng/1.6.34@{{ org }}/vfx2023 -libraw/*: libraw/0.21.4@{{ org }}/vfx2023 -libsndfile/*: libsndfile/system@{{ org }}/vfx2023 -libsquish/*: libsquish/system@{{ org }}/vfx2023 -libsvtav1/*: libsvtav1/system@{{ org }}/vfx2023 -libtiff/*: libtiff/4.0.9@{{ org }}/vfx2023 -libultrahdr/*: libultrahdr/1.4.0@{{ org }}/vfx2023 -libvpx/*: libvpx/system@{{ org }}/vfx2023 -libwebp/*: libwebp/1.5.0@{{ org }}/vfx2023 -libxcrypt/*: libxcrypt/4.4.36@{{ org }}/vfx2023 -libxshmfence/*: libxshmfence/system@{{ org }}/vfx2023 -log4cplus/*: log4cplus/2.1.2@{{ org }}/vfx2023 -lua/*: lua/5.4.4@{{ org }}/vfx2023 -lz4/*: lz4/1.10.0@{{ org }}/vfx2023 -materialx/*: materialx/1.38.7@{{ org }}/vfx2023 -md4c/*: md4c/0.4.8@{{ org }}/vfx2023 -mesa/*: mesa/23.1.4@{{ org }}/vfx2023 -minizip-ng/*: minizip-ng/4.0.10@{{ org }}/vfx2023 -moonray/*: moonray/3.6.0.1@{{ org }}/vfx2023 -mpdecimal/*: mpdecimal/system@{{ org }}/vfx2023 -mpg123/*: mpg123/system@{{ org }}/vfx2023 -nanobind/*: nanobind/2.11.0@{{ org }}/vfx2023 -nlohmann_json/*: nlohmann_json/3.12.0@{{ org }}/vfx2023 -nspr/*: nspr/system@{{ org }}/vfx2023 -nss/*: nss/3.124.0@{{ org }}/vfx2023 -ogg/*: ogg/system@{{ org }}/vfx2023 -onetbb/*: onetbb/2020.3@{{ org }}/vfx2023 -openal-soft/*: openal-soft/system@{{ org }}/vfx2023 -opencl-headers/*: opencl-headers/system@{{ org }}/vfx2023 -opencl-icd-loader/*: opencl-icd-loader/system@{{ org }}/vfx2023 -opencolorio/*: opencolorio/2.2.1@{{ org }}/vfx2023 -opencue/*: opencue/1.13.8@{{ org }}/vfx2023 -openexr/*: openexr/3.1.13@{{ org }}/vfx2023 -openfx/*: openfx/1.5s@{{ org }}/vfx2023 -opengl/*: opengl/system@{{ org }}/vfx2023 -openimagedenoise/*: openimagedenoise/2.3.3@{{ org }}/vfx2023 -openimageio/*: openimageio/2.4.17.0@{{ org }}/vfx2023 -openjpeg/*: openjpeg/2.4.0@{{ org }}/vfx2023 -openjph/*: openjph/0.32.0@{{ org }}/vfx2023 -opensubdiv/*: opensubdiv/3.5.1@{{ org }}/vfx2023 -opentimelineio/*: opentimelineio/0.15@{{ org }}/vfx2023 -openusd/*: openusd/23.08@{{ org }}/vfx2023 -openvdb/*: openvdb/10.1.0@{{ org }}/vfx2023 -opus/*: opus/system@{{ org }}/vfx2023 -osl/*: osl/1.12.14.0@{{ org }}/vfx2023 -partio/*: partio/1.19.0@{{ org }}/vfx2023 -pcre2/*: pcre2/system@{{ org }}/vfx2023 -ptex/*: ptex/2.4.3@{{ org }}/vfx2023 -pugixml/*: pugixml/1.14@{{ org }}/vfx2023 -pulseaudio/*: pulseaudio/system@{{ org }}/vfx2023 -pybind11/*: pybind11/2.13.6@{{ org }}/vfx2023 -pyside/*: pyside/5.15.18@{{ org }}/vfx2023 -pystring/*: pystring/1.1.4@{{ org }}/vfx2023 -qt/*: qt/5.15.18@{{ org }}/vfx2023 -random123/*: random123/1.14.0@{{ org }}/vfx2023 -rapidjson/*: rapidjson/cci.20250205@{{ org }}/vfx2023 -rawtoaces/*: rawtoaces/2.1.1@{{ org }}/vfx2023 -rez/*: rez/3.4.0@{{ org }}/vfx2023 -snappy/*: snappy/1.1.10@{{ org }}/vfx2023 -spdlog/*: spdlog/1.15.3@{{ org }}/vfx2023 -sqlite3/*: sqlite3/system@{{ org }}/vfx2023 -tcl/*: tcl/system@{{ org }}/vfx2023 -tk/*: tk/system@{{ org }}/vfx2023 -tsl-robin-map/*: tsl-robin-map/1.3.0@{{ org }}/vfx2023 -util-linux-libuuid/*: util-linux-libuuid/system@{{ org }}/vfx2023 -vorbis/*: vorbis/system@{{ org }}/vfx2023 -vulkan-headers/*: vulkan-headers/system@{{ org }}/vfx2023 -vulkan-loader/*: vulkan-loader/system@{{ org }}/vfx2023 -xkbcommon/*: xkbcommon/0.9.1@{{ org }}/vfx2023 -xorg/*: xorg/system@{{ org }}/vfx2023 -xorg-proto/*: xorg-proto/system@{{ org }}/vfx2023 -xz_utils/*: xz_utils/system@{{ org }}/vfx2023 -yaml-cpp/*: yaml-cpp/0.8.0@{{ org }}/vfx2023 -zlib/*: zlib/1.3.2@{{ org }}/vfx2023 -zstd/*: zstd/1.5.6@{{ org }}/vfx2023 +# common group packages +openssl/*: openssl/1.1.1k@{{ org }}/vfx2023_8 +gnutls/*: gnutls/3.6.16@{{ org }}/vfx2023_8 +ninja/*: ninja/1.13.2@{{ org }}/vfx2023_8 +# Other packages +aces_container/*: aces_container/1.0.2@{{ org }}/vfx2023_8 +alembic/*: alembic/1.8.8@{{ org }}/vfx2023_8 +boost/*: boost/1.80.0@{{ org }}/vfx2023_8 +brotli/*: brotli/system@{{ org }}/vfx2023_8 +bzip2/*: bzip2/1.0.8@{{ org }}/vfx2023_8 +c-blosc/*: c-blosc/1.21.6@{{ org }}/vfx2023_8 +ceres-solver/*: ceres-solver/2.2.0@{{ org }}/vfx2023_8 +cimg/*: cimg/3.3.2@{{ org }}/vfx2023_8 +cppunit/*: cppunit/1.15.1@{{ org }}/vfx2023_8 +cpython/*: cpython/3.10.22@{{ org }}/vfx2023_8 +dbus/*: dbus/system@{{ org }}/vfx2023_8 +double-conversion/*: double-conversion/system@{{ org }}/vfx2023_8 +eigen/*: eigen/3.4.1@{{ org }}/vfx2023_8 +embree/*: embree/4.3.3@{{ org }}/vfx2023_8 +expat/*: expat/2.6.4@{{ org }}/vfx2023_8 +fmt/*: fmt/11.2.0@{{ org }}/vfx2023_8 +fontconfig/*: fontconfig/system@{{ org }}/vfx2023_8 +freetype/*: freetype/2.13.2@{{ org }}/vfx2023_8 +gdbm/*: gdbm/system@{{ org }}/vfx2023_8 +giflib/*: giflib/5.1.4@{{ org }}/vfx2023_8 +glew/*: glew/2.2.0@{{ org }}/vfx2023_8 +glfw/*: glfw/3.4@{{ org }}/vfx2023_8 +glu/*: glu/system@{{ org }}/vfx2023_8 +glib/*: glib/2.56.4@{{ org }}/vfx2023_8 +gtest/*: gtest/1.15.2@{{ org }}/vfx2023_8 +harfbuzz/*: harfbuzz/11.0.1@{{ org }}/vfx2023_8 +hdf5/*: hdf5/1.14.6@{{ org }}/vfx2023_8 +highway/*: highway/1.2.0@{{ org }}/vfx2023_8 +icu/*: icu/system@{{ org }}/vfx2023_8 +imath/*: imath/3.1.12@{{ org }}/vfx2023_8 +ispc/*: ispc/1.21.0@{{ org }}/vfx2023_8 +jasper/*: jasper/4.2.5@{{ org }}/vfx2023_8 +jsoncpp/*: jsoncpp/1.9.5@{{ org }}/vfx2023_8 +lcms/*: lcms/2.17@{{ org }}/vfx2023_8 +lensfun/*: lensfun/0.3.4@{{ org }}/vfx2023_8 +libalsa/*: libalsa/system@{{ org }}/vfx2023_8 +libcgroup/*: libcgroup/0.42.2@{{ org }}/vfx2023_8 +libaom-av1/*: libaom-av1/system@{{ org }}/vfx2023_8 +libbacktrace/*: libbacktrace/cci.20210118@{{ org }}/vfx2023_8 +libdeflate/*: libdeflate/1.23@{{ org }}/vfx2023_8 +libdrm/*: libdrm/2.4.115@{{ org }}/vfx2023_8 +libffi/*: libffi/system@{{ org }}/vfx2023_8 +libiconv/*: libiconv/1.17@{{ org }}/vfx2023_8 +libjpeg-turbo/*: libjpeg-turbo/3.0.4@{{ org }}/vfx2023_8 +libjxl/*: libjxl/0.11.1@{{ org }}/vfx2023_8 +libmp3lame/*: libmp3lame/system@{{ org }}/vfx2023_8 +libmicrohttpd/*: libmicrohttpd/0.9.72@{{ org }}/vfx2023_8 +libpng/*: libpng/1.6.34@{{ org }}/vfx2023_8 +libraw/*: libraw/0.21.4@{{ org }}/vfx2023_8 +libsndfile/*: libsndfile/system@{{ org }}/vfx2023_8 +libsquish/*: libsquish/system@{{ org }}/vfx2023_8 +libsvtav1/*: libsvtav1/system@{{ org }}/vfx2023_8 +libtiff/*: libtiff/4.0.9@{{ org }}/vfx2023_8 +libultrahdr/*: libultrahdr/1.4.0@{{ org }}/vfx2023_8 +libvpx/*: libvpx/system@{{ org }}/vfx2023_8 +libwebp/*: libwebp/1.5.0@{{ org }}/vfx2023_8 +libxcrypt/*: libxcrypt/4.4.36@{{ org }}/vfx2023_8 +libxshmfence/*: libxshmfence/system@{{ org }}/vfx2023_8 +log4cplus/*: log4cplus/2.1.2@{{ org }}/vfx2023_8 +lua/*: lua/5.4.4@{{ org }}/vfx2023_8 +lz4/*: lz4/1.10.0@{{ org }}/vfx2023_8 +materialx/*: materialx/1.38.7@{{ org }}/vfx2023_8 +md4c/*: md4c/0.4.8@{{ org }}/vfx2023_8 +mesa/*: mesa/23.1.4@{{ org }}/vfx2023_8 +minizip-ng/*: minizip-ng/4.0.10@{{ org }}/vfx2023_8 +moonray/*: moonray/3.6.0.1@{{ org }}/vfx2023_8 +mpdecimal/*: mpdecimal/system@{{ org }}/vfx2023_8 +mpg123/*: mpg123/system@{{ org }}/vfx2023_8 +nanobind/*: nanobind/2.11.0@{{ org }}/vfx2023_8 +nlohmann_json/*: nlohmann_json/3.12.0@{{ org }}/vfx2023_8 +nspr/*: nspr/system@{{ org }}/vfx2023_8 +nss/*: nss/3.124.0@{{ org }}/vfx2023_8 +ogg/*: ogg/system@{{ org }}/vfx2023_8 +onetbb/*: onetbb/2020.3@{{ org }}/vfx2023_8 +openal-soft/*: openal-soft/system@{{ org }}/vfx2023_8 +opencl-headers/*: opencl-headers/system@{{ org }}/vfx2023_8 +opencl-icd-loader/*: opencl-icd-loader/system@{{ org }}/vfx2023_8 +opencolorio/*: opencolorio/2.2.1@{{ org }}/vfx2023_8 +opencue/*: opencue/1.13.8@{{ org }}/vfx2023_8 +openexr/*: openexr/3.1.13@{{ org }}/vfx2023_8 +openfx/*: openfx/1.5s@{{ org }}/vfx2023_8 +opengl/*: opengl/system@{{ org }}/vfx2023_8 +openimagedenoise/*: openimagedenoise/2.3.3@{{ org }}/vfx2023_8 +openimageio/*: openimageio/2.4.17.0@{{ org }}/vfx2023_8 +openjpeg/*: openjpeg/2.4.0@{{ org }}/vfx2023_8 +openjph/*: openjph/0.32.0@{{ org }}/vfx2023_8 +opensubdiv/*: opensubdiv/3.5.1@{{ org }}/vfx2023_8 +opentimelineio/*: opentimelineio/0.15@{{ org }}/vfx2023_8 +openusd/*: openusd/23.08@{{ org }}/vfx2023_8 +openvdb/*: openvdb/10.1.0@{{ org }}/vfx2023_8 +opus/*: opus/system@{{ org }}/vfx2023_8 +osl/*: osl/1.12.14.0@{{ org }}/vfx2023_8 +partio/*: partio/1.19.0@{{ org }}/vfx2023_8 +pcre2/*: pcre2/system@{{ org }}/vfx2023_8 +ptex/*: ptex/2.4.3@{{ org }}/vfx2023_8 +pugixml/*: pugixml/1.14@{{ org }}/vfx2023_8 +pulseaudio/*: pulseaudio/system@{{ org }}/vfx2023_8 +pybind11/*: pybind11/2.13.6@{{ org }}/vfx2023_8 +pyside/*: pyside/5.15.18@{{ org }}/vfx2023_8 +pystring/*: pystring/1.1.4@{{ org }}/vfx2023_8 +qt/*: qt/5.15.18@{{ org }}/vfx2023_8 +random123/*: random123/1.14.0@{{ org }}/vfx2023_8 +rapidjson/*: rapidjson/cci.20250205@{{ org }}/vfx2023_8 +rawtoaces/*: rawtoaces/2.1.1@{{ org }}/vfx2023_8 +rez/*: rez/3.4.0@{{ org }}/vfx2023_8 +snappy/*: snappy/1.1.10@{{ org }}/vfx2023_8 +spdlog/*: spdlog/1.15.3@{{ org }}/vfx2023_8 +sqlite3/*: sqlite3/system@{{ org }}/vfx2023_8 +tcl/*: tcl/system@{{ org }}/vfx2023_8 +tk/*: tk/system@{{ org }}/vfx2023_8 +tsl-robin-map/*: tsl-robin-map/1.3.0@{{ org }}/vfx2023_8 +util-linux-libuuid/*: util-linux-libuuid/system@{{ org }}/vfx2023_8 +vorbis/*: vorbis/system@{{ org }}/vfx2023_8 +vulkan-headers/*: vulkan-headers/system@{{ org }}/vfx2023_8 +vulkan-loader/*: vulkan-loader/system@{{ org }}/vfx2023_8 +xkbcommon/*: xkbcommon/0.9.1@{{ org }}/vfx2023_8 +xorg/*: xorg/system@{{ org }}/vfx2023_8 +xorg-proto/*: xorg-proto/system@{{ org }}/vfx2023_8 +xz_utils/*: xz_utils/system@{{ org }}/vfx2023_8 +yaml-cpp/*: yaml-cpp/0.8.0@{{ org }}/vfx2023_8 +zlib/*: zlib/1.3.2@{{ org }}/vfx2023_8 +zstd/*: zstd/1.5.6@{{ org }}/vfx2023_8 [replace_tool_requires] -b2/*: b2/5.2.1@{{ org }}/vfx2023 +# common group packages +cmake/*: cmake/3.31.11@{{ org }}/vfx2023_8 +ninja/*: ninja/1.13.2@{{ org }}/vfx2023_8 +# Other packages +b2/*: b2/5.2.1@{{ org }}/vfx2023_8 bison/*: bison/3.0.4@system -cpython/*: cpython/3.10.22@{{ org }}/vfx2023 +cpython/*: cpython/3.10.22@{{ org }}/vfx2023_8 flex/*: flex/2.6.1@system gperf/*: gperf/3.1@system -ispc/*: ispc/1.21.0@{{ org }}/vfx2023 +ispc/*: ispc/1.21.0@{{ org }}/vfx2023_8 libtool/*: libtool/2.4.6@system -meson/*: meson/1.10.2@{{ org }}/vfx2023 -nasm/*: nasm/system@{{ org }}/vfx2023 +meson/*: meson/1.10.2@{{ org }}/vfx2023_8 +nasm/*: nasm/system@{{ org }}/vfx2023_8 nodejs/*: nodejs/18.20.4@system pkgconf/*: pkgconf/1.4.2@system -pyside/*: pyside/5.15.18@{{ org }}/vfx2023 -qt/*: qt/5.15.18@{{ org }}/vfx2023 +pyside/*: pyside/5.15.18@{{ org }}/vfx2023_8 +qt/*: qt/5.15.18@{{ org }}/vfx2023_8 wayland/*: wayland/1.21.0@system wayland-protocols/*: wayland-protocols/1.25@system [platform_requires] @@ -159,15 +174,16 @@ pkgconf/1.4.2 wayland/1.21.0 wayland-protocols/1.25 [buildenv] +GCC_INSTALL_DIR=/opt/rh/gcc-toolset-11/root/lib/gcc/x86_64-redhat-linux/11 [conf] -user.aswf:osl_clang_ref=clang/15.0.7@{{ org }}/ci_common3 -user.aswf:pyside_clang_ref=clang/14.0.6@{{ org }}/ci_common3 -user.aswf:ispc_clang_ref=clang/15.0.7@{{ org }}/ci_common3 -user.aswf:openimagedenoise_clang_ref=clang/15.0.7@{{ org }}/ci_common3 -user.aswf:openvdb_clang_ref=clang/15.0.7@{{ org }}/ci_common3 +user.aswf:osl_clang_ref=clang/15.0.7@{{ org }}/vfx2023_8 +user.aswf:pyside_clang_ref=clang/14.0.6@{{ org }}/vfx2023_8 +user.aswf:ispc_clang_ref=clang/15.0.7@{{ org }}/vfx2023_8 +user.aswf:openimagedenoise_clang_ref=clang/15.0.7@{{ org }}/vfx2023_8 +user.aswf:openvdb_clang_ref=clang/15.0.7@{{ org }}/vfx2023_8 # mesa's swrast/llvmpipe driver must share one LLVM instance with # osl/openvdb/openimagedenoise in the same process (two different libLLVM # SONAMEs loaded together abort with "Option ... already exists!") -- alias # straight to osl's major version instead of adding a separate # ASWF_MESA_CLANG_MAJOR_VERSION key that could drift out of sync with it. -user.aswf:mesa_clang_ref=clang/15.0.7@{{ org }}/ci_common3 +user.aswf:mesa_clang_ref=clang/15.0.7@{{ org }}/vfx2023_8 diff --git a/packages/conan/settings/profiles/vfx2024 b/packages/conan/settings/profiles/vfx2024 index 14a716321..b906f7768 100644 --- a/packages/conan/settings/profiles/vfx2024 +++ b/packages/conan/settings/profiles/vfx2024 @@ -3,149 +3,164 @@ # !!! This file is automatically generated from a Jinja2 template. !!! # !!! Do not edit manually — run "aswfdocker dockergen" to regenerate. !!! {% set org = os.getenv("ASWF_PKG_ORG", "aswf") %} -include(ci_common4) - [settings] +os=Linux +arch=x86_64 +compiler=gcc +compiler.version=11.2 +compiler.libcxx=libstdc++11 +compiler.cppstd=17 +build_type=Release [options] # Build everything as shared libs by default *:shared=True [tool_requires] [replace_requires] -aces_container/*: aces_container/1.0.2@{{ org }}/vfx2024 -alembic/*: alembic/1.8.8@{{ org }}/vfx2024 -boost/*: boost/1.82.0@{{ org }}/vfx2024 -brotli/*: brotli/system@{{ org }}/vfx2024 -bzip2/*: bzip2/1.0.8@{{ org }}/vfx2024 -c-blosc/*: c-blosc/1.21.6@{{ org }}/vfx2024 -ceres-solver/*: ceres-solver/2.2.0@{{ org }}/vfx2024 -cimg/*: cimg/3.3.2@{{ org }}/vfx2024 -cppunit/*: cppunit/1.15.1@{{ org }}/vfx2024 -cpython/*: cpython/3.11.17@{{ org }}/vfx2024 -dbus/*: dbus/system@{{ org }}/vfx2024 -double-conversion/*: double-conversion/system@{{ org }}/vfx2024 -eigen/*: eigen/3.4.1@{{ org }}/vfx2024 -embree/*: embree/4.3.3@{{ org }}/vfx2024 -expat/*: expat/2.6.4@{{ org }}/vfx2024 -fmt/*: fmt/11.2.0@{{ org }}/vfx2024 -fontconfig/*: fontconfig/system@{{ org }}/vfx2024 -freetype/*: freetype/2.13.2@{{ org }}/vfx2024 -gdbm/*: gdbm/system@{{ org }}/vfx2024 -giflib/*: giflib/5.1.4@{{ org }}/vfx2024 -glew/*: glew/2.2.0@{{ org }}/vfx2024 -glfw/*: glfw/3.4@{{ org }}/vfx2024 -glib/*: glib/2.56.4@{{ org }}/vfx2024 -gtest/*: gtest/1.15.2@{{ org }}/vfx2024 -harfbuzz/*: harfbuzz/11.0.1@{{ org }}/vfx2024 -hdf5/*: hdf5/1.14.6@{{ org }}/vfx2024 -highway/*: highway/1.2.0@{{ org }}/vfx2024 -icu/*: icu/system@{{ org }}/vfx2024 -imath/*: imath/3.1.12@{{ org }}/vfx2024 -ispc/*: ispc/1.24.0@{{ org }}/vfx2024 -jasper/*: jasper/4.2.5@{{ org }}/vfx2024 -jsoncpp/*: jsoncpp/1.9.5@{{ org }}/vfx2024 -lcms/*: lcms/2.17@{{ org }}/vfx2024 -lensfun/*: lensfun/0.3.4@{{ org }}/vfx2024 -libalsa/*: libalsa/system@{{ org }}/vfx2024 -libcgroup/*: libcgroup/0.42.2@{{ org }}/vfx2024 -libaom-av1/*: libaom-av1/system@{{ org }}/vfx2024 -libbacktrace/*: libbacktrace/cci.20210118@{{ org }}/vfx2024 -libdeflate/*: libdeflate/1.23@{{ org }}/vfx2024 -libdrm/*: libdrm/2.4.115@{{ org }}/vfx2024 -libffi/*: libffi/system@{{ org }}/vfx2024 -libiconv/*: libiconv/1.17@{{ org }}/vfx2024 -libjpeg-turbo/*: libjpeg-turbo/3.0.4@{{ org }}/vfx2024 -libjxl/*: libjxl/0.11.1@{{ org }}/vfx2024 -libmp3lame/*: libmp3lame/system@{{ org }}/vfx2024 -libmicrohttpd/*: libmicrohttpd/0.9.72@{{ org }}/vfx2024 -libpng/*: libpng/1.6.34@{{ org }}/vfx2024 -libraw/*: libraw/0.21.4@{{ org }}/vfx2024 -libsndfile/*: libsndfile/system@{{ org }}/vfx2024 -libsquish/*: libsquish/system@{{ org }}/vfx2024 -libsvtav1/*: libsvtav1/system@{{ org }}/vfx2024 -libtiff/*: libtiff/4.0.9@{{ org }}/vfx2024 -libultrahdr/*: libultrahdr/1.4.0@{{ org }}/vfx2024 -libvpx/*: libvpx/system@{{ org }}/vfx2024 -libwebp/*: libwebp/1.5.0@{{ org }}/vfx2024 -libxcrypt/*: libxcrypt/4.4.36@{{ org }}/vfx2024 -libxshmfence/*: libxshmfence/system@{{ org }}/vfx2024 -log4cplus/*: log4cplus/2.1.2@{{ org }}/vfx2024 -lua/*: lua/5.4.4@{{ org }}/vfx2024 -lz4/*: lz4/1.10.0@{{ org }}/vfx2024 -materialx/*: materialx/1.39.1@{{ org }}/vfx2024 -md4c/*: md4c/0.4.8@{{ org }}/vfx2024 -mesa/*: mesa/23.1.4@{{ org }}/vfx2024 -minizip-ng/*: minizip-ng/4.0.10@{{ org }}/vfx2024 -moonray/*: moonray/3.6.0.1@{{ org }}/vfx2024 -mpdecimal/*: mpdecimal/system@{{ org }}/vfx2024 -mpg123/*: mpg123/system@{{ org }}/vfx2024 -nanobind/*: nanobind/2.11.0@{{ org }}/vfx2024 -nlohmann_json/*: nlohmann_json/3.12.0@{{ org }}/vfx2024 -nspr/*: nspr/system@{{ org }}/vfx2024 -nss/*: nss/3.124.0@{{ org }}/vfx2024 -ogg/*: ogg/system@{{ org }}/vfx2024 -onetbb/*: onetbb/2020.3@{{ org }}/vfx2024 -openal-soft/*: openal-soft/system@{{ org }}/vfx2024 -opencl-headers/*: opencl-headers/system@{{ org }}/vfx2024 -opencl-icd-loader/*: opencl-icd-loader/system@{{ org }}/vfx2024 -opencolorio/*: opencolorio/2.3.2@{{ org }}/vfx2024 -opencue/*: opencue/1.13.8@{{ org }}/vfx2024 -openexr/*: openexr/3.2.12@{{ org }}/vfx2024 -openfx/*: openfx/1.5s@{{ org }}/vfx2024 -opengl/*: opengl/system@{{ org }}/vfx2024 -openimagedenoise/*: openimagedenoise/2.3.3@{{ org }}/vfx2024 -openimageio/*: openimageio/2.5.19.1@{{ org }}/vfx2024 -openjpeg/*: openjpeg/2.4.0@{{ org }}/vfx2024 -openjph/*: openjph/0.32.0@{{ org }}/vfx2024 -opensubdiv/*: opensubdiv/3.6.1@{{ org }}/vfx2024 -opentimelineio/*: opentimelineio/0.17.0@{{ org }}/vfx2024 -openusd/*: openusd/24.08@{{ org }}/vfx2024 -openvdb/*: openvdb/11.0.0@{{ org }}/vfx2024 -opus/*: opus/system@{{ org }}/vfx2024 -osl/*: osl/1.13.11.0@{{ org }}/vfx2024 -partio/*: partio/1.19.0@{{ org }}/vfx2024 -pcre2/*: pcre2/system@{{ org }}/vfx2024 -ptex/*: ptex/2.4.3@{{ org }}/vfx2024 -pugixml/*: pugixml/1.14@{{ org }}/vfx2024 -pulseaudio/*: pulseaudio/system@{{ org }}/vfx2024 -pybind11/*: pybind11/2.13.6@{{ org }}/vfx2024 -pyside/*: pyside/6.5.6@{{ org }}/vfx2024 -pystring/*: pystring/1.1.4@{{ org }}/vfx2024 -qt/*: qt/6.5.6@{{ org }}/vfx2024 -random123/*: random123/1.14.0@{{ org }}/vfx2024 -rapidjson/*: rapidjson/cci.20250205@{{ org }}/vfx2024 -rawtoaces/*: rawtoaces/2.1.1@{{ org }}/vfx2024 -rez/*: rez/3.4.0@{{ org }}/vfx2024 -snappy/*: snappy/1.1.10@{{ org }}/vfx2024 -spdlog/*: spdlog/1.15.3@{{ org }}/vfx2024 -sqlite3/*: sqlite3/system@{{ org }}/vfx2024 -tcl/*: tcl/system@{{ org }}/vfx2024 -tk/*: tk/system@{{ org }}/vfx2024 -tsl-robin-map/*: tsl-robin-map/1.3.0@{{ org }}/vfx2024 -util-linux-libuuid/*: util-linux-libuuid/system@{{ org }}/vfx2024 -vorbis/*: vorbis/system@{{ org }}/vfx2024 -vulkan-headers/*: vulkan-headers/system@{{ org }}/vfx2024 -vulkan-loader/*: vulkan-loader/system@{{ org }}/vfx2024 -xkbcommon/*: xkbcommon/0.9.1@{{ org }}/vfx2024 -xorg/*: xorg/system@{{ org }}/vfx2024 -xorg-proto/*: xorg-proto/system@{{ org }}/vfx2024 -xz_utils/*: xz_utils/system@{{ org }}/vfx2024 -yaml-cpp/*: yaml-cpp/0.8.0@{{ org }}/vfx2024 -zlib/*: zlib/1.3.2@{{ org }}/vfx2024 -zstd/*: zstd/1.5.6@{{ org }}/vfx2024 +# common group packages +openssl/*: openssl/1.1.1k@{{ org }}/vfx2024_12 +gnutls/*: gnutls/3.6.16@{{ org }}/vfx2024_12 +ninja/*: ninja/1.13.2@{{ org }}/vfx2024_12 +# Other packages +aces_container/*: aces_container/1.0.2@{{ org }}/vfx2024_12 +alembic/*: alembic/1.8.8@{{ org }}/vfx2024_12 +boost/*: boost/1.82.0@{{ org }}/vfx2024_12 +brotli/*: brotli/system@{{ org }}/vfx2024_12 +bzip2/*: bzip2/1.0.8@{{ org }}/vfx2024_12 +c-blosc/*: c-blosc/1.21.6@{{ org }}/vfx2024_12 +ceres-solver/*: ceres-solver/2.2.0@{{ org }}/vfx2024_12 +cimg/*: cimg/3.3.2@{{ org }}/vfx2024_12 +cppunit/*: cppunit/1.15.1@{{ org }}/vfx2024_12 +cpython/*: cpython/3.11.17@{{ org }}/vfx2024_12 +dbus/*: dbus/system@{{ org }}/vfx2024_12 +double-conversion/*: double-conversion/system@{{ org }}/vfx2024_12 +eigen/*: eigen/3.4.1@{{ org }}/vfx2024_12 +embree/*: embree/4.3.3@{{ org }}/vfx2024_12 +expat/*: expat/2.6.4@{{ org }}/vfx2024_12 +fmt/*: fmt/11.2.0@{{ org }}/vfx2024_12 +fontconfig/*: fontconfig/system@{{ org }}/vfx2024_12 +freetype/*: freetype/2.13.2@{{ org }}/vfx2024_12 +gdbm/*: gdbm/system@{{ org }}/vfx2024_12 +giflib/*: giflib/5.1.4@{{ org }}/vfx2024_12 +glew/*: glew/2.2.0@{{ org }}/vfx2024_12 +glfw/*: glfw/3.4@{{ org }}/vfx2024_12 +glu/*: glu/system@{{ org }}/vfx2024_12 +glib/*: glib/2.56.4@{{ org }}/vfx2024_12 +gtest/*: gtest/1.15.2@{{ org }}/vfx2024_12 +harfbuzz/*: harfbuzz/11.0.1@{{ org }}/vfx2024_12 +hdf5/*: hdf5/1.14.6@{{ org }}/vfx2024_12 +highway/*: highway/1.2.0@{{ org }}/vfx2024_12 +icu/*: icu/system@{{ org }}/vfx2024_12 +imath/*: imath/3.1.12@{{ org }}/vfx2024_12 +ispc/*: ispc/1.24.0@{{ org }}/vfx2024_12 +jasper/*: jasper/4.2.5@{{ org }}/vfx2024_12 +jsoncpp/*: jsoncpp/1.9.5@{{ org }}/vfx2024_12 +lcms/*: lcms/2.17@{{ org }}/vfx2024_12 +lensfun/*: lensfun/0.3.4@{{ org }}/vfx2024_12 +libalsa/*: libalsa/system@{{ org }}/vfx2024_12 +libcgroup/*: libcgroup/0.42.2@{{ org }}/vfx2024_12 +libaom-av1/*: libaom-av1/system@{{ org }}/vfx2024_12 +libbacktrace/*: libbacktrace/cci.20210118@{{ org }}/vfx2024_12 +libdeflate/*: libdeflate/1.23@{{ org }}/vfx2024_12 +libdrm/*: libdrm/2.4.115@{{ org }}/vfx2024_12 +libffi/*: libffi/system@{{ org }}/vfx2024_12 +libiconv/*: libiconv/1.17@{{ org }}/vfx2024_12 +libjpeg-turbo/*: libjpeg-turbo/3.0.4@{{ org }}/vfx2024_12 +libjxl/*: libjxl/0.11.1@{{ org }}/vfx2024_12 +libmp3lame/*: libmp3lame/system@{{ org }}/vfx2024_12 +libmicrohttpd/*: libmicrohttpd/0.9.72@{{ org }}/vfx2024_12 +libpng/*: libpng/1.6.34@{{ org }}/vfx2024_12 +libraw/*: libraw/0.21.4@{{ org }}/vfx2024_12 +libsndfile/*: libsndfile/system@{{ org }}/vfx2024_12 +libsquish/*: libsquish/system@{{ org }}/vfx2024_12 +libsvtav1/*: libsvtav1/system@{{ org }}/vfx2024_12 +libtiff/*: libtiff/4.0.9@{{ org }}/vfx2024_12 +libultrahdr/*: libultrahdr/1.4.0@{{ org }}/vfx2024_12 +libvpx/*: libvpx/system@{{ org }}/vfx2024_12 +libwebp/*: libwebp/1.5.0@{{ org }}/vfx2024_12 +libxcrypt/*: libxcrypt/4.4.36@{{ org }}/vfx2024_12 +libxshmfence/*: libxshmfence/system@{{ org }}/vfx2024_12 +log4cplus/*: log4cplus/2.1.2@{{ org }}/vfx2024_12 +lua/*: lua/5.4.4@{{ org }}/vfx2024_12 +lz4/*: lz4/1.10.0@{{ org }}/vfx2024_12 +materialx/*: materialx/1.39.1@{{ org }}/vfx2024_12 +md4c/*: md4c/0.4.8@{{ org }}/vfx2024_12 +mesa/*: mesa/23.1.4@{{ org }}/vfx2024_12 +minizip-ng/*: minizip-ng/4.0.10@{{ org }}/vfx2024_12 +moonray/*: moonray/3.6.0.1@{{ org }}/vfx2024_12 +mpdecimal/*: mpdecimal/system@{{ org }}/vfx2024_12 +mpg123/*: mpg123/system@{{ org }}/vfx2024_12 +nanobind/*: nanobind/2.11.0@{{ org }}/vfx2024_12 +nlohmann_json/*: nlohmann_json/3.12.0@{{ org }}/vfx2024_12 +nspr/*: nspr/system@{{ org }}/vfx2024_12 +nss/*: nss/3.124.0@{{ org }}/vfx2024_12 +ogg/*: ogg/system@{{ org }}/vfx2024_12 +onetbb/*: onetbb/2020.3@{{ org }}/vfx2024_12 +openal-soft/*: openal-soft/system@{{ org }}/vfx2024_12 +opencl-headers/*: opencl-headers/system@{{ org }}/vfx2024_12 +opencl-icd-loader/*: opencl-icd-loader/system@{{ org }}/vfx2024_12 +opencolorio/*: opencolorio/2.3.2@{{ org }}/vfx2024_12 +opencue/*: opencue/1.13.8@{{ org }}/vfx2024_12 +openexr/*: openexr/3.2.12@{{ org }}/vfx2024_12 +openfx/*: openfx/1.5s@{{ org }}/vfx2024_12 +opengl/*: opengl/system@{{ org }}/vfx2024_12 +openimagedenoise/*: openimagedenoise/2.3.3@{{ org }}/vfx2024_12 +openimageio/*: openimageio/2.5.19.1@{{ org }}/vfx2024_12 +openjpeg/*: openjpeg/2.4.0@{{ org }}/vfx2024_12 +openjph/*: openjph/0.32.0@{{ org }}/vfx2024_12 +opensubdiv/*: opensubdiv/3.6.1@{{ org }}/vfx2024_12 +opentimelineio/*: opentimelineio/0.17.0@{{ org }}/vfx2024_12 +openusd/*: openusd/24.08@{{ org }}/vfx2024_12 +openvdb/*: openvdb/11.0.0@{{ org }}/vfx2024_12 +opus/*: opus/system@{{ org }}/vfx2024_12 +osl/*: osl/1.13.11.0@{{ org }}/vfx2024_12 +partio/*: partio/1.19.0@{{ org }}/vfx2024_12 +pcre2/*: pcre2/system@{{ org }}/vfx2024_12 +ptex/*: ptex/2.4.3@{{ org }}/vfx2024_12 +pugixml/*: pugixml/1.14@{{ org }}/vfx2024_12 +pulseaudio/*: pulseaudio/system@{{ org }}/vfx2024_12 +pybind11/*: pybind11/2.13.6@{{ org }}/vfx2024_12 +pyside/*: pyside/6.5.6@{{ org }}/vfx2024_12 +pystring/*: pystring/1.1.4@{{ org }}/vfx2024_12 +qt/*: qt/6.5.6@{{ org }}/vfx2024_12 +random123/*: random123/1.14.0@{{ org }}/vfx2024_12 +rapidjson/*: rapidjson/cci.20250205@{{ org }}/vfx2024_12 +rawtoaces/*: rawtoaces/2.1.1@{{ org }}/vfx2024_12 +rez/*: rez/3.4.0@{{ org }}/vfx2024_12 +snappy/*: snappy/1.1.10@{{ org }}/vfx2024_12 +spdlog/*: spdlog/1.15.3@{{ org }}/vfx2024_12 +sqlite3/*: sqlite3/system@{{ org }}/vfx2024_12 +tcl/*: tcl/system@{{ org }}/vfx2024_12 +tk/*: tk/system@{{ org }}/vfx2024_12 +tsl-robin-map/*: tsl-robin-map/1.3.0@{{ org }}/vfx2024_12 +util-linux-libuuid/*: util-linux-libuuid/system@{{ org }}/vfx2024_12 +vorbis/*: vorbis/system@{{ org }}/vfx2024_12 +vulkan-headers/*: vulkan-headers/system@{{ org }}/vfx2024_12 +vulkan-loader/*: vulkan-loader/system@{{ org }}/vfx2024_12 +xkbcommon/*: xkbcommon/0.9.1@{{ org }}/vfx2024_12 +xorg/*: xorg/system@{{ org }}/vfx2024_12 +xorg-proto/*: xorg-proto/system@{{ org }}/vfx2024_12 +xz_utils/*: xz_utils/system@{{ org }}/vfx2024_12 +yaml-cpp/*: yaml-cpp/0.8.0@{{ org }}/vfx2024_12 +zlib/*: zlib/1.3.2@{{ org }}/vfx2024_12 +zstd/*: zstd/1.5.6@{{ org }}/vfx2024_12 [replace_tool_requires] -b2/*: b2/5.2.1@{{ org }}/vfx2024 +# common group packages +cmake/*: cmake/3.31.11@{{ org }}/vfx2024_12 +ninja/*: ninja/1.13.2@{{ org }}/vfx2024_12 +# Other packages +b2/*: b2/5.2.1@{{ org }}/vfx2024_12 bison/*: bison/3.0.4@system -cpython/*: cpython/3.11.17@{{ org }}/vfx2024 +cpython/*: cpython/3.11.17@{{ org }}/vfx2024_12 flex/*: flex/2.6.1@system gperf/*: gperf/3.1@system -ispc/*: ispc/1.24.0@{{ org }}/vfx2024 +ispc/*: ispc/1.24.0@{{ org }}/vfx2024_12 libtool/*: libtool/2.4.6@system -meson/*: meson/1.10.2@{{ org }}/vfx2024 -nasm/*: nasm/system@{{ org }}/vfx2024 +meson/*: meson/1.10.2@{{ org }}/vfx2024_12 +nasm/*: nasm/system@{{ org }}/vfx2024_12 nodejs/*: nodejs/18.20.4@system pkgconf/*: pkgconf/1.4.2@system -pyside/*: pyside/6.5.6@{{ org }}/vfx2024 -qt/*: qt/6.5.6@{{ org }}/vfx2024 +pyside/*: pyside/6.5.6@{{ org }}/vfx2024_12 +qt/*: qt/6.5.6@{{ org }}/vfx2024_12 wayland/*: wayland/1.21.0@system wayland-protocols/*: wayland-protocols/1.25@system [platform_requires] @@ -159,15 +174,16 @@ pkgconf/1.4.2 wayland/1.21.0 wayland-protocols/1.25 [buildenv] +GCC_INSTALL_DIR=/opt/rh/gcc-toolset-11/root/lib/gcc/x86_64-redhat-linux/11 [conf] -user.aswf:osl_clang_ref=clang/17.0.6@{{ org }}/ci_common4 -user.aswf:pyside_clang_ref=clang/16.0.6@{{ org }}/ci_common4 -user.aswf:ispc_clang_ref=clang/17.0.6@{{ org }}/ci_common4 -user.aswf:openimagedenoise_clang_ref=clang/17.0.6@{{ org }}/ci_common4 -user.aswf:openvdb_clang_ref=clang/17.0.6@{{ org }}/ci_common4 +user.aswf:osl_clang_ref=clang/17.0.6@{{ org }}/vfx2024_12 +user.aswf:pyside_clang_ref=clang/16.0.6@{{ org }}/vfx2024_12 +user.aswf:ispc_clang_ref=clang/17.0.6@{{ org }}/vfx2024_12 +user.aswf:openimagedenoise_clang_ref=clang/17.0.6@{{ org }}/vfx2024_12 +user.aswf:openvdb_clang_ref=clang/17.0.6@{{ org }}/vfx2024_12 # mesa's swrast/llvmpipe driver must share one LLVM instance with # osl/openvdb/openimagedenoise in the same process (two different libLLVM # SONAMEs loaded together abort with "Option ... already exists!") -- alias # straight to osl's major version instead of adding a separate # ASWF_MESA_CLANG_MAJOR_VERSION key that could drift out of sync with it. -user.aswf:mesa_clang_ref=clang/17.0.6@{{ org }}/ci_common4 +user.aswf:mesa_clang_ref=clang/17.0.6@{{ org }}/vfx2024_12 diff --git a/packages/conan/settings/profiles/vfx2025 b/packages/conan/settings/profiles/vfx2025 index 0fef6960e..f42541435 100644 --- a/packages/conan/settings/profiles/vfx2025 +++ b/packages/conan/settings/profiles/vfx2025 @@ -3,149 +3,164 @@ # !!! This file is automatically generated from a Jinja2 template. !!! # !!! Do not edit manually — run "aswfdocker dockergen" to regenerate. !!! {% set org = os.getenv("ASWF_PKG_ORG", "aswf") %} -include(ci_common5) - [settings] +os=Linux +arch=x86_64 +compiler=gcc +compiler.version=11.2 +compiler.libcxx=libstdc++11 +compiler.cppstd=17 +build_type=Release [options] # Build everything as shared libs by default *:shared=True [tool_requires] [replace_requires] -aces_container/*: aces_container/1.0.2@{{ org }}/vfx2025 -alembic/*: alembic/1.8.8@{{ org }}/vfx2025 -boost/*: boost/1.85.0@{{ org }}/vfx2025 -brotli/*: brotli/system@{{ org }}/vfx2025 -bzip2/*: bzip2/1.0.8@{{ org }}/vfx2025 -c-blosc/*: c-blosc/1.21.6@{{ org }}/vfx2025 -ceres-solver/*: ceres-solver/2.2.0@{{ org }}/vfx2025 -cimg/*: cimg/3.3.2@{{ org }}/vfx2025 -cppunit/*: cppunit/1.15.1@{{ org }}/vfx2025 -cpython/*: cpython/3.11.17@{{ org }}/vfx2025 -dbus/*: dbus/system@{{ org }}/vfx2025 -double-conversion/*: double-conversion/system@{{ org }}/vfx2025 -eigen/*: eigen/3.4.1@{{ org }}/vfx2025 -embree/*: embree/4.3.3@{{ org }}/vfx2025 -expat/*: expat/2.6.4@{{ org }}/vfx2025 -fmt/*: fmt/11.2.0@{{ org }}/vfx2025 -fontconfig/*: fontconfig/system@{{ org }}/vfx2025 -freetype/*: freetype/2.13.2@{{ org }}/vfx2025 -gdbm/*: gdbm/system@{{ org }}/vfx2025 -giflib/*: giflib/5.1.4@{{ org }}/vfx2025 -glew/*: glew/2.2.0@{{ org }}/vfx2025 -glfw/*: glfw/3.4@{{ org }}/vfx2025 -glib/*: glib/2.56.4@{{ org }}/vfx2025 -gtest/*: gtest/1.15.2@{{ org }}/vfx2025 -harfbuzz/*: harfbuzz/11.0.1@{{ org }}/vfx2025 -hdf5/*: hdf5/1.14.6@{{ org }}/vfx2025 -highway/*: highway/1.2.0@{{ org }}/vfx2025 -icu/*: icu/system@{{ org }}/vfx2025 -imath/*: imath/3.1.12@{{ org }}/vfx2025 -ispc/*: ispc/1.26.0@{{ org }}/vfx2025 -jasper/*: jasper/4.2.5@{{ org }}/vfx2025 -jsoncpp/*: jsoncpp/1.9.5@{{ org }}/vfx2025 -lcms/*: lcms/2.17@{{ org }}/vfx2025 -lensfun/*: lensfun/0.3.4@{{ org }}/vfx2025 -libalsa/*: libalsa/system@{{ org }}/vfx2025 -libcgroup/*: libcgroup/0.42.2@{{ org }}/vfx2025 -libaom-av1/*: libaom-av1/system@{{ org }}/vfx2025 -libbacktrace/*: libbacktrace/cci.20210118@{{ org }}/vfx2025 -libdeflate/*: libdeflate/1.23@{{ org }}/vfx2025 -libdrm/*: libdrm/2.4.115@{{ org }}/vfx2025 -libffi/*: libffi/system@{{ org }}/vfx2025 -libiconv/*: libiconv/1.17@{{ org }}/vfx2025 -libjpeg-turbo/*: libjpeg-turbo/3.0.4@{{ org }}/vfx2025 -libjxl/*: libjxl/0.11.1@{{ org }}/vfx2025 -libmp3lame/*: libmp3lame/system@{{ org }}/vfx2025 -libmicrohttpd/*: libmicrohttpd/0.9.72@{{ org }}/vfx2025 -libpng/*: libpng/1.6.34@{{ org }}/vfx2025 -libraw/*: libraw/0.21.4@{{ org }}/vfx2025 -libsndfile/*: libsndfile/system@{{ org }}/vfx2025 -libsquish/*: libsquish/system@{{ org }}/vfx2025 -libsvtav1/*: libsvtav1/system@{{ org }}/vfx2025 -libtiff/*: libtiff/4.0.9@{{ org }}/vfx2025 -libultrahdr/*: libultrahdr/1.4.0@{{ org }}/vfx2025 -libvpx/*: libvpx/system@{{ org }}/vfx2025 -libwebp/*: libwebp/1.5.0@{{ org }}/vfx2025 -libxcrypt/*: libxcrypt/4.4.36@{{ org }}/vfx2025 -libxshmfence/*: libxshmfence/system@{{ org }}/vfx2025 -log4cplus/*: log4cplus/2.1.2@{{ org }}/vfx2025 -lua/*: lua/5.4.4@{{ org }}/vfx2025 -lz4/*: lz4/1.10.0@{{ org }}/vfx2025 -materialx/*: materialx/1.39.3@{{ org }}/vfx2025 -md4c/*: md4c/0.4.8@{{ org }}/vfx2025 -mesa/*: mesa/23.1.4@{{ org }}/vfx2025 -minizip-ng/*: minizip-ng/4.0.10@{{ org }}/vfx2025 -moonray/*: moonray/3.6.0.1@{{ org }}/vfx2025 -mpdecimal/*: mpdecimal/system@{{ org }}/vfx2025 -mpg123/*: mpg123/system@{{ org }}/vfx2025 -nanobind/*: nanobind/2.11.0@{{ org }}/vfx2025 -nlohmann_json/*: nlohmann_json/3.12.0@{{ org }}/vfx2025 -nspr/*: nspr/system@{{ org }}/vfx2025 -nss/*: nss/3.124.0@{{ org }}/vfx2025 -ogg/*: ogg/system@{{ org }}/vfx2025 -onetbb/*: onetbb/2021.13.0@{{ org }}/vfx2025 -openal-soft/*: openal-soft/system@{{ org }}/vfx2025 -opencl-headers/*: opencl-headers/system@{{ org }}/vfx2025 -opencl-icd-loader/*: opencl-icd-loader/system@{{ org }}/vfx2025 -opencolorio/*: opencolorio/2.4.2@{{ org }}/vfx2025 -opencue/*: opencue/1.13.8@{{ org }}/vfx2025 -openexr/*: openexr/3.3.14@{{ org }}/vfx2025 -openfx/*: openfx/1.5s@{{ org }}/vfx2025 -opengl/*: opengl/system@{{ org }}/vfx2025 -openimagedenoise/*: openimagedenoise/2.3.3@{{ org }}/vfx2025 -openimageio/*: openimageio/3.1.6.2@{{ org }}/vfx2025 -openjpeg/*: openjpeg/2.4.0@{{ org }}/vfx2025 -openjph/*: openjph/0.32.0@{{ org }}/vfx2025 -opensubdiv/*: opensubdiv/3.6.1@{{ org }}/vfx2025 -opentimelineio/*: opentimelineio/0.17.0@{{ org }}/vfx2025 -openusd/*: openusd/25.05.01@{{ org }}/vfx2025 -openvdb/*: openvdb/12.1.1@{{ org }}/vfx2025 -opus/*: opus/system@{{ org }}/vfx2025 -osl/*: osl/1.14.12.0@{{ org }}/vfx2025 -partio/*: partio/1.19.0@{{ org }}/vfx2025 -pcre2/*: pcre2/system@{{ org }}/vfx2025 -ptex/*: ptex/2.4.3@{{ org }}/vfx2025 -pugixml/*: pugixml/1.14@{{ org }}/vfx2025 -pulseaudio/*: pulseaudio/system@{{ org }}/vfx2025 -pybind11/*: pybind11/2.13.6@{{ org }}/vfx2025 -pyside/*: pyside/6.5.6@{{ org }}/vfx2025 -pystring/*: pystring/1.1.4@{{ org }}/vfx2025 -qt/*: qt/6.5.6@{{ org }}/vfx2025 -random123/*: random123/1.14.0@{{ org }}/vfx2025 -rapidjson/*: rapidjson/cci.20250205@{{ org }}/vfx2025 -rawtoaces/*: rawtoaces/2.1.1@{{ org }}/vfx2025 -rez/*: rez/3.4.0@{{ org }}/vfx2025 -snappy/*: snappy/1.1.10@{{ org }}/vfx2025 -spdlog/*: spdlog/1.15.3@{{ org }}/vfx2025 -sqlite3/*: sqlite3/system@{{ org }}/vfx2025 -tcl/*: tcl/system@{{ org }}/vfx2025 -tk/*: tk/system@{{ org }}/vfx2025 -tsl-robin-map/*: tsl-robin-map/1.3.0@{{ org }}/vfx2025 -util-linux-libuuid/*: util-linux-libuuid/system@{{ org }}/vfx2025 -vorbis/*: vorbis/system@{{ org }}/vfx2025 -vulkan-headers/*: vulkan-headers/system@{{ org }}/vfx2025 -vulkan-loader/*: vulkan-loader/system@{{ org }}/vfx2025 -xkbcommon/*: xkbcommon/0.9.1@{{ org }}/vfx2025 -xorg/*: xorg/system@{{ org }}/vfx2025 -xorg-proto/*: xorg-proto/system@{{ org }}/vfx2025 -xz_utils/*: xz_utils/system@{{ org }}/vfx2025 -yaml-cpp/*: yaml-cpp/0.8.0@{{ org }}/vfx2025 -zlib/*: zlib/1.3.2@{{ org }}/vfx2025 -zstd/*: zstd/1.5.6@{{ org }}/vfx2025 +# common group packages +openssl/*: openssl/1.1.1k@{{ org }}/vfx2025_11 +gnutls/*: gnutls/3.6.16@{{ org }}/vfx2025_11 +ninja/*: ninja/1.13.2@{{ org }}/vfx2025_11 +# Other packages +aces_container/*: aces_container/1.0.2@{{ org }}/vfx2025_11 +alembic/*: alembic/1.8.8@{{ org }}/vfx2025_11 +boost/*: boost/1.85.0@{{ org }}/vfx2025_11 +brotli/*: brotli/system@{{ org }}/vfx2025_11 +bzip2/*: bzip2/1.0.8@{{ org }}/vfx2025_11 +c-blosc/*: c-blosc/1.21.6@{{ org }}/vfx2025_11 +ceres-solver/*: ceres-solver/2.2.0@{{ org }}/vfx2025_11 +cimg/*: cimg/3.3.2@{{ org }}/vfx2025_11 +cppunit/*: cppunit/1.15.1@{{ org }}/vfx2025_11 +cpython/*: cpython/3.11.17@{{ org }}/vfx2025_11 +dbus/*: dbus/system@{{ org }}/vfx2025_11 +double-conversion/*: double-conversion/system@{{ org }}/vfx2025_11 +eigen/*: eigen/3.4.1@{{ org }}/vfx2025_11 +embree/*: embree/4.3.3@{{ org }}/vfx2025_11 +expat/*: expat/2.6.4@{{ org }}/vfx2025_11 +fmt/*: fmt/11.2.0@{{ org }}/vfx2025_11 +fontconfig/*: fontconfig/system@{{ org }}/vfx2025_11 +freetype/*: freetype/2.13.2@{{ org }}/vfx2025_11 +gdbm/*: gdbm/system@{{ org }}/vfx2025_11 +giflib/*: giflib/5.1.4@{{ org }}/vfx2025_11 +glew/*: glew/2.2.0@{{ org }}/vfx2025_11 +glfw/*: glfw/3.4@{{ org }}/vfx2025_11 +glu/*: glu/system@{{ org }}/vfx2025_11 +glib/*: glib/2.56.4@{{ org }}/vfx2025_11 +gtest/*: gtest/1.15.2@{{ org }}/vfx2025_11 +harfbuzz/*: harfbuzz/11.0.1@{{ org }}/vfx2025_11 +hdf5/*: hdf5/1.14.6@{{ org }}/vfx2025_11 +highway/*: highway/1.2.0@{{ org }}/vfx2025_11 +icu/*: icu/system@{{ org }}/vfx2025_11 +imath/*: imath/3.1.12@{{ org }}/vfx2025_11 +ispc/*: ispc/1.26.0@{{ org }}/vfx2025_11 +jasper/*: jasper/4.2.5@{{ org }}/vfx2025_11 +jsoncpp/*: jsoncpp/1.9.5@{{ org }}/vfx2025_11 +lcms/*: lcms/2.17@{{ org }}/vfx2025_11 +lensfun/*: lensfun/0.3.4@{{ org }}/vfx2025_11 +libalsa/*: libalsa/system@{{ org }}/vfx2025_11 +libcgroup/*: libcgroup/0.42.2@{{ org }}/vfx2025_11 +libaom-av1/*: libaom-av1/system@{{ org }}/vfx2025_11 +libbacktrace/*: libbacktrace/cci.20210118@{{ org }}/vfx2025_11 +libdeflate/*: libdeflate/1.23@{{ org }}/vfx2025_11 +libdrm/*: libdrm/2.4.115@{{ org }}/vfx2025_11 +libffi/*: libffi/system@{{ org }}/vfx2025_11 +libiconv/*: libiconv/1.17@{{ org }}/vfx2025_11 +libjpeg-turbo/*: libjpeg-turbo/3.0.4@{{ org }}/vfx2025_11 +libjxl/*: libjxl/0.11.1@{{ org }}/vfx2025_11 +libmp3lame/*: libmp3lame/system@{{ org }}/vfx2025_11 +libmicrohttpd/*: libmicrohttpd/0.9.72@{{ org }}/vfx2025_11 +libpng/*: libpng/1.6.34@{{ org }}/vfx2025_11 +libraw/*: libraw/0.21.4@{{ org }}/vfx2025_11 +libsndfile/*: libsndfile/system@{{ org }}/vfx2025_11 +libsquish/*: libsquish/system@{{ org }}/vfx2025_11 +libsvtav1/*: libsvtav1/system@{{ org }}/vfx2025_11 +libtiff/*: libtiff/4.0.9@{{ org }}/vfx2025_11 +libultrahdr/*: libultrahdr/1.4.0@{{ org }}/vfx2025_11 +libvpx/*: libvpx/system@{{ org }}/vfx2025_11 +libwebp/*: libwebp/1.5.0@{{ org }}/vfx2025_11 +libxcrypt/*: libxcrypt/4.4.36@{{ org }}/vfx2025_11 +libxshmfence/*: libxshmfence/system@{{ org }}/vfx2025_11 +log4cplus/*: log4cplus/2.1.2@{{ org }}/vfx2025_11 +lua/*: lua/5.4.4@{{ org }}/vfx2025_11 +lz4/*: lz4/1.10.0@{{ org }}/vfx2025_11 +materialx/*: materialx/1.39.3@{{ org }}/vfx2025_11 +md4c/*: md4c/0.4.8@{{ org }}/vfx2025_11 +mesa/*: mesa/23.1.4@{{ org }}/vfx2025_11 +minizip-ng/*: minizip-ng/4.0.10@{{ org }}/vfx2025_11 +moonray/*: moonray/3.6.0.1@{{ org }}/vfx2025_11 +mpdecimal/*: mpdecimal/system@{{ org }}/vfx2025_11 +mpg123/*: mpg123/system@{{ org }}/vfx2025_11 +nanobind/*: nanobind/2.11.0@{{ org }}/vfx2025_11 +nlohmann_json/*: nlohmann_json/3.12.0@{{ org }}/vfx2025_11 +nspr/*: nspr/system@{{ org }}/vfx2025_11 +nss/*: nss/3.124.0@{{ org }}/vfx2025_11 +ogg/*: ogg/system@{{ org }}/vfx2025_11 +onetbb/*: onetbb/2021.13.0@{{ org }}/vfx2025_11 +openal-soft/*: openal-soft/system@{{ org }}/vfx2025_11 +opencl-headers/*: opencl-headers/system@{{ org }}/vfx2025_11 +opencl-icd-loader/*: opencl-icd-loader/system@{{ org }}/vfx2025_11 +opencolorio/*: opencolorio/2.4.2@{{ org }}/vfx2025_11 +opencue/*: opencue/1.13.8@{{ org }}/vfx2025_11 +openexr/*: openexr/3.3.14@{{ org }}/vfx2025_11 +openfx/*: openfx/1.5s@{{ org }}/vfx2025_11 +opengl/*: opengl/system@{{ org }}/vfx2025_11 +openimagedenoise/*: openimagedenoise/2.3.3@{{ org }}/vfx2025_11 +openimageio/*: openimageio/3.1.6.2@{{ org }}/vfx2025_11 +openjpeg/*: openjpeg/2.4.0@{{ org }}/vfx2025_11 +openjph/*: openjph/0.32.0@{{ org }}/vfx2025_11 +opensubdiv/*: opensubdiv/3.6.1@{{ org }}/vfx2025_11 +opentimelineio/*: opentimelineio/0.17.0@{{ org }}/vfx2025_11 +openusd/*: openusd/25.05.01@{{ org }}/vfx2025_11 +openvdb/*: openvdb/12.1.1@{{ org }}/vfx2025_11 +opus/*: opus/system@{{ org }}/vfx2025_11 +osl/*: osl/1.14.12.0@{{ org }}/vfx2025_11 +partio/*: partio/1.19.0@{{ org }}/vfx2025_11 +pcre2/*: pcre2/system@{{ org }}/vfx2025_11 +ptex/*: ptex/2.4.3@{{ org }}/vfx2025_11 +pugixml/*: pugixml/1.14@{{ org }}/vfx2025_11 +pulseaudio/*: pulseaudio/system@{{ org }}/vfx2025_11 +pybind11/*: pybind11/2.13.6@{{ org }}/vfx2025_11 +pyside/*: pyside/6.5.6@{{ org }}/vfx2025_11 +pystring/*: pystring/1.1.4@{{ org }}/vfx2025_11 +qt/*: qt/6.5.6@{{ org }}/vfx2025_11 +random123/*: random123/1.14.0@{{ org }}/vfx2025_11 +rapidjson/*: rapidjson/cci.20250205@{{ org }}/vfx2025_11 +rawtoaces/*: rawtoaces/2.1.1@{{ org }}/vfx2025_11 +rez/*: rez/3.4.0@{{ org }}/vfx2025_11 +snappy/*: snappy/1.1.10@{{ org }}/vfx2025_11 +spdlog/*: spdlog/1.15.3@{{ org }}/vfx2025_11 +sqlite3/*: sqlite3/system@{{ org }}/vfx2025_11 +tcl/*: tcl/system@{{ org }}/vfx2025_11 +tk/*: tk/system@{{ org }}/vfx2025_11 +tsl-robin-map/*: tsl-robin-map/1.3.0@{{ org }}/vfx2025_11 +util-linux-libuuid/*: util-linux-libuuid/system@{{ org }}/vfx2025_11 +vorbis/*: vorbis/system@{{ org }}/vfx2025_11 +vulkan-headers/*: vulkan-headers/system@{{ org }}/vfx2025_11 +vulkan-loader/*: vulkan-loader/system@{{ org }}/vfx2025_11 +xkbcommon/*: xkbcommon/0.9.1@{{ org }}/vfx2025_11 +xorg/*: xorg/system@{{ org }}/vfx2025_11 +xorg-proto/*: xorg-proto/system@{{ org }}/vfx2025_11 +xz_utils/*: xz_utils/system@{{ org }}/vfx2025_11 +yaml-cpp/*: yaml-cpp/0.8.0@{{ org }}/vfx2025_11 +zlib/*: zlib/1.3.2@{{ org }}/vfx2025_11 +zstd/*: zstd/1.5.6@{{ org }}/vfx2025_11 [replace_tool_requires] -b2/*: b2/5.2.1@{{ org }}/vfx2025 +# common group packages +cmake/*: cmake/3.31.11@{{ org }}/vfx2025_11 +ninja/*: ninja/1.13.2@{{ org }}/vfx2025_11 +# Other packages +b2/*: b2/5.2.1@{{ org }}/vfx2025_11 bison/*: bison/3.0.4@system -cpython/*: cpython/3.11.17@{{ org }}/vfx2025 +cpython/*: cpython/3.11.17@{{ org }}/vfx2025_11 flex/*: flex/2.6.1@system gperf/*: gperf/3.1@system -ispc/*: ispc/1.26.0@{{ org }}/vfx2025 +ispc/*: ispc/1.26.0@{{ org }}/vfx2025_11 libtool/*: libtool/2.4.6@system -meson/*: meson/1.10.2@{{ org }}/vfx2025 -nasm/*: nasm/system@{{ org }}/vfx2025 +meson/*: meson/1.10.2@{{ org }}/vfx2025_11 +nasm/*: nasm/system@{{ org }}/vfx2025_11 nodejs/*: nodejs/18.20.4@system pkgconf/*: pkgconf/1.4.2@system -pyside/*: pyside/6.5.6@{{ org }}/vfx2025 -qt/*: qt/6.5.6@{{ org }}/vfx2025 +pyside/*: pyside/6.5.6@{{ org }}/vfx2025_11 +qt/*: qt/6.5.6@{{ org }}/vfx2025_11 wayland/*: wayland/1.21.0@system wayland-protocols/*: wayland-protocols/1.25@system [platform_requires] @@ -159,15 +174,16 @@ pkgconf/1.4.2 wayland/1.21.0 wayland-protocols/1.25 [buildenv] +GCC_INSTALL_DIR=/opt/rh/gcc-toolset-11/root/lib/gcc/x86_64-redhat-linux/11 [conf] -user.aswf:osl_clang_ref=clang/18.1.8@{{ org }}/ci_common5 -user.aswf:pyside_clang_ref=clang/18.1.8@{{ org }}/ci_common5 -user.aswf:ispc_clang_ref=clang/18.1.8@{{ org }}/ci_common5 -user.aswf:openimagedenoise_clang_ref=clang/18.1.8@{{ org }}/ci_common5 -user.aswf:openvdb_clang_ref=clang/18.1.8@{{ org }}/ci_common5 +user.aswf:osl_clang_ref=clang/18.1.8@{{ org }}/vfx2025_11 +user.aswf:pyside_clang_ref=clang/18.1.8@{{ org }}/vfx2025_11 +user.aswf:ispc_clang_ref=clang/18.1.8@{{ org }}/vfx2025_11 +user.aswf:openimagedenoise_clang_ref=clang/18.1.8@{{ org }}/vfx2025_11 +user.aswf:openvdb_clang_ref=clang/18.1.8@{{ org }}/vfx2025_11 # mesa's swrast/llvmpipe driver must share one LLVM instance with # osl/openvdb/openimagedenoise in the same process (two different libLLVM # SONAMEs loaded together abort with "Option ... already exists!") -- alias # straight to osl's major version instead of adding a separate # ASWF_MESA_CLANG_MAJOR_VERSION key that could drift out of sync with it. -user.aswf:mesa_clang_ref=clang/18.1.8@{{ org }}/ci_common5 +user.aswf:mesa_clang_ref=clang/18.1.8@{{ org }}/vfx2025_11 diff --git a/packages/conan/settings/profiles/vfx2026 b/packages/conan/settings/profiles/vfx2026 index 0f02c4389..f73b462b6 100644 --- a/packages/conan/settings/profiles/vfx2026 +++ b/packages/conan/settings/profiles/vfx2026 @@ -3,9 +3,14 @@ # !!! This file is automatically generated from a Jinja2 template. !!! # !!! Do not edit manually — run "aswfdocker dockergen" to regenerate. !!! {% set org = os.getenv("ASWF_PKG_ORG", "aswf") %} -include(ci_common6) - [settings] +os=Linux +arch=x86_64 +compiler=gcc +compiler.version=14.2 +compiler.libcxx=libstdc++11 +compiler.cppstd=20 +build_type=Release # Qt 6.6 and newer must be compiled with -std=gnu20++ to support 128 bit integers qt/*:compiler.cppstd=gnu20 [options] @@ -13,141 +18,151 @@ qt/*:compiler.cppstd=gnu20 *:shared=True [tool_requires] [replace_requires] -aces_container/*: aces_container/1.0.2@{{ org }}/vfx2026 -alembic/*: alembic/1.8.10@{{ org }}/vfx2026 -boost/*: boost/1.88.0@{{ org }}/vfx2026 -brotli/*: brotli/system@{{ org }}/vfx2026 -bzip2/*: bzip2/1.0.8@{{ org }}/vfx2026 -c-blosc/*: c-blosc/1.21.6@{{ org }}/vfx2026 -ceres-solver/*: ceres-solver/2.2.0@{{ org }}/vfx2026 -cimg/*: cimg/3.3.2@{{ org }}/vfx2026 -cppunit/*: cppunit/1.15.1@{{ org }}/vfx2026 -cpython/*: cpython/3.13.17@{{ org }}/vfx2026 -dbus/*: dbus/system@{{ org }}/vfx2026 -double-conversion/*: double-conversion/system@{{ org }}/vfx2026 -eigen/*: eigen/3.4.1@{{ org }}/vfx2026 -embree/*: embree/4.3.3@{{ org }}/vfx2026 -expat/*: expat/2.7.1@{{ org }}/vfx2026 -fmt/*: fmt/11.2.0@{{ org }}/vfx2026 -fontconfig/*: fontconfig/system@{{ org }}/vfx2026 -freetype/*: freetype/2.13.2@{{ org }}/vfx2026 -gdbm/*: gdbm/system@{{ org }}/vfx2026 -giflib/*: giflib/5.1.4@{{ org }}/vfx2026 -glew/*: glew/2.2.0@{{ org }}/vfx2026 -glfw/*: glfw/3.4@{{ org }}/vfx2026 -glib/*: glib/2.56.4@{{ org }}/vfx2026 -gtest/*: gtest/1.17.0@{{ org }}/vfx2026 -harfbuzz/*: harfbuzz/11.0.1@{{ org }}/vfx2026 -hdf5/*: hdf5/1.14.6@{{ org }}/vfx2026 -highway/*: highway/1.2.0@{{ org }}/vfx2026 -icu/*: icu/system@{{ org }}/vfx2026 -imath/*: imath/3.2.3@{{ org }}/vfx2026 -ispc/*: ispc/1.31.0@{{ org }}/vfx2026 -jasper/*: jasper/4.2.5@{{ org }}/vfx2026 -jsoncpp/*: jsoncpp/1.9.5@{{ org }}/vfx2026 -lcms/*: lcms/2.17@{{ org }}/vfx2026 -lensfun/*: lensfun/0.3.4@{{ org }}/vfx2026 -libalsa/*: libalsa/system@{{ org }}/vfx2026 -libcgroup/*: libcgroup/0.42.2@{{ org }}/vfx2026 -libaom-av1/*: libaom-av1/system@{{ org }}/vfx2026 -libbacktrace/*: libbacktrace/cci.20210118@{{ org }}/vfx2026 -libdeflate/*: libdeflate/1.24@{{ org }}/vfx2026 -libdrm/*: libdrm/2.4.115@{{ org }}/vfx2026 -libffi/*: libffi/system@{{ org }}/vfx2026 -libiconv/*: libiconv/1.18@{{ org }}/vfx2026 -libjpeg-turbo/*: libjpeg-turbo/3.1.0@{{ org }}/vfx2026 -libjxl/*: libjxl/0.11.1@{{ org }}/vfx2026 -libmp3lame/*: libmp3lame/system@{{ org }}/vfx2026 -libmicrohttpd/*: libmicrohttpd/0.9.72@{{ org }}/vfx2026 -libpng/*: libpng/1.6.34@{{ org }}/vfx2026 -libraw/*: libraw/0.21.4@{{ org }}/vfx2026 -libsndfile/*: libsndfile/system@{{ org }}/vfx2026 -libsquish/*: libsquish/system@{{ org }}/vfx2026 -libsvtav1/*: libsvtav1/system@{{ org }}/vfx2026 -libtiff/*: libtiff/4.0.9@{{ org }}/vfx2026 -libultrahdr/*: libultrahdr/1.4.0@{{ org }}/vfx2026 -libvpx/*: libvpx/system@{{ org }}/vfx2026 -libwebp/*: libwebp/1.5.0@{{ org }}/vfx2026 -libxcrypt/*: libxcrypt/4.4.38@{{ org }}/vfx2026 -libxshmfence/*: libxshmfence/system@{{ org }}/vfx2026 -log4cplus/*: log4cplus/2.1.2@{{ org }}/vfx2026 -lua/*: lua/5.4.4@{{ org }}/vfx2026 -lz4/*: lz4/1.10.0@{{ org }}/vfx2026 -materialx/*: materialx/1.39.4@{{ org }}/vfx2026 -md4c/*: md4c/0.5.2@{{ org }}/vfx2026 -mesa/*: mesa/23.1.4@{{ org }}/vfx2026 -minizip-ng/*: minizip-ng/4.0.10@{{ org }}/vfx2026 -moonray/*: moonray/3.6.0.1@{{ org }}/vfx2026 -mpdecimal/*: mpdecimal/system@{{ org }}/vfx2026 -mpg123/*: mpg123/system@{{ org }}/vfx2026 -nanobind/*: nanobind/2.11.0@{{ org }}/vfx2026 -nlohmann_json/*: nlohmann_json/3.12.0@{{ org }}/vfx2026 -nspr/*: nspr/system@{{ org }}/vfx2026 -nss/*: nss/3.124.0@{{ org }}/vfx2026 -ogg/*: ogg/system@{{ org }}/vfx2026 -onetbb/*: onetbb/2022.1.0@{{ org }}/vfx2026 -openal-soft/*: openal-soft/system@{{ org }}/vfx2026 -opencl-headers/*: opencl-headers/system@{{ org }}/vfx2026 -opencl-icd-loader/*: opencl-icd-loader/system@{{ org }}/vfx2026 -opencolorio/*: opencolorio/2.5.2@{{ org }}/vfx2026 -opencue/*: opencue/1.19.1@{{ org }}/vfx2026 -openexr/*: openexr/3.4.16@{{ org }}/vfx2026 -openfx/*: openfx/1.5.1@{{ org }}/vfx2026 -opengl/*: opengl/system@{{ org }}/vfx2026 -openimagedenoise/*: openimagedenoise/2.5.0@{{ org }}/vfx2026 -openimageio/*: openimageio/3.1.18.1@{{ org }}/vfx2026 -openjpeg/*: openjpeg/2.4.0@{{ org }}/vfx2026 -openjph/*: openjph/0.32.0@{{ org }}/vfx2026 -opensubdiv/*: opensubdiv/3.7.0@{{ org }}/vfx2026 -opentimelineio/*: opentimelineio/0.18.1@{{ org }}/vfx2026 -openusd/*: openusd/26.03@{{ org }}/vfx2026 -openvdb/*: openvdb/13.0.0@{{ org }}/vfx2026 -opus/*: opus/system@{{ org }}/vfx2026 -osl/*: osl/1.15.7.0@{{ org }}/vfx2026 -partio/*: partio/1.19.0@{{ org }}/vfx2026 -pcre2/*: pcre2/system@{{ org }}/vfx2026 -ptex/*: ptex/2.4.3@{{ org }}/vfx2026 -pugixml/*: pugixml/1.15@{{ org }}/vfx2026 -pulseaudio/*: pulseaudio/system@{{ org }}/vfx2026 -pybind11/*: pybind11/2.13.6@{{ org }}/vfx2026 -pyside/*: pyside/6.8.3@{{ org }}/vfx2026 -pystring/*: pystring/1.1.4@{{ org }}/vfx2026 -qt/*: qt/6.8.3@{{ org }}/vfx2026 -random123/*: random123/1.14.0@{{ org }}/vfx2026 -rapidjson/*: rapidjson/cci.20250205@{{ org }}/vfx2026 -rawtoaces/*: rawtoaces/2.2.2@{{ org }}/vfx2026 -rez/*: rez/3.4.0@{{ org }}/vfx2026 -snappy/*: snappy/1.2.2@{{ org }}/vfx2026 -spdlog/*: spdlog/1.15.3@{{ org }}/vfx2026 -sqlite3/*: sqlite3/system@{{ org }}/vfx2026 -tcl/*: tcl/system@{{ org }}/vfx2026 -tk/*: tk/system@{{ org }}/vfx2026 -tsl-robin-map/*: tsl-robin-map/1.4.0@{{ org }}/vfx2026 -util-linux-libuuid/*: util-linux-libuuid/system@{{ org }}/vfx2026 -vorbis/*: vorbis/system@{{ org }}/vfx2026 -vulkan-headers/*: vulkan-headers/system@{{ org }}/vfx2026 -vulkan-loader/*: vulkan-loader/system@{{ org }}/vfx2026 -xkbcommon/*: xkbcommon/0.9.1@{{ org }}/vfx2026 -xorg/*: xorg/system@{{ org }}/vfx2026 -xorg-proto/*: xorg-proto/system@{{ org }}/vfx2026 -xz_utils/*: xz_utils/system@{{ org }}/vfx2026 -yaml-cpp/*: yaml-cpp/0.8.0@{{ org }}/vfx2026 -zlib/*: zlib/1.3.2@{{ org }}/vfx2026 -zstd/*: zstd/1.5.7@{{ org }}/vfx2026 +# common group packages +openssl/*: openssl/1.1.1k@{{ org }}/vfx2026_9 +gnutls/*: gnutls/3.6.16@{{ org }}/vfx2026_9 +ninja/*: ninja/1.13.2@{{ org }}/vfx2026_9 +# Other packages +aces_container/*: aces_container/1.0.2@{{ org }}/vfx2026_9 +alembic/*: alembic/1.8.10@{{ org }}/vfx2026_9 +boost/*: boost/1.88.0@{{ org }}/vfx2026_9 +brotli/*: brotli/system@{{ org }}/vfx2026_9 +bzip2/*: bzip2/1.0.8@{{ org }}/vfx2026_9 +c-blosc/*: c-blosc/1.21.6@{{ org }}/vfx2026_9 +ceres-solver/*: ceres-solver/2.2.0@{{ org }}/vfx2026_9 +cimg/*: cimg/3.3.2@{{ org }}/vfx2026_9 +cppunit/*: cppunit/1.15.1@{{ org }}/vfx2026_9 +cpython/*: cpython/3.13.17@{{ org }}/vfx2026_9 +dbus/*: dbus/system@{{ org }}/vfx2026_9 +double-conversion/*: double-conversion/system@{{ org }}/vfx2026_9 +eigen/*: eigen/3.4.1@{{ org }}/vfx2026_9 +embree/*: embree/4.3.3@{{ org }}/vfx2026_9 +expat/*: expat/2.7.1@{{ org }}/vfx2026_9 +fmt/*: fmt/11.2.0@{{ org }}/vfx2026_9 +fontconfig/*: fontconfig/system@{{ org }}/vfx2026_9 +freetype/*: freetype/2.13.2@{{ org }}/vfx2026_9 +gdbm/*: gdbm/system@{{ org }}/vfx2026_9 +giflib/*: giflib/5.1.4@{{ org }}/vfx2026_9 +glew/*: glew/2.2.0@{{ org }}/vfx2026_9 +glfw/*: glfw/3.4@{{ org }}/vfx2026_9 +glu/*: glu/system@{{ org }}/vfx2026_9 +glib/*: glib/2.56.4@{{ org }}/vfx2026_9 +gtest/*: gtest/1.17.0@{{ org }}/vfx2026_9 +harfbuzz/*: harfbuzz/11.0.1@{{ org }}/vfx2026_9 +hdf5/*: hdf5/1.14.6@{{ org }}/vfx2026_9 +highway/*: highway/1.2.0@{{ org }}/vfx2026_9 +icu/*: icu/system@{{ org }}/vfx2026_9 +imath/*: imath/3.2.3@{{ org }}/vfx2026_9 +ispc/*: ispc/1.31.0@{{ org }}/vfx2026_9 +jasper/*: jasper/4.2.5@{{ org }}/vfx2026_9 +jsoncpp/*: jsoncpp/1.9.5@{{ org }}/vfx2026_9 +lcms/*: lcms/2.17@{{ org }}/vfx2026_9 +lensfun/*: lensfun/0.3.4@{{ org }}/vfx2026_9 +libalsa/*: libalsa/system@{{ org }}/vfx2026_9 +libcgroup/*: libcgroup/0.42.2@{{ org }}/vfx2026_9 +libaom-av1/*: libaom-av1/system@{{ org }}/vfx2026_9 +libbacktrace/*: libbacktrace/cci.20210118@{{ org }}/vfx2026_9 +libdeflate/*: libdeflate/1.24@{{ org }}/vfx2026_9 +libdrm/*: libdrm/2.4.115@{{ org }}/vfx2026_9 +libffi/*: libffi/system@{{ org }}/vfx2026_9 +libiconv/*: libiconv/1.18@{{ org }}/vfx2026_9 +libjpeg-turbo/*: libjpeg-turbo/3.1.0@{{ org }}/vfx2026_9 +libjxl/*: libjxl/0.11.1@{{ org }}/vfx2026_9 +libmp3lame/*: libmp3lame/system@{{ org }}/vfx2026_9 +libmicrohttpd/*: libmicrohttpd/0.9.72@{{ org }}/vfx2026_9 +libpng/*: libpng/1.6.34@{{ org }}/vfx2026_9 +libraw/*: libraw/0.21.4@{{ org }}/vfx2026_9 +libsndfile/*: libsndfile/system@{{ org }}/vfx2026_9 +libsquish/*: libsquish/system@{{ org }}/vfx2026_9 +libsvtav1/*: libsvtav1/system@{{ org }}/vfx2026_9 +libtiff/*: libtiff/4.0.9@{{ org }}/vfx2026_9 +libultrahdr/*: libultrahdr/1.4.0@{{ org }}/vfx2026_9 +libvpx/*: libvpx/system@{{ org }}/vfx2026_9 +libwebp/*: libwebp/1.5.0@{{ org }}/vfx2026_9 +libxcrypt/*: libxcrypt/4.4.38@{{ org }}/vfx2026_9 +libxshmfence/*: libxshmfence/system@{{ org }}/vfx2026_9 +log4cplus/*: log4cplus/2.1.2@{{ org }}/vfx2026_9 +lua/*: lua/5.4.4@{{ org }}/vfx2026_9 +lz4/*: lz4/1.10.0@{{ org }}/vfx2026_9 +materialx/*: materialx/1.39.4@{{ org }}/vfx2026_9 +md4c/*: md4c/0.5.2@{{ org }}/vfx2026_9 +mesa/*: mesa/23.1.4@{{ org }}/vfx2026_9 +minizip-ng/*: minizip-ng/4.0.10@{{ org }}/vfx2026_9 +moonray/*: moonray/3.6.0.1@{{ org }}/vfx2026_9 +mpdecimal/*: mpdecimal/system@{{ org }}/vfx2026_9 +mpg123/*: mpg123/system@{{ org }}/vfx2026_9 +nanobind/*: nanobind/2.11.0@{{ org }}/vfx2026_9 +nlohmann_json/*: nlohmann_json/3.12.0@{{ org }}/vfx2026_9 +nspr/*: nspr/system@{{ org }}/vfx2026_9 +nss/*: nss/3.124.0@{{ org }}/vfx2026_9 +ogg/*: ogg/system@{{ org }}/vfx2026_9 +onetbb/*: onetbb/2022.1.0@{{ org }}/vfx2026_9 +openal-soft/*: openal-soft/system@{{ org }}/vfx2026_9 +opencl-headers/*: opencl-headers/system@{{ org }}/vfx2026_9 +opencl-icd-loader/*: opencl-icd-loader/system@{{ org }}/vfx2026_9 +opencolorio/*: opencolorio/2.5.2@{{ org }}/vfx2026_9 +opencue/*: opencue/1.19.1@{{ org }}/vfx2026_9 +openexr/*: openexr/3.4.16@{{ org }}/vfx2026_9 +openfx/*: openfx/1.5.1@{{ org }}/vfx2026_9 +opengl/*: opengl/system@{{ org }}/vfx2026_9 +openimagedenoise/*: openimagedenoise/2.5.0@{{ org }}/vfx2026_9 +openimageio/*: openimageio/3.1.18.1@{{ org }}/vfx2026_9 +openjpeg/*: openjpeg/2.4.0@{{ org }}/vfx2026_9 +openjph/*: openjph/0.32.0@{{ org }}/vfx2026_9 +opensubdiv/*: opensubdiv/3.7.0@{{ org }}/vfx2026_9 +opentimelineio/*: opentimelineio/0.18.1@{{ org }}/vfx2026_9 +openusd/*: openusd/26.03@{{ org }}/vfx2026_9 +openvdb/*: openvdb/13.0.0@{{ org }}/vfx2026_9 +opus/*: opus/system@{{ org }}/vfx2026_9 +osl/*: osl/1.15.7.0@{{ org }}/vfx2026_9 +partio/*: partio/1.19.0@{{ org }}/vfx2026_9 +pcre2/*: pcre2/system@{{ org }}/vfx2026_9 +ptex/*: ptex/2.4.3@{{ org }}/vfx2026_9 +pugixml/*: pugixml/1.15@{{ org }}/vfx2026_9 +pulseaudio/*: pulseaudio/system@{{ org }}/vfx2026_9 +pybind11/*: pybind11/2.13.6@{{ org }}/vfx2026_9 +pyside/*: pyside/6.8.3@{{ org }}/vfx2026_9 +pystring/*: pystring/1.1.4@{{ org }}/vfx2026_9 +qt/*: qt/6.8.3@{{ org }}/vfx2026_9 +random123/*: random123/1.14.0@{{ org }}/vfx2026_9 +rapidjson/*: rapidjson/cci.20250205@{{ org }}/vfx2026_9 +rawtoaces/*: rawtoaces/2.2.2@{{ org }}/vfx2026_9 +rez/*: rez/3.4.0@{{ org }}/vfx2026_9 +snappy/*: snappy/1.2.2@{{ org }}/vfx2026_9 +spdlog/*: spdlog/1.15.3@{{ org }}/vfx2026_9 +sqlite3/*: sqlite3/system@{{ org }}/vfx2026_9 +tcl/*: tcl/system@{{ org }}/vfx2026_9 +tk/*: tk/system@{{ org }}/vfx2026_9 +tsl-robin-map/*: tsl-robin-map/1.4.0@{{ org }}/vfx2026_9 +util-linux-libuuid/*: util-linux-libuuid/system@{{ org }}/vfx2026_9 +vorbis/*: vorbis/system@{{ org }}/vfx2026_9 +vulkan-headers/*: vulkan-headers/system@{{ org }}/vfx2026_9 +vulkan-loader/*: vulkan-loader/system@{{ org }}/vfx2026_9 +xkbcommon/*: xkbcommon/0.9.1@{{ org }}/vfx2026_9 +xorg/*: xorg/system@{{ org }}/vfx2026_9 +xorg-proto/*: xorg-proto/system@{{ org }}/vfx2026_9 +xz_utils/*: xz_utils/system@{{ org }}/vfx2026_9 +yaml-cpp/*: yaml-cpp/0.8.0@{{ org }}/vfx2026_9 +zlib/*: zlib/1.3.2@{{ org }}/vfx2026_9 +zstd/*: zstd/1.5.7@{{ org }}/vfx2026_9 [replace_tool_requires] -b2/*: b2/5.3.2@{{ org }}/vfx2026 +# common group packages +cmake/*: cmake/4.0.6@{{ org }}/vfx2026_9 +ninja/*: ninja/1.13.2@{{ org }}/vfx2026_9 +# Other packages +b2/*: b2/5.3.2@{{ org }}/vfx2026_9 bison/*: bison/3.0.4@system -cpython/*: cpython/3.13.17@{{ org }}/vfx2026 +cpython/*: cpython/3.13.17@{{ org }}/vfx2026_9 flex/*: flex/2.6.1@system gperf/*: gperf/3.1@system -ispc/*: ispc/1.31.0@{{ org }}/vfx2026 +ispc/*: ispc/1.31.0@{{ org }}/vfx2026_9 libtool/*: libtool/2.4.6@system -meson/*: meson/1.10.2@{{ org }}/vfx2026 -nasm/*: nasm/system@{{ org }}/vfx2026 +meson/*: meson/1.10.2@{{ org }}/vfx2026_9 +nasm/*: nasm/system@{{ org }}/vfx2026_9 nodejs/*: nodejs/18.20.4@system pkgconf/*: pkgconf/1.4.2@system -pyside/*: pyside/6.8.3@{{ org }}/vfx2026 -qt/*: qt/6.8.3@{{ org }}/vfx2026 +pyside/*: pyside/6.8.3@{{ org }}/vfx2026_9 +qt/*: qt/6.8.3@{{ org }}/vfx2026_9 wayland/*: wayland/1.21.0@system wayland-protocols/*: wayland-protocols/1.25@system [platform_requires] @@ -161,15 +176,16 @@ pkgconf/1.4.2 wayland/1.21.0 wayland-protocols/1.25 [buildenv] +GCC_INSTALL_DIR=/opt/rh/gcc-toolset-14/root/lib/gcc/x86_64-redhat-linux/14 [conf] -user.aswf:osl_clang_ref=clang/20.1.7@{{ org }}/ci_common6 -user.aswf:pyside_clang_ref=clang/19.1.7@{{ org }}/ci_common6 -user.aswf:ispc_clang_ref=clang/20.1.7@{{ org }}/ci_common6 -user.aswf:openimagedenoise_clang_ref=clang/20.1.7@{{ org }}/ci_common6 -user.aswf:openvdb_clang_ref=clang/20.1.7@{{ org }}/ci_common6 +user.aswf:osl_clang_ref=clang/20.1.7@{{ org }}/vfx2026_9 +user.aswf:pyside_clang_ref=clang/19.1.7@{{ org }}/vfx2026_9 +user.aswf:ispc_clang_ref=clang/20.1.7@{{ org }}/vfx2026_9 +user.aswf:openimagedenoise_clang_ref=clang/20.1.7@{{ org }}/vfx2026_9 +user.aswf:openvdb_clang_ref=clang/20.1.7@{{ org }}/vfx2026_9 # mesa's swrast/llvmpipe driver must share one LLVM instance with # osl/openvdb/openimagedenoise in the same process (two different libLLVM # SONAMEs loaded together abort with "Option ... already exists!") -- alias # straight to osl's major version instead of adding a separate # ASWF_MESA_CLANG_MAJOR_VERSION key that could drift out of sync with it. -user.aswf:mesa_clang_ref=clang/20.1.7@{{ org }}/ci_common6 +user.aswf:mesa_clang_ref=clang/20.1.7@{{ org }}/vfx2026_9 diff --git a/packages/conan/settings/profiles/vfx2027 b/packages/conan/settings/profiles/vfx2027 index 43e08be44..0b6e37f54 100644 --- a/packages/conan/settings/profiles/vfx2027 +++ b/packages/conan/settings/profiles/vfx2027 @@ -3,9 +3,14 @@ # !!! This file is automatically generated from a Jinja2 template. !!! # !!! Do not edit manually — run "aswfdocker dockergen" to regenerate. !!! {% set org = os.getenv("ASWF_PKG_ORG", "aswf") %} -include(ci_common7) - [settings] +os=Linux +arch=x86_64 +compiler=gcc +compiler.version=14.2 +compiler.libcxx=libstdc++11 +compiler.cppstd=20 +build_type=Release # Qt 6.6 and newer must be compiled with -std=gnu20++ to support 128 bit integers qt/*:compiler.cppstd=gnu20 [options] @@ -13,141 +18,151 @@ qt/*:compiler.cppstd=gnu20 *:shared=True [tool_requires] [replace_requires] -aces_container/*: aces_container/1.0.2@{{ org }}/vfx2027 -alembic/*: alembic/1.8.11@{{ org }}/vfx2027 -boost/*: boost/1.91.0@{{ org }}/vfx2027 -brotli/*: brotli/system@{{ org }}/vfx2027 -bzip2/*: bzip2/1.0.8@{{ org }}/vfx2027 -c-blosc/*: c-blosc/1.21.6@{{ org }}/vfx2027 -ceres-solver/*: ceres-solver/2.2.0@{{ org }}/vfx2027 -cimg/*: cimg/3.7.6@{{ org }}/vfx2027 -cppunit/*: cppunit/1.15.1@{{ org }}/vfx2027 -cpython/*: cpython/3.13.17@{{ org }}/vfx2027 -dbus/*: dbus/system@{{ org }}/vfx2027 -double-conversion/*: double-conversion/system@{{ org }}/vfx2027 -eigen/*: eigen/3.4.1@{{ org }}/vfx2027 -embree/*: embree/4.3.3@{{ org }}/vfx2027 -expat/*: expat/2.8.4@{{ org }}/vfx2027 -fmt/*: fmt/12.2.0@{{ org }}/vfx2027 -fontconfig/*: fontconfig/system@{{ org }}/vfx2027 -freetype/*: freetype/2.14.3@{{ org }}/vfx2027 -gdbm/*: gdbm/system@{{ org }}/vfx2027 -giflib/*: giflib/5.2.1@{{ org }}/vfx2027 -glew/*: glew/2.3.1@{{ org }}/vfx2027 -glfw/*: glfw/3.4@{{ org }}/vfx2027 -glib/*: glib/2.68.4@{{ org }}/vfx2027 -gtest/*: gtest/1.18.0@{{ org }}/vfx2027 -harfbuzz/*: harfbuzz/14.2.1@{{ org }}/vfx2027 -hdf5/*: hdf5/1.14.6@{{ org }}/vfx2027 -highway/*: highway/1.4.0@{{ org }}/vfx2027 -icu/*: icu/system@{{ org }}/vfx2027 -imath/*: imath/3.2.3@{{ org }}/vfx2027 -ispc/*: ispc/1.31.0@{{ org }}/vfx2027 -jasper/*: jasper/4.2.9@{{ org }}/vfx2027 -jsoncpp/*: jsoncpp/1.9.5@{{ org }}/vfx2027 -lcms/*: lcms/2.19.1@{{ org }}/vfx2027 -lensfun/*: lensfun/0.3.4@{{ org }}/vfx2027 -libalsa/*: libalsa/system@{{ org }}/vfx2027 -libcgroup/*: libcgroup/0.42.2@{{ org }}/vfx2027 -libaom-av1/*: libaom-av1/system@{{ org }}/vfx2027 -libbacktrace/*: libbacktrace/cci.20240730@{{ org }}/vfx2027 -libdeflate/*: libdeflate/1.25@{{ org }}/vfx2027 -libdrm/*: libdrm/2.4.128@{{ org }}/vfx2027 -libffi/*: libffi/system@{{ org }}/vfx2027 -libiconv/*: libiconv/1.19@{{ org }}/vfx2027 -libjpeg-turbo/*: libjpeg-turbo/3.2.0@{{ org }}/vfx2027 -libjxl/*: libjxl/0.12.0@{{ org }}/vfx2027 -libmp3lame/*: libmp3lame/system@{{ org }}/vfx2027 -libmicrohttpd/*: libmicrohttpd/0.9.72@{{ org }}/vfx2027 -libpng/*: libpng/1.6.37@{{ org }}/vfx2027 -libraw/*: libraw/0.22.2@{{ org }}/vfx2027 -libsndfile/*: libsndfile/system@{{ org }}/vfx2027 -libsquish/*: libsquish/system@{{ org }}/vfx2027 -libsvtav1/*: libsvtav1/system@{{ org }}/vfx2027 -libtiff/*: libtiff/4.4.0@{{ org }}/vfx2027 -libultrahdr/*: libultrahdr/1.4.0@{{ org }}/vfx2027 -libvpx/*: libvpx/system@{{ org }}/vfx2027 -libwebp/*: libwebp/1.6.0@{{ org }}/vfx2027 -libxcrypt/*: libxcrypt/4.5.2@{{ org }}/vfx2027 -libxshmfence/*: libxshmfence/system@{{ org }}/vfx2027 -log4cplus/*: log4cplus/2.1.2@{{ org }}/vfx2027 -lua/*: lua/5.4.4@{{ org }}/vfx2027 -lz4/*: lz4/1.10.0@{{ org }}/vfx2027 -materialx/*: materialx/1.39.5@{{ org }}/vfx2027 -md4c/*: md4c/0.5.3@{{ org }}/vfx2027 -mesa/*: mesa/25.0.7@{{ org }}/vfx2027 -minizip-ng/*: minizip-ng/4.2.1@{{ org }}/vfx2027 -moonray/*: moonray/3.6.0.1@{{ org }}/vfx2027 -mpdecimal/*: mpdecimal/system@{{ org }}/vfx2027 -mpg123/*: mpg123/system@{{ org }}/vfx2027 -nanobind/*: nanobind/2.12.0@{{ org }}/vfx2027 -nlohmann_json/*: nlohmann_json/3.12.0@{{ org }}/vfx2027 -nspr/*: nspr/system@{{ org }}/vfx2027 -nss/*: nss/3.124.0@{{ org }}/vfx2027 -ogg/*: ogg/system@{{ org }}/vfx2027 -onetbb/*: onetbb/2023.1.0@{{ org }}/vfx2027 -openal-soft/*: openal-soft/system@{{ org }}/vfx2027 -opencl-headers/*: opencl-headers/system@{{ org }}/vfx2027 -opencl-icd-loader/*: opencl-icd-loader/system@{{ org }}/vfx2027 -opencolorio/*: opencolorio/2.6.0@{{ org }}/vfx2027 -opencue/*: opencue/1.37.0@{{ org }}/vfx2027 -openexr/*: openexr/3.5.2@{{ org }}/vfx2027 -openfx/*: openfx/1.5.1@{{ org }}/vfx2027 -opengl/*: opengl/system@{{ org }}/vfx2027 -openimagedenoise/*: openimagedenoise/2.5.0@{{ org }}/vfx2027 -openimageio/*: openimageio/3.2.1.1@{{ org }}/vfx2027 -openjpeg/*: openjpeg/2.4.0@{{ org }}/vfx2027 -openjph/*: openjph/0.32.0@{{ org }}/vfx2027 -opensubdiv/*: opensubdiv/3.8.0@{{ org }}/vfx2027 -opentimelineio/*: opentimelineio/0.18.1@{{ org }}/vfx2027 -openusd/*: openusd/26.08@{{ org }}/vfx2027 -openvdb/*: openvdb/13.1.0@{{ org }}/vfx2027 -opus/*: opus/system@{{ org }}/vfx2027 -osl/*: osl/1.15.7.0@{{ org }}/vfx2027 -partio/*: partio/1.20.0@{{ org }}/vfx2027 -pcre2/*: pcre2/system@{{ org }}/vfx2027 -ptex/*: ptex/2.5.2@{{ org }}/vfx2027 -pugixml/*: pugixml/1.16@{{ org }}/vfx2027 -pulseaudio/*: pulseaudio/system@{{ org }}/vfx2027 -pybind11/*: pybind11/3.0.4@{{ org }}/vfx2027 -pyside/*: pyside/6.8.3@{{ org }}/vfx2027 -pystring/*: pystring/1.1.5@{{ org }}/vfx2027 -qt/*: qt/6.8.3@{{ org }}/vfx2027 -random123/*: random123/1.14.0@{{ org }}/vfx2027 -rapidjson/*: rapidjson/cci.20250205@{{ org }}/vfx2027 -rawtoaces/*: rawtoaces/2.2.2@{{ org }}/vfx2027 -rez/*: rez/3.4.0@{{ org }}/vfx2027 -snappy/*: snappy/1.2.2@{{ org }}/vfx2027 -spdlog/*: spdlog/1.17.0@{{ org }}/vfx2027 -sqlite3/*: sqlite3/system@{{ org }}/vfx2027 -tcl/*: tcl/system@{{ org }}/vfx2027 -tk/*: tk/system@{{ org }}/vfx2027 -tsl-robin-map/*: tsl-robin-map/1.4.1@{{ org }}/vfx2027 -util-linux-libuuid/*: util-linux-libuuid/system@{{ org }}/vfx2027 -vorbis/*: vorbis/system@{{ org }}/vfx2027 -vulkan-headers/*: vulkan-headers/system@{{ org }}/vfx2027 -vulkan-loader/*: vulkan-loader/system@{{ org }}/vfx2027 -xkbcommon/*: xkbcommon/1.0.3@{{ org }}/vfx2027 -xorg/*: xorg/system@{{ org }}/vfx2027 -xorg-proto/*: xorg-proto/system@{{ org }}/vfx2027 -xz_utils/*: xz_utils/system@{{ org }}/vfx2027 -yaml-cpp/*: yaml-cpp/0.9.0@{{ org }}/vfx2027 -zlib/*: zlib/1.3.2@{{ org }}/vfx2027 -zstd/*: zstd/1.5.7@{{ org }}/vfx2027 +# common group packages +openssl/*: openssl/3.5.9@{{ org }}/vfx2027_4 +gnutls/*: gnutls/3.8.10@{{ org }}/vfx2027_4 +ninja/*: ninja/1.13.2@{{ org }}/vfx2027_4 +# Other packages +aces_container/*: aces_container/1.0.2@{{ org }}/vfx2027_4 +alembic/*: alembic/1.8.11@{{ org }}/vfx2027_4 +boost/*: boost/1.91.0@{{ org }}/vfx2027_4 +brotli/*: brotli/system@{{ org }}/vfx2027_4 +bzip2/*: bzip2/1.0.8@{{ org }}/vfx2027_4 +c-blosc/*: c-blosc/1.21.6@{{ org }}/vfx2027_4 +ceres-solver/*: ceres-solver/2.2.0@{{ org }}/vfx2027_4 +cimg/*: cimg/3.7.6@{{ org }}/vfx2027_4 +cppunit/*: cppunit/1.15.1@{{ org }}/vfx2027_4 +cpython/*: cpython/3.13.17@{{ org }}/vfx2027_4 +dbus/*: dbus/system@{{ org }}/vfx2027_4 +double-conversion/*: double-conversion/system@{{ org }}/vfx2027_4 +eigen/*: eigen/3.4.1@{{ org }}/vfx2027_4 +embree/*: embree/4.3.3@{{ org }}/vfx2027_4 +expat/*: expat/2.8.4@{{ org }}/vfx2027_4 +fmt/*: fmt/12.2.0@{{ org }}/vfx2027_4 +fontconfig/*: fontconfig/system@{{ org }}/vfx2027_4 +freetype/*: freetype/2.14.3@{{ org }}/vfx2027_4 +gdbm/*: gdbm/system@{{ org }}/vfx2027_4 +giflib/*: giflib/5.2.1@{{ org }}/vfx2027_4 +glew/*: glew/2.3.1@{{ org }}/vfx2027_4 +glfw/*: glfw/3.4@{{ org }}/vfx2027_4 +glu/*: glu/system@{{ org }}/vfx2027_4 +glib/*: glib/2.68.4@{{ org }}/vfx2027_4 +gtest/*: gtest/1.18.0@{{ org }}/vfx2027_4 +harfbuzz/*: harfbuzz/14.2.1@{{ org }}/vfx2027_4 +hdf5/*: hdf5/1.14.6@{{ org }}/vfx2027_4 +highway/*: highway/1.4.0@{{ org }}/vfx2027_4 +icu/*: icu/system@{{ org }}/vfx2027_4 +imath/*: imath/3.2.3@{{ org }}/vfx2027_4 +ispc/*: ispc/1.31.0@{{ org }}/vfx2027_4 +jasper/*: jasper/4.2.9@{{ org }}/vfx2027_4 +jsoncpp/*: jsoncpp/1.9.5@{{ org }}/vfx2027_4 +lcms/*: lcms/2.19.1@{{ org }}/vfx2027_4 +lensfun/*: lensfun/0.3.4@{{ org }}/vfx2027_4 +libalsa/*: libalsa/system@{{ org }}/vfx2027_4 +libcgroup/*: libcgroup/0.42.2@{{ org }}/vfx2027_4 +libaom-av1/*: libaom-av1/system@{{ org }}/vfx2027_4 +libbacktrace/*: libbacktrace/cci.20240730@{{ org }}/vfx2027_4 +libdeflate/*: libdeflate/1.25@{{ org }}/vfx2027_4 +libdrm/*: libdrm/2.4.128@{{ org }}/vfx2027_4 +libffi/*: libffi/system@{{ org }}/vfx2027_4 +libiconv/*: libiconv/1.19@{{ org }}/vfx2027_4 +libjpeg-turbo/*: libjpeg-turbo/3.2.0@{{ org }}/vfx2027_4 +libjxl/*: libjxl/0.12.0@{{ org }}/vfx2027_4 +libmp3lame/*: libmp3lame/system@{{ org }}/vfx2027_4 +libmicrohttpd/*: libmicrohttpd/0.9.72@{{ org }}/vfx2027_4 +libpng/*: libpng/1.6.37@{{ org }}/vfx2027_4 +libraw/*: libraw/0.22.2@{{ org }}/vfx2027_4 +libsndfile/*: libsndfile/system@{{ org }}/vfx2027_4 +libsquish/*: libsquish/system@{{ org }}/vfx2027_4 +libsvtav1/*: libsvtav1/system@{{ org }}/vfx2027_4 +libtiff/*: libtiff/4.4.0@{{ org }}/vfx2027_4 +libultrahdr/*: libultrahdr/1.4.0@{{ org }}/vfx2027_4 +libvpx/*: libvpx/system@{{ org }}/vfx2027_4 +libwebp/*: libwebp/1.6.0@{{ org }}/vfx2027_4 +libxcrypt/*: libxcrypt/4.5.2@{{ org }}/vfx2027_4 +libxshmfence/*: libxshmfence/system@{{ org }}/vfx2027_4 +log4cplus/*: log4cplus/2.1.2@{{ org }}/vfx2027_4 +lua/*: lua/5.4.4@{{ org }}/vfx2027_4 +lz4/*: lz4/1.10.0@{{ org }}/vfx2027_4 +materialx/*: materialx/1.39.5@{{ org }}/vfx2027_4 +md4c/*: md4c/0.5.3@{{ org }}/vfx2027_4 +mesa/*: mesa/25.0.7@{{ org }}/vfx2027_4 +minizip-ng/*: minizip-ng/4.2.1@{{ org }}/vfx2027_4 +moonray/*: moonray/3.6.0.1@{{ org }}/vfx2027_4 +mpdecimal/*: mpdecimal/system@{{ org }}/vfx2027_4 +mpg123/*: mpg123/system@{{ org }}/vfx2027_4 +nanobind/*: nanobind/2.12.0@{{ org }}/vfx2027_4 +nlohmann_json/*: nlohmann_json/3.12.0@{{ org }}/vfx2027_4 +nspr/*: nspr/system@{{ org }}/vfx2027_4 +nss/*: nss/3.124.0@{{ org }}/vfx2027_4 +ogg/*: ogg/system@{{ org }}/vfx2027_4 +onetbb/*: onetbb/2023.1.0@{{ org }}/vfx2027_4 +openal-soft/*: openal-soft/system@{{ org }}/vfx2027_4 +opencl-headers/*: opencl-headers/system@{{ org }}/vfx2027_4 +opencl-icd-loader/*: opencl-icd-loader/system@{{ org }}/vfx2027_4 +opencolorio/*: opencolorio/2.6.0@{{ org }}/vfx2027_4 +opencue/*: opencue/1.37.0@{{ org }}/vfx2027_4 +openexr/*: openexr/3.5.2@{{ org }}/vfx2027_4 +openfx/*: openfx/1.5.1@{{ org }}/vfx2027_4 +opengl/*: opengl/system@{{ org }}/vfx2027_4 +openimagedenoise/*: openimagedenoise/2.5.0@{{ org }}/vfx2027_4 +openimageio/*: openimageio/3.2.1.1@{{ org }}/vfx2027_4 +openjpeg/*: openjpeg/2.4.0@{{ org }}/vfx2027_4 +openjph/*: openjph/0.32.0@{{ org }}/vfx2027_4 +opensubdiv/*: opensubdiv/3.8.0@{{ org }}/vfx2027_4 +opentimelineio/*: opentimelineio/0.18.1@{{ org }}/vfx2027_4 +openusd/*: openusd/26.08@{{ org }}/vfx2027_4 +openvdb/*: openvdb/13.1.0@{{ org }}/vfx2027_4 +opus/*: opus/system@{{ org }}/vfx2027_4 +osl/*: osl/1.15.7.0@{{ org }}/vfx2027_4 +partio/*: partio/1.20.0@{{ org }}/vfx2027_4 +pcre2/*: pcre2/system@{{ org }}/vfx2027_4 +ptex/*: ptex/2.5.2@{{ org }}/vfx2027_4 +pugixml/*: pugixml/1.16@{{ org }}/vfx2027_4 +pulseaudio/*: pulseaudio/system@{{ org }}/vfx2027_4 +pybind11/*: pybind11/3.0.4@{{ org }}/vfx2027_4 +pyside/*: pyside/6.8.3@{{ org }}/vfx2027_4 +pystring/*: pystring/1.1.5@{{ org }}/vfx2027_4 +qt/*: qt/6.8.3@{{ org }}/vfx2027_4 +random123/*: random123/1.14.0@{{ org }}/vfx2027_4 +rapidjson/*: rapidjson/cci.20250205@{{ org }}/vfx2027_4 +rawtoaces/*: rawtoaces/2.2.2@{{ org }}/vfx2027_4 +rez/*: rez/3.4.0@{{ org }}/vfx2027_4 +snappy/*: snappy/1.2.2@{{ org }}/vfx2027_4 +spdlog/*: spdlog/1.17.0@{{ org }}/vfx2027_4 +sqlite3/*: sqlite3/system@{{ org }}/vfx2027_4 +tcl/*: tcl/system@{{ org }}/vfx2027_4 +tk/*: tk/system@{{ org }}/vfx2027_4 +tsl-robin-map/*: tsl-robin-map/1.4.1@{{ org }}/vfx2027_4 +util-linux-libuuid/*: util-linux-libuuid/system@{{ org }}/vfx2027_4 +vorbis/*: vorbis/system@{{ org }}/vfx2027_4 +vulkan-headers/*: vulkan-headers/system@{{ org }}/vfx2027_4 +vulkan-loader/*: vulkan-loader/system@{{ org }}/vfx2027_4 +xkbcommon/*: xkbcommon/1.0.3@{{ org }}/vfx2027_4 +xorg/*: xorg/system@{{ org }}/vfx2027_4 +xorg-proto/*: xorg-proto/system@{{ org }}/vfx2027_4 +xz_utils/*: xz_utils/system@{{ org }}/vfx2027_4 +yaml-cpp/*: yaml-cpp/0.9.0@{{ org }}/vfx2027_4 +zlib/*: zlib/1.3.2@{{ org }}/vfx2027_4 +zstd/*: zstd/1.5.7@{{ org }}/vfx2027_4 [replace_tool_requires] -b2/*: b2/5.5.3@{{ org }}/vfx2027 +# common group packages +cmake/*: cmake/4.3.3@{{ org }}/vfx2027_4 +ninja/*: ninja/1.13.2@{{ org }}/vfx2027_4 +# Other packages +b2/*: b2/5.5.3@{{ org }}/vfx2027_4 bison/*: bison/3.7.4@system -cpython/*: cpython/3.13.17@{{ org }}/vfx2027 +cpython/*: cpython/3.13.17@{{ org }}/vfx2027_4 flex/*: flex/2.6.4@system gperf/*: gperf/3.1.13@system -ispc/*: ispc/1.31.0@{{ org }}/vfx2027 +ispc/*: ispc/1.31.0@{{ org }}/vfx2027_4 libtool/*: libtool/2.4.6@system -meson/*: meson/1.10.2@{{ org }}/vfx2027 -nasm/*: nasm/system@{{ org }}/vfx2027 +meson/*: meson/1.10.2@{{ org }}/vfx2027_4 +nasm/*: nasm/system@{{ org }}/vfx2027_4 nodejs/*: nodejs/18.20.8@system pkgconf/*: pkgconf/1.7.3@system -pyside/*: pyside/6.8.3@{{ org }}/vfx2027 -qt/*: qt/6.8.3@{{ org }}/vfx2027 +pyside/*: pyside/6.8.3@{{ org }}/vfx2027_4 +qt/*: qt/6.8.3@{{ org }}/vfx2027_4 wayland/*: wayland/1.21.0@system wayland-protocols/*: wayland-protocols/1.37.1@system [platform_requires] @@ -161,15 +176,16 @@ pkgconf/1.7.3 wayland/1.21.0 wayland-protocols/1.37.1 [buildenv] +GCC_INSTALL_DIR=/opt/rh/gcc-toolset-14/root/lib/gcc/x86_64-redhat-linux/14 [conf] -user.aswf:osl_clang_ref=clang/22.1.7@{{ org }}/ci_common7 -user.aswf:pyside_clang_ref=clang/21.1.8@{{ org }}/ci_common7 -user.aswf:ispc_clang_ref=clang/22.1.7@{{ org }}/ci_common7 -user.aswf:openimagedenoise_clang_ref=clang/22.1.7@{{ org }}/ci_common7 -user.aswf:openvdb_clang_ref=clang/22.1.7@{{ org }}/ci_common7 +user.aswf:osl_clang_ref=clang/22.1.7@{{ org }}/vfx2027_4 +user.aswf:pyside_clang_ref=clang/21.1.8@{{ org }}/vfx2027_4 +user.aswf:ispc_clang_ref=clang/22.1.7@{{ org }}/vfx2027_4 +user.aswf:openimagedenoise_clang_ref=clang/22.1.7@{{ org }}/vfx2027_4 +user.aswf:openvdb_clang_ref=clang/22.1.7@{{ org }}/vfx2027_4 # mesa's swrast/llvmpipe driver must share one LLVM instance with # osl/openvdb/openimagedenoise in the same process (two different libLLVM # SONAMEs loaded together abort with "Option ... already exists!") -- alias # straight to osl's major version instead of adding a separate # ASWF_MESA_CLANG_MAJOR_VERSION key that could drift out of sync with it. -user.aswf:mesa_clang_ref=clang/22.1.7@{{ org }}/ci_common7 +user.aswf:mesa_clang_ref=clang/22.1.7@{{ org }}/vfx2027_4 diff --git a/packages/conan/settings/remotes.json b/packages/conan/settings/remotes.json index 3e7ad599c..9829f6633 100644 --- a/packages/conan/settings/remotes.json +++ b/packages/conan/settings/remotes.json @@ -5,11 +5,6 @@ "url": "https://linuxfoundation.jfrog.io/artifactory/api/conan/aswf-conan", "verify_ssl": true }, - { - "name": "conan-central", - "url": "https://center2.conan.io", - "verify_ssl": true - }, { "name": "aswftesting", "url": "https://linuxfoundation.jfrog.io/artifactory/api/conan/aswf-conan-dev", diff --git a/packages/review/Dockerfile b/packages/review/Dockerfile index 0a539aa21..7c206833d 100644 --- a/packages/review/Dockerfile +++ b/packages/review/Dockerfile @@ -4,7 +4,6 @@ # "Global" ARGs ARG ASWF_ORG -ARG CI_COMMON_VERSION ARG ASWF_CLANG_MAJOR_VERSION ARG ASWF_VFXPLATFORM_VERSION @@ -39,7 +38,7 @@ FROM ${ASWF_ORG}/ci-package-oiio:${ASWF_VFXPLATFORM_VERSION}-${ASWF_OIIO_VERSION FROM ${ASWF_ORG}/ci-package-ocio:${ASWF_VFXPLATFORM_VERSION}-${ASWF_OCIO_VERSION} AS ci-package-ocio-external #################### ci-base-builder #################### -FROM ${ASWF_ORG}/ci-common:${CI_COMMON_VERSION}-clang${ASWF_CLANG_MAJOR_VERSION} AS ci-base-builder +FROM ${ASWF_ORG}/ci-common:${ASWF_VFXPLATFORM_VERSION}-clang${ASWF_CLANG_MAJOR_VERSION} AS ci-base-builder ARG ASWF_CMAKE_VERSION ARG ASWF_CPYTHON_VERSION @@ -48,6 +47,7 @@ ARG ASWF_NUMPY_VERSION ARG ASWF_BOOST_VERSION ARG ASWF_ONETBB_VERSION ARG ASWF_PKG_ORG +ARG ASWF_CONAN_PROFILE ARG ASWF_CONAN_CHANNEL ARG ASWF_VFXPLATFORM_VERSION @@ -74,7 +74,7 @@ EOF RUN --mount=type=cache,target=/opt/conan_home/d \ --mount=type=bind,rw,target=/opt/conan_home/.conan2,source=packages/conan/settings \ conan install /usr/local \ - --profile:all "${ASWF_CONAN_CHANNEL}" \ + --profile:all "${ASWF_CONAN_PROFILE}" \ --deployer aswf_deploy \ --deployer-folder /usr/local @@ -93,9 +93,8 @@ FROM ci-base-builder AS ci-openrv-builder ARG ASWF_OPENRV_VERSION ENV ASWF_OPENRV_VERSION=${ASWF_OPENRV_VERSION} ARG ASWF_PKG_ORG +ARG ASWF_CONAN_PROFILE ARG ASWF_CONAN_CHANNEL -ARG CI_COMMON_VERSION -ENV CI_COMMON_VERSION=${CI_COMMON_VERSION} ARG ASWF_VFXPLATFORM_VERSION ENV ASWF_VFXPLATFORM_VERSION=${ASWF_VFXPLATFORM_VERSION} ARG ASWF_CXX_STANDARD @@ -129,7 +128,7 @@ EOF RUN --mount=type=cache,target=/opt/conan_home/d \ --mount=type=bind,rw,target=/opt/conan_home/.conan2,source=packages/conan/settings \ conan install /usr/local \ - --profile:all "${ASWF_CONAN_CHANNEL}" \ + --profile:all "${ASWF_CONAN_PROFILE}" \ --deployer aswf_deploy \ --deployer-folder /usr/local @@ -148,7 +147,7 @@ EOF RUN --mount=type=cache,target=/opt/conan_home/d \ --mount=type=bind,rw,target=/opt/conan_home/.conan2,source=packages/conan/settings \ conan install /tmp/qttemp \ - --profile:all "${ASWF_CONAN_CHANNEL}" \ + --profile:all "${ASWF_CONAN_PROFILE}" \ --deployer aswf_deploy \ --deployer-folder /tmp/qttemp @@ -164,7 +163,6 @@ RUN --mount=type=cache,target=/tmp/ccache \ FROM scratch AS ci-package-openrv ARG ASWF_ORG -ARG CI_COMMON_VERSION ARG ASWF_DTS_VERSION ARG ASWF_DTS_PREFIX ARG ASWF_OPENRV_VERSION @@ -179,7 +177,6 @@ LABEL org.opencontainers.image.url="https://github.com/AcademySoftwareFoundation LABEL org.opencontainers.image.source="https://github.com/AcademySoftwareFoundation/aswf-docker/blob/main/packages/Dockerfile" LABEL org.opencontainers.image.version="${ASWF_OPENRV_VERSION}" LABEL org.opencontainers.image.licenses="Apache-2.0" -LABEL io.aswf.docker.versions.ci-common="${CI_COMMON_VERSION}" LABEL io.aswf.docker.versions.vfx-platform="${ASWF_VFXPLATFORM_VERSION}" LABEL io.aswf.docker.versions.dts="${ASWF_DTS_VERSION}" LABEL io.aswf.docker.versions.osl="${ASWF_OSL_VERSION}" diff --git a/pylintrc b/pylintrc index 0a1fa5349..2929d6536 100644 --- a/pylintrc +++ b/pylintrc @@ -50,10 +50,6 @@ load-plugins= # Pickle collected data for later comparisons. persistent=yes -# When enabled, pylint would attempt to guess common misconfiguration and emit -# user-friendly hints instead of false-positive error messages. -suggestion-mode=yes - # Allow loading of arbitrary C extensions. Extensions are imported into the # active Python interpreter and may run arbitrary code. unsafe-load-any-extension=no @@ -90,7 +86,8 @@ disable=raw-checker-failed, missing-function-docstring, too-few-public-methods, too-many-instance-attributes, - too-many-arguments + too-many-arguments, + too-many-positional-arguments # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option diff --git a/pyproject.toml b/pyproject.toml index 16d0190be..e5d56288b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,6 +63,9 @@ dev = [ "types-pyyaml", "types-requests", "twine", + "zizmor", + "jactionlint", + "shellcheck-py", ] [project.scripts] @@ -88,6 +91,8 @@ include = ''' ( ^/python/.*\.py$ | ^/packages/conan/settings/extensions/deployers/.*\.py$ + | ^/packages/conan/settings/extensions/commands/.*\.py$ + | ^/packages/conan/settings/extensions/hooks/.*\.py$ | ^/setup\.py$ ) ''' diff --git a/python/aswfdocker/bake.py b/python/aswfdocker/bake.py new file mode 100644 index 000000000..aa03cf6f9 --- /dev/null +++ b/python/aswfdocker/bake.py @@ -0,0 +1,51 @@ +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +""" +Shared helpers for constructing and serializing `docker buildx bake` +invocations. Used by both builder.py (real image/package builds) and +buildorder.py (the read-only Conan dependency-graph grapher) -- a leaf +module with no dependency on either, so neither creates a circular import +by sharing this. + +Execution itself (dry-run support, live vs captured output, error +handling) stays with each caller: builder.py's bake calls are interactive +commands a human watches build real artifacts, while buildorder.py's is a +headless metadata query that always runs and inspects stderr on failure. +Only the part that's actually the same -- how a bake command line is put +together -- lives here. +""" + +import json +import typing + + +def write_bake_jsonfile(path: str, bake_dict: dict) -> None: + with open(path, "w", encoding="utf-8") as f: + json.dump(bake_dict, f, indent=4, sort_keys=True) + + +def bake_command( + bake_jsonfile: str, + build_targets: typing.Sequence[str], + overrides: typing.Mapping[str, str], + progress: str, + override_scope: str = "*", +) -> typing.List[str]: + """Builds a `docker buildx bake` argv list. + + `overrides` is a {field: value} mapping applied as + `--set=.=` (in iteration order), e.g. + {"output": "type=cacheonly", "target": "ci-conan-package-builder"}. + `override_scope` defaults to "*" (every target in the bake file); + pass a specific target name to scope it to just that one. + + `build_targets` is what gets passed positionally -- the bake group(s) + or target(s) to actually build. An empty sequence builds whatever the + bake file's own "default" group names. + """ + cmd = ["docker", "buildx", "bake", "-f", bake_jsonfile] + for field, value in overrides.items(): + cmd.append(f"--set={override_scope}.{field}={value}") + cmd += ["--progress", progress] + cmd.extend(build_targets) + return cmd diff --git a/python/aswfdocker/builder.py b/python/aswfdocker/builder.py index 56894e13f..2876734de 100644 --- a/python/aswfdocker/builder.py +++ b/python/aswfdocker/builder.py @@ -6,17 +6,35 @@ import logging import subprocess -import json import os import sys import tempfile import typing +import uuid -from aswfdocker import constants, aswfinfo, utils, groupinfo, index +from aswfdocker import ( + bake, + buildorder, + constants, + aswfinfo, + utils, + groupinfo, + index, +) logger = logging.getLogger(__name__) +class PackageSelection(typing.NamedTuple): + """Which members of a package group to build; see buildorder.plan_build(). + Empty target lists select the whole group.""" + + targets: typing.Sequence[str] = () + targets_to: typing.Sequence[str] = () + targets_from: typing.Sequence[str] = () + force: bool = False + + class Builder: """Builder generates a "docker buildx bake" json file to drive the parallel builds of Docker images.""" @@ -25,78 +43,73 @@ def __init__( build_info: aswfinfo.ASWFInfo, group_info: groupinfo.GroupInfo, push: bool = False, + conan_remote: str = constants.CONAN_REMOTE_AUTO, ): self.push = push self.build_info = build_info self.group_info = group_info self.index = index.Index() + self.conan_remote = utils.resolve_conan_remote( + conan_remote, build_info.package_org + ) + # See ASWF_CONAN_NONCE in packages/common/Dockerfile: the build plan + # has already decided every package bake runs must build, so BuildKit + # must never replay one from its layer cache. + self.conan_nonce = uuid.uuid4().hex + self._git_provenance_cache: typing.Optional[typing.Dict[str, str]] = None + + def _git_provenance(self) -> typing.Dict[str, str]: + if self._git_provenance_cache is None: + self._git_provenance_cache = utils.git_provenance(utils.get_git_top_level()) + return self._git_provenance_cache def make_bake_dict( self, build_missing: bool, - no_remote: bool, ) -> typing.Dict[str, dict]: - # pylint: disable=too-many-locals root: typing.Dict[str, dict] = {} root["target"] = {} for image, version in self.group_info.iter_images_versions(): - versions_to_bake = set() major_version = utils.get_major_version(version) version_info = self.index.version_info(major_version) if self.group_info.type == constants.ImageType.PACKAGE: - if version in versions_to_bake: - # Only one version per image needed - continue - # if version_info.ci_common_version != major_version: - # Only bake conan images in ci_common container! - # version = version_info.ci_common_version - # major_version = utils.get_major_version(version) - versions_to_bake.add(version) # tags may not make much sense for Conan packages - tags = list( - map( - lambda tag: f"{constants.DOCKER_REGISTRY}/{self.build_info.docker_org}" - + f"/ci-baseos-gl-conan:{tag}", - [version, major_version], - ) - ) - docker_file = "packages/common/Dockerfile" + tags = [ + f"{constants.DOCKER_REGISTRY}/{self.build_info.docker_org}" + + f"/ci-baseos-gl-conan:{version_info.release}" + ] + docker_file = constants.CONAN_PACKAGE_DOCKERFILE else: tags = version_info.get_tags(version, self.build_info.docker_org, image) docker_file = f"{image}/Dockerfile" - major_version_no_clang = major_version.split("-")[0] - if version_info.ci_common_version == major_version_no_clang: - channel = f"ci_common{major_version_no_clang}" - else: - channel = f"vfx{version_info.major_version}" - args = { - "ASWF_ORG": self.build_info.docker_org, - "ASWF_PKG_ORG": self.build_info.package_org, - "ASWF_VERSION": version, - "CI_COMMON_VERSION": version_info.ci_common_version, - "ASWF_CONAN_CHANNEL": channel, - # Needed by every Dockerfile's own `conan install` (both IMAGE and - # PACKAGE types), so CONAN_HOME lines up with the bind-mounted - # packages/conan/settings and its profiles are found. - "ASWF_CONAN_HOME": constants.ASWF_CONAN_HOME, - } + args = utils.common_conan_bake_args( + self.build_info.docker_org, + self.build_info.package_org, + version_info, + ) + args["ASWF_VERSION"] = version + # Both package builds (conan create) and image builds (conan + # install) resolve packages, so both get the remote policy. + args["ASWF_CONAN_REMOTE_ARGS"] = " ".join( + utils.conan_remote_args(self.conan_remote) + ) if self.group_info.type == constants.ImageType.PACKAGE: # params as env var needed for conan build args.update( { "ASWF_PKG_NAME": image.replace("ci-package-", ""), - "ASWF_PKG_VERSION": version_info.package_versions.get( - "ASWF_" - # Handle dependencies with hyphens in their name. - + image.replace("ci-package-", "").upper().replace("-", "_") - + "_VERSION" + "ASWF_PKG_VERSION": version_info.all_package_versions.get( + utils.package_version_key(image.replace("ci-package-", "")) ), "ASWF_CONAN_BUILD_MISSING": ( "--build=missing" if build_missing else "" ), - "ASWF_CONAN_NO_REMOTE": "--no-remote" if no_remote else "", "ASWF_CONAN_PUSH": "TRUE" if self.push else "", + "ASWF_CONAN_NONCE": self.conan_nonce, + # Recorded in each built package's Conan metadata by + # the hook_aswf_provenance hook, for image SBOMs. + **self._git_provenance(), } ) args.update(version_info.all_package_versions) @@ -110,11 +123,14 @@ def make_bake_dict( }, "tags": tags, "output": ["type=registry,push=true" if self.push else "type=docker"], - "secret": [ + } + # Artifactory downloads are anonymous: only package uploads need + # the credentials. + if self.group_info.type == constants.ImageType.PACKAGE and self.push: + target_dict["secret"] = [ "id=conan_login_username,env=CONAN_LOGIN_USERNAME", "id=conan_password,env=CONAN_PASSWORD", - ], - } + ] # Docker Desktop on Apple Silicon defaults to linux/arm64; pin amd64 to match CI. if sys.platform == "darwin": target_dict["platforms"] = ["linux/amd64"] @@ -126,9 +142,8 @@ def make_bake_dict( def make_bake_jsonfile( self, build_missing: bool, - no_remote: bool, ) -> typing.Optional[str]: - d = self.make_bake_dict(build_missing, no_remote) + d = self.make_bake_dict(build_missing) if not d["group"]["default"]["targets"]: return None groups = "-".join(self.group_info.names) @@ -137,73 +152,15 @@ def make_bake_jsonfile( tempfile.gettempdir(), f"docker-bake-{self.group_info.type.name}-{groups}-{versions}.json", ) - with open(path, "w", encoding="utf-8") as f: - json.dump(d, f, indent=4, sort_keys=True) + bake.write_bake_jsonfile(path, d) return path - def _run(self, cmd: str, dry_run: bool): + def _run(self, cmd: typing.List[str], dry_run: bool): if dry_run: - logger.info("Would run: '%s'", cmd) + logger.info("Would run: '%s'", " ".join(cmd)) else: - logger.info("Building: '%s'", cmd) - subprocess.run(cmd, shell=True, check=True, cwd=self.build_info.repo_root) - - def _run_in_docker(self, base_cmd, cmd, dry_run): - self._run( - " ".join(base_cmd + cmd), - dry_run=dry_run, - ) - - def _get_conan_env_vars(self, version_info): - envs = { - "ASWF_CONAN_HOME": constants.ASWF_CONAN_HOME, - "CONAN_HOME": os.path.join(constants.ASWF_CONAN_HOME, ".conan2"), - "CCACHE_DIR": "/tmp/ccache", - "CONAN_NON_INTERACTIVE": "1", - } - if "CONAN_LOGIN_USERNAME" in os.environ: - envs["CONAN_LOGIN_USERNAME"] = os.environ["CONAN_LOGIN_USERNAME"] - if "ARTIFACTORY_USER" in os.environ: - envs["CONAN_LOGIN_USERNAME"] = os.environ["ARTIFACTORY_USER"] - if "CONAN_PASSWORD" in os.environ: - envs["CONAN_PASSWORD"] = os.environ["CONAN_PASSWORD"] - if "ARTIFACTORY_TOKEN" in os.environ: - envs["CONAN_PASSWORD"] = os.environ["ARTIFACTORY_TOKEN"] - for name, value in version_info.all_package_versions.items(): - envs[name] = value - return envs - - # We should leverage this to avoid repeating volume definitions in packages/common/Dockerfiles - def _get_conan_vols(self): - conan_base = os.path.join(utils.get_git_top_level(), "packages", "conan") - vols = { - os.path.join(conan_base, "settings"): os.path.join( - constants.ASWF_CONAN_HOME, ".conan2" - ), - os.path.join(conan_base, "data"): os.path.join( - constants.ASWF_CONAN_HOME, "d" - ), - os.path.join(conan_base, "recipes"): os.path.join( - constants.ASWF_CONAN_HOME, "recipes" - ), - os.path.join(conan_base, "ccache"): "/tmp/ccache", - } - return vols - - def _get_conan_base_cmd(self, version_info): - base_cmd = ["docker", "run"] - for name, value in self._get_conan_env_vars(version_info).items(): - base_cmd.append("-e") - base_cmd.append(f"{name}={value}") - for name, value in self._get_conan_vols().items(): - base_cmd.append("-v") - base_cmd.append(f"{name}:{value}") - tag = ( - f"{constants.DOCKER_REGISTRY}/{self.build_info.docker_org}" - + f"/ci-baseos-gl-conan:{version_info.ci_common_version}" - ) - base_cmd.append(tag) - return base_cmd + logger.info("Building: '%s'", " ".join(cmd)) + subprocess.run(cmd, check=True, cwd=self.build_info.repo_root) def _build_conan_package( self, @@ -225,10 +182,14 @@ def _build_conan_package( # - conan create # - conan upload main version (conditional) # - runcmd = ( - f"docker buildx bake -f {bake_jsonfile} --set=*.output=type=cacheonly " - f"--set=*.target=ci-conan-package-builder --progress {progress} " - f"ci-package-{image}-{major_version}" + runcmd = bake.bake_command( + bake_jsonfile, + build_targets=[f"ci-package-{image}-{major_version}"], + overrides={ + "output": "type=cacheonly", + "target": "ci-conan-package-builder", + }, + progress=progress, ) self._run( @@ -241,7 +202,7 @@ def build( dry_run: bool = False, progress: str = "", build_missing=False, - no_remote=False, + selection: typing.Optional[PackageSelection] = None, ) -> None: images_and_versions = [] for image, version in self.group_info.iter_images_versions(get_image=True): @@ -250,28 +211,129 @@ def build( if not images_and_versions: return - path = self.make_bake_jsonfile(build_missing, no_remote) + path = self.make_bake_jsonfile(build_missing) if path: if self.group_info.type == constants.ImageType.IMAGE: self._run( - f"docker buildx bake -f {path} --progress {progress}", + bake.bake_command( + path, build_targets=[], overrides={}, progress=progress + ), dry_run=dry_run, ) else: - conan_base = os.path.join( - utils.get_git_top_level(), "packages", "conan" + self._build_conan_packages( + images_and_versions, + path, + dry_run, + progress, + selection or PackageSelection(), + ) + + def _conan_build_passes( + self, images_and_versions: typing.Sequence[typing.Tuple[str, str]] + ) -> typing.Iterator[typing.Tuple[str, typing.List[typing.Tuple[str, str]]]]: + """Splits the (package, version) pairs to build into build passes: + one per year, or, when per-clang packages (see per_clang_packages in + versions.yaml) are included, one per clang version of that year. + Each pass holds the year's other packages too, so that its build + order covers dependencies between them (e.g. clang tool-requiring + cmake). Yields (pass version, its (package, version) pairs).""" + by_year: typing.Dict[str, typing.List[typing.Tuple[str, str]]] = {} + for image, version in images_and_versions: + year = utils.get_major_version(version).split("-")[0] + by_year.setdefault(year, []).append((image, version)) + for year, pairs in by_year.items(): + per_clang: typing.Dict[str, typing.List[typing.Tuple[str, str]]] = {} + others = [] + for image, version in pairs: + major_version = utils.get_major_version(version) + if image in self.index.per_clang_packages: + per_clang.setdefault(major_version, []).append((image, version)) + else: + others.append((image, version)) + if not per_clang: + yield year, others + for clang_version, clang_pairs in per_clang.items(): + yield clang_version, others + clang_pairs + + def _build_conan_packages( # pylint: disable=too-many-arguments,too-many-locals + self, + images_and_versions: typing.Sequence[typing.Tuple[str, str]], + bake_jsonfile: str, + dry_run: bool, + progress: str, + selection: PackageSelection, + ) -> None: + """Builds the selected members of the group, pass by pass (see + _conan_build_passes()), in the order Conan's dependency graph + dictates, skipping packages whose binary is already up to date + (unless forced) or that an earlier pass of the same year builds. + The graph is computed even for a dry run: it's the only way to know + what would be built.""" + repo_root = utils.get_git_top_level() + with_recipes = [] + for image, version in images_and_versions: + if not os.path.exists( + os.path.join(repo_root, "packages", "conan", "recipes", image) + ): + logger.warning("Recipe for %s not found: skipping!", image) + continue + with_recipes.append((image, version)) + + # Per year: packages an earlier pass builds (per-clang ones excluded, + # as each pass builds a different version of them). + done: typing.Dict[str, typing.Set[str]] = {} + for pass_version, pairs in self._conan_build_passes(with_recipes): + versions = dict(pairs) + version_info = self.index.version_info(pass_version) + year_done = done.setdefault(version_info.major_version, set()) + channel = version_info.conan_channel + members = [ + ( + image, + version_info.all_package_versions[utils.package_version_key(image)], + ) + for image in versions + ] + + logger.info( + "Computing Conan build order for %s (%s)", pass_version, channel + ) + order = buildorder.compute_build_order( + repo_root, + self.build_info.docker_org, + self.build_info.package_org, + version_info, + members, + conan_remote=self.conan_remote, + ) + plan = buildorder.plan_build( + order, + list(versions), + selection.targets, + selection.targets_to, + selection.targets_from, + selection.force, + done=year_done, + ) + logger.info( + "%s: building %s; up to date: %s", + pass_version, + ", ".join(plan.to_build) or "nothing", + ", ".join(plan.up_to_date) or "nothing", + ) + year_done.update( + image + for image in plan.to_build + if image not in self.index.per_clang_packages + ) + # As of Conan 2.18, parallel builds are still not supported and can result in + # database lock failures, so we have to build sequentially. + for image in plan.to_build: + self._build_conan_package( + image, + versions[image], + dry_run, + progress, + bake_jsonfile, ) - # As of Conan 2.18, parallel builds are still not supported and can result in - # database lock failures, so we have to build sequentially. - for image, version in images_and_versions: - recipe_path = os.path.join(conan_base, "recipes", image) - if not os.path.exists(recipe_path): - logger.warning("Recipe for %s not found: skipping!", image) - continue - self._build_conan_package( - image, - version, - dry_run, - progress, - path, - ) diff --git a/python/aswfdocker/buildorder.py b/python/aswfdocker/buildorder.py new file mode 100644 index 000000000..0b7cc9b68 --- /dev/null +++ b/python/aswfdocker/buildorder.py @@ -0,0 +1,523 @@ +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +""" +Computes the Conan dependency build order for a set of packages, so a +package group (e.g. "vfx") can be built/released in the right order without +hand-maintaining split layers in versions.yaml, and plans which of those +packages a build actually needs to (re)build. + +The order is computed by running `conan graph build-order` via a +`docker buildx bake` call against packages/common/Dockerfile's +ci-conan-package-builder stage/ci-conan-graph-output stage -- the same +Dockerfile, base image, bind-mounted recipes/profiles and persistent Conan +cache mount (id=aswf-conan-cache) real `conan create` package builds use. +Nothing is actually built: recipes are exported (metadata only, no +download/build) so Conan can see their requires() -- all in one Conan +process via the `conan aswf-export` custom command -- then a single +`conan graph build-order` call resolves the graph. + +Reusing that same cache mount (rather than a plain `docker run`, which +cannot see a BuildKit cache mount at all) matters for correctness, not just +consistency: `--build=missing`'s decision of what still needs building has +to see whatever is already sitting in the *local* Conan cache from a +previous local build, so a local `aswfdocker build --group vfx` only +rebuilds what actually changed and its dependents. On a fresh GHA runner +that cache mount starts empty, so the same mechanism naturally falls +through to checking the configured remotes (remotes.json) instead -- which +is also exactly the right behavior there, since every package upload +completes before its orchestrator job reports success, making the remote +the authoritative record between levels. No environment-specific branching +is needed in this module for that: it's just whatever the cache mount +actually contains, in either case. + +Every one of our packages the profile can redirect a dependency to is +exported, each under its own channel (see profile_refs()), not just the +requested members: Conan has to read a dependency's recipe to follow its +requires(), so a dependency outside the group whose recipe was never +exported (e.g. a freshly bumped cpython, or cmake from the common group) would +otherwise make graph resolution fail outright instead of being reported. Missing *binaries* are +never a problem -- `--build=missing` just marks them "Build". With every +recipe available, the result answers "what needs building for these +members" from any cache state, including an empty or fully invalidated one. + +The graph is deliberately not `--reduce`d: it keeps packages that already +have an up-to-date binary, along with each package's build status, so the +selection logic in plan_build() can follow edges through up-to-date packages +(--target-to/--target-from) and place packages Conan considers current +(--force-rebuild). +""" + +import json +import os +import re +import shlex +import subprocess +import tempfile +import typing +import uuid + +import yaml + +from aswfdocker import bake, constants, utils, versioninfo + +CONFIG_YML_NAME = "config.yml" +BAKE_TARGET_NAME = "ci-conan-graph" +BUILD_ORDER_FILENAME = "aswf-build-order.json" + + +# `binary` statuses from conan/internal/graph/graph.py (BINARY_*) +_NEEDS_BUILD = {"Build", "EditableBuild"} +_UNBUILDABLE = {"Invalid", "Missing"} + + +class BuildOrderError(Exception): + """Raised when the Conan build-order graph could not be computed or + parsed, or a build can't be planned from it.""" + + +class UnbuiltDependenciesError(BuildOrderError): + """Packages a planned build depends on need (re)building but weren't + selected -- they belong to an earlier group, or the same group but + outside the --target selection.""" + + def __init__(self, blockers: typing.Sequence[str]): + self.blockers = list(blockers) + super().__init__( + "These dependencies need to be (re)built first, but aren't part of " + "this build's selection -- build their group first, or widen the " + "selection (e.g. --target-to):\n " + "\n ".join(self.blockers) + ) + + +def _name_from_ref(ref: str) -> str: + """Extracts the bare package name from a Conan ref string, e.g. + "osl/1.14.4.0@aswf/vfx2027_4" -> "osl".""" + return ref.split("@", 1)[0].split("/", 1)[0] + + +class BuildOrder: + """The leveled dependency graph from one `conan graph build-order` + result: every package in it (whether or not it needs building), their + dependency edges, and which ones need (re)building. + + `levels[i]` only ever depends on names in `levels[0:i]` (or on nothing), + so each level can in principle be built in parallel once Conan 2's + sqlite build-cache concurrency issue no longer forces sequential builds. + """ + + def __init__(self, levels: typing.List[typing.List[str]]): + self.levels: typing.List[typing.List[str]] = levels + self.need_build: typing.Set[str] = set() + # name -> full refs, e.g. two clang versions selected via conf refs + self.refs: typing.Dict[str, typing.Set[str]] = {} + self._depends: typing.Dict[str, typing.Set[str]] = {} + self._dependents: typing.Dict[str, typing.Set[str]] = {} + + def add_edge(self, name: str, depends_on: str) -> None: + self._depends.setdefault(name, set()).add(depends_on) + self._dependents.setdefault(depends_on, set()).add(name) + + def flat_order(self) -> typing.List[str]: + """The levels flattened into a single sequential build order, each + name once.""" + return list(dict.fromkeys(name for level in self.levels for name in level)) + + @staticmethod + def _closure( + seed_names: typing.Iterable[str], + edges: typing.Dict[str, typing.Set[str]], + ) -> typing.Set[str]: + closure: typing.Set[str] = set() + pending = list(seed_names) + while pending: + name = pending.pop() + for other in edges.get(name, ()): + if other not in closure: + closure.add(other) + pending.append(other) + return closure + + def downstream_closure(self, seed_names: typing.Iterable[str]) -> typing.Set[str]: + """Every package that transitively depends on any of `seed_names`, + not including the seeds themselves (unless one depends on another). + + Drives --target-from, and later skipping packages blocked by a + failed build / --resume-from-package. + """ + return self._closure(seed_names, self._dependents) + + def upstream_closure(self, seed_names: typing.Iterable[str]) -> typing.Set[str]: + """Every package any of `seed_names` transitively depends on, not + including the seeds themselves (unless one depends on another). + + Drives --target-to, and finding unbuilt dependencies of a build. + """ + return self._closure(seed_names, self._depends) + + +def parse_build_order_json(data: dict) -> BuildOrder: + """Parses the output of + `conan graph build-order --order-by=recipe --format=json` (unreduced). + + Each entry in data["order"] is a level (list of recipe-reference + dicts); each dict has "ref" (e.g. "osl/1.14.4.0@aswf/vfx2027_4"), + "depends" (a list of other recipe-ref strings) and "packages" (levels + of binary-package dicts, each with a "binary" status such as "Build" + or "Cache"). + + `conan graph build-order` doesn't fail on a package it can't build -- + it just records an "Invalid" (e.g. rejected by the recipe's validate()) + or "Missing" status -- so those are turned into an error here. + """ + try: + raw_levels = data["order"] + except (TypeError, KeyError) as exc: + raise BuildOrderError( + f"Unexpected conan graph build-order output, missing 'order': {data!r}" + ) from exc + + levels: typing.List[typing.List[str]] = [] + order = BuildOrder(levels) + unbuildable = [] + for raw_level in raw_levels: + level_names = [] + for entry in raw_level: + name = _name_from_ref(entry["ref"]) + level_names.append(name) + order.refs.setdefault(name, set()).add(entry["ref"]) + for dep_ref in entry.get("depends", []): + order.add_edge(name, _name_from_ref(dep_ref)) + binaries = { + package.get("binary") + for package_level in entry.get("packages", []) + for package in package_level + } + if binaries & _NEEDS_BUILD: + order.need_build.add(name) + for binary in sorted(b for b in binaries & _UNBUILDABLE if b): + unbuildable.append(f"{entry['ref']} ({binary})") + levels.append(level_names) + if unbuildable: + raise BuildOrderError( + "Conan can't build these packages with this profile:\n " + + "\n ".join(unbuildable) + ) + return order + + +class BuildPlan(typing.NamedTuple): + to_build: typing.List[str] + """Selected packages to build, in dependency order.""" + up_to_date: typing.List[str] + """Selected packages skipped because their binary is already current.""" + + +def plan_build( # pylint: disable=too-many-arguments + order: BuildOrder, + members: typing.Iterable[str], + targets: typing.Iterable[str] = (), + targets_to: typing.Iterable[str] = (), + targets_from: typing.Iterable[str] = (), + force: bool = False, + done: typing.AbstractSet[str] = frozenset(), +) -> BuildPlan: + """Decides which group members to build, and in what order. + + The selection is every member of the group, unless narrowed by: + `targets` (just those packages), `targets_to` (each package plus + everything it transitively requires) and/or `targets_from` (each + package plus everything that transitively requires it) -- their union, + limited to the group's members. Selected packages are built if they + need (re)building, or unconditionally with `force`. + + Raises UnbuiltDependenciesError if anything those builds depend on + needs building but isn't selected, rather than building against a + dependency that isn't there. + + `done` names packages an earlier plan of the same run already builds: + they're left out of this plan, and never block it. + """ + member_set = set(members) + named = set(targets) | set(targets_to) | set(targets_from) + unknown = sorted(named - member_set) + if unknown: + raise BuildOrderError( + f"Not members of the requested group(s): {', '.join(unknown)}" + ) + if named: + selected = ( + named + | order.upstream_closure(targets_to) + | order.downstream_closure(targets_from) + ) & member_set + else: + selected = member_set + + selected -= done + flat = order.flat_order() + to_build = [n for n in flat if n in selected and (force or n in order.need_build)] + up_to_date = [n for n in flat if n in selected and n not in to_build] + blocking = (order.upstream_closure(to_build) & order.need_build) - selected - done + if blocking: + raise UnbuiltDependenciesError( + sorted(ref for name in blocking for ref in order.refs.get(name, {name})) + ) + return BuildPlan(to_build, up_to_date) + + +def _recipe_folder(repo_root: str, name: str, version: str) -> str: + """Mirrors packages/common/Dockerfile's own resolution of a recipe's + source folder: most recipes are single-version and live directly under + packages/conan/recipes/, but a few (qt, onetbb, ...) are + multi-version and keep a config.yml mapping each version to its own + sub-folder, same as a Conan Center Index "all" recipe layout.""" + recipe_dir = os.path.join(repo_root, "packages", "conan", "recipes", name) + config_path = os.path.join(recipe_dir, CONFIG_YML_NAME) + if not os.path.isfile(config_path): + return recipe_dir + with open(config_path, "r", encoding="utf-8") as f: + config = yaml.safe_load(f) + folder = (config.get("versions") or {}).get(version, {}).get("folder") + if not folder: + raise BuildOrderError(f"{config_path}: no folder entry for version {version!r}") + return os.path.join(recipe_dir, folder) + + +def _export_entry( + repo_root: str, name: str, version: str, package_org: str, channel: str +) -> typing.List[str]: + """One [path, name, version, user, channel] entry for the `conan + aswf-export` custom command (packages/conan/settings/extensions/ + commands/cmd_aswf_export.py).""" + folder = _recipe_folder(repo_root, name, version) + # folder is a host path (used to compute config.yml), but inside the + # container recipes are bind-mounted at ASWF_CONAN_HOME/recipes instead. + recipes_root = os.path.join(repo_root, "packages", "conan", "recipes") + relative = os.path.relpath(folder, recipes_root) + container_folder = os.path.join(constants.ASWF_CONAN_HOME, "recipes", relative) + return [container_folder, name, version, package_org, channel] + + +def _shell_args(args: typing.Sequence[str]) -> str: + return " ".join(shlex.quote(arg) for arg in args) + + +def _export_all_command( + entries: typing.Sequence[typing.Sequence[str]], + remote_args: typing.Sequence[str], +) -> str: + # One Conan process for every export, instead of one `conan export` + # (and one interpreter start) per recipe. + return ( + f"conan aswf-export {_shell_args(remote_args)} " + f"{shlex.quote(json.dumps(list(entries)))}" + ) + + +def _build_order_command( # pylint: disable=too-many-arguments + members: typing.Sequence[typing.Tuple[str, str]], + package_org: str, + profile_name: str, + channel: str, + remote_args: typing.Sequence[str], +) -> str: + profile = os.path.join( + constants.ASWF_CONAN_HOME, ".conan2", "profiles", profile_name + ) + requires = " ".join( + f"--requires={shlex.quote(f'{name}/{version}@{package_org}/{channel}')}" + for name, version in members + ) + profile_arg = shlex.quote(profile) + return ( + f"conan graph build-order {requires} " + f"--profile:all {profile_arg} {_shell_args(remote_args)} --build=missing " + "--order-by=recipe --format=json" + ) + + +_PROFILE_REF_RE = re.compile( + r"^(?P[\w.+-]+)/(?P[^@\s]+)@\{\{\s*org\s*\}\}/(?P\S+)$" +) +_REPLACE_SECTIONS = {"replace_requires", "replace_tool_requires"} + + +def profile_refs( + repo_root: str, profile_name: str +) -> typing.List[typing.Tuple[str, str, str]]: + """(name, version, channel) for every one of our own packages the given + generated Conan profile (following its include()s) can redirect a + dependency to: the targets of [replace_requires]/[replace_tool_requires] + and user.aswf:*_ref conf values, e.g. "cmake/4.3.3@{{ org }}/vfx2027_4". + + These are exactly the references Conan will look up while resolving a + graph with that profile -- including packages outside the group being + built, and every clang version a recipe can select via conf. Only refs with a recipe directory are + returned; others (e.g. platform/system packages) aren't ours to export. + """ + profiles_dir = os.path.join(repo_root, "packages", "conan", "settings", "profiles") + recipes_root = os.path.join(repo_root, "packages", "conan", "recipes") + refs: typing.Dict[typing.Tuple[str, str, str], None] = {} + visited: typing.Set[str] = set() + + def scan(name: str) -> None: + if name in visited: + return + visited.add(name) + section = "" + with open(os.path.join(profiles_dir, name), "r", encoding="utf-8") as f: + for raw in f: + line = raw.strip() + if not line or line.startswith(("#", "{%")): + continue + if line.startswith("include(") and line.endswith(")"): + scan(line[len("include(") : -1].strip()) + elif line.startswith("[") and line.endswith("]"): + section = line[1:-1] + elif section in _REPLACE_SECTIONS and ":" in line: + add(line.split(":", 1)[1].strip()) + elif section == "conf" and "=" in line: + key, value = line.split("=", 1) + if key.strip().endswith("_ref"): + add(value.strip()) + + def add(ref: str) -> None: + match = _PROFILE_REF_RE.match(ref) + if match and os.path.isdir(os.path.join(recipes_root, match["name"])): + refs[(match["name"], match["version"], match["channel"])] = None + + scan(profile_name) + return list(refs) + + +def _graph_script( # pylint: disable=too-many-arguments + repo_root: str, + package_org: str, + profile_name: str, + channel: str, + members: typing.Sequence[typing.Tuple[str, str]], + exports: typing.Sequence[typing.Tuple[str, str, str]], + remote_args: typing.Sequence[str], +) -> str: + to_export = list(exports) + for name, version in members: + if (name, version, channel) not in to_export: + to_export.append((name, version, channel)) + entries = [ + _export_entry(repo_root, name, version, package_org, export_channel) + for name, version, export_channel in to_export + ] + return ( + f"{_export_all_command(entries, remote_args)} && " + f"{_build_order_command(members, package_org, profile_name, channel, remote_args)}" + ) + + +def _bake_dict( + docker_org: str, + package_org: str, + version_info: versioninfo.VersionInfo, + script: str, + nonce: str, +) -> dict: + args = utils.common_conan_bake_args(docker_org, package_org, version_info) + args["ASWF_CONAN_GRAPH_SCRIPT"] = script + # See ASWF_CONAN_NONCE in packages/common/Dockerfile: forces the graph RUN + # to execute every time, without the no-cache/no-cache-filter side effect + # of replacing the shared Conan cache mount with an empty one. + args["ASWF_CONAN_NONCE"] = nonce + return { + "target": { + BAKE_TARGET_NAME: { + "context": ".", + "dockerfile": constants.CONAN_PACKAGE_DOCKERFILE, + "args": args, + } + } + } + + +def _read_build_order_output(output_dir: str) -> dict: + output_path = os.path.join(output_dir, BUILD_ORDER_FILENAME) + try: + with open(output_path, "r", encoding="utf-8") as f: + return json.load(f) + except OSError as exc: + raise BuildOrderError( + f"docker buildx bake did not produce {output_path}: {exc}" + ) from exc + except json.JSONDecodeError as exc: + raise BuildOrderError( + f"Could not parse conan graph build-order output as JSON: {exc}" + ) from exc + + +def _run_bake_and_read_output(repo_root: str, bake_dict: dict, progress: str) -> dict: + with tempfile.TemporaryDirectory() as tmpdir: + bake_jsonfile = os.path.join(tmpdir, "docker-bake-graph.json") + bake.write_bake_jsonfile(bake_jsonfile, bake_dict) + output_dir = os.path.join(tmpdir, "output") + os.makedirs(output_dir) + + cmd = bake.bake_command( + bake_jsonfile, + build_targets=[BAKE_TARGET_NAME], + overrides={ + "target": "ci-conan-graph-output", + "output": f"type=local,dest={output_dir}", + }, + progress=progress, + override_scope=BAKE_TARGET_NAME, + ) + result = subprocess.run( + cmd, + cwd=repo_root, + capture_output=True, + text=True, + check=False, + ) + if result.returncode != 0: + raise BuildOrderError( + f"Failed to compute build order (exit {result.returncode}):\n" + f"{result.stderr}" + ) + return _read_build_order_output(output_dir) + + +def compute_build_order( + repo_root: str, + docker_org: str, + package_org: str, + version_info: versioninfo.VersionInfo, + members: typing.Sequence[typing.Tuple[str, str]], + conan_remote: str = constants.CONAN_REMOTE_AUTO, + progress: str = "plain", +) -> BuildOrder: + """Computes the build order for `members` (a sequence of (name, version) + pairs, e.g. the flattened image list of a "vfx" meta-group), via + `docker buildx bake` against the same packages/common/Dockerfile real + package builds use (see module docstring for why this has to be bake + and not a plain `docker run`), in the Conan channel and with the + profile of `version_info`'s release. Every package that profile can + redirect a dependency to is exported first (see profile_refs()). + `conan_remote` is the same remote policy real builds apply (see + utils.resolve_conan_remote()), so "what needs building" is answered + against the same cache/remote a real build would use. + """ + if not members: + return BuildOrder([]) + + remote_args = utils.conan_remote_args( + utils.resolve_conan_remote(conan_remote, package_org) + ) + profile_name = str(version_info.conan_profile) + channel = version_info.conan_channel + exports = profile_refs(repo_root, profile_name) + script = _graph_script( + repo_root, package_org, profile_name, channel, members, exports, remote_args + ) + bake_dict = _bake_dict( + docker_org, package_org, version_info, script, uuid.uuid4().hex + ) + data = _run_bake_and_read_output(repo_root, bake_dict, progress) + return parse_build_order_json(data) diff --git a/python/aswfdocker/cli/aswfdocker.py b/python/aswfdocker/cli/aswfdocker.py index 40d83791d..f8d9c049d 100644 --- a/python/aswfdocker/cli/aswfdocker.py +++ b/python/aswfdocker/cli/aswfdocker.py @@ -13,6 +13,7 @@ from aswfdocker import ( builder, + buildorder, aswfinfo, groupinfo, constants, @@ -91,7 +92,7 @@ def common_image_options(function): "-v", required=False, multiple=True, - help='The major version number to build, e.g. "2019", can be specified multiple times.' + help='The major version number to build, e.g. "2027", can be specified multiple times.' ' Can also be "all".', )(function) function = click.option( @@ -99,7 +100,7 @@ def common_image_options(function): "-n", callback=validate_image_name, required=False, - help="The full image name, e.g. aswftesting/ci-common:1 or aswf/ci-package-openexr:2019", + help="The full image name, e.g. aswftesting/ci-common:2027-clang22 or aswf/ci-package-openexr:2027", )(function) function = click.option( "--target", @@ -145,7 +146,8 @@ def get_group_info(build_info, ci_image_type, groups, versions, full_name, targe "-p", type=click.Choice(["YES", "NO", "AUTO"], case_sensitive=False), default="NO", - help="Push built images to Docker repository.", + help="Push built images to Docker Hub and Conan packages to Artifactory " + "(GitHub Actions only).", ) @click.option("--dry-run", "-d", is_flag=True, help="Just logs what would happen.") @click.option( @@ -190,13 +192,46 @@ def get_group_info(build_info, ci_image_type, groups, versions, full_name, targe help="Instruct Conan to build missing binary packages from source.", ) @click.option( - "--no-remote", - "-nr", + "--conan-remote", + "-cr", + default=constants.CONAN_REMOTE_AUTO, + show_default=True, + help=f'Conan remote policy. "{constants.CONAN_REMOTE_AUTO}": only the local ' + "Conan cache, except on GitHub Actions where only the remote named after the " + f'package org (aswf or aswftesting) is used; "{constants.CONAN_REMOTE_LOCAL}": ' + "only the local Conan cache; any other value: only that named remote.", +) +@click.option( + "--target-to", + "-tt", + multiple=True, + help="PACKAGE builds only: build this package and everything in the group it " + "transitively requires. Can be specified multiple times.", +) +@click.option( + "--target-from", + "-tf", + multiple=True, + help="PACKAGE builds only: build this package and everything in the group that " + "transitively requires it. Can be specified multiple times.", +) +@click.option( + "--force-rebuild", + "-fr", is_flag=True, - help="Do not use Conan remote, resolve exclusively in the cache", + help="PACKAGE builds only: rebuild every selected package even if Conan considers " + "its binary up to date (e.g. after a system library change). Image builds always " + "rebuild.", +) +@click.option( + "--docker-org", + "-do", + default="", + help="The Docker organization (and Conan user/remote) to build for, instead of " + "the one derived from the repository URI and branch.", ) @pass_build_info -def build( +def build( # pylint: disable=too-many-arguments,too-many-locals build_info, ci_image_type, group, @@ -207,9 +242,19 @@ def build( dry_run, progress, build_missing, - no_remote, + conan_remote, + target_to, + target_from, + force_rebuild, + docker_org, ): - """Builds a Conan package or ci-image Docker image.""" + """Builds a Conan package or ci-image Docker image. + + Conan packages are built in dependency order, skipping packages whose + binary is already up to date unless --force-rebuild is given. + """ + if docker_org: + build_info.set_org(docker_org) if push == "YES": pushb = True elif push == "AUTO": @@ -217,16 +262,71 @@ def build( else: pushb = False + is_package = ci_image_type == constants.ImageType.PACKAGE.name + if (target_to or target_from) and not is_package and not full_name: + raise click.BadOptionUsage( + "--target-to/--target-from", + "--target-to/--target-from require --ci-image-type PACKAGE", + ) + if is_package and not group and (target or target_to or target_from): + # Infer the group(s) from every named package, not just the first. + idx = index.Index() + try: + group = sorted( + { + idx.get_group_from_image(constants.ImageType.PACKAGE, t) + for t in (*target, *target_to, *target_from) + } + ) + except RuntimeError as e: + raise click.BadOptionUsage("--target-to/--target-from", e.args[0]) + group_info = get_group_info( build_info, ci_image_type, group, version, full_name, target ) - b = builder.Builder(build_info=build_info, group_info=group_info, push=pushb) - b.build( - dry_run=dry_run, - progress=progress, - build_missing=build_missing, - no_remote=no_remote, + if pushb and not utils.on_github_actions(): + raise click.BadOptionUsage( + "--push", + "Conan packages and Docker images can only be uploaded to Artifactory " + "and Docker Hub from GitHub Actions.", + ) + selection = None + if group_info.type == constants.ImageType.PACKAGE: + # Package builds compute the build order over the whole group, so the + # targets narrow what gets built rather than which members exist. + selection = builder.PackageSelection( + targets=group_info.targets, + targets_to=target_to, + targets_from=target_from, + force=force_rebuild, + ) + group_info = groupinfo.GroupInfo( + type_=group_info.type, + names=group_info.names, + versions=group_info.versions, + targets=[], + ) + elif target_to or target_from: + raise click.BadOptionUsage( + "--target-to/--target-from", + "--target-to/--target-from require --ci-image-type PACKAGE", + ) + + b = builder.Builder( + build_info=build_info, + group_info=group_info, + push=pushb, + conan_remote=conan_remote, ) + try: + b.build( + dry_run=dry_run, + progress=progress, + build_missing=build_missing, + selection=selection, + ) + except buildorder.BuildOrderError as e: + raise click.ClickException(str(e)) @cli.command(deprecated="No longer relevant since all packages are built with Conan.") @@ -294,7 +394,9 @@ def download(*_args, **_kwargs): @cli.command() def packages(): - """Lists all known CI packages in this format: PACKAGEGROUP/ci-package-PACKAGE:VERSION""" + """Lists all known CI packages in this format: PACKAGEGROUP/ci-package-PACKAGE:VERSION, + one line for each VFX Platform year (or year and clang version) a package is built for. + """ for group, pkgs in index.Index().groups[constants.ImageType.PACKAGE].items(): for package in pkgs: image_name = utils.get_image_name(constants.ImageType.PACKAGE, package) @@ -364,11 +466,29 @@ def settings(settings_path, github_access_token): @click.option( "--message", "-m", - help="The release message.", + help="The release message of each image's GitHub release (images only).", +) +@click.option( + "--force-rebuild", + is_flag=True, + help="Conan packages only: rebuild and upload the selected packages even if " + "Artifactory already has an up-to-date binary.", +) +@click.option( + "--workflow-ref", + default="", + help="The branch to run the release workflow definition from, defaults to the " + "repository's default branch. Releases are always built from --sha.", +) +@click.option( + "--full-release", + is_flag=True, + help="Release every Conan package and image of the given years (-v), in " + "dependency order.", ) @click.option("--dry-run", "-d", is_flag=True, help="Just logs what would happen.") @pass_build_info -def release( +def release( # pylint: disable=too-many-arguments,too-many-locals build_info, ci_image_type, group, @@ -379,9 +499,20 @@ def release( github_org, docker_org, message, + force_rebuild, + workflow_ref, + full_release, dry_run, ): - """Creates a GitHub release for a ci-package or ci-image Docker image.""" + """Releases ci-image Docker images and/or Conan packages. + + Starts a GitHub Actions workflow building them from the commit, the only + place holding the Docker Hub and Artifactory credentials: images are + pushed to Docker Hub and each recorded as a GitHub release (and tag) on + the commit, Conan packages are uploaded to Artifactory. With + --full-release, every package and image of the given years is released, + in dependency order. + """ # Disable SSL unclosed ResourceWarning coming from GitHub warnings.filterwarnings( @@ -397,31 +528,217 @@ def release( sys.exit(1) sha = utils.get_current_sha() if docker_org: - build_info.docker_org = docker_org + build_info.set_org(docker_org) + + workflow_releaser: releaser.WorkflowReleaser + if full_release: + if ci_image_type or group or full_name or target: + raise click.BadOptionUsage( + "--full-release", + "--full-release releases every group: it can't be combined with " + "-t, -g, -n or --target", + ) + years = sorted(vi.version for vi in index.Index().iter_years()) + if list(version) == [constants.ALL]: + version = years + if not version or set(version) - set(years): + raise click.BadOptionUsage( + "--version", + f"--full-release needs years to release (-v), from: {', '.join(years)}", + ) + full_releaser = releaser.FullReleaser( + build_info=build_info, + versions=sorted(version), + sha=sha, + github_org=github_org, + workflow_ref=workflow_ref, + force_rebuild=force_rebuild, + message=message, + ) + full_releaser.gather() + workflow_releaser = full_releaser + prompt = ( + f"Are you sure you want GitHub Actions to release every Conan package " + f"({'forcing a rebuild' if force_rebuild else 'unless up to date'}) of " + f"{' '.join(sorted(version))} to {build_info.docker_org} from sha={sha}, " + f"and these {len(full_releaser.releases)} images (as draft GitHub " + "releases until they're pushed)?\n" + + "\n".join(r.name for r in full_releaser.releases) + + "\n" + ) + else: + group_info = get_group_info( + build_info, ci_image_type, group, version, full_name, target + ) + if group_info.type == constants.ImageType.PACKAGE: + package_releaser = releaser.PackageReleaser( + build_info=build_info, + group_info=group_info, + sha=sha, + github_org=github_org, + workflow_ref=workflow_ref, + force_rebuild=force_rebuild, + ) + package_releaser.gather() + workflow_releaser = package_releaser + prompt = ( + "Are you sure you want GitHub Actions to build and upload these {} " + "Conan packages from sha={} ({})?\n{}\n".format( + len(package_releaser.release_list), + sha, + "forcing a rebuild" if force_rebuild else "unless up to date", + "\n".join(package_releaser.release_list), + ) + ) + else: + if force_rebuild: + raise click.BadOptionUsage( + "--force-rebuild", + "--force-rebuild only applies to Conan package releases", + ) + image_releaser = releaser.ImageReleaser( + build_info=build_info, + group_info=group_info, + sha=sha, + github_org=github_org, + workflow_ref=workflow_ref, + message=message, + ) + image_releaser.gather() + workflow_releaser = image_releaser + prompt = ( + "Are you sure you want GitHub Actions to build and push these {} " + "images from sha={} (as draft GitHub releases until they're " + "pushed)?\n{}\n".format( + len(image_releaser.releases), + sha, + "\n".join(r.name for r in image_releaser.releases), + ) + ) + if build_info.docker_org not in ( + constants.PUBLISH_DOCKER_ORG, + constants.TESTING_DOCKER_ORG, + ): + raise click.BadOptionUsage( + "--docker-org", + f"Releases go to {constants.PUBLISH_DOCKER_ORG} or " + f"{constants.TESTING_DOCKER_ORG}, not {build_info.docker_org}", + ) + if not click.confirm(prompt): + click.echo("Release cancelled.") + return + try: + workflow_releaser.release(dry_run=dry_run) + except RuntimeError as e: + raise click.ClickException(e.args[0]) + click.echo("Dry run: no release started." if dry_run else "Release started.") + +@cli.command() +@common_image_options +@click.option( + "--sha", + "-s", + required=True, + help="The sha the releases are on.", +) +@click.option( + "--docker-org", + "-do", + required=True, + help="The Docker organization the images were pushed to.", +) +@click.option( + "--message", + "-m", + default="", + help="The release message, for releases without a draft.", +) +@click.option( + "--sbom-dir", + default="", + help="The directory holding the image SBOMs (from exportsboms) to attach " + "to the releases.", +) +@pass_build_info +def publishreleases( + build_info, + ci_image_type, + group, + version, + full_name, + target, + sha, + docker_org, + message, + sbom_dir, +): + """Publishes the draft GitHub release (creating its tag) of each released + image (GitHub Actions only), with the workflow's GITHUB_TOKEN, with the + image's SBOM attached.""" + if not utils.on_github_actions(): + raise click.UsageError( + "GitHub releases of images can only be published from GitHub Actions." + ) + build_info.set_org(docker_org) group_info = get_group_info( build_info, ci_image_type, group, version, full_name, target ) - - r = releaser.Releaser( - github_org=github_org, + if group_info.type != constants.ImageType.IMAGE: + raise click.BadOptionUsage("--ci-image-type", "Only images get GitHub releases") + publisher = releaser.ReleasePublisher( build_info=build_info, group_info=group_info, - message=message, sha=sha, + message=message, + token=os.environ["GITHUB_TOKEN"], + repository=os.environ["GITHUB_REPOSITORY"], + sbom_dir=sbom_dir, + ) + try: + publisher.publish() + except FileNotFoundError as e: + raise click.ClickException(e.args[0]) + + +@cli.command() +@common_image_options +@click.option( + "--output-dir", + "-o", + required=True, + help="The directory to export the SBOMs to.", +) +@click.option( + "--docker-org", + "-do", + default="", + help="The Docker organization of the images, instead of the one derived " + "from the repository URI and branch.", +) +@pass_build_info +def exportsboms( + build_info, + ci_image_type, + group, + version, + full_name, + target, + output_dir, + docker_org, +): + """Exports the SBOM of each image, as built in the local Docker image + store, for publishreleases to attach to its GitHub release.""" + if docker_org: + build_info.set_org(docker_org) + group_info = get_group_info( + build_info, ci_image_type, group, version, full_name, target + ) + if group_info.type != constants.ImageType.IMAGE: + raise click.BadOptionUsage("--ci-image-type", "Only images have SBOMs") + releaser.export_sboms( + releaser.image_releases(build_info, group_info, message=""), output_dir ) - r.gather() - if not click.confirm( - "Are you sure you want to create the following {} release on sha={}?\n{}\n".format( - len(r.release_list), - r.sha, - "\n".join(tag for _, _, tag in r.release_list), - ) - ): - click.echo("Release cancelled.") - return - r.release(dry_run=dry_run) - click.echo("Release done.") @cli.command() @@ -487,7 +804,15 @@ def dockergen(context, image_name, check, verbose): @click.option( "--password", "-p", - help="Docker Hub password", + envvar="DOCKERHUB_PASSWORD", + help="Docker Hub password (default: the DOCKERHUB_PASSWORD environment variable).", +) +@click.option( + "--docker-org", + "-do", + default="", + help="The Docker organization to push the descriptions to, instead of the " + "one derived from the repository URI and branch.", ) @pass_build_info def pushoverview( @@ -499,14 +824,21 @@ def pushoverview( target, username, password, + docker_org, ): """Pushes the Docker Image README file to Docker Hub""" + if docker_org: + build_info.set_org(docker_org) group_info = get_group_info( build_info, ci_image_type, group, version, full_name, target ) if group_info.type == constants.ImageType.PACKAGE: click.echo("Package readme do not exist yet.") return + if not utils.on_github_actions(): + raise click.UsageError( + "Docker Hub descriptions can only be updated from GitHub Actions." + ) token = utils.get_dockerhub_token(username, password) for image, _ in group_info.iter_images_versions(): dg = aswf_dockergen.DockerGen(image.replace("ci-", "")) diff --git a/python/aswfdocker/constants.py b/python/aswfdocker/constants.py index cc0ef2eec..d0d298bc4 100644 --- a/python/aswfdocker/constants.py +++ b/python/aswfdocker/constants.py @@ -28,6 +28,17 @@ class ImageType(enum.Enum): f"https://github.com/{MAIN_GITHUB_ASWF_ORG}/{MAIN_GITHUB_REPO_NAME}" ) +# Release GitHub Actions workflows, started by `aswfdocker release`: +# Conan packages built and uploaded to Artifactory (-t PACKAGE), images built +# and pushed to Docker Hub (-t IMAGE), or both in dependency order +# (--full-release). +PACKAGE_RELEASE_WORKFLOW = "release-packages.yml" +IMAGE_RELEASE_WORKFLOW = "release-images.yml" +FULL_RELEASE_WORKFLOW = "release-all.yml" +# The image groups release-all.yml releases (checked by test_releaser), for +# `aswfdocker release --full-release` to create their draft GitHub releases. +FULL_RELEASE_IMAGE_GROUPS = ("baseos-gl-conan", "common", "base", "vfx") + CCI_GITHUB_ORG = "conan-io" CCI_GITHUB_REPO_NAME = "conan-center-index" CCI_DEFAULT_BRANCH = "master" @@ -37,4 +48,25 @@ class ImageType(enum.Enum): ALL = "all" +# Images also tagged with their year's legacy_common_version (see +# versions.yaml), e.g. ci-common:7-clang22 as well as ci-common:2027-clang22, +# from when they were versioned separately from the VFX Platform year. +LEGACY_COMMON_TAGGED_IMAGES = ("ci-baseos-gl-conan", "ci-common") + ASWF_CONAN_HOME = "/opt/conan_home" + +# Conan remote policy values (see utils.resolve_conan_remote()): any other +# value names the single Conan remote to use. +CONAN_REMOTE_AUTO = "auto" +CONAN_REMOTE_LOCAL = "local" + +# Dockerfile (relative to the repo root) every Conan package build and the +# Conan dependency-graph grapher are baked from. +CONAN_PACKAGE_DOCKERFILE = "packages/common/Dockerfile" + +# The CycloneDX SBOM of the Conan packages in an image, written by the +# aswf_deploy Conan deployer (packages/conan/settings/extensions/deployers), +# and attached to the image's GitHub release. It's under the images' +# ASWF_INSTALL_PREFIX (ci-image-dockerfile.jinja2), which aswfdocker can't +# read from outside the build container, so the two must agree. +IMAGE_SBOM_PATH = "/usr/local/aswf/sbom.cdx.json" diff --git a/python/aswfdocker/data/ci-image-dockerfile.jinja2 b/python/aswfdocker/data/ci-image-dockerfile.jinja2 index f000eab03..f147c7716 100644 --- a/python/aswfdocker/data/ci-image-dockerfile.jinja2 +++ b/python/aswfdocker/data/ci-image-dockerfile.jinja2 @@ -7,13 +7,12 @@ ARG ASWF_ORG ARG ASWF_PKG_ORG -ARG CI_COMMON_VERSION +ARG ASWF_VFXPLATFORM_VERSION +ARG ASWF_VFXPLATFORM_MINOR_VERSION ARG ASWF_CLANG_MAJOR_VERSION +ARG ASWF_CONAN_PROFILE ARG ASWF_CONAN_CHANNEL ARG ASWF_CXX_STANDARD -{% if name != "common" and name != "baseos-gl-conan" %} -ARG ASWF_VFXPLATFORM_VERSION -{% endif %} {% for arg in docker_args -%} ARG {{ arg }} @@ -41,8 +40,9 @@ ARG ASWF_ORG ARG ASWF_CONAN_HOME ARG ASWF_PKG_ORG ARG ASWF_VERSION -ARG CI_COMMON_VERSION +ARG ASWF_CONAN_PROFILE ARG ASWF_CONAN_CHANNEL +ARG ASWF_CONAN_REMOTE_ARGS ARG ASWF_CXX_STANDARD {% if name == "common" or name == "baseos-gl-conan" %} @@ -110,9 +110,9 @@ ENV {{ arg }}=${{ arg }} {% endfor -%} {% endfor %} -COPY ci-{{name_image | default(name)}}/README.md ci-{{name_image | default(name)}}/image.yaml /usr/local/aswf/ +COPY ci-{{name_image | default(name)}}/README.md ci-{{name_image | default(name)}}/image.yaml ${ASWF_INSTALL_PREFIX}/aswf/ {% if name != "common" and name != "baseos-gl-conan" and name != "base" and name != "baseqt" and name != "vfxall" %} -COPY scripts/vfx/build_{{name_image | default(name)}}.sh /usr/local/aswf +COPY scripts/vfx/build_{{name_image | default(name)}}.sh ${ASWF_INSTALL_PREFIX}/aswf/ {% endif -%} {{ docker_commands }} @@ -124,11 +124,7 @@ COPY scripts/vfx/build_{{name_image | default(name)}}.sh /usr/local/aswf ARG ASWF_PYTHON_MAJOR_MINOR_VERSION ENV ASWF_PYTHON_MAJOR_MINOR_VERSION=${ASWF_PYTHON_MAJOR_MINOR_VERSION} -# conan-only packages -COPY < . +COPY < Conan profile. + # minor_version: the year's current release. Images are tagged + # "." (or "-clang."), and Conan + # packages are built in the vfx_ channel, in the + # ci-baseos-gl-conan:. image: bumping it starts a release + # whose packages are all rebuilt, never reusing a previous release's. + # legacy_common_version: ci-common and ci-baseos-gl-conan images are also + # tagged with this pre-2028 ci_common version (e.g. ci-common:7-clang22 + # as well as ci-common:2027-clang22) for existing consumers. Years from + # 2028 on don't set it. + # tags: extra tags (e.g. "latest") for the year's images. + # clang_versions: every clang version (major: full version) built for the + # year. A "-clang" version is derived for each, for the + # per-clang images in ci-images and the per_clang_packages below. The + # last one listed is also tagged with the bare year. + # package_versions: version pins. ASWF_CLANG_MAJOR_VERSION is the clang + # version everything not built per clang version uses. + "2023": + major_version: "2023" + minor_version: "8" + legacy_common_version: "3" + conan_profile: "vfx2023" + generate_profile: true + clang_versions: + "14": "14.0.6" + "15": "15.0.7" package_versions: + # Toolchain ASWF_DTS_VERSION: "11" ASWF_DTS_PREFIX: "gcc-toolset" ASWF_GCC_VERSION: "11.2" @@ -156,395 +75,8 @@ versions: ASWF_YQ_VERSION: "4.45.2" ASWF_BASEOS_DISTRO: "rockylinux8" ASWF_BASEOS_IMAGE: "nvidia/cuda" - "3-clang14": - parent_versions: ["3"] - major_version: "3" - ci_common_version: "3" - package_versions: + # Clang version used by images not built for every clang version ASWF_CLANG_MAJOR_VERSION: "14" - ASWF_CLANG_VERSION: "14.0.6" - "3-clang15": - parent_versions: ["3"] - major_version: "3" - ci_common_version: "3" - use_major_version_as_tag: true - package_versions: - ASWF_CLANG_MAJOR_VERSION: "15" - ASWF_CLANG_VERSION: "15.0.7" - "4": - major_version: "4" - ci_common_version: "4" - conan_profile: "ci_common4" - package_versions: - ASWF_DTS_VERSION: "11" - ASWF_DTS_PREFIX: "gcc-toolset" - ASWF_GCC_VERSION: "11.2" - ASWF_CXX_STANDARD: "17" - ASWF_CONAN_VERSION: "2.29.0" - ASWF_CONAN_PYTHON_VERSION: "3.11.17" - ASWF_CUDA_VERSION: "12.6.3" - ASWF_OPTIX_VERSION: "8.0.0" - ASWF_GLVND_VERSION: "1.7.0" - ASWF_CCACHE_VERSION: "4.9.1" - ASWF_CMAKE_VERSION: "3.31.11" - ASWF_NINJA_VERSION: "1.13.2" - ASWF_SONAR_VERSION: "8.1.0.6389" - ASWF_OPENSSL_VERSION: "1.1.1k" - ASWF_GNUTLS_VERSION: "3.6.16" - ASWF_YQ_VERSION: "4.45.2" - ASWF_BASEOS_DISTRO: "rockylinux8" - ASWF_BASEOS_IMAGE: "nvidia/cuda" - "4-clang16": - parent_versions: ["4"] - major_version: "4" - ci_common_version: "4" - use_major_version_as_tag: true - package_versions: - ASWF_CLANG_MAJOR_VERSION: "16" - ASWF_CLANG_VERSION: "16.0.6" - "4-clang17": - parent_versions: ["4"] - major_version: "4" - ci_common_version: "4" - use_major_version_as_tag: true - package_versions: - ASWF_CLANG_MAJOR_VERSION: "17" - ASWF_CLANG_VERSION: "17.0.6" - "5": - major_version: "5" - ci_common_version: "5" - conan_profile: "ci_common5" - package_versions: - ASWF_DTS_VERSION: "11" - ASWF_DTS_PREFIX: "gcc-toolset" - ASWF_GCC_VERSION: "11.2" - ASWF_CXX_STANDARD: "17" - ASWF_CONAN_VERSION: "2.29.0" - ASWF_CONAN_PYTHON_VERSION: "3.11.17" - ASWF_CUDA_VERSION: "12.6.3" - ASWF_OPTIX_VERSION: "8.0.0" - ASWF_GLVND_VERSION: "1.7.0" - ASWF_CCACHE_VERSION: "4.9.1" - ASWF_CMAKE_VERSION: "3.31.11" - ASWF_OPENSSL_VERSION: "1.1.1k" - ASWF_GNUTLS_VERSION: "3.6.16" - ASWF_NINJA_VERSION: "1.13.2" - ASWF_SONAR_VERSION: "8.1.0.6389" - ASWF_YQ_VERSION: "4.45.2" - ASWF_BASEOS_DISTRO: "rockylinux8" - ASWF_BASEOS_IMAGE: "nvidia/cuda" - "5-clang18": - parent_versions: ["5"] - major_version: "5" - ci_common_version: "5" - use_major_version_as_tag: true - package_versions: - ASWF_CLANG_MAJOR_VERSION: "18" - ASWF_CLANG_VERSION: "18.1.8" - "5-clang19": - parent_versions: ["5"] - major_version: "5" - ci_common_version: "5" - use_major_version_as_tag: true - package_versions: - ASWF_CLANG_MAJOR_VERSION: "19" - ASWF_CLANG_VERSION: "19.1.7" - "6": - major_version: "6" - tags: ["latest"] - ci_common_version: "6" - conan_profile: "ci_common6" - package_versions: - ASWF_DTS_VERSION: "14" - ASWF_DTS_PREFIX: "gcc-toolset" - ASWF_GCC_VERSION: "14.2" - ASWF_CXX_STANDARD: "20" - ASWF_CONAN_VERSION: "2.29.0" - ASWF_CONAN_PYTHON_VERSION: "3.13.17" - ASWF_CUDA_VERSION: "12.9.2" - ASWF_OPTIX_VERSION: "8.0.0" - ASWF_GLVND_VERSION: "1.7.0" - ASWF_CCACHE_VERSION: "4.13.6" - ASWF_CMAKE_VERSION: "4.0.6" - ASWF_OPENSSL_VERSION: "1.1.1k" - ASWF_GNUTLS_VERSION: "3.6.16" - ASWF_NINJA_VERSION: "1.13.2" - ASWF_SONAR_VERSION: "8.1.0.6389" - ASWF_YQ_VERSION: "4.45.4" - ASWF_BASEOS_DISTRO: "rockylinux8" - ASWF_BASEOS_IMAGE: "nvidia/cuda" - "6-clang19": - parent_versions: ["6"] - major_version: "6" - ci_common_version: "6" - use_major_version_as_tag: true - package_versions: - ASWF_CLANG_MAJOR_VERSION: "19" - ASWF_CLANG_VERSION: "19.1.7" - "6-clang20": - parent_versions: ["6"] - major_version: "6" - tags: ["latest"] - ci_common_version: "6" - use_major_version_as_tag: true - package_versions: - ASWF_CLANG_MAJOR_VERSION: "20" - ASWF_CLANG_VERSION: "20.1.7" - "7": - major_version: "7" - tags: ["latest"] - ci_common_version: "7" - conan_profile: "ci_common7" - package_versions: - ASWF_DTS_VERSION: "14" - ASWF_DTS_PREFIX: "gcc-toolset" - ASWF_GCC_VERSION: "14.2" - ASWF_CXX_STANDARD: "20" - ASWF_CONAN_VERSION: "2.29.0" - ASWF_CONAN_PYTHON_VERSION: "3.13.17" - ASWF_CUDA_VERSION: "13.1.2" - ASWF_OPTIX_VERSION: "9.1.0" - ASWF_GLVND_VERSION: "1.7.0" - ASWF_CCACHE_VERSION: "4.13.6" - ASWF_CMAKE_VERSION: "4.3.3" - ASWF_OPENSSL_VERSION: "3.5.8" - ASWF_GNUTLS_VERSION: "3.8.10" - ASWF_NINJA_VERSION: "1.13.2" - ASWF_SONAR_VERSION: "8.1.0.6389" - ASWF_YQ_VERSION: "4.53.3" - ASWF_BASEOS_DISTRO: "rockylinux9" - ASWF_BASEOS_IMAGE: "nvidia/cuda" - "7-clang21": - parent_versions: ["7"] - major_version: "7" - ci_common_version: "7" - use_major_version_as_tag: true - package_versions: - ASWF_CLANG_MAJOR_VERSION: "21" - ASWF_CLANG_VERSION: "21.1.8" - "7-clang22": - parent_versions: ["7"] - major_version: "7" - tags: ["draft"] - ci_common_version: "7" - use_major_version_as_tag: true - package_versions: - ASWF_CLANG_MAJOR_VERSION: "22" - ASWF_CLANG_VERSION: "22.1.7" - "2019": - parent_versions: ["1", "1-clang7"] - major_version: "2019" - ci_common_version: "1" - conan_profile: "vfx2019" - package_versions: - ASWF_ALEMBIC_VERSION: "1.7.11" - ASWF_C_BLOSC_VERSION: "1.5.0" - ASWF_BOOST_VERSION: "1.66.0" - ASWF_CMAKE_VERSION: "3.12.4" - ASWF_CPPUNIT_VERSION: "1.14.0" - ASWF_CPYTHON_VERSION: "2.7.15" - ASWF_GLEW_VERSION: "2.1.0" - ASWF_GLFW_VERSION: "3.1.2" - ASWF_GTEST_VERSION: "1.8.1" - ASWF_HDF5_VERSION: "1.8.21" - ASWF_IMATH_VERSION: "2.3.0" - ASWF_LOG4CPLUS_VERSION: "1.1.2" - ASWF_NUMPY_VERSION: "1.14" - ASWF_OPENCOLORIO_CONFIGS_VERSION: "1.0_r2" - ASWF_OPENCOLORIO_VERSION: "1.1.0" - ASWF_OPENIMAGEIO_VERSION: "2.0.8" - ASWF_OPENEXR_VERSION: "2.3.0" - ASWF_OPENSUBDIV_VERSION: "3_3_3" - ASWF_OPENVDB_VERSION: "6.2.1" - ASWF_OSL_VERSION: "1.10.9" - ASWF_OPENTIMELINEIO_VERSION: "0.12.1" - ASWF_PARTIO_VERSION: "1.10.1" - ASWF_PTEX_VERSION: "2.1.33" - ASWF_PYBIND11_VERSION: "2.4.3" - ASWF_PYSIDE_VERSION: "5.12.6" - ASWF_PYSIDE_CLANG_VERSION: "7.1.0" - ASWF_PYTHON_MAJOR_MINOR_VERSION: "2.7" - ASWF_QT_VERSION: "5.12.6" - ASWF_ONETBB_VERSION: "2018" - ASWF_OPENUSD_VERSION: "19.11" - ASWF_VFXPLATFORM_VERSION: "2019" - ASWF_CXX_STANDARD: "14" - "2019-clang6": - parent_versions: ["1", "1-clang6", "2019"] - major_version: "2019" - ci_common_version: "1" - "2019-clang7": - parent_versions: ["1", "1-clang7", "2019"] - major_version: "2019" - ci_common_version: "1" - use_major_version_as_tag: true - "2019-clang8": - parent_versions: ["1", "1-clang8", "2019"] - major_version: "2019" - ci_common_version: "1" - "2019-clang9": - parent_versions: ["1", "1-clang9", "2019"] - major_version: "2019" - ci_common_version: "1" - "2019-clang10": - parent_versions: ["1", "1-clang10", "2019"] - major_version: "2019" - ci_common_version: "1" - "2020": - parent_versions: ["1", "1-clang7"] - major_version: "2020" - ci_common_version: "1" - conan_profile: "vfx2020" - package_versions: - ASWF_ALEMBIC_VERSION: "1.7.12" - ASWF_C_BLOSC_VERSION: "1.5.0" - ASWF_BOOST_VERSION: "1.70.0" - ASWF_CMAKE_VERSION: "3.18.4" - ASWF_CPPUNIT_VERSION: "1.15.1" - ASWF_CPYTHON_VERSION: "3.7.3" - ASWF_GLEW_VERSION: "2.1.0" - ASWF_GLFW_VERSION: "3.1.2" - ASWF_GTEST_VERSION: "1.10.0" - ASWF_HDF5_VERSION: "1.8.21" - ASWF_IMATH_VERSION: "2.4.0" - ASWF_LOG4CPLUS_VERSION: "1.1.2" - ASWF_NUMPY_VERSION: "1.16" - ASWF_OPENCOLORIO_CONFIGS_VERSION: "1.0_r2" - ASWF_OPENCOLORIO_VERSION: "1.1.1" - ASWF_OPENIMAGEIO_VERSION: "2.1.13.0" - ASWF_OPENEXR_VERSION: "2.4.0" - ASWF_OPENSUBDIV_VERSION: "3_4_3" - ASWF_OPENVDB_VERSION: "7.1.0" - ASWF_OSL_VERSION: "1.10.10" - ASWF_OPENTIMELINEIO_VERSION: "0.12.1" - ASWF_PARTIO_VERSION: "1.10.1" - ASWF_PTEX_VERSION: "2.3.2" - ASWF_PYBIND11_VERSION: "2.4.3" - ASWF_PYSIDE_VERSION: "5.12.6" - ASWF_PYSIDE_CLANG_VERSION: "7.1.0" - ASWF_PYTHON_MAJOR_MINOR_VERSION: "3.7" - ASWF_QT_VERSION: "5.12.6" - ASWF_ONETBB_VERSION: "2019_u6" - ASWF_OPENUSD_VERSION: "20.11" - ASWF_VFXPLATFORM_VERSION: "2020" - ASWF_CXX_STANDARD: "17" - "2020-clang7": - parent_versions: ["1", "1-clang7", "2020"] - major_version: "2020" - ci_common_version: "1" - use_major_version_as_tag: true - "2021": - parent_versions: ["2", "2-clang10"] - major_version: "2021" - ci_common_version: "2" - conan_profile: "vfx2021" - package_versions: - ASWF_ALEMBIC_VERSION: "1.7.16" - ASWF_C_BLOSC_VERSION: "1.5.0" - ASWF_BOOST_VERSION: "1.73.0" - ASWF_CMAKE_VERSION: "3.19.3" - ASWF_CPPUNIT_VERSION: "1.15.1" - ASWF_CPYTHON_VERSION: "3.7.9" - ASWF_GLEW_VERSION: "2.1.0" - ASWF_GLFW_VERSION: "3.1.2" - ASWF_GTEST_VERSION: "1.11.0" - ASWF_HDF5_VERSION: "1.8.21" - ASWF_IMATH_VERSION: "2.5.5" - ASWF_LOG4CPLUS_VERSION: "1.1.2" - ASWF_NUMPY_VERSION: "1.19" - ASWF_OPENCOLORIO_CONFIGS_VERSION: "1.0_r2" - ASWF_OPENCOLORIO_VERSION: "2.0.1" - ASWF_OPENIMAGEIO_VERSION: "2.2.14.0" - ASWF_OPENEXR_VERSION: "2.5.5" - ASWF_OPENSUBDIV_VERSION: "3_4_3" - ASWF_OPENVDB_VERSION: "8.0.1" - ASWF_OSL_VERSION: "1.11.13.0" - ASWF_OPENTIMELINEIO_VERSION: "0.13" - ASWF_PARTIO_VERSION: "1.14.0" - ASWF_PTEX_VERSION: "2.3.2" - ASWF_PYBIND11_VERSION: "2.6.2" - ASWF_PYSIDE_VERSION: "5.15.2" - ASWF_PYTHON_MAJOR_MINOR_VERSION: "3.7" - ASWF_QT_VERSION: "5.15.2" - ASWF_ONETBB_VERSION: "2020_u2" - ASWF_OPENUSD_VERSION: "21.05" - ASWF_VFXPLATFORM_VERSION: "2021" - ASWF_CXX_STANDARD: "17" - "2021-clang10": - parent_versions: ["2", "2-clang10", "2021"] - major_version: "2021" - ci_common_version: "2" - use_major_version_as_tag: true - "2021-clang11": - parent_versions: ["2", "2-clang11", "2021"] - major_version: "2021" - ci_common_version: "2" - "2022": - parent_versions: ["2", "2-clang10"] - major_version: "2022" - ci_common_version: "2" - conan_profile: "vfx2022" - package_versions: - ASWF_ALEMBIC_VERSION: "1.8.2" - ASWF_C_BLOSC_VERSION: "1.17.0" - ASWF_BOOST_VERSION: "1.76.0" - ASWF_CMAKE_VERSION: "3.22.0" - ASWF_CPPUNIT_VERSION: "1.15.1" - ASWF_CPYTHON_VERSION: "3.9.15" - ASWF_GLEW_VERSION: "2.1.0" - ASWF_GLFW_VERSION: "3.1.2" - ASWF_GTEST_VERSION: "1.11.0" - ASWF_HDF5_VERSION: "1.8.21" - ASWF_IMATH_VERSION: "3.1.5" - ASWF_LOG4CPLUS_VERSION: "1.1.2" - ASWF_MATERIALX_VERSION: "1.38.5" - ASWF_NUMPY_VERSION: "1.20" - ASWF_OPENCOLORIO_CONFIGS_VERSION: "1.0_r2" - ASWF_OPENCOLORIO_VERSION: "2.1.1" - ASWF_OPENIMAGEIO_VERSION: "2.4.5.0" - ASWF_OPENEXR_VERSION: "3.1.5" - ASWF_OPENSUBDIV_VERSION: "3_4_4" - ASWF_OPENVDB_VERSION: "9.1.0" - ASWF_OSL_VERSION: "1.12.7.0" - ASWF_OPENTIMELINEIO_VERSION: "0.14.1" - ASWF_PARTIO_VERSION: "1.14.0" - ASWF_PTEX_VERSION: "2.4.0" - ASWF_PYBIND11_VERSION: "2.8.1" - ASWF_PYSIDE_VERSION: "5.15.2" - ASWF_PYTHON_MAJOR_MINOR_VERSION: "3.9" - ASWF_QT_VERSION: "5.15.2" - ASWF_ONETBB_VERSION: "2020.3" - ASWF_OPENUSD_VERSION: "22.11" - ASWF_VFXPLATFORM_VERSION: "2022" - ASWF_CXX_STANDARD: "17" - "2022-clang10": - parent_versions: ["2", "2-clang10", "2022"] - major_version: "2022" - use_major_version_as_tag: true - ci_common_version: "2" - "2022-clang11": - parent_versions: ["2", "2-clang11", "2022"] - major_version: "2022" - ci_common_version: "2" - "2022-clang12": - parent_versions: ["2", "2-clang12", "2022"] - major_version: "2022" - ci_common_version: "2" - "2022-clang13": - parent_versions: ["2", "2-clang13", "2022"] - major_version: "2022" - ci_common_version: "2" - "2022-clang14": - parent_versions: ["2", "2-clang14", "2022"] - major_version: "2022" - ci_common_version: "2" - "2023": - parent_versions: ["3", "3-clang14"] - major_version: "2023" - ci_common_version: "3" - conan_profile: "vfx2023" - generate_profile: true - package_versions: # Conan wrapper packages for system components ASWF_BROTLI_VERSION: "system" ASWF_DBUS_VERSION: "system" @@ -576,6 +108,7 @@ versions: ASWF_OPENCL_HEADERS_VERSION: "system" ASWF_OPENCL_ICD_LOADER_VERSION: "system" ASWF_OPENGL_VERSION: "system" + ASWF_GLU_VERSION: "system" ASWF_OPENJPEG_VERSION: "2.4.0" ASWF_OPUS_VERSION: "system" ASWF_PCRE2_VERSION: "system" @@ -665,7 +198,6 @@ versions: ASWF_QT_VERSION: "5.15.18" ASWF_ONETBB_VERSION: "2020.3" ASWF_VFXPLATFORM_VERSION: "2023" - ASWF_CXX_STANDARD: "17" # ASWF packages ASWF_IMATH_VERSION: "3.1.12" ASWF_MATERIALX_VERSION: "1.38.7" @@ -684,22 +216,37 @@ versions: ASWF_OPENTIMELINEIO_VERSION: "0.15" ASWF_RAWTOACES_VERSION: "2.1.1" ASWF_REZ_VERSION: "3.4.0" - "2023-clang14": - parent_versions: ["3", "3-clang14", "2023"] - major_version: "2023" - ci_common_version: "3" - "2023-clang15": - parent_versions: ["3", "3-clang15", "2023"] - major_version: "2023" - use_major_version_as_tag: true - ci_common_version: "3" "2024": - parent_versions: ["4", "4-clang16"] major_version: "2024" - ci_common_version: "4" + minor_version: "12" + legacy_common_version: "4" conan_profile: "vfx2024" generate_profile: true + clang_versions: + "16": "16.0.6" + "17": "17.0.6" package_versions: + # Toolchain + ASWF_DTS_VERSION: "11" + ASWF_DTS_PREFIX: "gcc-toolset" + ASWF_GCC_VERSION: "11.2" + ASWF_CXX_STANDARD: "17" + ASWF_CONAN_VERSION: "2.29.0" + ASWF_CONAN_PYTHON_VERSION: "3.11.17" + ASWF_CUDA_VERSION: "12.6.3" + ASWF_OPTIX_VERSION: "8.0.0" + ASWF_GLVND_VERSION: "1.7.0" + ASWF_CCACHE_VERSION: "4.9.1" + ASWF_CMAKE_VERSION: "3.31.11" + ASWF_NINJA_VERSION: "1.13.2" + ASWF_SONAR_VERSION: "8.1.0.6389" + ASWF_OPENSSL_VERSION: "1.1.1k" + ASWF_GNUTLS_VERSION: "3.6.16" + ASWF_YQ_VERSION: "4.45.2" + ASWF_BASEOS_DISTRO: "rockylinux8" + ASWF_BASEOS_IMAGE: "nvidia/cuda" + # Clang version used by images not built for every clang version + ASWF_CLANG_MAJOR_VERSION: "16" # Conan wrapper packages for system components ASWF_BROTLI_VERSION: "system" ASWF_DBUS_VERSION: "system" @@ -731,6 +278,7 @@ versions: ASWF_OPENCL_HEADERS_VERSION: "system" ASWF_OPENCL_ICD_LOADER_VERSION: "system" ASWF_OPENGL_VERSION: "system" + ASWF_GLU_VERSION: "system" ASWF_OPENJPEG_VERSION: "2.4.0" ASWF_OPUS_VERSION: "system" ASWF_PCRE2_VERSION: "system" @@ -820,7 +368,6 @@ versions: ASWF_QT_VERSION: "6.5.6" ASWF_ONETBB_VERSION: "2020.3" ASWF_VFXPLATFORM_VERSION: "2024" - ASWF_CXX_STANDARD: "17" # ASWF packages ASWF_IMATH_VERSION: "3.1.12" ASWF_MATERIALX_VERSION: "1.39.1" @@ -839,22 +386,37 @@ versions: ASWF_OPENTIMELINEIO_VERSION: "0.17.0" ASWF_RAWTOACES_VERSION: "2.1.1" ASWF_REZ_VERSION: "3.4.0" - "2024-clang16": - parent_versions: ["4", "4-clang16", "2024"] - major_version: "2024" - ci_common_version: "4" - "2024-clang17": - parent_versions: ["4", "4-clang17", "2024"] - major_version: "2024" - use_major_version_as_tag: true - ci_common_version: "4" "2025": - parent_versions: ["5", "5-clang18"] major_version: "2025" - ci_common_version: "5" + minor_version: "11" + legacy_common_version: "5" conan_profile: "vfx2025" generate_profile: true + clang_versions: + "18": "18.1.8" + "19": "19.1.7" package_versions: + # Toolchain + ASWF_DTS_VERSION: "11" + ASWF_DTS_PREFIX: "gcc-toolset" + ASWF_GCC_VERSION: "11.2" + ASWF_CXX_STANDARD: "17" + ASWF_CONAN_VERSION: "2.29.0" + ASWF_CONAN_PYTHON_VERSION: "3.11.17" + ASWF_CUDA_VERSION: "12.6.3" + ASWF_OPTIX_VERSION: "8.0.0" + ASWF_GLVND_VERSION: "1.7.0" + ASWF_CCACHE_VERSION: "4.9.1" + ASWF_CMAKE_VERSION: "3.31.11" + ASWF_OPENSSL_VERSION: "1.1.1k" + ASWF_GNUTLS_VERSION: "3.6.16" + ASWF_NINJA_VERSION: "1.13.2" + ASWF_SONAR_VERSION: "8.1.0.6389" + ASWF_YQ_VERSION: "4.45.2" + ASWF_BASEOS_DISTRO: "rockylinux8" + ASWF_BASEOS_IMAGE: "nvidia/cuda" + # Clang version used by images not built for every clang version + ASWF_CLANG_MAJOR_VERSION: "18" # Conan wrapper packages for system components ASWF_BROTLI_VERSION: "system" ASWF_DBUS_VERSION: "system" @@ -886,6 +448,7 @@ versions: ASWF_OPENCL_HEADERS_VERSION: "system" ASWF_OPENCL_ICD_LOADER_VERSION: "system" ASWF_OPENGL_VERSION: "system" + ASWF_GLU_VERSION: "system" ASWF_OPENJPEG_VERSION: "2.4.0" ASWF_OPUS_VERSION: "system" ASWF_PCRE2_VERSION: "system" @@ -975,7 +538,6 @@ versions: ASWF_PYTHON_MAJOR_MINOR_VERSION: "3.11" ASWF_QT_VERSION: "6.5.6" ASWF_VFXPLATFORM_VERSION: "2025" - ASWF_CXX_STANDARD: "17" # ASWF packages ASWF_IMATH_VERSION: "3.1.12" ASWF_MATERIALX_VERSION: "1.39.3" @@ -994,23 +556,37 @@ versions: ASWF_OPENTIMELINEIO_VERSION: "0.17.0" ASWF_RAWTOACES_VERSION: "2.1.1" ASWF_REZ_VERSION: "3.4.0" - "2025-clang18": - parent_versions: ["5", "5-clang18", "2025"] - major_version: "2025" - ci_common_version: "5" - "2025-clang19": - parent_versions: ["5", "5-clang19", "2025"] - major_version: "2025" - use_major_version_as_tag: true - ci_common_version: "5" "2026": - parent_versions: ["6", "6-clang19"] major_version: "2026" - tags: ["latest"] - ci_common_version: "6" + minor_version: "9" + legacy_common_version: "6" conan_profile: "vfx2026" generate_profile: true + clang_versions: + "19": "19.1.7" + "20": "20.1.7" package_versions: + # Toolchain + ASWF_DTS_VERSION: "14" + ASWF_DTS_PREFIX: "gcc-toolset" + ASWF_GCC_VERSION: "14.2" + ASWF_CXX_STANDARD: "20" + ASWF_CONAN_VERSION: "2.29.0" + ASWF_CONAN_PYTHON_VERSION: "3.13.17" + ASWF_CUDA_VERSION: "12.9.2" + ASWF_OPTIX_VERSION: "8.0.0" + ASWF_GLVND_VERSION: "1.7.0" + ASWF_CCACHE_VERSION: "4.13.6" + ASWF_CMAKE_VERSION: "4.0.6" + ASWF_OPENSSL_VERSION: "1.1.1k" + ASWF_GNUTLS_VERSION: "3.6.16" + ASWF_NINJA_VERSION: "1.13.2" + ASWF_SONAR_VERSION: "8.1.0.6389" + ASWF_YQ_VERSION: "4.45.4" + ASWF_BASEOS_DISTRO: "rockylinux8" + ASWF_BASEOS_IMAGE: "nvidia/cuda" + # Clang version used by images not built for every clang version + ASWF_CLANG_MAJOR_VERSION: "19" # Conan wrapper packages for system components ASWF_BROTLI_VERSION: "system" ASWF_DBUS_VERSION: "system" @@ -1042,6 +618,7 @@ versions: ASWF_OPENCL_HEADERS_VERSION: "system" ASWF_OPENCL_ICD_LOADER_VERSION: "system" ASWF_OPENGL_VERSION: "system" + ASWF_GLU_VERSION: "system" ASWF_OPENJPEG_VERSION: "2.4.0" ASWF_OPUS_VERSION: "system" ASWF_PCRE2_VERSION: "system" @@ -1131,7 +708,6 @@ versions: ASWF_PYTHON_MAJOR_MINOR_VERSION: "3.13" ASWF_QT_VERSION: "6.8.3" ASWF_VFXPLATFORM_VERSION: "2026" - ASWF_CXX_STANDARD: "20" # ASWF packages ASWF_IMATH_VERSION: "3.2.3" ASWF_MATERIALX_VERSION: "1.39.4" @@ -1150,24 +726,38 @@ versions: ASWF_OPENTIMELINEIO_VERSION: "0.18.1" ASWF_RAWTOACES_VERSION: "2.2.2" ASWF_REZ_VERSION: "3.4.0" - "2026-clang19": - parent_versions: ["6", "6-clang19", "2026"] - major_version: "2026" - ci_common_version: "6" - "2026-clang20": - parent_versions: ["6", "6-clang20", "2026"] - major_version: "2026" - tags: ["latest"] - use_major_version_as_tag: true - ci_common_version: "6" "2027": - parent_versions: ["7", "7-clang21"] major_version: "2027" - tags: ["draft"] - ci_common_version: "7" + minor_version: "4" + legacy_common_version: "7" + tags: ["latest"] conan_profile: "vfx2027" generate_profile: true + clang_versions: + "21": "21.1.8" + "22": "22.1.7" package_versions: + # Toolchain + ASWF_DTS_VERSION: "14" + ASWF_DTS_PREFIX: "gcc-toolset" + ASWF_GCC_VERSION: "14.2" + ASWF_CXX_STANDARD: "20" + ASWF_CONAN_VERSION: "2.29.0" + ASWF_CONAN_PYTHON_VERSION: "3.13.17" + ASWF_CUDA_VERSION: "13.1.2" + ASWF_OPTIX_VERSION: "9.1.0" + ASWF_GLVND_VERSION: "1.7.0" + ASWF_CCACHE_VERSION: "4.13.6" + ASWF_CMAKE_VERSION: "4.3.3" + ASWF_OPENSSL_VERSION: "3.5.9" + ASWF_GNUTLS_VERSION: "3.8.10" + ASWF_NINJA_VERSION: "1.13.2" + ASWF_SONAR_VERSION: "8.1.0.6389" + ASWF_YQ_VERSION: "4.53.3" + ASWF_BASEOS_DISTRO: "rockylinux9" + ASWF_BASEOS_IMAGE: "nvidia/cuda" + # Clang version used by images not built for every clang version + ASWF_CLANG_MAJOR_VERSION: "21" # Conan wrapper packages for system components ASWF_BROTLI_VERSION: "system" ASWF_DBUS_VERSION: "system" @@ -1199,6 +789,7 @@ versions: ASWF_OPENCL_HEADERS_VERSION: "system" ASWF_OPENCL_ICD_LOADER_VERSION: "system" ASWF_OPENGL_VERSION: "system" + ASWF_GLU_VERSION: "system" ASWF_OPENJPEG_VERSION: "2.4.0" ASWF_OPUS_VERSION: "system" ASWF_PCRE2_VERSION: "system" @@ -1288,7 +879,6 @@ versions: ASWF_PYTHON_MAJOR_MINOR_VERSION: "3.13" ASWF_QT_VERSION: "6.8.3" ASWF_VFXPLATFORM_VERSION: "2027" - ASWF_CXX_STANDARD: "20" # ASWF packages ASWF_IMATH_VERSION: "3.2.3" ASWF_MATERIALX_VERSION: "1.39.5" @@ -1307,1132 +897,52 @@ versions: ASWF_OPENTIMELINEIO_VERSION: "0.18.1" ASWF_RAWTOACES_VERSION: "2.2.2" ASWF_REZ_VERSION: "3.4.0" - "2027-clang21": - parent_versions: ["7", "7-clang21", "2027"] - major_version: "2027" - ci_common_version: "7" - "2027-clang22": - parent_versions: ["7", "7-clang22", "2027"] - major_version: "2027" - tags: ["draft"] - use_major_version_as_tag: true - ci_common_version: "7" -ci-packages: +# Conan packages built once for every clang version in a year's +# clang_versions (as version "-clang"), rather than once per +# year. Every other package is built for each year that pins its version. +per_clang_packages: + - clang - clang: - - "1-clang6.2" - - "1-clang7.2" - - "1-clang8.2" - - "1-clang9.2" - - "1-clang10.2" - - "2-clang10.3" - - "2-clang11.4" - - "2-clang12.1" - - "2-clang13.1" - - "2-clang14.0" - - "3-clang14.7" - - "3-clang15.7" - - "4-clang16.11" - - "4-clang17.11" - - "5-clang18.10" - - "5-clang19.10" - - "6-clang19.8" - - "6-clang20.8" - - "7-clang21.3" - - "7-clang22.3" - ninja: - - "1.3" - - "2.2" - - "3.7" - - "4.11" - - "5.10" - - "6.8" - - "7.3" - cmake: - - "1.3" - - "2.2" - - "3.7" - - "4.11" - - "5.10" - - "6.8" - - "7.3" - openssl: - - "3.7" - - "4.11" - - "5.10" - - "6.8" - - "7.3" - gnutls: - - "3.7" - - "4.11" - - "5.10" - - "6.8" - - "7.3" - cpython: - - "2019.2" - - "2020.2" - - "2021.2" - - "2022.3" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - pybind11: - - "2019.0" - - "2020.0" - - "2021.0" - - "2022.3" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - b2: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libbacktrace: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - boost: - - "2019.2" - - "2020.2" - - "2021.2" - - "2022.2" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - cppunit: - - "2019.2" - - "2020.2" - - "2021.1" - - "2022.1" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - glew: - - "2019.2" - - "2020.2" - - "2021.2" - - "2022.1" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - glfw: - - "2019.2" - - "2020.2" - - "2021.2" - - "2022.1" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - log4cplus: - - "2019.2" - - "2020.2" - - "2021.1" - - "2022.1" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - embree: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - ispc: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - jsoncpp: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libcgroup: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libmicrohttpd: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - lua: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - openimagedenoise: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - random123: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - moonray: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - gtest: - - "2019.0" - - "2020.0" - - "2021.0" - - "2022.1" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - qt: - - "2019.2" - - "2020.2" - - "2021.2" - - "2022.0" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - pyside: - - "2019.2" - - "2020.2" - - "2021.2" - - "2022.1" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - c-blosc: - - "2019.2" - - "2020.2" - - "2021.1" - - "2022.2" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - imath: - - "2019.0" - - "2020.0" - - "2021.0" - - "2022.2" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - opencue: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - openexr: - - "2019.2" - - "2020.2" - - "2021.3" - - "2022.3" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - openfx: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - alembic: - - "2019.2" - - "2020.2" - - "2021.2" - - "2022.2" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - opencolorio: - - "2019.2" - - "2020.2" - - "2021.4" - - "2022.2" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - openimageio: - - "2019.2" - - "2020.2" - - "2021.4" - - "2022.4" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - opensubdiv: - - "2019.2" - - "2020.2" - - "2021.2" - - "2022.2" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - ptex: - - "2019.2" - - "2020.2" - - "2021.1" - - "2022.2" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - openrv: - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - openusd: - - "2019.3" - - "2020.2" - - "2021.5" - - "2022.4" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - openvdb: - - "2019.2" - - "2020.2" - - "2021.3" - - "2022.4" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - partio: - - "2019.1" - - "2020.1" - - "2021.2" - - "2022.2" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - osl: - - "2019.1" - - "2020.1" - - "2021.3" - - "2022.4" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - opentimelineio: - - "2019.1" - - "2020.1" - - "2021.3" - - "2022.4" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - rawtoaces: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - materialx: - - "2019.0" - - "2020.0" - - "2021.0" - - "2022.1" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - expat: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - md4c: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - mesa: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - meson: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - brotli: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - cimg: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - dbus: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - double-conversion: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - aces_container: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - bzip2: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - ceres-solver: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - eigen: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - fmt: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - fontconfig: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - freetype: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - gdbm: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - giflib: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - glib: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - harfbuzz: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - hdf5: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - highway: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - icu: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - jasper: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - lcms: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - lensfun: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libalsa: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libaom-av1: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libdeflate: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libdrm: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libffi: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libiconv: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libjpeg-turbo: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libjxl: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libmp3lame: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libpng: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libraw: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libsndfile: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libsquish: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libsvtav1: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libtiff: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libultrahdr: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libvpx: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libwebp: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libxcrypt: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - libxshmfence: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - lz4: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - minizip-ng: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - mpdecimal: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - mpg123: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - nanobind: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - nasm: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - nlohmann_json: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - nspr: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - nss: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - ogg: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - onetbb: - - "2019.2" - - "2020.2" - - "2021.2" - - "2022.1" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - openal-soft: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - opencl-headers: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - opencl-icd-loader: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - opengl: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - openjpeg: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - openjph: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - opus: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - pcre2: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - pugixml: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - pulseaudio: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - pystring: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - rapidjson: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - snappy: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - spdlog: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - sqlite3: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - tcl: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - tk: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - tsl-robin-map: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - util-linux-libuuid: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - vorbis: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - vulkan-headers: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - vulkan-loader: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - xkbcommon: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - xorg: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - xorg-proto: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - xz_utils: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - yaml-cpp: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - zlib: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - zstd: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" +# Every CI image, built for each year as version ".", or with +# per_clang: true, for each of the year's clang_versions as +# "-clang.". exclude_versions lists years an image isn't +# built for. ci-images: - baseos-gl-conan: - - "3.7" - - "4.11" - - "5.10" - - "6.8" - - "7.3" + baseos-gl-conan: {} common: - - "1-clang6.8" - - "1-clang7.8" - - "1-clang8.8" - - "1-clang9.8" - - "1-clang10.8" - - "2-clang10.5" - - "2-clang11.6" - - "2-clang12.1" - - "2-clang13.1" - - "2-clang14.0" - - "3-clang14.7" - - "3-clang15.7" - - "4-clang16.11" - - "4-clang17.11" - - "5-clang18.10" - - "5-clang19.10" - - "6-clang19.8" - - "6-clang20.8" - - "7-clang21.3" - - "7-clang22.3" - base: - - "2019.9" - - "2020.9" - - "2021.6" - - "2022.4" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - baseqt: - - "2019.2" - - "2020.2" - - "2021.3" - - "2022.4" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - imath: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - openexr: - - "2019.8" - - "2020.8" - - "2021.5" - - "2022.3" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - openfx: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - ocio: - - "2019.9" - - "2020.8" - - "2021.6" - - "2022.4" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - oiio: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - opencue: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - rez: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - rawtoaces: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - usd: - - "2019.9" - - "2020.8" - - "2021.6" - - "2022.4" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - otio: - - "2019.3" - - "2020.3" - - "2021.5" - - "2022.3" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" - materialx: - - "2022.1" - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" + per_clang: true + base: {} + baseqt: {} + imath: {} + openexr: {} + openfx: {} + ocio: {} + oiio: {} + opencue: {} + rez: {} + rawtoaces: {} + usd: {} + otio: {} + materialx: {} openrv: - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" + exclude_versions: ["2023"] osl: - - "2019-clang6.5" - - "2019-clang7.5" - - "2019-clang8.5" - - "2019-clang9.5" - - "2019-clang10.5" - - "2020-clang7.5" - - "2021-clang10.7" - - "2021-clang11.7" - - "2022-clang10.11" - - "2022-clang11.11" - - "2022-clang12.2" - - "2022-clang13.2" - - "2022-clang14.1" - - "2023-clang14.7" - - "2023-clang15.7" - - "2024-clang16.11" - - "2024-clang17.11" - - "2025-clang18.10" - - "2025-clang19.10" - - "2026-clang19.8" - - "2026-clang20.8" - - "2027-clang21.3" - - "2027-clang22.3" + per_clang: true openvdb: - - "2019-clang6.8" - - "2019-clang7.8" - - "2019-clang8.8" - - "2019-clang9.8" - - "2020-clang7.8" - - "2021-clang10.6" - - "2022-clang10.12" - - "2022-clang11.12" - - "2022-clang12.3" - - "2022-clang13.3" - - "2022-clang14.2" - - "2023-clang14.7" - - "2023-clang15.7" - - "2024-clang16.11" - - "2024-clang17.11" - - "2025-clang18.10" - - "2025-clang19.10" - - "2026-clang19.8" - - "2026-clang20.8" - - "2027-clang21.3" - - "2027-clang22.3" + per_clang: true vfxall: - - "2019-clang6.12" - - "2019-clang7.12" - - "2019-clang8.12" - - "2019-clang9.12" - - "2020-clang7.10" - - "2021-clang10.7" - - "2022-clang10.13" - - "2022-clang11.13" - - "2022-clang12.4" - - "2022-clang13.4" - - "2022-clang14.3" - - "2023-clang14.7" - - "2023-clang15.7" - - "2024-clang16.11" - - "2024-clang17.11" - - "2025-clang18.10" - - "2025-clang19.10" - - "2026-clang19.8" - - "2026-clang20.8" - - "2027-clang21.3" - - "2027-clang22.3" - moonray: - - "2023.7" - - "2024.11" - - "2025.10" - - "2026.8" - - "2027.3" + per_clang: true + moonray: {} groups: package: - common-wrappers: + common: - openssl - gnutls - common-1: - cmake - ninja - common-2: - clang - base1-wrappers: + base1: - brotli - gdbm - icu @@ -2453,7 +963,6 @@ groups: - xorg - xorg-proto - xz_utils - base1-1: - b2 - bzip2 - cppunit @@ -2482,7 +991,6 @@ groups: - yaml-cpp - zlib - zstd - base1-2: - c-blosc - ceres-solver - cpython @@ -2491,12 +999,10 @@ groups: - libmicrohttpd - log4cplus - minizip-ng - base1-3: - boost - mesa - nanobind - pybind11 - base2-wrappers: - dbus - double-conversion - fontconfig @@ -2508,22 +1014,22 @@ groups: - nss - openal-soft - opengl + - glu - openjpeg - opus - pulseaudio - xkbcommon - base2-1: - glew - glfw - harfbuzz - libjpeg-turbo - libwebp - md4c - base2-2: + base2: - qt base3: - pyside - vfx1-wrappers: + vfx: - giflib - libaom-av1 - libmp3lame @@ -2533,7 +1039,6 @@ groups: - mpg123 - ogg - vorbis - vfx1-1: - aces_container - cimg - embree @@ -2550,29 +1055,21 @@ groups: - partio - ptex - spdlog - vfx1-2: - - libjxl - - libraw - - opencue - - openexr - - openfx - - opentimelineio - vfx1-3: + - libjxl + - libraw + - opencue + - openexr + - openfx + - opentimelineio - alembic - opencolorio - openvdb - vfx1-4: - openimageio - vfx1-5: - osl - rawtoaces - materialx - vfx1-6: - openusd - vfx1-7: - moonray - review: - - openrv image: baseos-gl-conan: - baseos-gl-conan @@ -2581,13 +1078,12 @@ groups: base: - base - baseqt - vfx1: + vfx: - imath - opencue - openexr - openfx - rez - vfx2: - ocio - oiio - otio @@ -2595,7 +1091,6 @@ groups: - usd - moonray - rawtoaces - vfx3: - osl - openvdb - vfxall diff --git a/python/aswfdocker/dockergen.py b/python/aswfdocker/dockergen.py index b019a7e9d..a9785bef9 100644 --- a/python/aswfdocker/dockergen.py +++ b/python/aswfdocker/dockergen.py @@ -20,19 +20,11 @@ def conan_profile_version_keys(idx: index.Index) -> typing.List[str]: """Return version keys for which Conan profiles should be generated. Scans versions.yaml for entries marked ``generate_profile: true`` (the - VFX Platform year entries) and collects their ``ci_common_version`` values - so the matching ci_common profiles are generated automatically. Adding a - new VFX Platform year to versions.yaml with ``generate_profile: true`` - is all that is needed — no code change required. + VFX Platform year entries). Adding a new VFX Platform year to + versions.yaml with ``generate_profile: true`` is all that is needed — no + code change required. """ - ci_common_keys: typing.Set[str] = set() - vfx_keys: typing.List[str] = [] - for vi in idx.iter_version_info(): - if vi.generate_profile: - vfx_keys.append(vi.version) - if vi.ci_common_version: - ci_common_keys.add(vi.ci_common_version) - return sorted(ci_common_keys) + sorted(vfx_keys) + return sorted(vi.version for vi in idx.iter_version_info() if vi.generate_profile) class ConanProfileGen: @@ -70,30 +62,18 @@ def __init__(self, version_key: str): def _template_context(self) -> typing.Dict[str, typing.Any]: # Resolve OS-distro–specific package versions (bison, flex, etc.) from - # the ASWF_BASEOS_DISTRO value inherited by this version entry. For - # vfx year entries the value is inherited from the ci_common parent - # (e.g. "6" carries ASWF_BASEOS_DISTRO: "rockylinux8"). The distro - # entry in versions.yaml is keyed by that distro name. + # the ASWF_BASEOS_DISTRO value of this version entry (e.g. "2027" + # carries ASWF_BASEOS_DISTRO: "rockylinux9"). The distro entry in + # versions.yaml is keyed by that distro name. baseos_distro = self.version_info.all_package_versions.get("ASWF_BASEOS_DISTRO") distro_versions: typing.Dict[str, str] = {} if baseos_distro: distro_versions = self._idx.version_info(baseos_distro).package_versions - ci_common_version = self.version_info.ci_common_version - clang_versions: typing.Dict[str, str] = {} - if ci_common_version: - prefix = f"{ci_common_version}-clang" - for vi in self._idx.iter_version_info(): - if vi.version.startswith(prefix): - major = vi.package_versions.get("ASWF_CLANG_MAJOR_VERSION") - full = vi.package_versions.get("ASWF_CLANG_VERSION") - if major and full: - clang_versions[major] = full return { "versions": self.version_info.all_package_versions, "distro_versions": distro_versions, - "conan_profile": self.version_info.conan_profile, - "ci_common_version": ci_common_version, - "clang_versions": clang_versions, + "conan_channel": self.version_info.conan_channel, + "clang_versions": self.version_info.clang_versions, } def _output_path(self) -> str: @@ -103,13 +83,8 @@ def _output_path(self) -> str: self.version_info.conan_profile, ) - def _template_name(self) -> str: - if self.version_info.conan_profile.startswith("ci_common"): - return "conan-profile-ci-common.jinja2" - return "conan-profile-vfx.jinja2" - def _render(self) -> typing.Tuple[str, str]: - tmpl = self._env.get_template(self._template_name()) + tmpl = self._env.get_template("conan-profile-vfx.jinja2") return self._output_path(), tmpl.render(self._template_context()) def generate(self) -> str: diff --git a/python/aswfdocker/groupinfo.py b/python/aswfdocker/groupinfo.py index 2e4057980..6bb77b67e 100644 --- a/python/aswfdocker/groupinfo.py +++ b/python/aswfdocker/groupinfo.py @@ -50,6 +50,16 @@ def __init__( self.targets, ) + def _selects(self, version: str) -> bool: + """Whether the requested versions select `version`: by its major + version (e.g. "2027-clang22" selects 2027-clang22.3), or by its + year, so that "2027" selects every 2027 clang variant too.""" + major_version = utils.get_major_version(version) + return ( + major_version in self.versions + or major_version.split("-")[0] in self.versions + ) + def iter_images_versions(self, get_image=False): for image in self.images: if self.targets and image not in self.targets: @@ -57,16 +67,14 @@ def iter_images_versions(self, get_image=False): continue ci_image = utils.get_image_name(self.type, image) all_versions = list(self.index.iter_versions(self.type, image)) - major_versions = [utils.get_major_version(v) for v in all_versions] logger.debug( "iter image=%s ci_image=%s all_versions=%s", image, ci_image, all_versions, ) - for version in [v for v in self.versions if v in major_versions]: + for version in filter(self._selects, all_versions): logger.debug("iter version=%s", version) - version = all_versions[major_versions.index(version)] if get_image: yield image, version else: diff --git a/python/aswfdocker/index.py b/python/aswfdocker/index.py index 34ee01e68..4f5e1a225 100644 --- a/python/aswfdocker/index.py +++ b/python/aswfdocker/index.py @@ -5,10 +5,11 @@ """ import logging +import typing import yaml import importlib_resources -from aswfdocker import constants, versioninfo +from aswfdocker import constants, utils, versioninfo logger = logging.getLogger(__name__) @@ -30,36 +31,39 @@ def __init__(self): constants.ImageType.IMAGE: self._versions["groups"]["image"], constants.ImageType.PACKAGE: self._versions["groups"]["package"], } - self._version_infos = {} + self.per_clang_packages = set(self._versions.get("per_clang_packages", [])) + self._version_infos: typing.Dict[str, versioninfo.VersionInfo] = {} for version, v in self._versions["versions"].items(): + if v.get("major_version") and not v.get("minor_version"): + raise RuntimeError(f"Version {version} has no minor_version") vi = versioninfo.VersionInfo( version=version, major_version=v.get("major_version"), + minor_version=v.get("minor_version"), tags=v.get("tags", []), - ci_common_version=v.get("ci_common_version"), - package_versions=v.get("package_versions", {}), - parent_versions=v.get("parent_versions", []), - use_major_version_as_tag=v.get("use_major_version_as_tag", False), + legacy_common_version=v.get("legacy_common_version"), + package_versions=dict(v.get("package_versions", {})), + parent_versions=[], + use_major_version_as_tag=False, ) vi.conan_profile = v.get("conan_profile") vi.generate_profile = v.get("generate_profile", False) + vi.clang_versions = v.get("clang_versions", {}) self._version_infos[version] = vi + self._add_clang_versions(vi) for vi in self._version_infos.values(): - vi.all_package_versions = vi.package_versions.copy() for parent in vi.parent_versions: vi.all_package_versions.update( self._version_infos[parent].package_versions ) - if not vi.conan_profile: - vi.conan_profile = self._version_infos[parent].conan_profile + vi.all_package_versions.update(vi.package_versions) # OS-distro package_versions (bison/flex/..., and system # clang/OSMesa versions) live in a side entry keyed by - # ASWF_BASEOS_DISTRO (e.g. "rockylinux8") rather than in the normal - # parent_versions chain, since they're inherited by distro rather - # than by package lineage. Fill in any that aren't already set - # (directly or via parent_versions), without overriding anything - # more specific. + # ASWF_BASEOS_DISTRO (e.g. "rockylinux8") rather than in a + # year's own package_versions, since they're inherited by distro. + # Fill in any that aren't already set, without overriding + # anything more specific. baseos_distro = vi.all_package_versions.get("ASWF_BASEOS_DISTRO") if baseos_distro and baseos_distro in self._version_infos: for key, value in self._version_infos[ @@ -67,22 +71,86 @@ def __init__(self): ].package_versions.items(): vi.all_package_versions.setdefault(key, value) - def _get_key(self, image_type: constants.ImageType): - if image_type == constants.ImageType.PACKAGE: - return "ci-packages" - return "ci-images" + def _add_clang_versions(self, year: versioninfo.VersionInfo) -> None: + """Derives a "-clang" version from each of a year's + clang_versions, and pins the year's own default clang version.""" + if not year.clang_versions: + return + default = year.package_versions.get("ASWF_CLANG_MAJOR_VERSION") + if default not in year.clang_versions: + raise RuntimeError( + f"Version {year.version}: ASWF_CLANG_MAJOR_VERSION {default} " + f"is not one of its clang_versions {list(year.clang_versions)}" + ) + year.package_versions["ASWF_CLANG_VERSION"] = year.clang_versions[default] + majors = list(year.clang_versions) + for major in majors: + # Only the newest clang version gets the bare year (and the + # year's extra tags like "latest"), so that tag is unambiguous. + newest = major == majors[-1] + vi = versioninfo.VersionInfo( + version=f"{year.version}-clang{major}", + major_version=year.major_version, + minor_version=year.minor_version, + tags=year.tags if newest else [], + legacy_common_version=year.legacy_common_version, + package_versions={ + "ASWF_CLANG_MAJOR_VERSION": major, + "ASWF_CLANG_VERSION": year.clang_versions[major], + }, + parent_versions=[year.version], + use_major_version_as_tag=newest, + ) + vi.conan_profile = year.conan_profile + vi.clang_major_version = major + self._version_infos[vi.version] = vi def iter_images(self, image_type: constants.ImageType): """ - Iterates over all images by image type. + Iterates over all images (or Conan packages) by image type. """ - yield from self._versions[self._get_key(image_type)] + if image_type == constants.ImageType.PACKAGE: + for packages in self.groups[image_type].values(): + yield from packages + else: + yield from self._versions["ci-images"] def iter_versions(self, image_type: constants.ImageType, name: str): """ - Iterates over all versions by image type and image name. + Iterates over all versions by image type and image name. An image + is built for every year's current release (see ci-images in + versions.yaml), e.g. "2027.4", or "2027-clang22.4" for each of the + year's clang versions. A Conan package is built for every year that + pins its version, or for each of those years' clang versions if it's + one of per_clang_packages. """ - yield from self._versions[self._get_key(image_type)][name] + if image_type == constants.ImageType.IMAGE: + image = self._versions["ci-images"][name] or {} + excluded = image.get("exclude_versions", []) + for year in self.iter_years(): + if year.version in excluded: + continue + if image.get("per_clang"): + for major in year.clang_versions: + yield f"{year.version}-clang{major}.{year.minor_version}" + else: + yield f"{year.version}.{year.minor_version}" + return + key = utils.package_version_key(name) + for year in self.iter_years(): + if key not in year.all_package_versions: + continue + if name in self.per_clang_packages: + for major in year.clang_versions: + yield f"{year.version}-clang{major}" + else: + yield year.version + + def iter_years(self): + """VFX Platform year versions, e.g. "2027" but not "2027-clang22".""" + for vi in self._version_infos.values(): + if vi.major_version and vi.clang_major_version is None: + yield vi def iter_version_info(self): return self._version_infos.values() diff --git a/python/aswfdocker/releaser.py b/python/aswfdocker/releaser.py index cb90f747c..de3d9b995 100644 --- a/python/aswfdocker/releaser.py +++ b/python/aswfdocker/releaser.py @@ -1,67 +1,366 @@ # Copyright (c) Contributors to the aswf-docker Project. All rights reserved. # SPDX-License-Identifier: Apache-2.0 import logging +import os +import subprocess import typing -from datetime import datetime, timezone -from github import Github, InputGitAuthor, GithubException, Auth +from github import Github, GithubException, Auth +from github.GitRelease import GitRelease from aswfdocker import settings, constants, aswfinfo, groupinfo logger = logging.getLogger(__name__) +class ImageRelease(typing.NamedTuple): + """The GitHub release recording a released image.""" + + name: str # e.g. aswf/ci-base:2027.4 + message: str + prerelease: bool + + @property + def tag(self) -> str: + """The release's git tag, e.g. aswf/ci-base/2027.4 (tags can't hold + colons).""" + return self.name.replace(":", "/") + + @property + def image(self) -> str: + """The released image, e.g. docker.io/aswf/ci-base:2027.4.""" + return f"{constants.DOCKER_REGISTRY}/{self.name}" + + @property + def sbom_file(self) -> str: + """The name of the image's SBOM, as attached to the release, e.g. + ci-base-2027.4.cdx.json.""" + return self.name.split("/", 1)[1].replace(":", "-") + ".cdx.json" + + +def export_sboms(releases: typing.Sequence[ImageRelease], output_dir: str) -> None: + """Copies the SBOM of each released image (see constants.IMAGE_SBOM_PATH) + out of the image, as built in the local Docker image store, to + `output_dir`/`release.sbom_file`.""" + os.makedirs(output_dir, exist_ok=True) + for release in releases: + # The image is never pulled: the SBOM must be the one of the image + # just built. The container is never started, so its command + # doesn't matter (but images without one need one). + container = subprocess.run( + ["docker", "create", "--pull", "never", release.image, "true"], + check=True, + stdout=subprocess.PIPE, + text=True, + ).stdout.strip() + try: + path = os.path.join(output_dir, release.sbom_file) + subprocess.run( + ["docker", "cp", f"{container}:{constants.IMAGE_SBOM_PATH}", path], + check=True, + ) + logger.info("Exported the SBOM of %s to %s", release.image, path) + finally: + subprocess.run( + ["docker", "rm", container], check=True, stdout=subprocess.DEVNULL + ) + + +def image_releases( + build_info: aswfinfo.ASWFInfo, group_info: groupinfo.GroupInfo, message: str +) -> typing.List[ImageRelease]: + """The GitHub releases recording the images of `group_info`.""" + prerelease = build_info.docker_org == constants.TESTING_DOCKER_ORG + start_message = f"{message}\n\n" if message else "" + return [ + ImageRelease( + name=f"{build_info.docker_org}/{image}:{version}", + message=f"{start_message}Inspect released Docker image here: " + f"https://hub.docker.com/r/{build_info.docker_org}/{image}/tags?name={version}", + prerelease=prerelease, + ) + for image, version in group_info.iter_images_versions() + ] + + +def attach_asset(release: GitRelease, path: str, name: str) -> None: + """Attaches the file at `path` to the (draft) `release` as `name`, + replacing any asset of that name (e.g. when the job publishing the + releases is re-run).""" + for asset in release.get_assets(): + if asset.name == name: + asset.delete_asset() + logger.warning("Asset %s of %s replaced", name, release.title) + release.upload_asset(path, name=name, content_type="application/vnd.cyclonedx+json") + logger.info("Attached %s to %s.", name, release.title) + + class GitHub: - def __init__(self, github_org: str): - s = settings.Settings() - if s.github_access_token: - auth = Auth.Token(s.github_access_token) - self.github = Github(auth=auth) + """The aswf-docker repository on GitHub (by default the main ASWF one, or + the one of another `github_org`, or `repository`), accessed with + `token`, by default the one saved by `aswfdocker settings`.""" + + def __init__(self, github_org: str = "", token: str = "", repository: str = ""): + if not token: + token = settings.Settings().github_access_token + if token: + self.github = Github(auth=Auth.Token(token), per_page=100) else: - self.github = Github() - if not github_org: - github_org = constants.MAIN_GITHUB_ASWF_ORG - self.repo = self.github.get_repo( - f"{github_org}/{constants.MAIN_GITHUB_REPO_NAME}" + self.github = Github(per_page=100) + if not repository: + if not github_org: + github_org = constants.MAIN_GITHUB_ASWF_ORG + repository = f"{github_org}/{constants.MAIN_GITHUB_REPO_NAME}" + self.repo = self.github.get_repo(repository) + + def draft_releases(self) -> typing.Dict[str, GitRelease]: + """The repository's draft releases, by tag. Only the release list + has them: they can't be looked up by tag.""" + return {r.tag_name: r for r in self.repo.get_releases() if r.draft} + + def create_draft_release( + self, + sha: str, + release: ImageRelease, + drafts: typing.Dict[str, GitRelease], + ) -> None: + """Creates `release` as a draft on `sha`, replacing any earlier draft + of it. Its tag only gets created when it's published.""" + old = drafts.get(release.tag) + if old: + old.delete_release() + logger.warning("Draft release %s already existed, deleted!", release.name) + self.repo.create_git_release( + tag=release.tag, + name=release.name, + message=release.message, + draft=True, + prerelease=release.prerelease, + target_commitish=sha, ) + logger.info("Draft release %s created.", release.name) - def create_release(self, sha, tag, release_message, prerelease): - logger.debug("GitHub.create_release(tag=%s)", tag) - real_tag = tag.replace(":", "/") + def publish_release( + self, + sha: str, + release: ImageRelease, + drafts: typing.Dict[str, GitRelease], + sbom_path: str = "", + ) -> None: + """Publishes the draft of `release` on `sha`, which creates its tag, + replacing any earlier release (and tag) of it, with the image's SBOM + at `sbom_path` (if given) attached. Without a draft (e.g. when the + release workflow was started from the GitHub Actions tab), one is + created first: a release's assets are attached before it's + published, as GitHub's immutable releases require.""" + draft = drafts.get(release.tag) + if draft and draft.target_commitish != sha: + draft = None try: - release = self.repo.get_release(real_tag) + old = self.repo.get_release(release.tag) except GithubException: - release = None - if release: - release.delete_release() - logger.warning("Release %s already existed, deleted!", real_tag) + old = None + if old and not draft and old.target_commitish == sha: + # e.g. the job publishing the releases was re-run + logger.info("Release %s already published.", release.name) + return + if not draft: + logger.warning("No draft release of %s on %s", release.name, sha) + draft = self.repo.create_git_release( + tag=release.tag, + name=release.name, + message=release.message, + draft=True, + prerelease=release.prerelease, + target_commitish=sha, + ) + logger.info("Draft release %s created.", release.name) + if sbom_path: + # Before the earlier release is deleted, so that it stays if this + # fails. + attach_asset(draft, sbom_path, release.sbom_file) + if old: + old.delete_release() + logger.warning("Release %s already existed, deleted!", release.name) try: - ref = self.repo.get_git_ref(ref="tags/" + real_tag) + ref = self.repo.get_git_ref(ref="tags/" + release.tag) except GithubException: ref = None if ref: ref.delete() - logger.warning("Tag %s already existed, deleted!", real_tag) - release = self.repo.create_git_tag_and_release( - tag=real_tag, - tag_message=tag, - release_name=tag, - release_message=release_message, - object=sha, - type="commit", + logger.warning("Tag %s already existed, deleted!", release.tag) + draft.update_release( + name=draft.title, + message=draft.body, draft=False, - prerelease=prerelease, - tagger=InputGitAuthor( - self.github.get_user().name, - self.github.get_user().email, - datetime.now(timezone.utc).replace(microsecond=0).isoformat(), - ), + prerelease=draft.prerelease, + tag_name=release.tag, + target_commitish=sha, + ) + logger.info("Release %s published.", release.name) + + def commit_exists(self, sha: str) -> bool: + try: + self.repo.get_commit(sha) + except GithubException: + return False + return True + + def dispatch_workflow( + self, workflow: str, ref: str, inputs: typing.Dict[str, str] + ) -> None: + logger.debug("GitHub.dispatch_workflow(%s, ref=%s, %s)", workflow, ref, inputs) + if not self.repo.get_workflow(workflow).create_dispatch(ref=ref, inputs=inputs): + raise RuntimeError(f"Failed to start the {workflow} workflow") + logger.info( + "Started the %s workflow: %s/actions/workflows/%s", + workflow, + self.repo.html_url, + workflow, ) - logger.info("Release %s created.", real_tag) -class Releaser: - """Releaser creates GitHub releases for each Docker image.""" +class ReleasePublisher: + """ReleasePublisher publishes the draft GitHub releases recording the + images released by the release-images.yml GitHub Actions workflow, which + runs it once the images are pushed, with its own GitHub token. The + drafts were created by `aswfdocker release`, with the token of the + person releasing, who the releases are attributed to. With `sbom_dir`, + each release gets its image's SBOM (exported there by export_sboms()) + attached.""" + + def __init__( # pylint: disable=too-many-arguments + self, + build_info: aswfinfo.ASWFInfo, + group_info: groupinfo.GroupInfo, + sha: str, + message="", + token="", + repository="", + sbom_dir="", + ): + self.sha = sha + self.releases = image_releases(build_info, group_info, message) + self.sbom_dir = sbom_dir + self.gh = GitHub(token=token, repository=repository) + + def sbom_paths(self) -> typing.Dict[str, str]: + """The SBOM to attach to each release, by release name. Raises + FileNotFoundError if any is missing, before anything is published.""" + if not self.sbom_dir: + return {} + paths = { + r.name: os.path.join(self.sbom_dir, r.sbom_file) for r in self.releases + } + missing = [p for p in paths.values() if not os.path.isfile(p)] + if missing: + raise FileNotFoundError(f"Missing image SBOMs: {', '.join(missing)}") + return paths + + def publish(self): + sbom_paths = self.sbom_paths() + drafts = self.gh.draft_releases() + for release in self.releases: + self.gh.publish_release( + self.sha, release, drafts, sbom_paths.get(release.name, "") + ) + + +class WorkflowReleaser: + """WorkflowReleaser has a release GitHub Actions workflow build and + publish from a given commit, as only GitHub Actions holds the Artifactory + and Docker Hub credentials (and, in future, the signing keys).""" + + workflow = "" + + def __init__(self, sha: str, github_org="", workflow_ref=""): + self.sha = sha + self.gh = GitHub(github_org) + # The workflow definition comes from this branch (by default the + # repository's default branch), but always builds `sha`. + self.workflow_ref = workflow_ref or self.gh.repo.default_branch + # The image releases to create as drafts (see gather()). + self.releases: typing.List[ImageRelease] = [] + + def inputs(self) -> typing.Dict[str, str]: + """The workflow_dispatch inputs (all strings, as the GitHub API + requires).""" + raise NotImplementedError + + def release(self, dry_run=True): + inputs = self.inputs() + if dry_run: + for release in self.releases: + logger.info("Would create draft GitHub release %s", release.name) + logger.info( + "Would start the %s workflow on %s with inputs: %s", + self.workflow, + self.workflow_ref, + inputs, + ) + return + if not self.gh.commit_exists(self.sha): + raise RuntimeError( + f"Commit {self.sha} not found in {self.gh.repo.full_name}: " + "push it to a branch there before releasing from it" + ) + self.create_draft_releases() + self.gh.dispatch_workflow(self.workflow, self.workflow_ref, inputs) + + def create_draft_releases(self): + """Creates the draft GitHub releases of the images to release, which + the workflow publishes once they're pushed: being created with the + token of the person releasing, they're attributed to them.""" + if not self.releases: + return + drafts = self.gh.draft_releases() + for release in self.releases: + self.gh.create_draft_release(self.sha, release, drafts) + + +class PackageReleaser(WorkflowReleaser): + """PackageReleaser has the release-packages.yml GitHub Actions workflow + build Conan packages from a given commit and upload them to Artifactory. + Unlike image releases, no GitHub release or tag is created.""" + + workflow = constants.PACKAGE_RELEASE_WORKFLOW + + def __init__( # pylint: disable=too-many-arguments + self, + build_info: aswfinfo.ASWFInfo, + group_info: groupinfo.GroupInfo, + sha: str, + github_org="", + workflow_ref="", + force_rebuild=False, + ): + super().__init__(sha, github_org, workflow_ref) + self.build_info = build_info + self.group_info = group_info + self.force_rebuild = force_rebuild + self.release_list: typing.List[str] = [] + + def gather(self): + for image, version in self.group_info.iter_images_versions(): + self.release_list.append(f"{self.build_info.package_org}/{image}:{version}") + + def inputs(self) -> typing.Dict[str, str]: + return { + "sha": self.sha, + "package_org": self.build_info.package_org, + "groups": " ".join(self.group_info.names), + "versions": " ".join(self.group_info.versions), + "targets": " ".join(self.group_info.targets), + "force_rebuild": "true" if self.force_rebuild else "false", + } + + +class ImageReleaser(WorkflowReleaser): + """ImageReleaser has the release-images.yml GitHub Actions workflow build + Docker images from a given commit, push them to Docker Hub and publish + the draft GitHub release recording each of them (see ReleasePublisher).""" + + workflow = constants.IMAGE_RELEASE_WORKFLOW def __init__( # pylint: disable=too-many-arguments self, @@ -69,38 +368,69 @@ def __init__( # pylint: disable=too-many-arguments group_info: groupinfo.GroupInfo, sha: str, github_org="", + workflow_ref="", message="", ): - self.github_org = github_org + super().__init__(sha, github_org, workflow_ref) self.build_info = build_info self.group_info = group_info - self.sha = sha self.message = message - self.gh = GitHub(github_org) - self.release_list: typing.List[typing.Tuple[str]] = [] def gather(self): - for image, version in self.group_info.iter_images_versions(): - tag = f"{self.build_info.docker_org}/{image}:{version}" - self.release_list.append((image, version, tag)) + self.releases = image_releases(self.build_info, self.group_info, self.message) - def release(self, dry_run=True): - logger.debug("Releaser.release(dry_run=%s)", dry_run) - prerelease = self.build_info.docker_org == constants.TESTING_DOCKER_ORG - if self.message: - start_message = f"{self.message}\n\n" - else: - start_message = self.message - for image, version, tag in self.release_list: - message = ( - f"{start_message}Inspect released Docker image here: " - f"https://hub.docker.com/r/{self.build_info.docker_org}/{image}/tags?name={version}" - ) - if dry_run: - logger.info( - "Would create this GitHub release on current commit: %s", tag - ) - else: - self.gh.create_release( - self.sha, tag, release_message=message, prerelease=prerelease - ) + def inputs(self) -> typing.Dict[str, str]: + return { + "sha": self.sha, + "docker_org": self.build_info.docker_org, + "groups": " ".join(self.group_info.names), + "versions": " ".join(self.group_info.versions), + "targets": " ".join(self.group_info.targets), + "message": self.message or "", + } + + +class FullReleaser(WorkflowReleaser): + """FullReleaser has the release-all.yml GitHub Actions workflow release + every Conan package and image of the given years from a given commit, in + dependency order, publishing the draft GitHub release recording each + image (see ReleasePublisher).""" + + workflow = constants.FULL_RELEASE_WORKFLOW + + def __init__( # pylint: disable=too-many-arguments + self, + build_info: aswfinfo.ASWFInfo, + versions: typing.Sequence[str], + sha: str, + github_org="", + workflow_ref="", + force_rebuild=False, + message="", + ): + super().__init__(sha, github_org, workflow_ref) + self.build_info = build_info + self.versions = list(versions) + self.force_rebuild = force_rebuild + self.message = message + + def gather(self): + self.releases = image_releases( + self.build_info, + groupinfo.GroupInfo( + type_=constants.ImageType.IMAGE, + names=list(constants.FULL_RELEASE_IMAGE_GROUPS), + versions=self.versions, + targets=[], + ), + self.message, + ) + + def inputs(self) -> typing.Dict[str, str]: + return { + "sha": self.sha, + "org": self.build_info.docker_org, + "versions": " ".join(self.versions), + "force_rebuild": "true" if self.force_rebuild else "false", + "message": self.message or "", + } diff --git a/python/aswfdocker/tests/test_aswf_deploy.py b/python/aswfdocker/tests/test_aswf_deploy.py index b12a11d52..6d0da9692 100644 --- a/python/aswfdocker/tests/test_aswf_deploy.py +++ b/python/aswfdocker/tests/test_aswf_deploy.py @@ -17,8 +17,10 @@ import importlib.util import io import os +import json import tempfile import unittest +from unittest import mock _REPO_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", "..", "..")) _MODULE_PATH = os.path.join( @@ -56,10 +58,24 @@ def __init__(self, name, version="1.0"): self.version = version +class _FakePref: + def __init__(self, package_id): + self.package_id = package_id + + class _FakeDep: - def __init__(self, name, package_folder, version="1.0", context="host"): + def __init__( + self, + name, + package_folder, + version="1.0", + context="host", + package_metadata_folder=None, + ): self.ref = _FakeRef(name, version) + self.pref = _FakePref(f"{name}-pid") self.package_folder = package_folder + self.package_metadata_folder = package_metadata_folder self.context = context # not read by the deployer; documents intent @@ -116,6 +132,28 @@ def __init__(self, conanfile): self.root = _FakeGraphRoot(conanfile) +def _fake_cyclonedx_1_6(conanfile, name=None, **_kwargs): + """Stands in for conan.tools.sbom.cyclonedx_1_6(), which needs a real + Conan graph (conanfile.subgraph): one component per dependency of the + fake conanfile, all depended on by the root, in Conan's output shape.""" + components = [] + for _req, dep in conanfile.dependencies.items(): + ref = f"pkg:conan/{dep.ref.name}@{dep.ref.version}" + components.append( + {"bom-ref": ref, "name": dep.ref.name, "version": str(dep.ref.version)} + ) + return { + "bomFormat": "CycloneDX", + "specVersion": "1.6", + "metadata": {"component": {"bom-ref": "root", "name": name}}, + "components": components, + "dependencies": [ + {"ref": "root", "dependsOn": [c["bom-ref"] for c in components]} + ] + + [{"ref": c["bom-ref"]} for c in components], + } + + def _copy_tree(dep, output, symlinks=True): """Test helper: builds a fresh report and calls _copy_package_tree, returning the report so tests can inspect warnings/errors.""" @@ -918,7 +956,309 @@ def test_raise_if_errors_does_not_raise_for_warnings_only(self): report.raise_if_errors() # must not raise +class TestComponentProperties(unittest.TestCase): + def test_package_id_only_without_metadata(self): + dep = _FakeDep("zlib", None) + self.assertEqual( + aswf_deploy._component_properties(dep), {"aswf:package_id": "zlib-pid"} + ) + + def test_metadata_folder_without_provenance_file(self): + with tempfile.TemporaryDirectory() as tmp: + dep = _FakeDep("zlib", None, package_metadata_folder=tmp) + self.assertEqual( + aswf_deploy._component_properties(dep), + {"aswf:package_id": "zlib-pid"}, + ) + + def test_system_wrapper_is_tagged(self): + dep = _FakeDep("opengl", None, version="system") + self.assertEqual( + aswf_deploy._component_properties(dep, system=True), + {"aswf:package_id": "opengl-pid", "aswf:provided_by": "system"}, + ) + + def test_reads_clean_provenance(self): + with tempfile.TemporaryDirectory() as tmp: + _write( + os.path.join(tmp, "aswf_provenance.json"), + json.dumps({"git_sha": "abc123", "git_dirty": False}), + ) + dep = _FakeDep("zlib", None, package_metadata_folder=tmp) + self.assertEqual( + aswf_deploy._component_properties(dep), + { + "aswf:package_id": "zlib-pid", + "aswf:git_sha": "abc123", + "aswf:git_dirty": "false", + }, + ) + + def test_reads_dirty_provenance_with_diff_hash(self): + with tempfile.TemporaryDirectory() as tmp: + _write( + os.path.join(tmp, "aswf_provenance.json"), + json.dumps( + {"git_sha": "abc123", "git_dirty": True, "git_diff_hash": "f00d"} + ), + ) + dep = _FakeDep("zlib", None, package_metadata_folder=tmp) + props = aswf_deploy._component_properties(dep) + self.assertEqual(props["aswf:git_dirty"], "true") + self.assertEqual(props["aswf:git_diff_hash"], "f00d") + + +class TestIsSystemWrapper(unittest.TestCase): + def test_empty_package_with_system_version(self): + with tempfile.TemporaryDirectory() as tmp: + dep = _FakeDep("opengl", tmp, version="system") + self.assertTrue(aswf_deploy._is_system_wrapper(dep)) + + def test_version_string_alone_does_not_decide(self): + with tempfile.TemporaryDirectory() as tmp: + os.makedirs(os.path.join(tmp, "include")) + dep = _FakeDep("opengl", tmp, version="system") + self.assertFalse(aswf_deploy._is_system_wrapper(dep)) + + def test_empty_package_with_real_version(self): + with tempfile.TemporaryDirectory() as tmp: + _write(os.path.join(tmp, "conaninfo.txt"), "stuff") + dep = _FakeDep("openssl", tmp, version="3.5.8") + self.assertTrue(aswf_deploy._is_system_wrapper(dep)) + + def test_normal_package(self): + with tempfile.TemporaryDirectory() as tmp: + os.makedirs(os.path.join(tmp, "lib")) + self.assertFalse(aswf_deploy._is_system_wrapper(_FakeDep("zlib", tmp))) + + def test_skipped_binary_is_not_a_wrapper(self): + # package_folder is None when Conan skips a binary nothing needs, + # e.g. a static library already linked into its consumers. + self.assertFalse(aswf_deploy._is_system_wrapper(_FakeDep("zlib", None))) + + +class TestSpdxLicenses(unittest.TestCase): + def test_expression_name_becomes_expression(self): + self.assertEqual( + aswf_deploy._spdx_licenses( + [{"license": {"name": "Apache-2.0 WITH LLVM-exception"}}] + ), + [{"expression": "Apache-2.0 WITH LLVM-exception"}], + ) + + def test_ids_and_free_text_are_unchanged(self): + for licenses in ( + [{"license": {"id": "BSD-3-Clause"}}], + # Prose, not an SPDX expression (operators must be uppercase here). + [{"license": {"name": "Python-2.0 and numpy (BSD-3-Clause license)"}}], + # An expression can't sit alongside other license entries. + [{"license": {"id": "MIT"}}, {"license": {"name": "A OR B"}}], + ): + self.assertEqual(aswf_deploy._spdx_licenses(licenses), licenses) + + def test_applied_to_kept_components(self): + sbom = _sbom(["clang"], {"root": ["clang"]}) + sbom["components"][0]["licenses"] = [ + {"license": {"name": "Apache-2.0 WITH LLVM-exception"}} + ] + result = aswf_deploy._filter_and_annotate_sbom(sbom, {("clang", "1.0"): {}}) + self.assertEqual( + result["components"][0]["licenses"], + [{"expression": "Apache-2.0 WITH LLVM-exception"}], + ) + + +def _sbom(components, depends_on): + """A minimal Conan-shaped CycloneDX SBOM: `components` is a list of + names (version 1.0, bom-ref == name), `depends_on` maps a ref (or + "root") to the refs it depends on.""" + return { + "bomFormat": "CycloneDX", + "metadata": {"component": {"bom-ref": "root", "name": "ci-test"}}, + "components": [{"bom-ref": n, "name": n, "version": "1.0"} for n in components], + "dependencies": [ + {"ref": ref, **({"dependsOn": deps} if deps else {})} + for ref, deps in depends_on.items() + ], + } + + +class TestFilterAndAnnotateSbom(unittest.TestCase): + def test_keeps_listed_components_and_adds_sorted_properties(self): + sbom = _sbom(["zlib", "cmake"], {"root": ["zlib", "cmake"]}) + result = aswf_deploy._filter_and_annotate_sbom( + sbom, {("zlib", "1.0"): {"b": "2", "a": "1"}} + ) + self.assertEqual( + result["components"], + [ + { + "bom-ref": "zlib", + "name": "zlib", + "version": "1.0", + "properties": [ + {"name": "a", "value": "1"}, + {"name": "b", "value": "2"}, + ], + } + ], + ) + self.assertEqual( + result["dependencies"], [{"ref": "root", "dependsOn": ["zlib"]}] + ) + self.assertEqual(result["metadata"], sbom["metadata"]) + self.assertEqual(result["bomFormat"], "CycloneDX") + + def test_version_must_match(self): + sbom = _sbom(["zlib"], {"root": ["zlib"]}) + result = aswf_deploy._filter_and_annotate_sbom( + sbom, {("zlib", "2.0"): {"a": "1"}} + ) + self.assertNotIn("components", result) + self.assertEqual(result["dependencies"], [{"ref": "root"}]) + + def test_rewires_dependencies_past_dropped_components(self): + # openexr -> imath (dropped) -> zlib; openexr must end up on zlib. + sbom = _sbom( + ["openexr", "imath", "zlib"], + { + "root": ["openexr"], + "openexr": ["imath"], + "imath": ["zlib"], + "zlib": [], + }, + ) + props = {("openexr", "1.0"): {"x": "1"}, ("zlib", "1.0"): {"x": "1"}} + result = aswf_deploy._filter_and_annotate_sbom(sbom, props) + self.assertEqual( + result["dependencies"], + [ + {"ref": "root", "dependsOn": ["openexr"]}, + {"ref": "openexr", "dependsOn": ["zlib"]}, + {"ref": "zlib"}, + ], + ) + + def test_duplicate_bom_refs_are_collapsed(self): + # Conan emits one component and one dependencies entry per graph + # node, and two nodes of the same recipe revision share a bom-ref. + sbom = _sbom( + ["cmake", "openssl", "cmake"], + {"root": ["cmake"], "cmake": ["openssl"], "openssl": []}, + ) + sbom["dependencies"].append({"ref": "cmake", "dependsOn": ["zlib"]}) + sbom["components"].append({"bom-ref": "zlib", "name": "zlib", "version": "1.0"}) + props = {(n, "1.0"): {"x": "1"} for n in ("cmake", "openssl", "zlib")} + result = aswf_deploy._filter_and_annotate_sbom(sbom, props) + self.assertEqual( + [c["bom-ref"] for c in result["components"]], ["cmake", "openssl", "zlib"] + ) + self.assertEqual( + [e for e in result["dependencies"] if e["ref"] == "cmake"], + [{"ref": "cmake", "dependsOn": ["openssl", "zlib"]}], + ) + + def test_rewiring_handles_diamonds_without_duplicates(self): + sbom = _sbom( + ["app", "a", "b", "zlib"], + {"root": ["app"], "app": ["a", "b"], "a": ["zlib"], "b": ["zlib"]}, + ) + props = {("app", "1.0"): {"x": "1"}, ("zlib", "1.0"): {"x": "1"}} + result = aswf_deploy._filter_and_annotate_sbom(sbom, props) + app = next(e for e in result["dependencies"] if e["ref"] == "app") + self.assertEqual(app["dependsOn"], ["zlib"]) + + +class TestSetSbomRoot(unittest.TestCase): + def test_replaces_random_root_with_stable_image_ref(self): + sbom = _sbom(["zlib"], {"root": ["zlib"], "zlib": []}) + result = aswf_deploy._set_sbom_root(sbom, "ci-base", "2027.10") + self.assertEqual( + result["metadata"]["component"], + { + "bom-ref": "ci-base@2027.10", + "name": "ci-base", + "version": "2027.10", + "type": "container", + }, + ) + self.assertEqual( + result["dependencies"], + [{"ref": "ci-base@2027.10", "dependsOn": ["zlib"]}, {"ref": "zlib"}], + ) + + def test_without_version(self): + sbom = _sbom([], {"root": []}) + result = aswf_deploy._set_sbom_root(sbom, "ci-base", None) + self.assertEqual(result["metadata"]["component"]["bom-ref"], "ci-base") + self.assertNotIn("version", result["metadata"]["component"]) + + +def _layer(name, timestamp, components, depends_on): + sbom = _sbom(components, {"root": [], **depends_on}) + sbom["metadata"]["timestamp"] = timestamp + return aswf_deploy._set_sbom_root(sbom, name, "1.0") + + +class TestMergeSboms(unittest.TestCase): + def setUp(self): + self.common = _layer( + "ci-common", + "2026-01-01T00:00:00Z", + ["cmake", "openssl"], + {"root": ["cmake"], "cmake": ["openssl"], "openssl": []}, + ) + self.base = _layer( + "ci-base", + "2026-01-02T00:00:00Z", + ["openssl", "zlib"], + {"root": ["zlib", "openssl"], "zlib": [], "openssl": []}, + ) + + def test_merges_layers_under_image_root(self): + merged = aswf_deploy._merge_sboms( + [self.common, self.base], self.base, "ci-base", "1.0" + ) + self.assertEqual( + [c["bom-ref"] for c in merged["components"]], ["cmake", "openssl", "zlib"] + ) + self.assertEqual( + merged["dependencies"], + [ + {"ref": "ci-base@1.0", "dependsOn": ["cmake", "zlib", "openssl"]}, + {"ref": "cmake", "dependsOn": ["openssl"]}, + {"ref": "openssl"}, + {"ref": "zlib"}, + ], + ) + root = merged["metadata"]["component"] + self.assertEqual(root["bom-ref"], "ci-base@1.0") + self.assertEqual( + root["properties"], [{"name": "aswf:layers", "value": "ci-common,ci-base"}] + ) + self.assertTrue(merged["serialNumber"].startswith("urn:uuid:")) + self.assertEqual(merged["metadata"]["timestamp"], "2026-01-02T00:00:00Z") + + def test_different_builds_of_a_package_are_kept_and_reported(self): + self.base["components"][0]["bom-ref"] = "openssl-rev2" + with mock.patch("builtins.print") as mock_print: + merged = aswf_deploy._merge_sboms( + [self.common, self.base], self.base, "ci-base", "1.0" + ) + refs = [c["bom-ref"] for c in merged["components"]] + self.assertIn("openssl", refs) + self.assertIn("openssl-rev2", refs) + self.assertIn("different builds of openssl", mock_print.call_args[0][0]) + + class TestDeployEndToEnd(unittest.TestCase): + def setUp(self): + patcher = mock.patch.object( + aswf_deploy, "cyclonedx_1_6", side_effect=_fake_cyclonedx_1_6 + ) + patcher.start() + self.addCleanup(patcher.stop) + def test_full_deploy_excludes_named_package_and_deploys_others(self): with tempfile.TemporaryDirectory() as tmp: conan_home = os.path.join(tmp, "conan_home") @@ -1062,6 +1402,143 @@ def test_deploy_does_not_raise_for_warnings_only(self): finally: del os.environ["CONAN_HOME"] + def test_deploy_writes_filtered_annotated_sbom(self): + with tempfile.TemporaryDirectory() as tmp: + conan_home = os.path.join(tmp, "conan_home") + os.makedirs(conan_home) + os.environ["CONAN_HOME"] = conan_home + try: + output = os.path.join(tmp, "output") + pkg_zlib = os.path.join(tmp, "pkg_zlib") + pkg_openexr = os.path.join(tmp, "pkg_openexr") + pkg_cmake = os.path.join(tmp, "pkg_cmake") + pkg_opengl = os.path.join(tmp, "pkg_opengl") + meta_zlib = os.path.join(tmp, "meta_zlib") + _write(os.path.join(pkg_zlib, "include", "zlib.h"), "zlib") + _write(os.path.join(pkg_openexr, "include", "openexr.h"), "exr") + _write(os.path.join(pkg_cmake, "bin", "cmake"), "binary") + os.makedirs(pkg_opengl) + pkg_openssl = os.path.join(tmp, "pkg_openssl") + _write(os.path.join(pkg_openssl, "conaninfo.txt"), "wrapper") + _write( + os.path.join(meta_zlib, "aswf_provenance.json"), + json.dumps({"git_sha": "abc123", "git_dirty": False}), + ) + + conanfile = _FakeConanFile( + conf_values={ + "user.aswf:exclude_package": "openexr", + "user.aswf:sbom_name": "ci-test", + }, + deps=[ + _direct_host_dep( + _FakeDep( + "zlib", pkg_zlib, package_metadata_folder=meta_zlib + ) + ), + _direct_host_dep(_FakeDep("openexr", pkg_openexr)), + _direct_host_dep( + _FakeDep("opengl", pkg_opengl, version="system") + ), + _direct_host_dep( + _FakeDep("openssl", pkg_openssl, version="3.5.8") + ), + ( + _FakeRequirement("cmake", build=True, direct=False), + _FakeDep("cmake", pkg_cmake), + ), + ], + ) + aswf_deploy.deploy(_FakeGraph(conanfile), output) + + with open( + os.path.join(output, "aswf", "ci-test.cdx.json"), encoding="utf-8" + ) as f: + sbom = json.load(f) + components = {c["name"]: c for c in sbom["components"]} + # Excluded and out-of-scope packages are left out, system + # wrappers (not copied, but provided by the image) are kept. + self.assertEqual(sorted(components), ["opengl", "openssl", "zlib"]) + self.assertEqual(sbom["metadata"]["component"]["name"], "ci-test") + self.assertIn( + {"name": "aswf:git_sha", "value": "abc123"}, + components["zlib"]["properties"], + ) + self.assertEqual( + components["opengl"]["properties"], + [ + {"name": "aswf:package_id", "value": "opengl-pid"}, + {"name": "aswf:provided_by", "value": "system"}, + ], + ) + self.assertIn( + {"name": "aswf:provided_by", "value": "system"}, + components["openssl"]["properties"], + ) + self.assertNotIn( + "aswf:provided_by", + [p["name"] for p in components["zlib"]["properties"]], + ) + finally: + del os.environ["CONAN_HOME"] + + def test_layered_deploys_merge_into_image_sbom(self): + with tempfile.TemporaryDirectory() as tmp: + conan_home = os.path.join(tmp, "conan_home") + os.makedirs(conan_home) + os.environ["CONAN_HOME"] = conan_home + try: + output = os.path.join(tmp, "output") + pkg_cmake = os.path.join(tmp, "pkg_cmake") + pkg_zlib = os.path.join(tmp, "pkg_zlib") + _write(os.path.join(pkg_cmake, "bin", "cmake"), "binary") + _write(os.path.join(pkg_zlib, "include", "zlib.h"), "zlib") + for image, dep in ( + ("ci-common", _FakeDep("cmake", pkg_cmake)), + ("ci-base", _FakeDep("zlib", pkg_zlib)), + ): + conanfile = _FakeConanFile( + conf_values={"user.aswf:sbom_name": f"{image}/2027.10"}, + deps=[_direct_host_dep(dep)], + ) + aswf_deploy.deploy(_FakeGraph(conanfile), output) + + sbom_dir = os.path.join(output, "aswf") + self.assertEqual( + sorted(os.listdir(sbom_dir)), + ["ci-base.cdx.json", "ci-common.cdx.json", "sbom.cdx.json"], + ) + with open( + os.path.join(sbom_dir, "sbom.cdx.json"), encoding="utf-8" + ) as f: + merged = json.load(f) + self.assertEqual( + sorted(c["name"] for c in merged["components"]), ["cmake", "zlib"] + ) + self.assertEqual( + merged["metadata"]["component"]["bom-ref"], "ci-base@2027.10" + ) + self.assertEqual( + sorted(merged["dependencies"][0]["dependsOn"]), + ["pkg:conan/cmake@1.0", "pkg:conan/zlib@1.0"], + ) + finally: + del os.environ["CONAN_HOME"] + + def test_deploy_uses_default_sbom_name(self): + with tempfile.TemporaryDirectory() as tmp: + conan_home = os.path.join(tmp, "conan_home") + os.makedirs(conan_home) + os.environ["CONAN_HOME"] = conan_home + try: + output = os.path.join(tmp, "output") + aswf_deploy.deploy(_FakeGraph(_FakeConanFile()), output) + self.assertTrue( + os.path.isfile(os.path.join(output, "aswf", "conan-sbom.cdx.json")) + ) + finally: + del os.environ["CONAN_HOME"] + if __name__ == "__main__": unittest.main() diff --git a/python/aswfdocker/tests/test_bake.py b/python/aswfdocker/tests/test_bake.py new file mode 100644 index 000000000..9057edef6 --- /dev/null +++ b/python/aswfdocker/tests/test_bake.py @@ -0,0 +1,90 @@ +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +""" +Tests for bake.py +""" + +import json +import os +import tempfile +import unittest + +from aswfdocker import bake + + +class TestWriteBakeJsonfile(unittest.TestCase): + def test_round_trips_content(self): + bake_dict = {"target": {"foo": {"args": {"A": "1"}}}} + with tempfile.TemporaryDirectory() as tmpdir: + path = os.path.join(tmpdir, "bake.json") + bake.write_bake_jsonfile(path, bake_dict) + with open(path, "r", encoding="utf-8") as f: + self.assertEqual(json.load(f), bake_dict) + + +class TestBakeCommand(unittest.TestCase): + def test_no_targets_or_overrides(self): + cmd = bake.bake_command( + "/tmp/bake.json", build_targets=[], overrides={}, progress="auto" + ) + self.assertEqual( + cmd, + ["docker", "buildx", "bake", "-f", "/tmp/bake.json", "--progress", "auto"], + ) + + def test_overrides_use_wildcard_scope_by_default(self): + cmd = bake.bake_command( + "/tmp/bake.json", + build_targets=["ci-package-osl-2027"], + overrides={ + "output": "type=cacheonly", + "target": "ci-conan-package-builder", + }, + progress="auto", + ) + self.assertEqual( + cmd, + [ + "docker", + "buildx", + "bake", + "-f", + "/tmp/bake.json", + "--set=*.output=type=cacheonly", + "--set=*.target=ci-conan-package-builder", + "--progress", + "auto", + "ci-package-osl-2027", + ], + ) + + def test_overrides_use_named_scope_when_given(self): + cmd = bake.bake_command( + "/tmp/bake.json", + build_targets=["ci-conan-graph"], + overrides={ + "target": "ci-conan-graph-output", + "output": "type=local,dest=/tmp/out", + }, + progress="quiet", + override_scope="ci-conan-graph", + ) + self.assertEqual( + cmd, + [ + "docker", + "buildx", + "bake", + "-f", + "/tmp/bake.json", + "--set=ci-conan-graph.target=ci-conan-graph-output", + "--set=ci-conan-graph.output=type=local,dest=/tmp/out", + "--progress", + "quiet", + "ci-conan-graph", + ], + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/python/aswfdocker/tests/test_builder.py b/python/aswfdocker/tests/test_builder.py index d91c7bf01..25d2d9c6b 100644 --- a/python/aswfdocker/tests/test_builder.py +++ b/python/aswfdocker/tests/test_builder.py @@ -12,7 +12,7 @@ from click.testing import CliRunner -from aswfdocker import builder, aswfinfo, index, constants, groupinfo +from aswfdocker import builder, buildorder, aswfinfo, index, constants, groupinfo from aswfdocker.cli import aswfdocker @@ -30,14 +30,14 @@ def test_bake_dict_sets_linux_amd64_platform_on_macos(self): self.build_info, groupinfo.GroupInfo( names=["base"], - versions=["2019"], + versions=["2027"], type_=constants.ImageType.IMAGE, targets=[], ), ) - baked = b.make_bake_dict(False, False) + baked = b.make_bake_dict(False) self.assertEqual( - baked["target"]["ci-base-2019"]["platforms"], + baked["target"]["ci-base-2027"]["platforms"], ["linux/amd64"], ) @@ -46,340 +46,413 @@ def test_bake_dict_omits_platforms_when_not_darwin(self): self.build_info, groupinfo.GroupInfo( names=["base"], - versions=["2019"], + versions=["2027"], type_=constants.ImageType.IMAGE, targets=[], ), ) for plat in ("linux", "win32"): with patch.object(builder.sys, "platform", plat): - baked = b.make_bake_dict(False, False) + baked = b.make_bake_dict(False) self.assertNotIn( "platforms", - baked["target"]["ci-base-2019"], + baked["target"]["ci-base-2027"], msg=f"host sys.platform={plat!r}", ) - def test_package_opentimelineio_2019_dict(self): + def test_package_opentimelineio_2027_dict(self): b = builder.Builder( self.build_info, groupinfo.GroupInfo( - names=["vfx1-2"], - versions=["2019"], + names=["vfx"], + versions=["2027"], type_=constants.ImageType.PACKAGE, targets=[], ), ) - opentimelineio_version = list( - index.Index().iter_versions(constants.ImageType.PACKAGE, "opentimelineio") - )[0] - baked = b.make_bake_dict(False, False) - self.assertIn( - "ASWF_OPENTIMELINEIO_VERSION", - baked["target"]["ci-package-opentimelineio-2019"]["args"], + opentimelineio_version = _version_for( + constants.ImageType.PACKAGE, "opentimelineio", "2027" ) + baked = b.make_bake_dict(False) + target = baked["target"]["ci-package-opentimelineio-2027"] + self.assertIn("ASWF_OPENTIMELINEIO_VERSION", target["args"]) # tags may not make much sense for Conan packages self.assertEqual( - baked["target"]["ci-package-opentimelineio-2019"]["tags"], + target["tags"], [ - f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-baseos-gl-conan:2019.1", - f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-baseos-gl-conan:2019", + f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-baseos-gl-conan:" + + index.Index().version_info("2027").release ], ) + self.assertEqual(opentimelineio_version, "2027") + self.assertEqual(target["args"]["ASWF_VERSION"], "2027") + self.assertEqual(target["args"]["ASWF_VFXPLATFORM_VERSION"], "2027") self.assertEqual( - baked["target"]["ci-package-opentimelineio-2019"]["args"]["ASWF_VERSION"], - opentimelineio_version, + target["args"]["ASWF_CONAN_CHANNEL"], + index.Index().version_info("2027").conan_channel, ) - self.assertEqual( - baked["target"]["ci-package-opentimelineio-2019"]["dockerfile"], - "packages/common/Dockerfile", + self.assertEqual(target["dockerfile"], "packages/common/Dockerfile") + + def test_package_remote_args_follow_environment(self): + group_info = groupinfo.GroupInfo( + names=["vfx"], + versions=["2027"], + type_=constants.ImageType.PACKAGE, + targets=["opentimelineio"], + ) + for env, expected in ( + ({}, "--no-remote"), + # package_org for this test's build_info is aswftesting + ({"GITHUB_ACTIONS": "true"}, "--remote aswftesting"), + ): + with patch.dict(os.environ, env): + if not env: + os.environ.pop("GITHUB_ACTIONS", None) + baked = builder.Builder(self.build_info, group_info).make_bake_dict( + False + ) + args = baked["target"]["ci-package-opentimelineio-2027"]["args"] + self.assertEqual(args["ASWF_CONAN_REMOTE_ARGS"], expected) + self.assertNotIn("ASWF_CONAN_NO_REMOTE", args) + + def test_package_builds_get_a_fresh_nonce_per_run(self): + # Without it BuildKit replays a `conan create` the plan decided must + # run (e.g. --force-rebuild with unchanged recipes/settings). + group_info = groupinfo.GroupInfo( + names=["vfx"], + versions=["2027"], + type_=constants.ImageType.PACKAGE, + targets=["opentimelineio"], ) + nonces = [ + builder.Builder(self.build_info, group_info).make_bake_dict(False)[ + "target" + ]["ci-package-opentimelineio-2027"]["args"]["ASWF_CONAN_NONCE"] + for _ in range(2) + ] + self.assertTrue(all(nonces)) + self.assertNotEqual(nonces[0], nonces[1]) - def test_image_base_2019_dict(self): + def test_only_package_uploads_get_artifactory_credentials(self): + # Downloads are anonymous, so nothing else needs the secrets. + for type_, names, image, push, expected in ( + ( + constants.ImageType.PACKAGE, + ["vfx"], + "ci-package-opentimelineio", + True, + True, + ), + ( + constants.ImageType.PACKAGE, + ["vfx"], + "ci-package-opentimelineio", + False, + False, + ), + (constants.ImageType.IMAGE, ["base"], "ci-base", True, False), + ): + group_info = groupinfo.GroupInfo( + names=names, + versions=["2027"], + type_=type_, + targets=( + ["opentimelineio"] if type_ == constants.ImageType.PACKAGE else [] + ), + ) + target = builder.Builder( + self.build_info, group_info, push=push + ).make_bake_dict(False)["target"][f"{image}-2027"] + self.assertEqual("secret" in target, expected, (type_, push)) + + def test_image_builds_get_no_nonce(self): + # Replaying cached image layers is fine, and keeps image builds fast. b = builder.Builder( self.build_info, groupinfo.GroupInfo( names=["base"], - versions=["2019"], + versions=["2027"], type_=constants.ImageType.IMAGE, targets=[], ), ) - base_version = list( - index.Index().iter_versions(constants.ImageType.IMAGE, "base") - )[0] - baked = b.make_bake_dict(False, False) + self.assertNotIn( + "ASWF_CONAN_NONCE", + b.make_bake_dict(False)["target"]["ci-base-2027"]["args"], + ) + + @patch.object(builder.utils, "git_provenance") + def test_package_builds_get_git_provenance(self, mock_provenance): + provenance = { + "ASWF_GIT_SHA": "abc123", + "ASWF_GIT_DIRTY": "true", + "ASWF_GIT_DIFF_HASH": "f00d", + } + mock_provenance.return_value = provenance + group_info = groupinfo.GroupInfo( + names=["vfx"], + versions=["2027"], + type_=constants.ImageType.PACKAGE, + targets=["opentimelineio", "openexr"], + ) + targets = builder.Builder(self.build_info, group_info).make_bake_dict(False)[ + "target" + ] + for target in ("ci-package-opentimelineio-2027", "ci-package-openexr-2027"): + self.assertLessEqual(provenance.items(), targets[target]["args"].items()) + # Computed once per run, not per target. + mock_provenance.assert_called_once() + + @patch.object(builder.utils, "git_provenance") + def test_image_builds_get_no_git_provenance(self, mock_provenance): + b = builder.Builder( + self.build_info, + groupinfo.GroupInfo( + names=["base"], + versions=["2027"], + type_=constants.ImageType.IMAGE, + targets=[], + ), + ) + args = b.make_bake_dict(False)["target"]["ci-base-2027"]["args"] + self.assertNotIn("ASWF_GIT_SHA", args) + mock_provenance.assert_not_called() + + def test_image_base_2027_dict(self): + b = builder.Builder( + self.build_info, + groupinfo.GroupInfo( + names=["base"], + versions=["2027"], + type_=constants.ImageType.IMAGE, + targets=[], + ), + ) + base_version = _version_for(constants.ImageType.IMAGE, "base", "2027") + baked = b.make_bake_dict(False) self.assertEqual( - baked["target"]["ci-base-2019"]["tags"], - [ - f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-base:2019", - f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-base:{base_version}", - ], + baked["target"]["ci-base-2027"]["tags"], + _tags("ci-base", ["2027", base_version], "2027"), ) self.assertEqual( - baked["target"]["ci-base-2019"]["args"]["ASWF_VERSION"], base_version + baked["target"]["ci-base-2027"]["args"]["ASWF_VERSION"], base_version ) @patch.object(builder.sys, "platform", "linux") - def test_image_base_2019clang_dict(self): + def test_image_openvdb_clang_dict(self): b = builder.Builder( self.build_info, groupinfo.GroupInfo( - names=["vfx3"], - versions=["2019-clang9"], + names=[ + index.Index().get_group_from_image( + constants.ImageType.IMAGE, "openvdb" + ) + ], + versions=["2027-clang22"], type_=constants.ImageType.IMAGE, targets=["openvdb"], ), + # Explicit, so the expected args don't depend on GITHUB_ACTIONS. + conan_remote=constants.CONAN_REMOTE_LOCAL, + ) + openvdb_version = _version_for( + constants.ImageType.IMAGE, "openvdb", "2027-clang22" ) - openvdb_version = list( - index.Index().iter_versions(constants.ImageType.IMAGE, "openvdb") - )[3] self.assertEqual( - b.make_bake_dict(False, False), + b.make_bake_dict(False), { - "group": {"default": {"targets": ["ci-openvdb-2019-clang9"]}}, + "group": {"default": {"targets": ["ci-openvdb-2027-clang22"]}}, "target": { - "ci-openvdb-2019-clang9": { - "args": { - "ASWF_ALEMBIC_VERSION": "1.7.11", - "ASWF_BASEOS_DISTRO": "centos7", - "ASWF_BASEOS_IMAGE": "nvidia/cudagl", - "ASWF_C_BLOSC_VERSION": "1.5.0", - "ASWF_BOOST_VERSION": "1.66.0", - "ASWF_CCACHE_VERSION": "4.0", - "ASWF_CLANG_MAJOR_VERSION": "9", - "ASWF_CLANG_VERSION": "9.0.1", - "ASWF_CMAKE_VERSION": "3.12.4", - "ASWF_CONAN_CHANNEL": "vfx2019", - "ASWF_CONAN_HOME": "/opt/conan_home", - "ASWF_CONAN_PYTHON_VERSION": "3.9.11", - "ASWF_CONAN_VERSION": "1.47.0", - "ASWF_CPPUNIT_VERSION": "1.14.0", - "ASWF_CPYTHON_VERSION": "2.7.15", - "ASWF_CUDA_VERSION": "10.2", - "ASWF_CXX_STANDARD": "14", - "ASWF_DTS_VERSION": "6", - "ASWF_DTS_PREFIX": "devtoolset", - "ASWF_GLEW_VERSION": "2.1.0", - "ASWF_GLFW_VERSION": "3.1.2", - "ASWF_GLVND_VERSION": "1.2.0", - "ASWF_GTEST_VERSION": "1.8.1", - "ASWF_HDF5_VERSION": "1.8.21", - "ASWF_IMATH_VERSION": "2.3.0", - "ASWF_LOG4CPLUS_VERSION": "1.1.2", - "ASWF_NINJA_VERSION": "1.10.1", - "ASWF_NUMPY_VERSION": "1.14", - "ASWF_OPENCOLORIO_CONFIGS_VERSION": "1.0_r2", - "ASWF_OPENCOLORIO_VERSION": "1.1.0", - "ASWF_OPENIMAGEIO_VERSION": "2.0.8", - "ASWF_ONETBB_VERSION": "2018", - "ASWF_OPENEXR_VERSION": "2.3.0", - "ASWF_OPENSUBDIV_VERSION": "3_3_3", - "ASWF_OPENVDB_VERSION": "6.2.1", - "ASWF_OPTIX_VERSION": "7.1.0", - "ASWF_ORG": "aswflocaltesting", - "ASWF_OSL_VERSION": "1.10.9", - "ASWF_OPENTIMELINEIO_VERSION": "0.12.1", - "ASWF_PARTIO_VERSION": "1.10.1", - "ASWF_PKG_ORG": "aswftesting", - "ASWF_PTEX_VERSION": "2.1.33", - "ASWF_PYBIND11_VERSION": "2.4.3", - "ASWF_PYSIDE_CLANG_VERSION": "7.1.0", - "ASWF_PYSIDE_VERSION": "5.12.6", - "ASWF_PYTHON_MAJOR_MINOR_VERSION": "2.7", - "ASWF_QT_VERSION": "5.12.6", - "ASWF_SONAR_VERSION": "4.6.2.2472", - "ASWF_OPENUSD_VERSION": "19.11", - "ASWF_VERSION": openvdb_version, - "ASWF_VFXPLATFORM_VERSION": "2019", - "CI_COMMON_VERSION": "1", - }, - "context": ".", - "dockerfile": "ci-openvdb/Dockerfile", - "labels": { - "org.opencontainers.image.created": constants.DEV_BUILD_DATE, - "org.opencontainers.image.revision": constants.DEV_BUILD_DATE, - }, - "output": ["type=docker"], - "secret": [ - "id=conan_login_username,env=CONAN_LOGIN_USERNAME", - "id=conan_password,env=CONAN_PASSWORD", - ], - "tags": [ - f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-openvdb:2019-clang9", - f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-openvdb:{openvdb_version}", - ], - }, + "ci-openvdb-2027-clang22": _expected_image_target( + "openvdb", + "2027-clang22", + openvdb_version, + # a clang variant is also tagged with its VFX year + _tags( + "ci-openvdb", + ["2027", "2027-clang22", openvdb_version], + "2027-clang22", + ), + ), }, }, ) @patch.object(builder.sys, "platform", "linux") - def test_image_base_2019_2020_dict(self): + def test_image_base_2026_2027_dict(self): b = builder.Builder( self.build_info, groupinfo.GroupInfo( names=["base"], - versions=["2019", "2020"], + versions=["2026", "2027"], type_=constants.ImageType.IMAGE, targets=["base"], ), + # Explicit, so the expected args don't depend on GITHUB_ACTIONS. + conan_remote=constants.CONAN_REMOTE_LOCAL, ) - base_versions = list( - index.Index().iter_versions(constants.ImageType.IMAGE, "base") - ) + expected_targets = {} + for year in ("2026", "2027"): + base_version = _version_for(constants.ImageType.IMAGE, "base", year) + expected_targets[f"ci-base-{year}"] = _expected_image_target( + "base", year, base_version, _tags("ci-base", [year, base_version], year) + ) self.assertEqual( - b.make_bake_dict(False, False), + b.make_bake_dict(False), { - "group": {"default": {"targets": ["ci-base-2019", "ci-base-2020"]}}, - "target": { - "ci-base-2020": { - "context": ".", - "dockerfile": "ci-base/Dockerfile", - "args": { - "ASWF_ALEMBIC_VERSION": "1.7.12", - "ASWF_BASEOS_DISTRO": "centos7", - "ASWF_BASEOS_IMAGE": "nvidia/cudagl", - "ASWF_C_BLOSC_VERSION": "1.5.0", - "ASWF_BOOST_VERSION": "1.70.0", - "ASWF_CCACHE_VERSION": "4.0", - "ASWF_CLANG_MAJOR_VERSION": "7", - "ASWF_CLANG_VERSION": "7.1.0", - "ASWF_CMAKE_VERSION": "3.18.4", - "ASWF_CONAN_CHANNEL": "vfx2020", - "ASWF_CONAN_HOME": "/opt/conan_home", - "ASWF_CONAN_PYTHON_VERSION": "3.9.11", - "ASWF_CONAN_VERSION": "1.47.0", - "ASWF_CPPUNIT_VERSION": "1.15.1", - "ASWF_CPYTHON_VERSION": "3.7.3", - "ASWF_CUDA_VERSION": "10.2", - "ASWF_CXX_STANDARD": "17", - "ASWF_DTS_VERSION": "6", - "ASWF_DTS_PREFIX": "devtoolset", - "ASWF_GLEW_VERSION": "2.1.0", - "ASWF_GLFW_VERSION": "3.1.2", - "ASWF_GLVND_VERSION": "1.2.0", - "ASWF_GTEST_VERSION": "1.10.0", - "ASWF_HDF5_VERSION": "1.8.21", - "ASWF_IMATH_VERSION": "2.4.0", - "ASWF_LOG4CPLUS_VERSION": "1.1.2", - "ASWF_NINJA_VERSION": "1.10.1", - "ASWF_NUMPY_VERSION": "1.16", - "ASWF_OPENCOLORIO_CONFIGS_VERSION": "1.0_r2", - "ASWF_OPENCOLORIO_VERSION": "1.1.1", - "ASWF_OPENIMAGEIO_VERSION": "2.1.13.0", - "ASWF_ONETBB_VERSION": "2019_u6", - "ASWF_OPENEXR_VERSION": "2.4.0", - "ASWF_OPENSUBDIV_VERSION": "3_4_3", - "ASWF_OPENVDB_VERSION": "7.1.0", - "ASWF_OPTIX_VERSION": "7.1.0", - "ASWF_ORG": "aswflocaltesting", - "ASWF_OSL_VERSION": "1.10.10", - "ASWF_OPENTIMELINEIO_VERSION": "0.12.1", - "ASWF_PARTIO_VERSION": "1.10.1", - "ASWF_PKG_ORG": "aswftesting", - "ASWF_PTEX_VERSION": "2.3.2", - "ASWF_PYBIND11_VERSION": "2.4.3", - "ASWF_PYSIDE_CLANG_VERSION": "7.1.0", - "ASWF_PYSIDE_VERSION": "5.12.6", - "ASWF_PYTHON_MAJOR_MINOR_VERSION": "3.7", - "ASWF_QT_VERSION": "5.12.6", - "ASWF_SONAR_VERSION": "4.6.2.2472", - "ASWF_OPENUSD_VERSION": "20.11", - "ASWF_VERSION": base_versions[1], - "ASWF_VFXPLATFORM_VERSION": "2020", - "CI_COMMON_VERSION": "1", - }, - "labels": { - "org.opencontainers.image.created": constants.DEV_BUILD_DATE, - "org.opencontainers.image.revision": constants.DEV_BUILD_DATE, - }, - "tags": [ - f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-base:2020", - f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-base:{base_versions[1]}", - ], - "output": ["type=docker"], - "secret": [ - "id=conan_login_username,env=CONAN_LOGIN_USERNAME", - "id=conan_password,env=CONAN_PASSWORD", - ], - }, - "ci-base-2019": { - "context": ".", - "dockerfile": "ci-base/Dockerfile", - "args": { - "ASWF_ALEMBIC_VERSION": "1.7.11", - "ASWF_BASEOS_DISTRO": "centos7", - "ASWF_BASEOS_IMAGE": "nvidia/cudagl", - "ASWF_C_BLOSC_VERSION": "1.5.0", - "ASWF_BOOST_VERSION": "1.66.0", - "ASWF_CCACHE_VERSION": "4.0", - "ASWF_CLANG_MAJOR_VERSION": "7", - "ASWF_CLANG_VERSION": "7.1.0", - "ASWF_CMAKE_VERSION": "3.12.4", - "ASWF_CPPUNIT_VERSION": "1.14.0", - "ASWF_CONAN_CHANNEL": "vfx2019", - "ASWF_CONAN_HOME": "/opt/conan_home", - "ASWF_CONAN_PYTHON_VERSION": "3.9.11", - "ASWF_CONAN_VERSION": "1.47.0", - "ASWF_CPYTHON_VERSION": "2.7.15", - "ASWF_CUDA_VERSION": "10.2", - "ASWF_CXX_STANDARD": "14", - "ASWF_DTS_VERSION": "6", - "ASWF_DTS_PREFIX": "devtoolset", - "ASWF_GLEW_VERSION": "2.1.0", - "ASWF_GLFW_VERSION": "3.1.2", - "ASWF_GLVND_VERSION": "1.2.0", - "ASWF_GTEST_VERSION": "1.8.1", - "ASWF_HDF5_VERSION": "1.8.21", - "ASWF_IMATH_VERSION": "2.3.0", - "ASWF_LOG4CPLUS_VERSION": "1.1.2", - "ASWF_NINJA_VERSION": "1.10.1", - "ASWF_NUMPY_VERSION": "1.14", - "ASWF_OPENCOLORIO_CONFIGS_VERSION": "1.0_r2", - "ASWF_OPENCOLORIO_VERSION": "1.1.0", - "ASWF_OPENIMAGEIO_VERSION": "2.0.8", - "ASWF_ONETBB_VERSION": "2018", - "ASWF_OPENEXR_VERSION": "2.3.0", - "ASWF_OPENSUBDIV_VERSION": "3_3_3", - "ASWF_OPENVDB_VERSION": "6.2.1", - "ASWF_OPTIX_VERSION": "7.1.0", - "ASWF_ORG": "aswflocaltesting", - "ASWF_OSL_VERSION": "1.10.9", - "ASWF_OPENTIMELINEIO_VERSION": "0.12.1", - "ASWF_PARTIO_VERSION": "1.10.1", - "ASWF_PKG_ORG": "aswftesting", - "ASWF_PTEX_VERSION": "2.1.33", - "ASWF_PYBIND11_VERSION": "2.4.3", - "ASWF_PYSIDE_CLANG_VERSION": "7.1.0", - "ASWF_PYSIDE_VERSION": "5.12.6", - "ASWF_PYTHON_MAJOR_MINOR_VERSION": "2.7", - "ASWF_QT_VERSION": "5.12.6", - "ASWF_SONAR_VERSION": "4.6.2.2472", - "ASWF_OPENUSD_VERSION": "19.11", - "ASWF_VERSION": base_versions[0], - "ASWF_VFXPLATFORM_VERSION": "2019", - "CI_COMMON_VERSION": "1", - }, - "labels": { - "org.opencontainers.image.created": constants.DEV_BUILD_DATE, - "org.opencontainers.image.revision": constants.DEV_BUILD_DATE, - }, - "tags": [ - f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-base:2019", - f"{constants.DOCKER_REGISTRY}/aswflocaltesting/ci-base:{base_versions[0]}", - ], - "output": ["type=docker"], - "secret": [ - "id=conan_login_username,env=CONAN_LOGIN_USERNAME", - "id=conan_password,env=CONAN_PASSWORD", - ], - }, - }, + "group": {"default": {"targets": ["ci-base-2026", "ci-base-2027"]}}, + "target": expected_targets, }, ) + def test_image_common_year_selects_every_clang_version(self): + b = builder.Builder( + self.build_info, + groupinfo.GroupInfo( + names=["common"], + versions=["2027"], + type_=constants.ImageType.IMAGE, + targets=[], + ), + ) + targets = b.make_bake_dict(False)["target"] + year = index.Index().version_info("2027") + majors = list(year.clang_versions) + self.assertEqual( + sorted(targets), sorted(f"ci-common-2027-clang{m}" for m in majors) + ) + for major in majors: + args = targets[f"ci-common-2027-clang{major}"]["args"] + self.assertEqual(args["ASWF_CLANG_MAJOR_VERSION"], major) + self.assertEqual(args["ASWF_VFXPLATFORM_VERSION"], "2027") + self.assertEqual(args["ASWF_CONAN_CHANNEL"], year.conan_channel) + + def test_image_common_legacy_tags(self): + # ci-common keeps its pre-2028 ci_common version tags alongside the + # VFX Platform year ones, only the newest clang getting the bare one. + b = builder.Builder( + self.build_info, + groupinfo.GroupInfo( + names=["common"], + versions=["2027"], + type_=constants.ImageType.IMAGE, + targets=[], + ), + ) + targets = b.make_bake_dict(False)["target"] + majors = list(index.Index().version_info("2027").clang_versions) + oldest, newest = majors[0], majors[-1] + for major, tags in ( + (oldest, [f"2027-clang{oldest}"]), + (newest, ["2027", f"2027-clang{newest}"]), + ): + version = _version_for( + constants.ImageType.IMAGE, "common", f"2027-clang{major}" + ) + legacy = [f"7{tag[4:]}" for tag in [*tags, version]] + self.assertEqual( + targets[f"ci-common-2027-clang{major}"]["tags"], + _tags("ci-common", [*tags, version, *legacy], f"2027-clang{major}"), + ) + + def test_image_base_has_no_legacy_tags(self): + b = builder.Builder( + self.build_info, + groupinfo.GroupInfo( + names=["base"], + versions=["2027"], + type_=constants.ImageType.IMAGE, + targets=["base"], + ), + ) + for tag in b.make_bake_dict(False)["target"]["ci-base-2027"]["tags"]: + self.assertNotIn(":7", tag) + + def test_package_clang_built_per_clang_version(self): + b = builder.Builder( + self.build_info, + groupinfo.GroupInfo( + names=["common"], + versions=["2027"], + type_=constants.ImageType.PACKAGE, + targets=[], + ), + ) + targets = b.make_bake_dict(False)["target"] + year = index.Index().version_info("2027") + self.assertEqual( + sorted(t for t in targets if t.startswith("ci-package-clang-")), + sorted(f"ci-package-clang-2027-clang{m}" for m in year.clang_versions), + ) + # The rest of the group is built once for the year + self.assertIn("ci-package-cmake-2027", targets) + for major, full in year.clang_versions.items(): + args = targets[f"ci-package-clang-2027-clang{major}"]["args"] + self.assertEqual(args["ASWF_PKG_VERSION"], full) + self.assertEqual(args["ASWF_CONAN_CHANNEL"], year.conan_channel) + + +def _version_for(image_type, name, major_version): + """The full version of `name` built for `major_version`, from versions.yaml.""" + return next( + v + for v in index.Index().iter_versions(image_type, name) + if v.split(".")[0] == major_version + ) + +def _tags(image, tags, major_version): + """Expected image tags: `tags` plus the version's own extra tags (e.g. + "latest"/"draft"), which change from year to year in versions.yaml.""" + extra = index.Index().version_info(major_version).tags + return [ + f"{constants.DOCKER_REGISTRY}/aswflocaltesting/{image}:{tag}" + for tag in [*tags, *extra] + ] + + +def _expected_image_target(image, major_version, image_version, tags): + """The bake target make_bake_dict() should produce for an IMAGE build: + its fixed args, overlaid by every package version the version pins + (versions.yaml's all_package_versions).""" + version_info = index.Index().version_info(major_version) + args = { + "ASWF_ORG": "aswflocaltesting", + "ASWF_PKG_ORG": "aswftesting", + "ASWF_VFXPLATFORM_VERSION": version_info.major_version, + "ASWF_VFXPLATFORM_MINOR_VERSION": version_info.minor_version, + "ASWF_CONAN_PROFILE": version_info.conan_profile, + "ASWF_CONAN_CHANNEL": version_info.conan_channel, + "ASWF_CONAN_HOME": constants.ASWF_CONAN_HOME, + "ASWF_VERSION": image_version, + "ASWF_CONAN_REMOTE_ARGS": "--no-remote", + **version_info.all_package_versions, + } + return { + "context": ".", + "dockerfile": f"ci-{image}/Dockerfile", + "args": args, + "labels": { + "org.opencontainers.image.created": constants.DEV_BUILD_DATE, + "org.opencontainers.image.revision": constants.DEV_BUILD_DATE, + }, + "tags": tags, + "output": ["type=docker"], + } + + +def _all_members_need_build(*args, **_kwargs): + """Stands in for buildorder.compute_build_order() (which runs Docker): + a flat graph in which every member needs building.""" + members = args[4] + order = buildorder.BuildOrder([[name for name, _ in members]]) + order.need_build = {name for name, _ in members} + return order + + +@patch.object( + builder.buildorder, "compute_build_order", side_effect=_all_members_need_build +) class TestBuilderCli(unittest.TestCase): def setUp(self): self.maxDiff = None @@ -390,7 +463,11 @@ def setUp(self): def tearDown(self): logging.getLogger("").handlers = self._log_handlers - def test_builder_cli(self): + @staticmethod + def _would_run(output): + return [line for line in output.strip().splitlines() if "Would run:" in line] + + def test_builder_cli(self, mock_compute): runner = CliRunner() result = runner.invoke( aswfdocker.cli, @@ -399,37 +476,44 @@ def test_builder_cli(self): "--ci-image-type", "PACKAGE", "--version", - "2019", + "2027", "--target", "openexr", "--dry-run", ], ) - self.assertFalse(result.exception) + self.assertFalse(result.exception, msg=result.output) bake_path = os.path.join( - tempfile.gettempdir(), "docker-bake-PACKAGE-vfx1-2-2019.json" + tempfile.gettempdir(), "docker-bake-PACKAGE-vfx-2027.json" + ) + # The build order is computed over the whole group, not just the target + mock_compute.assert_called_once() + self.assertIn("openexr", [name for name, _ in mock_compute.call_args.args[4]]) + self.assertGreater(len(mock_compute.call_args.args[4]), 1) + self.assertIn( + "INFO:aswfdocker.builder:2027: building openexr; up to date: nothing", + result.output, ) - cmds = result.output.strip().splitlines() - # Expect 1 lines of output # 1 - docker buildx bake for the conan packages (no login or upload) - self.assertEqual(len(cmds), 1) self.assertEqual( - cmds[0], - f"INFO:aswfdocker.builder:Would run: 'docker buildx bake -f {bake_path} " - + "--set=*.output=type=cacheonly --set=*.target=ci-conan-package-builder " - + "--progress auto ci-package-openexr-2019'", + self._would_run(result.output), + [ + f"INFO:aswfdocker.builder:Would run: 'docker buildx bake -f {bake_path} " + + "--set=*.output=type=cacheonly --set=*.target=ci-conan-package-builder " + + "--progress auto ci-package-openexr-2027'" + ], ) self.assertEqual(result.exit_code, 0) - def test_builder_cli_fromtag(self): + def test_builder_cli_fromtag(self, _mock_compute): runner = CliRunner() result = runner.invoke( aswfdocker.cli, - ["build", "--full-name", "aswftesting/ci-common:1-clang7", "--dry-run"], + ["build", "--full-name", "aswftesting/ci-common:2027-clang22", "--dry-run"], ) self.assertFalse(result.exception) bake_path = os.path.join( - tempfile.gettempdir(), "docker-bake-IMAGE-common-1-clang7.json" + tempfile.gettempdir(), "docker-bake-IMAGE-common-2027-clang22.json" ) cmd = f"docker buildx bake -f {bake_path} --progress auto" self.assertEqual( @@ -442,7 +526,9 @@ def _assertEndsWith(self, cmds, expected): self.assertTrue(cmds[self._i].endswith(expected), "got: " + cmds[self._i]) self._i += 1 - def test_builderlist_cli(self): + # Uploading packages is only allowed on GitHub Actions. + @patch.dict(os.environ, {"GITHUB_ACTIONS": "true"}) + def test_builderlist_cli(self, mock_compute): runner = CliRunner() result = runner.invoke( aswfdocker.cli, @@ -464,9 +550,11 @@ def test_builderlist_cli(self): ) self.assertFalse(result.exception, msg=result.output) bake_path = os.path.join( - tempfile.gettempdir(), "docker-bake-PACKAGE-vfx1-2-2025-2026.json" + tempfile.gettempdir(), "docker-bake-PACKAGE-vfx-2025-2026.json" ) - cmds = result.output.strip().splitlines() + # One build order per version + self.assertEqual(mock_compute.call_count, 2) + cmds = self._would_run(result.output) # We expect 2 steps: # docker buildx to build and upload (2x for each openexr package) self.assertEqual(len(cmds), 2) @@ -486,7 +574,7 @@ def test_builderlist_cli(self): self._i += 1 self.assertEqual(result.exit_code, 0) - def test_builder_cli_allversions(self): + def test_builder_cli_allversions(self, _mock_compute): runner = CliRunner() result = runner.invoke( aswfdocker.cli, @@ -495,11 +583,9 @@ def test_builder_cli_allversions(self): self.assertFalse(result.exception) bake_path = os.path.join( tempfile.gettempdir(), - "docker-bake-IMAGE-common-1-clang10-1-clang6-1-clang7-1" - "-clang8-1-clang9-2-clang10-2-clang11-2-clang12-2-clang13-2" - "-clang14-3-clang14-3-clang15-4-clang16-4-clang17" - "-5-clang18-5-clang19-6-clang19-6-clang20" - "-7-clang21-7-clang22.json", + "docker-bake-IMAGE-common-2023-clang14-2023-clang15-2024-clang16" + "-2024-clang17-2025-clang18-2025-clang19-2026-clang19-2026-clang20" + "-2027-clang21-2027-clang22.json", ) cmd = f"docker buildx bake -f {bake_path} --progress auto" self.assertEqual( @@ -507,3 +593,210 @@ def test_builder_cli_allversions(self): f"INFO:aswfdocker.builder:Would run: '{cmd}'\n", ) self.assertEqual(result.exit_code, 0) + + @staticmethod + def _package_build(*args): + return CliRunner().invoke( + aswfdocker.cli, + [ + "build", + "--ci-image-type", + "PACKAGE", + "--version", + "2027", + "--dry-run", + *args, + ], + ) + + def test_target_to_infers_group(self, mock_compute): + result = self._package_build("--target-to", "openexr") + self.assertEqual(result.exit_code, 0, msg=result.output) + bake_path = os.path.join( + tempfile.gettempdir(), "docker-bake-PACKAGE-vfx-2027.json" + ) + mock_compute.assert_called_once() + self.assertEqual( + self._would_run(result.output), + [ + f"INFO:aswfdocker.builder:Would run: 'docker buildx bake -f {bake_path} " + + "--set=*.output=type=cacheonly --set=*.target=ci-conan-package-builder " + + "--progress auto ci-package-openexr-2027'" + ], + ) + + def test_docker_org_overrides_repo_derived_org(self, mock_compute): + result = self._package_build("--target", "openexr", "--docker-org", "aswf") + self.assertEqual(result.exit_code, 0, msg=result.output) + # package_org (the Conan user and remote) follows the Docker org + self.assertEqual(mock_compute.call_args.args[1:3], ("aswf", "aswf")) + + def test_package_push_refused_outside_github_actions(self, mock_compute): + with patch.dict(os.environ): + os.environ.pop("GITHUB_ACTIONS", None) + result = self._package_build("--target", "openexr", "--push", "YES") + self.assertNotEqual(result.exit_code, 0) + self.assertIn("can only be uploaded", result.output) + mock_compute.assert_not_called() + + def test_image_push_refused_outside_github_actions(self, _mock_compute): + with patch.dict(os.environ): + os.environ.pop("GITHUB_ACTIONS", None) + result = CliRunner().invoke( + aswfdocker.cli, + ["build", "-g", "base", "-v", "2027", "--push", "YES", "--dry-run"], + ) + self.assertNotEqual(result.exit_code, 0) + self.assertIn("can only be uploaded", result.output) + + def test_image_auto_push_refused_outside_github_actions(self, _mock_compute): + with patch.dict(os.environ): + os.environ.pop("GITHUB_ACTIONS", None) + result = CliRunner().invoke( + aswfdocker.cli, + [ + "--repo-uri", + constants.MAIN_GITHUB_ASWF_DOCKER_URL, + "--source-branch", + "refs/heads/main", + "build", + "-g", + "base", + "-v", + "2027", + "--push", + "AUTO", + "--dry-run", + ], + ) + self.assertNotEqual(result.exit_code, 0) + self.assertIn("can only be uploaded", result.output) + + @patch.dict(os.environ, {"GITHUB_ACTIONS": "true"}) + def test_image_push_allowed_on_github_actions(self, _mock_compute): + result = CliRunner().invoke( + aswfdocker.cli, + ["build", "-g", "base", "-v", "2027", "--push", "YES", "--dry-run"], + ) + self.assertEqual(result.exit_code, 0, msg=result.output) + + @staticmethod + def _clang_needs_cmake(*args, **_kwargs): + """A graph where clang tool-requires cmake, everything needing a build.""" + names = [name for name, _ in args[4]] + order = buildorder.BuildOrder([names]) + if "clang" in names and "cmake" in names: + order.add_edge("clang", "cmake") + order.need_build = set(names) + return order + + def _bake_targets(self, output): + return [cmd.rsplit(" ", 1)[-1].rstrip("'") for cmd in self._would_run(output)] + + def test_common_builds_every_clang_version_once_each(self, mock_compute): + mock_compute.side_effect = self._clang_needs_cmake + result = CliRunner().invoke( + aswfdocker.cli, + ["build", "-t", "PACKAGE", "-g", "common", "-v", "2027", "--dry-run"], + ) + self.assertEqual(result.exit_code, 0, msg=result.output) + majors = list(index.Index().version_info("2027").clang_versions) + # One build order per clang version, each covering the whole group + self.assertEqual(mock_compute.call_count, len(majors)) + clang_versions = index.Index().version_info("2027").clang_versions + for call, major in zip(mock_compute.call_args_list, majors): + self.assertIn(("clang", clang_versions[major]), call.args[4]) + self.assertIn("cmake", [name for name, _ in call.args[4]]) + # ...but the other packages are only built by the first one + self.assertEqual( + self._bake_targets(result.output), + [ + "ci-package-openssl-2027", + "ci-package-gnutls-2027", + "ci-package-cmake-2027", + "ci-package-ninja-2027", + *(f"ci-package-clang-2027-clang{m}" for m in majors), + ], + ) + + def test_target_to_clang_builds_its_dependencies_once(self, mock_compute): + mock_compute.side_effect = self._clang_needs_cmake + result = self._package_build("--target-to", "clang") + self.assertEqual(result.exit_code, 0, msg=result.output) + majors = list(index.Index().version_info("2027").clang_versions) + self.assertEqual( + self._bake_targets(result.output), + [ + "ci-package-cmake-2027", + *(f"ci-package-clang-2027-clang{m}" for m in majors), + ], + ) + + def test_target_clang_refuses_unbuilt_cmake(self, mock_compute): + mock_compute.side_effect = self._clang_needs_cmake + result = self._package_build("--target", "clang") + self.assertEqual(result.exit_code, 1, msg=result.output) + self.assertEqual(self._would_run(result.output), []) + + def test_single_clang_version(self, mock_compute): + result = CliRunner().invoke( + aswfdocker.cli, + [ + "build", + "-t", + "PACKAGE", + "-g", + "common", + "-v", + "2027-clang22", + "--dry-run", + ], + ) + self.assertEqual(result.exit_code, 0, msg=result.output) + mock_compute.assert_called_once() + self.assertEqual( + self._bake_targets(result.output), ["ci-package-clang-2027-clang22"] + ) + + def test_target_to_rejected_for_images(self, _mock_compute): + result = CliRunner().invoke( + aswfdocker.cli, + ["build", "--version", "2027", "--target-to", "openexr", "--dry-run"], + ) + self.assertNotEqual(result.exit_code, 0) + self.assertIn("require --ci-image-type PACKAGE", result.output) + + @staticmethod + def _nothing_needs_build(*args, **kwargs): + order = _all_members_need_build(*args, **kwargs) + order.need_build = set() + return order + + def test_up_to_date_packages_are_skipped(self, mock_compute): + mock_compute.side_effect = self._nothing_needs_build + result = self._package_build("--target", "openexr") + self.assertEqual(result.exit_code, 0, msg=result.output) + self.assertEqual(self._would_run(result.output), []) + self.assertIn("2027: building nothing; up to date: openexr", result.output) + + def test_force_rebuild_builds_up_to_date_packages(self, mock_compute): + mock_compute.side_effect = self._nothing_needs_build + result = self._package_build("--target", "openexr", "--force-rebuild") + self.assertEqual(result.exit_code, 0, msg=result.output) + self.assertEqual(len(self._would_run(result.output)), 1) + self.assertIn("2027: building openexr; up to date: nothing", result.output) + + def test_unbuilt_dependency_refuses_with_list(self, mock_compute): + def imath_needs_build(*args, **_kwargs): + names = [name for name, _ in args[4]] + order = buildorder.BuildOrder([names]) + order.add_edge("openexr", "imath") + order.need_build = {"imath", "openexr"} + order.refs = {name: {f"{name}/x@aswftesting/vfx2027"} for name in names} + return order + + mock_compute.side_effect = imath_needs_build + result = self._package_build("--target", "openexr") + self.assertEqual(result.exit_code, 1, msg=result.output) + self.assertIn("imath/x@aswftesting/vfx2027", result.output) + self.assertEqual(self._would_run(result.output), []) diff --git a/python/aswfdocker/tests/test_buildorder.py b/python/aswfdocker/tests/test_buildorder.py new file mode 100644 index 000000000..cdad7254f --- /dev/null +++ b/python/aswfdocker/tests/test_buildorder.py @@ -0,0 +1,679 @@ +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# pylint: disable=protected-access +""" +Tests for buildorder.py +""" + +import json +import os +import shlex +import tempfile +import unittest +from unittest.mock import patch, MagicMock + +from aswfdocker import buildorder, versioninfo + +# TestNameFromRef/TestRecipeFolder/TestExportCommand use real aswf-docker +# package names (osl, qt, zlib) because they exercise this project's real +# on-disk recipe-folder conventions (including qt's config.yml +# multi-version layout). Even there, buildorder.py never inspects a version +# number, so none of the version strings below need to track the real +# values in python/aswfdocker/data/versions.yaml or +# packages/conan/settings/profiles/. +# +# TestParseBuildOrderJson and TestComputeBuildOrder instead use synthetic +# package names (pkga, pkgb, ...): their fixtures encode entirely +# fabricated dependency edges, used only to exercise +# parse_build_order_json()'s graph-handling logic (levels, +# downstream_closure). buildorder.py never looks at a recipe's actual +# requires() -- it only trusts whatever `conan graph build-order` reports -- +# so real package names there would wrongly suggest these made-up edges +# mean something about, say, osl's or openexr's real dependencies, which +# they don't and needn't. +TEST_PACKAGE_ORG = "aswf" +TEST_PROFILE = "vfx2027" +TEST_CHANNEL = "vfx2027_4" +OTHER_TEST_CHANNEL = "other_test_channel" +ZLIB_TEST_VERSION = "1.3.1" +OSL_TEST_VERSION = "1.14.4.0" +QT_TEST_VERSION = "6.8.1" +PKGA_TEST_VERSION = "1.0.0" +PKGB_TEST_VERSION = "2.0.0" +PKGC_TEST_VERSION = "3.0.0" +PKGD_TEST_VERSION = "4.0.0" +PKGE_TEST_VERSION = "5.0.0" + + +def _ref(name, version, org=TEST_PACKAGE_ORG, channel=TEST_CHANNEL): + return f"{name}/{version}@{org}/{channel}" + + +def _version_info(): + """The 2027.4 release, built with TEST_PROFILE in TEST_CHANNEL.""" + vi = versioninfo.VersionInfo( + version="2027", + major_version="2027", + minor_version="4", + tags=[], + parent_versions=[], + package_versions={}, + ) + vi.conan_profile = TEST_PROFILE + return vi + + +def _ref_entry(ref, depends=(), binary=None): + packages = [[{"package_id": "x", "binary": binary}]] if binary else [] + return {"ref": ref, "depends": list(depends), "packages": packages} + + +def _five_package_order(need_build=()): + """pkga/pkgb (no deps) -> pkgc (depends on both) -> pkgd/pkge (both + depend on pkgc), with `need_build` marked "Build" and the rest "Cache". + Purely synthetic -- see module docstring comment above.""" + + def entry(name, version, depends=()): + return _ref_entry( + _ref(name, version), + depends=depends, + binary="Build" if name in need_build else "Cache", + ) + + pkgc_ref = _ref("pkgc", PKGC_TEST_VERSION) + return buildorder.parse_build_order_json( + { + "order": [ + [entry("pkga", PKGA_TEST_VERSION), entry("pkgb", PKGB_TEST_VERSION)], + [ + entry( + "pkgc", + PKGC_TEST_VERSION, + [ + _ref("pkga", PKGA_TEST_VERSION), + _ref("pkgb", PKGB_TEST_VERSION), + ], + ) + ], + [ + entry("pkgd", PKGD_TEST_VERSION, [pkgc_ref]), + entry("pkge", PKGE_TEST_VERSION, [pkgc_ref]), + ], + ] + } + ) + + +class TestNameFromRef(unittest.TestCase): + def test_simple(self): + self.assertEqual( + buildorder._name_from_ref(_ref("osl", OSL_TEST_VERSION)), "osl" + ) + + def test_no_user_channel(self): + # Conan's own ref grammar is name/version[@user/channel] -- the + # @user/channel suffix is optional in general, even though every ref + # this project's own pipeline actually resolves will have one, since + # the vfx profiles' replace_requires/replace_tool_requires + # always redirect to a fully-qualified aswf/ ref. This case + # exercises that general grammar, not a shape our own pipeline will + # ever actually produce. + self.assertEqual(buildorder._name_from_ref(f"zlib/{ZLIB_TEST_VERSION}"), "zlib") + + +class TestParseBuildOrderJson(unittest.TestCase): + """Fixture shape: pkga/pkgb (no deps) -> pkgc (depends on both) -> + pkgd/pkge (both depend on pkgc). Purely synthetic -- see module + docstring comment above.""" + + def setUp(self): + self.data = { + "order_by": "recipe", + "reduced": True, + "order": [ + [ + _ref_entry(_ref("pkga", PKGA_TEST_VERSION)), + _ref_entry(_ref("pkgb", PKGB_TEST_VERSION)), + ], + [ + _ref_entry( + _ref("pkgc", PKGC_TEST_VERSION), + depends=[ + _ref("pkga", PKGA_TEST_VERSION), + _ref("pkgb", PKGB_TEST_VERSION), + ], + ), + ], + [ + _ref_entry( + _ref("pkgd", PKGD_TEST_VERSION), + depends=[_ref("pkgc", PKGC_TEST_VERSION)], + ), + _ref_entry( + _ref("pkge", PKGE_TEST_VERSION), + depends=[_ref("pkgc", PKGC_TEST_VERSION)], + ), + ], + ], + } + + def test_levels(self): + order = buildorder.parse_build_order_json(self.data) + self.assertEqual( + order.levels, + [ + ["pkga", "pkgb"], + ["pkgc"], + ["pkgd", "pkge"], + ], + ) + + def test_flat_order(self): + order = buildorder.parse_build_order_json(self.data) + self.assertEqual(order.flat_order(), ["pkga", "pkgb", "pkgc", "pkgd", "pkge"]) + + def test_downstream_closure_from_root(self): + order = buildorder.parse_build_order_json(self.data) + self.assertEqual(order.downstream_closure(["pkga"]), {"pkgc", "pkgd", "pkge"}) + + def test_downstream_closure_from_middle(self): + order = buildorder.parse_build_order_json(self.data) + self.assertEqual(order.downstream_closure(["pkgc"]), {"pkgd", "pkge"}) + + def test_downstream_closure_from_leaf_is_empty(self): + order = buildorder.parse_build_order_json(self.data) + self.assertEqual(order.downstream_closure(["pkgd"]), set()) + + def test_downstream_closure_multiple_seeds(self): + order = buildorder.parse_build_order_json(self.data) + self.assertEqual( + order.downstream_closure(["pkga", "pkgb"]), + {"pkgc", "pkgd", "pkge"}, + ) + + def test_missing_order_key_raises(self): + with self.assertRaises(buildorder.BuildOrderError): + buildorder.parse_build_order_json({"order_by": "recipe"}) + + def test_none_raises(self): + with self.assertRaises(buildorder.BuildOrderError): + buildorder.parse_build_order_json(None) + + def test_need_build_from_binary_status(self): + order = _five_package_order(need_build={"pkgb", "pkgd"}) + self.assertEqual(order.need_build, {"pkgb", "pkgd"}) + self.assertEqual(order.refs["pkgb"], {_ref("pkgb", PKGB_TEST_VERSION)}) + + def test_upstream_closure(self): + order = _five_package_order() + self.assertEqual(order.upstream_closure(["pkgd"]), {"pkgc", "pkga", "pkgb"}) + self.assertEqual(order.upstream_closure(["pkga"]), set()) + + def test_unbuildable_packages_raise(self): + # graph build-order records these instead of failing + for binary in ("Invalid", "Missing"): + with self.assertRaises(buildorder.BuildOrderError) as ctx: + buildorder.parse_build_order_json( + { + "order": [ + [_ref_entry(_ref("pkga", PKGA_TEST_VERSION), binary=binary)] + ] + } + ) + self.assertIn( + f"{_ref('pkga', PKGA_TEST_VERSION)} ({binary})", str(ctx.exception) + ) + + +class TestPlanBuild(unittest.TestCase): + """Uses _five_package_order(): pkga/pkgb -> pkgc -> pkgd/pkge.""" + + ALL = ["pkga", "pkgb", "pkgc", "pkgd", "pkge"] + + def test_whole_group_builds_only_what_needs_building_in_order(self): + order = _five_package_order(need_build={"pkgd", "pkgb", "pkgc"}) + plan = buildorder.plan_build(order, self.ALL) + self.assertEqual(plan.to_build, ["pkgb", "pkgc", "pkgd"]) + self.assertEqual(plan.up_to_date, ["pkga", "pkge"]) + + def test_force_rebuilds_every_selected_member(self): + order = _five_package_order() + plan = buildorder.plan_build(order, self.ALL, force=True) + self.assertEqual(plan.to_build, self.ALL) + self.assertEqual(plan.up_to_date, []) + + def test_targets_build_only_named_packages(self): + order = _five_package_order(need_build={"pkgd", "pkge"}) + plan = buildorder.plan_build(order, self.ALL, targets=["pkge"]) + self.assertEqual(plan.to_build, ["pkge"]) + + def test_target_to_includes_upstream(self): + order = _five_package_order(need_build={"pkga", "pkgc", "pkgd", "pkge"}) + plan = buildorder.plan_build(order, self.ALL, targets_to=["pkgd"]) + self.assertEqual(plan.to_build, ["pkga", "pkgc", "pkgd"]) + self.assertEqual(plan.up_to_date, ["pkgb"]) + + def test_target_from_includes_downstream_through_up_to_date(self): + # pkgc is up to date but still links pkga to pkgd/pkge + order = _five_package_order() + plan = buildorder.plan_build(order, self.ALL, targets_from=["pkga"], force=True) + self.assertEqual(plan.to_build, ["pkga", "pkgc", "pkgd", "pkge"]) + + def test_done_packages_are_skipped_and_never_block(self): + # An earlier plan of the same run builds pkga/pkgb: even forced, + # they're not rebuilt, and pkgc doesn't wait for them. + order = _five_package_order(need_build=set(self.ALL)) + plan = buildorder.plan_build( + order, self.ALL, targets=["pkgc"], force=True, done={"pkga", "pkgb"} + ) + self.assertEqual(plan.to_build, ["pkgc"]) + self.assertEqual(plan.up_to_date, []) + + def test_selections_union(self): + order = _five_package_order() + plan = buildorder.plan_build( + order, self.ALL, targets=["pkgb"], targets_from=["pkgd"], force=True + ) + self.assertEqual(plan.to_build, ["pkgb", "pkgd"]) + + def test_unselected_dependency_needing_build_refuses(self): + # same-group dependency outside the --target selection + order = _five_package_order(need_build={"pkga", "pkgd"}) + with self.assertRaises(buildorder.UnbuiltDependenciesError) as ctx: + buildorder.plan_build(order, self.ALL, targets=["pkgd"]) + self.assertEqual(ctx.exception.blockers, [_ref("pkga", PKGA_TEST_VERSION)]) + + def test_out_of_group_dependency_needing_build_refuses(self): + # pkga/pkgb stand in for an earlier group's packages + order = _five_package_order(need_build={"pkgb", "pkgc"}) + with self.assertRaises(buildorder.UnbuiltDependenciesError) as ctx: + buildorder.plan_build(order, ["pkgc", "pkgd", "pkge"]) + self.assertEqual(ctx.exception.blockers, [_ref("pkgb", PKGB_TEST_VERSION)]) + + def test_force_still_refuses_unbuilt_out_of_group_dependency(self): + order = _five_package_order(need_build={"pkga"}) + with self.assertRaises(buildorder.UnbuiltDependenciesError): + buildorder.plan_build(order, ["pkgc", "pkgd", "pkge"], force=True) + + def test_unrelated_unbuilt_package_does_not_block(self): + # pkgb needs building too, but pkga doesn't depend on it + order = _five_package_order(need_build={"pkga", "pkgb"}) + plan = buildorder.plan_build(order, self.ALL, targets=["pkga"]) + self.assertEqual(plan.to_build, ["pkga"]) + + def test_unknown_target_raises(self): + order = _five_package_order() + with self.assertRaises(buildorder.BuildOrderError): + buildorder.plan_build(order, self.ALL, targets_to=["nope"]) + + def test_nothing_to_build(self): + order = _five_package_order() + plan = buildorder.plan_build(order, self.ALL) + self.assertEqual(plan.to_build, []) + self.assertEqual(plan.up_to_date, self.ALL) + + +class TestRecipeFolder(unittest.TestCase): + def test_single_version_recipe_has_no_config_yml(self): + with tempfile.TemporaryDirectory() as repo_root: + recipe_dir = os.path.join(repo_root, "packages", "conan", "recipes", "osl") + os.makedirs(recipe_dir) + self.assertEqual( + buildorder._recipe_folder(repo_root, "osl", OSL_TEST_VERSION), + recipe_dir, + ) + + def test_multi_version_recipe_uses_config_yml_folder(self): + with tempfile.TemporaryDirectory() as repo_root: + recipe_dir = os.path.join(repo_root, "packages", "conan", "recipes", "qt") + os.makedirs(recipe_dir) + with open( + os.path.join(recipe_dir, "config.yml"), "w", encoding="utf-8" + ) as f: + f.write(f"versions:\n '{QT_TEST_VERSION}':\n folder: all\n") + self.assertEqual( + buildorder._recipe_folder(repo_root, "qt", QT_TEST_VERSION), + os.path.join(recipe_dir, "all"), + ) + + def test_multi_version_recipe_missing_version_entry_raises(self): + with tempfile.TemporaryDirectory() as repo_root: + recipe_dir = os.path.join(repo_root, "packages", "conan", "recipes", "qt") + os.makedirs(recipe_dir) + with open( + os.path.join(recipe_dir, "config.yml"), "w", encoding="utf-8" + ) as f: + f.write(f"versions:\n '{QT_TEST_VERSION}':\n folder: all\n") + with self.assertRaises(buildorder.BuildOrderError): + buildorder._recipe_folder(repo_root, "qt", "0.0.0") + + +class TestExportEntry(unittest.TestCase): + def test_single_version(self): + with tempfile.TemporaryDirectory() as repo_root: + os.makedirs(os.path.join(repo_root, "packages", "conan", "recipes", "osl")) + entry = buildorder._export_entry( + repo_root, "osl", OSL_TEST_VERSION, TEST_PACKAGE_ORG, TEST_CHANNEL + ) + self.assertEqual( + entry, + [ + os.path.join(buildorder.constants.ASWF_CONAN_HOME, "recipes", "osl"), + "osl", + OSL_TEST_VERSION, + TEST_PACKAGE_ORG, + TEST_CHANNEL, + ], + ) + + def test_multi_version(self): + with tempfile.TemporaryDirectory() as repo_root: + recipe_dir = os.path.join(repo_root, "packages", "conan", "recipes", "qt") + os.makedirs(recipe_dir) + with open( + os.path.join(recipe_dir, "config.yml"), "w", encoding="utf-8" + ) as f: + f.write(f"versions:\n '{QT_TEST_VERSION}':\n folder: all\n") + entry = buildorder._export_entry( + repo_root, "qt", QT_TEST_VERSION, TEST_PACKAGE_ORG, TEST_CHANNEL + ) + self.assertEqual( + entry[0], + os.path.join(buildorder.constants.ASWF_CONAN_HOME, "recipes", "qt", "all"), + ) + + +class TestExportAllCommand(unittest.TestCase): + def test_round_trips_through_shell_quoting(self): + entries = [ + ["/opt/conan_home/recipes/osl", "osl", OSL_TEST_VERSION, "aswf", "vfx2027"], + ["/opt/conan_home/recipes/zlib", "zlib", ZLIB_TEST_VERSION, "aswf", "x'y"], + ] + argv = shlex.split( + buildorder._export_all_command(entries, ["--remote", "aswftesting"]) + ) + self.assertEqual(argv[:4], ["conan", "aswf-export", "--remote", "aswftesting"]) + self.assertEqual(len(argv), 5) + self.assertEqual(json.loads(argv[4]), entries) + + +class TestBuildOrderCommand(unittest.TestCase): + def test_contains_requires_and_profile(self): + cmd = buildorder._build_order_command( + [("pkga", PKGA_TEST_VERSION), ("pkgb", PKGB_TEST_VERSION)], + TEST_PACKAGE_ORG, + TEST_PROFILE, + TEST_CHANNEL, + ["--no-remote"], + ) + self.assertIn(" --no-remote ", cmd) + self.assertIn(f"--requires={_ref('pkga', PKGA_TEST_VERSION)}", cmd) + self.assertIn(f"--requires={_ref('pkgb', PKGB_TEST_VERSION)}", cmd) + self.assertNotIn("--reduce", cmd) # plan_build() needs the full graph + self.assertIn("--order-by=recipe", cmd) + self.assertIn("--format=json", cmd) + self.assertIn( + os.path.join( + buildorder.constants.ASWF_CONAN_HOME, + ".conan2", + "profiles", + TEST_PROFILE, + ), + cmd, + ) + + +def _write_profiles(repo_root): + """A synthetic pair of generated profiles: TEST_PROFILE includes + OTHER_TEST_CHANNEL (profile_refs() follows include()s, although the + generated profiles don't currently use them), redirects pkga/pkgb to + TEST_CHANNEL, pkgc (via the include) and pkgd (via a *_ref conf value) to + OTHER_TEST_CHANNEL, and also lists refs that must be ignored: a + platform-style ref with no {{ org }}/channel, and one of our refs with + no recipe directory.""" + profiles_dir = os.path.join(repo_root, "packages", "conan", "settings", "profiles") + recipes_root = os.path.join(repo_root, "packages", "conan", "recipes") + os.makedirs(profiles_dir) + for name in ("pkga", "pkgb", "pkgc", "pkgd"): + os.makedirs(os.path.join(recipes_root, name)) + org = '{% set org = os.getenv("ASWF_PKG_ORG", "aswf") %}' + with open( + os.path.join(profiles_dir, OTHER_TEST_CHANNEL), "w", encoding="utf-8" + ) as f: + f.write( + f"{org}\n" + "[replace_tool_requires]\n" + f"pkgc/*: pkgc/{PKGC_TEST_VERSION}@{{{{ org }}}}/{OTHER_TEST_CHANNEL}\n" + ) + with open(os.path.join(profiles_dir, TEST_PROFILE), "w", encoding="utf-8") as f: + f.write( + "# generated\n" + f"{org}\n" + f"include({OTHER_TEST_CHANNEL})\n" + "[options]\n" + "*:shared=True\n" + "[replace_requires]\n" + f"pkga/*: pkga/{PKGA_TEST_VERSION}@{{{{ org }}}}/{TEST_CHANNEL}\n" + f"pkgb/*: pkgb/{PKGB_TEST_VERSION}@{{{{ org }}}}/{TEST_CHANNEL}\n" + "pkgconf/*: pkgconf/1.7.3@system\n" + f"norecipe/*: norecipe/9.9.9@{{{{ org }}}}/{TEST_CHANNEL}\n" + "[conf]\n" + f"user.aswf:pkgd_ref=pkgd/{PKGD_TEST_VERSION}@{{{{ org }}}}/{OTHER_TEST_CHANNEL}\n" + "user.aswf:unrelated_setting=True\n" + ) + + +class TestProfileRefs(unittest.TestCase): + def test_follows_include_replace_sections_and_ref_conf(self): + with tempfile.TemporaryDirectory() as repo_root: + _write_profiles(repo_root) + self.assertEqual( + buildorder.profile_refs(repo_root, TEST_PROFILE), + [ + ("pkgc", PKGC_TEST_VERSION, OTHER_TEST_CHANNEL), + ("pkga", PKGA_TEST_VERSION, TEST_CHANNEL), + ("pkgb", PKGB_TEST_VERSION, TEST_CHANNEL), + ("pkgd", PKGD_TEST_VERSION, OTHER_TEST_CHANNEL), + ], + ) + + +class TestComputeBuildOrder(unittest.TestCase): + """Fixture shape: pkga (no deps) -> pkgb (depends on pkga), requested as + members; pkgc/pkgd are only reachable through the profile (standing in + for out-of-group dependencies like cpython, or cmake from common). + Purely synthetic -- see module docstring comment above.""" + + def setUp(self): + tmpdir = tempfile.TemporaryDirectory() # pylint: disable=consider-using-with + self.addCleanup(tmpdir.cleanup) + self.repo_root = tmpdir.name + _write_profiles(self.repo_root) + self.members = [("pkga", PKGA_TEST_VERSION), ("pkgb", PKGB_TEST_VERSION)] + self.fixture = { + "order_by": "recipe", + "order": [ + [_ref_entry(_ref("pkga", PKGA_TEST_VERSION))], + [ + _ref_entry( + _ref("pkgb", PKGB_TEST_VERSION), + depends=[_ref("pkga", PKGA_TEST_VERSION)], + ) + ], + ], + } + + def _compute( + self, members=None, conan_remote=buildorder.constants.CONAN_REMOTE_LOCAL + ): + # conan_remote is explicit by default so these tests don't depend on + # GITHUB_ACTIONS when run on CI. + return buildorder.compute_build_order( + self.repo_root, + TEST_PACKAGE_ORG, + TEST_PACKAGE_ORG, + _version_info(), + self.members if members is None else members, + conan_remote=conan_remote, + ) + + def test_empty_members_skips_subprocess(self): + with patch.object(buildorder.subprocess, "run") as mock_run: + order = self._compute(members=[]) + mock_run.assert_not_called() + self.assertEqual(order.levels, []) + + @staticmethod + def _output_dir_from_cmd(cmd): + prefix = f"--set={buildorder.BAKE_TARGET_NAME}.output=type=local,dest=" + for arg in cmd: + if arg.startswith(prefix): + return arg[len(prefix) :] + raise AssertionError(f"no --set=...output=type=local,dest=... in {cmd!r}") + + def _fake_bake_run(self, output_contents, captured=None): + """Returns a subprocess.run replacement that writes + `output_contents` into the --output=type=local,dest=... directory + the real `compute_build_order()` passes, mimicking what `docker + buildx bake` would actually leave there. If `captured` is given, + records the invoked cmd and the bake JSON file's parsed content + into it -- both read here, synchronously, since + compute_build_order() deletes its tempdir (bake jsonfile included) + before returning.""" + + def run(cmd, **_kwargs): + if captured is not None: + captured["cmd"] = cmd + bake_jsonfile = cmd[cmd.index("-f") + 1] + with open(bake_jsonfile, "r", encoding="utf-8") as f: + captured["bake_dict"] = json.load(f) + output_dir = self._output_dir_from_cmd(cmd) + output_path = os.path.join(output_dir, buildorder.BUILD_ORDER_FILENAME) + with open(output_path, "w", encoding="utf-8") as f: + f.write(output_contents) + return MagicMock(returncode=0, stdout="", stderr="") + + return run + + def test_happy_path_parses_result(self): + captured = {} + with patch.object( + buildorder.subprocess, + "run", + side_effect=self._fake_bake_run(json.dumps(self.fixture), captured), + ): + order = self._compute() + self.assertEqual(order.levels, [["pkga"], ["pkgb"]]) + + cmd = captured["cmd"] + self.assertEqual(cmd[:3], ["docker", "buildx", "bake"]) + self.assertIn( + f"--set={buildorder.BAKE_TARGET_NAME}.target=ci-conan-graph-output", cmd + ) + self.assertIn(buildorder.BAKE_TARGET_NAME, cmd) + + args = captured["bake_dict"]["target"][buildorder.BAKE_TARGET_NAME]["args"] + self.assertEqual(args["ASWF_ORG"], TEST_PACKAGE_ORG) + self.assertEqual(args["ASWF_PKG_ORG"], TEST_PACKAGE_ORG) + self.assertEqual(args["ASWF_VFXPLATFORM_VERSION"], "2027") + self.assertEqual(args["ASWF_VFXPLATFORM_MINOR_VERSION"], "4") + self.assertEqual(args["ASWF_CONAN_PROFILE"], TEST_PROFILE) + self.assertEqual(args["ASWF_CONAN_CHANNEL"], TEST_CHANNEL) + self.assertIn("ASWF_CONAN_GRAPH_SCRIPT", args) + self.assertIn("conan graph build-order", args["ASWF_CONAN_GRAPH_SCRIPT"]) + + def test_forces_fresh_run_without_resetting_cache_mounts(self): + # A per-run nonce ARG defeats BuildKit's layer-cache replay of the + # graph RUN. no-cache/no-cache-filter must never be used for this: + # they also make BuildKit replace the shared aswf-conan-cache (and + # aswf-ccache) mounts with fresh empty ones. + nonces = [] + for _ in range(2): + captured = {} + with patch.object( + buildorder.subprocess, + "run", + side_effect=self._fake_bake_run(json.dumps(self.fixture), captured), + ): + self._compute() + target = captured["bake_dict"]["target"][buildorder.BAKE_TARGET_NAME] + self.assertNotIn("no-cache", target) + self.assertNotIn("no-cache-filter", target) + nonces.append(target["args"]["ASWF_CONAN_NONCE"]) + self.assertFalse( + any("no-cache" in arg for arg in captured["cmd"]), captured["cmd"] + ) + self.assertNotEqual(nonces[0], nonces[1]) + + def test_exports_profile_refs_on_their_own_channel_requires_only_members(self): + captured = {} + with patch.object( + buildorder.subprocess, + "run", + side_effect=self._fake_bake_run(json.dumps(self.fixture), captured), + ): + self._compute() + args = captured["bake_dict"]["target"][buildorder.BAKE_TARGET_NAME]["args"] + script = args["ASWF_CONAN_GRAPH_SCRIPT"] + export_part, graph_part = script.split(" && ") + argv = shlex.split(export_part) + self.assertEqual(argv[:2], ["conan", "aswf-export"]) + exported = [tuple(entry[1:]) for entry in json.loads(argv[-1])] + self.assertEqual( + exported, + [ + ("pkgc", PKGC_TEST_VERSION, TEST_PACKAGE_ORG, OTHER_TEST_CHANNEL), + ("pkga", PKGA_TEST_VERSION, TEST_PACKAGE_ORG, TEST_CHANNEL), + ("pkgb", PKGB_TEST_VERSION, TEST_PACKAGE_ORG, TEST_CHANNEL), + ("pkgd", PKGD_TEST_VERSION, TEST_PACKAGE_ORG, OTHER_TEST_CHANNEL), + ], + ) + self.assertIn(f"--requires={_ref('pkga', PKGA_TEST_VERSION)}", graph_part) + self.assertIn(f"--requires={_ref('pkgb', PKGB_TEST_VERSION)}", graph_part) + self.assertNotIn("--requires=pkgc", graph_part) + self.assertNotIn("--requires=pkgd", graph_part) + + def test_remote_policy_applies_to_export_and_graph(self): + for conan_remote, expected in ( + (buildorder.constants.CONAN_REMOTE_LOCAL, ["--no-remote"]), + ("aswftesting", ["--remote", "aswftesting"]), + ): + captured = {} + with patch.object( + buildorder.subprocess, + "run", + side_effect=self._fake_bake_run(json.dumps(self.fixture), captured), + ): + self._compute(conan_remote=conan_remote) + target = captured["bake_dict"]["target"][buildorder.BAKE_TARGET_NAME] + export_part, graph_part = target["args"]["ASWF_CONAN_GRAPH_SCRIPT"].split( + " && " + ) + self.assertEqual(shlex.split(export_part)[2:-1], expected) + self.assertIn(f" {' '.join(expected)} ", graph_part) + + def test_nonzero_exit_raises(self): + mock_result = MagicMock(returncode=1, stdout="", stderr="boom") + with patch.object(buildorder.subprocess, "run", return_value=mock_result): + with self.assertRaises(buildorder.BuildOrderError): + self._compute() + + def test_invalid_json_raises(self): + with patch.object( + buildorder.subprocess, "run", side_effect=self._fake_bake_run("not json") + ): + with self.assertRaises(buildorder.BuildOrderError): + self._compute() + + def test_missing_output_file_raises(self): + # docker buildx bake "succeeded" but never actually wrote the + # extracted file -- shouldn't happen, but must not be misread as + # an empty/trivial result. + mock_result = MagicMock(returncode=0, stdout="", stderr="") + with patch.object(buildorder.subprocess, "run", return_value=mock_result): + with self.assertRaises(buildorder.BuildOrderError): + self._compute() + + +if __name__ == "__main__": + unittest.main() diff --git a/python/aswfdocker/tests/test_cmd_aswf_download_metadata.py b/python/aswfdocker/tests/test_cmd_aswf_download_metadata.py new file mode 100644 index 000000000..3b0c80350 --- /dev/null +++ b/python/aswfdocker/tests/test_cmd_aswf_download_metadata.py @@ -0,0 +1,146 @@ +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +""" +Tests for the `conan aswf-download-metadata` custom command +(packages/conan/settings/extensions/commands/cmd_aswf_download_metadata.py). + +Like the deployer, that module lives outside the aswfdocker package and is +loaded by Conan from $CONAN_HOME/extensions/commands, so it's loaded here +by file path. +""" + +import importlib.util +import os +import unittest + +_REPO_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", "..", "..")) +_MODULE_PATH = os.path.join( + _REPO_ROOT, + "packages", + "conan", + "settings", + "extensions", + "commands", + "cmd_aswf_download_metadata.py", +) + + +def _load_module(): + spec = importlib.util.spec_from_file_location( + "cmd_aswf_download_metadata", _MODULE_PATH + ) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +def _node(ref, binary, binary_remote, package_id="pid", prev="prev1"): + return { + "ref": ref, + "recipe": "Downloaded", + "rrev_timestamp": 1700000000.0, + "package_id": package_id, + "prev": prev, + "prev_timestamp": 1700000001.0, + "binary": binary, + "binary_remote": binary_remote, + } + + +_GRAPH = { + "graph": { + "nodes": { + # The consumer conanfile.txt + "0": { + "ref": "", + "recipe": "Consumer", + "package_id": None, + "prev": None, + "binary": None, + "binary_remote": None, + }, + "1": _node( + "openexr/3.4.3@aswf/vfx2027_4#rrev1", "Download", "aswf", "pid1" + ), + # Already in the cache: nothing to download. + "2": _node("imath/3.2.2@aswf/vfx2027_4#rrev2", "Cache", None, "pid2"), + # A tool requirement `conan install` skips, though it's on the + # remote. + "3": _node("cmake/4.1.2@aswf/vfx2027_4#rrev3", "Skip", "aswf", "pid3"), + # On another remote. + "4": _node("zlib/1.3.1@aswf/vfx2027_4#rrev4", "Download", "other", "pid4"), + "5": _node("ptex/2.5.0@aswf/vfx2027_4#rrev5", "Download", "aswf", "pid5"), + } + } +} + + +class _FakeDownloadAPI: + def __init__(self): + self.calls = [] + + def recipe(self, ref, remote, metadata=None): + self.calls.append(("recipe", str(ref), remote.name, metadata)) + + def package(self, pref, remote, metadata=None): + self.calls.append(("package", pref.repr_notime(), remote.name, metadata)) + + +class _FakeRemote: + name = "aswf" + + +class _FakeConanAPI: + def __init__(self): + self.download = _FakeDownloadAPI() + + +class TestPackagesToDownload(unittest.TestCase): + def setUp(self): + self.module = _load_module() + + def test_only_downloads_from_remote(self): + prefs = self.module.packages_to_download(_GRAPH, "aswf") + self.assertEqual( + [p.repr_notime() for p in prefs], + [ + "openexr/3.4.3@aswf/vfx2027_4#rrev1:pid1#prev1", + "ptex/2.5.0@aswf/vfx2027_4#rrev5:pid5#prev1", + ], + ) + self.assertEqual(prefs[0].ref.timestamp, 1700000000.0) + self.assertEqual(prefs[0].timestamp, 1700000001.0) + + def test_nothing_to_download(self): + self.assertEqual(self.module.packages_to_download(_GRAPH, "missing"), []) + + +class TestDownloadWithMetadata(unittest.TestCase): + def setUp(self): + self.module = _load_module() + + def test_downloads_recipe_then_package_with_metadata(self): + conan_api = _FakeConanAPI() + prefs = self.module.packages_to_download(_GRAPH, "aswf") + self.module.download_with_metadata( + conan_api, prefs, _FakeRemote(), ["aswf_provenance.json"] + ) + self.assertEqual( + conan_api.download.calls, + [ + ("recipe", "openexr/3.4.3@aswf/vfx2027_4", "aswf", None), + ( + "package", + "openexr/3.4.3@aswf/vfx2027_4#rrev1:pid1#prev1", + "aswf", + ["aswf_provenance.json"], + ), + ("recipe", "ptex/2.5.0@aswf/vfx2027_4", "aswf", None), + ( + "package", + "ptex/2.5.0@aswf/vfx2027_4#rrev5:pid5#prev1", + "aswf", + ["aswf_provenance.json"], + ), + ], + ) diff --git a/python/aswfdocker/tests/test_cmd_aswf_export.py b/python/aswfdocker/tests/test_cmd_aswf_export.py new file mode 100644 index 000000000..743aada27 --- /dev/null +++ b/python/aswfdocker/tests/test_cmd_aswf_export.py @@ -0,0 +1,126 @@ +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +""" +Tests for the `conan aswf-export` custom command +(packages/conan/settings/extensions/commands/cmd_aswf_export.py). + +Like the deployer, that module lives outside the aswfdocker package and is +loaded by Conan from $CONAN_HOME/extensions/commands, so it's loaded here +by file path. export_all() is exercised against a fake conan_api that +records the calls the built-in `conan export` command would make. +""" + +import importlib.util +import os +import unittest + +_REPO_ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), "..", "..", "..")) +_MODULE_PATH = os.path.join( + _REPO_ROOT, + "packages", + "conan", + "settings", + "extensions", + "commands", + "cmd_aswf_export.py", +) + + +def _load_module(): + spec = importlib.util.spec_from_file_location("cmd_aswf_export", _MODULE_PATH) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +class _FakeRef: + def __init__(self, text): + self._text = text + + def repr_notime(self): + return self._text + + +class _FakeLocalAPI: + @staticmethod + def get_conanfile_path(path, cwd, py): + assert py is True + return os.path.join(cwd, path, "conanfile.py") + + +_IMPLICIT_LOCKFILE = object() + + +class _FakeLockfileAPI: + @staticmethod + def get_lockfile(lockfile, conanfile_path, cwd, partial): + # No explicit lockfile, but Conan may still pick up an implicit + # conan.lock next to the recipe -- export() must be handed whatever + # comes back, same as the built-in `conan export`. + assert lockfile is None and conanfile_path and cwd and partial is False + return _IMPLICIT_LOCKFILE + + +class _FakeExportAPI: + def __init__(self): + self.calls = [] + + def export(self, **kwargs): + self.calls.append(kwargs) + ref = ( + f"{kwargs['name']}/{kwargs['version']}@{kwargs['user']}/{kwargs['channel']}" + ) + return _FakeRef(ref), None + + +class _FakeConanAPI: + def __init__(self): + self.local = _FakeLocalAPI() + self.lockfile = _FakeLockfileAPI() + self.export = _FakeExportAPI() + + +class TestExportAll(unittest.TestCase): + def test_exports_each_entry_in_order(self): + module = _load_module() + api = _FakeConanAPI() + refs = module.export_all( + api, + [ + ["recipes/zlib", "zlib", "1.3.1", "aswf", "vfx2027"], + ["recipes/cmake", "cmake", "4.3.3", "aswf", "vfx2026"], + ], + "/work", + ["remote"], + ) + self.assertEqual( + [r.repr_notime() for r in refs], + ["zlib/1.3.1@aswf/vfx2027", "cmake/4.3.3@aswf/vfx2026"], + ) + self.assertEqual( + api.export.calls, + [ + { + "path": "/work/recipes/zlib/conanfile.py", + "name": "zlib", + "version": "1.3.1", + "user": "aswf", + "channel": "vfx2027", + "lockfile": _IMPLICIT_LOCKFILE, + "remotes": ["remote"], + }, + { + "path": "/work/recipes/cmake/conanfile.py", + "name": "cmake", + "version": "4.3.3", + "user": "aswf", + "channel": "vfx2026", + "lockfile": _IMPLICIT_LOCKFILE, + "remotes": ["remote"], + }, + ], + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/python/aswfdocker/tests/test_conandiff.py b/python/aswfdocker/tests/test_conandiff.py index 586616eff..75c0a54b0 100644 --- a/python/aswfdocker/tests/test_conandiff.py +++ b/python/aswfdocker/tests/test_conandiff.py @@ -255,7 +255,7 @@ def test_unknown_group_raises(self): conandiff._resolve_recipe_names(["not-a-real-group"], []) def test_group_and_target_combined(self): - names = conandiff._resolve_recipe_names(["base1-1"], ["zlib", "b2"]) + names = conandiff._resolve_recipe_names(["base1"], ["zlib", "b2"]) self.assertEqual(sorted(names), ["b2", "zlib"]) diff --git a/python/aswfdocker/tests/test_dockergen.py b/python/aswfdocker/tests/test_dockergen.py index 641052113..8caa9045a 100644 --- a/python/aswfdocker/tests/test_dockergen.py +++ b/python/aswfdocker/tests/test_dockergen.py @@ -9,7 +9,7 @@ from click.testing import CliRunner -from aswfdocker import dockergen +from aswfdocker import constants, dockergen, index from aswfdocker.cli import aswfdocker @@ -19,6 +19,16 @@ def test_dockergen(self): self.assertTrue(dg.check_dockerfile()) self.assertTrue(dg.check_readme()) + def test_images_from_ci_common_pin_its_release(self): + # Never inadvertently built on top of a previous release's ci-common. + for image in index.Index().iter_images(constants.ImageType.IMAGE): + docker_from = dockergen.DockerGen(image).image_data["docker_from"] + if "/ci-common:" in docker_from: + self.assertTrue( + docker_from.endswith(".${ASWF_VFXPLATFORM_MINOR_VERSION}"), + msg=f"ci-{image}: {docker_from}", + ) + class TestUtilsCli(unittest.TestCase): def setUp(self): @@ -38,10 +48,6 @@ def test_cli_dockergen(self): # for Conan profiles (always checked regardless of --image-name). self.assertTrue(lines[0].endswith("ci-base/Dockerfile is up to date")) self.assertTrue(lines[1].endswith("ci-base/README.md is up to date")) - self.assertTrue( - any("profiles/ci_common" in line for line in lines), - "Expected Conan ci_common profile check lines in output", - ) self.assertTrue( any("profiles/vfx" in line for line in lines), "Expected Conan vfx profile check lines in output", diff --git a/python/aswfdocker/tests/test_hook_aswf_provenance.py b/python/aswfdocker/tests/test_hook_aswf_provenance.py new file mode 100644 index 000000000..d0406cd26 --- /dev/null +++ b/python/aswfdocker/tests/test_hook_aswf_provenance.py @@ -0,0 +1,113 @@ +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +""" +Tests for the hook_aswf_provenance Conan hook +""" + +import importlib.util +import json +import os +import tempfile +import unittest +from unittest import mock + +_MODULE_PATH = os.path.join( + os.path.dirname(__file__), + "..", + "..", + "..", + "packages", + "conan", + "settings", + "extensions", + "hooks", + "hook_aswf_provenance.py", +) + + +def _load_hook(): + spec = importlib.util.spec_from_file_location("hook_aswf_provenance", _MODULE_PATH) + module = importlib.util.module_from_spec(spec) + spec.loader.exec_module(module) + return module + + +hook = _load_hook() + + +class _FakeOutput: + def __init__(self): + self.messages = [] + + def info(self, message): + self.messages.append(message) + + +class _FakeConanFile: + def __init__(self, package_metadata_folder): + self.package_metadata_folder = package_metadata_folder + self.output = _FakeOutput() + + +_ENV_VARS = ("ASWF_GIT_SHA", "ASWF_GIT_DIRTY", "ASWF_GIT_DIFF_HASH") + + +class TestPostPackage(unittest.TestCase): + def setUp(self): + tmp = tempfile.TemporaryDirectory() # pylint: disable=consider-using-with + self.addCleanup(tmp.cleanup) + # Conan creates the metadata folder lazily; the hook must cope. + self.metadata = os.path.join(tmp.name, "metadata") + self.conanfile = _FakeConanFile(self.metadata) + env = mock.patch.dict(os.environ) + env.start() + self.addCleanup(env.stop) + for name in _ENV_VARS: + os.environ.pop(name, None) + + def _provenance(self): + with open( + os.path.join(self.metadata, hook.PROVENANCE_FILE), encoding="utf-8" + ) as f: + return json.load(f) + + def test_nothing_written_outside_aswfdocker_builds(self): + hook.post_package(self.conanfile) + self.assertFalse(os.path.exists(self.metadata)) + self.assertEqual(self.conanfile.output.messages, []) + + def test_empty_sha_is_treated_as_unset(self): + # The Dockerfile ARG exists even when aswfdocker doesn't set it. + os.environ["ASWF_GIT_SHA"] = "" + hook.post_package(self.conanfile) + self.assertFalse(os.path.exists(self.metadata)) + + def test_clean_build(self): + os.environ.update( + { + "ASWF_GIT_SHA": "abc123", + "ASWF_GIT_DIRTY": "false", + "ASWF_GIT_DIFF_HASH": "", + } + ) + hook.post_package(self.conanfile) + self.assertEqual(self._provenance(), {"git_sha": "abc123", "git_dirty": False}) + self.assertEqual(len(self.conanfile.output.messages), 1) + + def test_dirty_build(self): + os.environ.update( + { + "ASWF_GIT_SHA": "abc123", + "ASWF_GIT_DIRTY": "true", + "ASWF_GIT_DIFF_HASH": "f00d", + } + ) + hook.post_package(self.conanfile) + self.assertEqual( + self._provenance(), + {"git_sha": "abc123", "git_dirty": True, "git_diff_hash": "f00d"}, + ) + + +if __name__ == "__main__": + unittest.main() diff --git a/python/aswfdocker/tests/test_index.py b/python/aswfdocker/tests/test_index.py index acd77f270..4679b3ede 100644 --- a/python/aswfdocker/tests/test_index.py +++ b/python/aswfdocker/tests/test_index.py @@ -16,7 +16,8 @@ def setUp(self): def test_iter_images(self): packages = list(self.index.iter_images(constants.ImageType.PACKAGE)) self.assertGreater(len(packages), 15) - self.assertEqual(packages[0], "clang") + self.assertEqual(packages[0], "openssl") + self.assertIn("clang", packages) def test_get_versions(self): images = list(self.index.iter_images(constants.ImageType.IMAGE)) @@ -24,24 +25,115 @@ def test_get_versions(self): self.assertEqual(images[0], "baseos-gl-conan") versions = list(self.index.iter_versions(constants.ImageType.IMAGE, images[0])) self.assertGreaterEqual(len(versions), 1) - self.assertTrue(versions[0].startswith("3")) + self.assertTrue(versions[0].startswith("2023.")) + + def test_image_versions_follow_year_releases(self): + years = list(self.index.iter_years()) + # One "." version per year's current release... + self.assertEqual( + list(self.index.iter_versions(constants.ImageType.IMAGE, "base")), + [f"{y.version}.{y.minor_version}" for y in years], + ) + # ...or one per clang version for per-clang images... + self.assertEqual( + list(self.index.iter_versions(constants.ImageType.IMAGE, "common")), + [ + f"{y.version}-clang{major}.{y.minor_version}" + for y in years + for major in y.clang_versions + ], + ) + # ...except for the years an image excludes. + self.assertNotIn( + "2023", + [ + v.split(".")[0] + for v in self.index.iter_versions(constants.ImageType.IMAGE, "openrv") + ], + ) + + def test_every_image_is_in_a_group(self): + grouped = [ + image + for images in self.index.groups[constants.ImageType.IMAGE].values() + for image in images + ] + self.assertEqual( + sorted(self.index.iter_images(constants.ImageType.IMAGE)), sorted(grouped) + ) + + def test_release_and_conan_channel(self): + year = self.index.version_info("2027") + self.assertEqual(year.release, f"2027.{year.minor_version}") + self.assertEqual(year.conan_channel, f"vfx2027_{year.minor_version}") + # A year's clang versions belong to the same release + for major in year.clang_versions: + vi = self.index.version_info(f"2027-clang{major}") + self.assertEqual(vi.release, year.release) + self.assertEqual(vi.conan_channel, year.conan_channel) + + def test_package_versions_follow_year_pins(self): + # Built for every year that pins a version for it... + self.assertEqual( + list(self.index.iter_versions(constants.ImageType.PACKAGE, "cmake")), + ["2023", "2024", "2025", "2026", "2027"], + ) + # ...but not for a year that doesn't. + del self.index.version_info("2023").all_package_versions["ASWF_CMAKE_VERSION"] + self.assertEqual( + list(self.index.iter_versions(constants.ImageType.PACKAGE, "cmake")), + ["2024", "2025", "2026", "2027"], + ) + + def test_per_clang_package_versions(self): + versions = list(self.index.iter_versions(constants.ImageType.PACKAGE, "clang")) + self.assertIn("2027-clang21", versions) + self.assertIn("2027-clang22", versions) + self.assertNotIn("2027", versions) def test_version_info(self): - vi = self.index.version_info("2019") + vi = self.index.version_info("2027") self.assertTrue(vi) - self.assertEqual(vi.version, "2019") - # Version 2022 pre-dates the generate_profile flag: must default to False - vi = self.index.version_info("2022") - self.assertFalse(vi.generate_profile) - # Version 2023 onwards opts in to profile generation - vi = self.index.version_info("2023") + self.assertEqual(vi.version, "2027") self.assertTrue(vi.generate_profile) - # Version 2026 uses ci_common6 as its toolchain base - vi = self.index.version_info("2026") - self.assertEqual(vi.ci_common_version, "6") + self.assertEqual(vi.conan_profile, "vfx2027") + # Toolchain pins live in the year itself + self.assertIn("ASWF_GCC_VERSION", vi.package_versions) + # Distro entries aren't years and don't generate profiles + self.assertFalse(self.index.version_info("rockylinux9").generate_profile) + self.assertNotIn("rockylinux9", [y.version for y in self.index.iter_years()]) + + def test_clang_versions(self): + year = self.index.version_info("2027") + majors = list(year.clang_versions) + self.assertGreaterEqual(len(majors), 2) + # The year itself pins its default clang version... + default = year.all_package_versions["ASWF_CLANG_MAJOR_VERSION"] + self.assertEqual( + year.all_package_versions["ASWF_CLANG_VERSION"], + year.clang_versions[default], + ) + for major in majors: + vi = self.index.version_info(f"2027-clang{major}") + # ...each derived clang version overrides it, inheriting the rest + self.assertEqual(vi.all_package_versions["ASWF_CLANG_MAJOR_VERSION"], major) + self.assertEqual( + vi.all_package_versions["ASWF_CLANG_VERSION"], + year.clang_versions[major], + ) + self.assertEqual( + vi.all_package_versions["ASWF_GCC_VERSION"], + year.all_package_versions["ASWF_GCC_VERSION"], + ) + self.assertEqual(vi.major_version, "2027") + self.assertEqual(vi.conan_profile, "vfx2027") + # Only the newest clang version gets the bare year tag + self.assertEqual(vi.use_major_version_as_tag, major == majors[-1]) + self.assertEqual(vi.tags, year.tags if major == majors[-1] else []) + self.assertNotIn("2027-clang21", [y.version for y in self.index.iter_years()]) def test_group_from_image(self): self.assertEqual( self.index.get_group_from_image(constants.ImageType.PACKAGE, "clang"), - "common-2", + "common", ) diff --git a/python/aswfdocker/tests/test_releaser.py b/python/aswfdocker/tests/test_releaser.py index 0f5e00b5e..0fc00947d 100644 --- a/python/aswfdocker/tests/test_releaser.py +++ b/python/aswfdocker/tests/test_releaser.py @@ -2,59 +2,286 @@ # SPDX-License-Identifier: Apache-2.0 +import os +import subprocess +import tempfile import unittest from unittest import mock import logging +import yaml from click.testing import CliRunner from aswfdocker import releaser, aswfinfo, index, constants, groupinfo, utils from aswfdocker.cli import aswfdocker +def _release(draft, tag_name, target_commitish="abc123"): + r = mock.MagicMock() + r.draft = draft + r.tag_name = tag_name + r.target_commitish = target_commitish + r.title = tag_name.replace("/2027", ":2027") + r.body = "From the draft" + r.prerelease = False + return r + + +class TestGitHubReleases(unittest.TestCase): + """GitHub's draft release handling, against a mocked repository.""" + + RELEASE = releaser.ImageRelease( + name="aswf/ci-base:2027.4", message="Hello", prerelease=False + ) + + def setUp(self): + patcher = mock.patch.object(releaser, "Github") + self.addCleanup(patcher.stop) + github_class = patcher.start() + self.gh = releaser.GitHub(token="token", repository="me/aswf-docker") + # The mock itself, rather than self.gh.repo, which pylint infers as a + # PyGithub Repository without the mock's assert_* members. + self.repo = github_class.return_value.get_repo.return_value + + def test_tag_has_no_colon(self): + self.assertEqual(self.RELEASE.tag, "aswf/ci-base/2027.4") + + def test_draft_releases_by_tag(self): + draft = _release(True, "aswf/ci-base/2027.4") + self.repo.get_releases.return_value = [ + draft, + _release(False, "aswf/ci-base/2027.3"), + ] + self.assertEqual(self.gh.draft_releases(), {"aswf/ci-base/2027.4": draft}) + + def test_create_draft_release_replaces_earlier_draft(self): + old = _release(True, "aswf/ci-base/2027.4", "def456") + self.gh.create_draft_release( + "abc123", self.RELEASE, {"aswf/ci-base/2027.4": old} + ) + old.delete_release.assert_called_once_with() + self.repo.create_git_release.assert_called_once_with( + tag="aswf/ci-base/2027.4", + name="aswf/ci-base:2027.4", + message="Hello", + draft=True, + prerelease=False, + target_commitish="abc123", + ) + # A published release of the image is left alone until its new + # release is published. + self.repo.get_release.assert_not_called() + self.repo.get_git_ref.assert_not_called() + + def test_publish_release_publishes_draft_replacing_earlier_release(self): + draft = _release(True, "aswf/ci-base/2027.4") + old = _release(False, "aswf/ci-base/2027.4", "def456") + self.repo.get_release.return_value = old + self.gh.publish_release("abc123", self.RELEASE, {draft.tag_name: draft}) + old.delete_release.assert_called_once_with() + self.repo.get_git_ref.return_value.delete.assert_called_once_with() + draft.update_release.assert_called_once_with( + name="aswf/ci-base:2027.4", + message="From the draft", + draft=False, + prerelease=False, + tag_name="aswf/ci-base/2027.4", + target_commitish="abc123", + ) + self.repo.create_git_release.assert_not_called() + + def test_publish_release_keeps_already_published_release(self): + # e.g. the job publishing the releases was re-run: the release + # attributed to the person releasing stays. + published = _release(False, "aswf/ci-base/2027.4") + self.repo.get_release.return_value = published + self.gh.publish_release("abc123", self.RELEASE, {}) + published.delete_release.assert_not_called() + self.repo.get_git_ref.assert_not_called() + self.repo.create_git_release.assert_not_called() + + def test_publish_release_without_draft_creates_it(self): + # e.g. the workflow was started from the GitHub Actions tab, or the + # draft is on another commit: a draft is created, to attach the + # SBOM to before publishing it. + self.repo.get_release.side_effect = releaser.GithubException(404) + self.repo.get_git_ref.side_effect = releaser.GithubException(404) + for drafts in ({}, {"aswf/ci-base/2027.4": _release(True, "x", "def456")}): + self.repo.create_git_release.reset_mock() + self.gh.publish_release("abc123", self.RELEASE, drafts, "/sboms/x.json") + self.repo.create_git_release.assert_called_once_with( + tag="aswf/ci-base/2027.4", + name="aswf/ci-base:2027.4", + message="Hello", + draft=True, + prerelease=False, + target_commitish="abc123", + ) + draft = self.repo.create_git_release.return_value + draft.upload_asset.assert_called_once_with( + "/sboms/x.json", + name="ci-base-2027.4.cdx.json", + content_type="application/vnd.cyclonedx+json", + ) + self.assertEqual(draft.update_release.call_args.kwargs["draft"], False) + draft.reset_mock() + + def test_publish_release_attaches_sbom_before_replacing_release(self): + draft = _release(True, "aswf/ci-base/2027.4") + old = _release(False, "aswf/ci-base/2027.4", "def456") + self.repo.get_release.return_value = old + order = mock.MagicMock() + order.attach_mock(draft.upload_asset, "attach_asset") + order.attach_mock(old.delete_release, "delete") + order.attach_mock(draft.update_release, "publish") + draft.get_assets.return_value = [] + self.gh.publish_release( + "abc123", self.RELEASE, {draft.tag_name: draft}, "/sboms/x.json" + ) + self.assertEqual( + [c[0] for c in order.mock_calls], ["attach_asset", "delete", "publish"] + ) + + def test_publish_release_replaces_sbom_of_draft(self): + # e.g. the job publishing the releases was re-run after attaching + # the SBOM, but before publishing. + draft = _release(True, "aswf/ci-base/2027.4") + stale, other = mock.MagicMock(), mock.MagicMock() + stale.name = "ci-base-2027.4.cdx.json" + other.name = "notes.txt" + draft.get_assets.return_value = [stale, other] + self.repo.get_release.side_effect = releaser.GithubException(404) + self.repo.get_git_ref.side_effect = releaser.GithubException(404) + self.gh.publish_release( + "abc123", self.RELEASE, {draft.tag_name: draft}, "/sboms/x.json" + ) + stale.delete_asset.assert_called_once_with() + other.delete_asset.assert_not_called() + draft.upload_asset.assert_called_once() + self.repo.create_git_release.assert_not_called() + + def test_publish_release_without_sbom(self): + draft = _release(True, "aswf/ci-base/2027.4") + self.repo.get_release.side_effect = releaser.GithubException(404) + self.repo.get_git_ref.side_effect = releaser.GithubException(404) + self.gh.publish_release("abc123", self.RELEASE, {draft.tag_name: draft}) + draft.upload_asset.assert_not_called() + draft.update_release.assert_called_once() + + +class TestImageReleaseSbom(unittest.TestCase): + RELEASE = releaser.ImageRelease( + name="aswftesting/ci-common:2027-clang22.4", message="", prerelease=True + ) + + def test_names(self): + self.assertEqual( + self.RELEASE.image, "docker.io/aswftesting/ci-common:2027-clang22.4" + ) + self.assertEqual(self.RELEASE.sbom_file, "ci-common-2027-clang22.4.cdx.json") + + @mock.patch.object(releaser.subprocess, "run") + def test_export_sboms(self, mock_run): + mock_run.return_value.stdout = "cid123\n" + with tempfile.TemporaryDirectory() as tmp: + out = os.path.join(tmp, "sboms") + releaser.export_sboms([self.RELEASE], out) + self.assertTrue(os.path.isdir(out)) + self.assertEqual( + [c.args[0] for c in mock_run.call_args_list], + [ + [ + "docker", + "create", + "--pull", + "never", + "docker.io/aswftesting/ci-common:2027-clang22.4", + "true", + ], + [ + "docker", + "cp", + "cid123:/usr/local/aswf/sbom.cdx.json", + os.path.join(out, "ci-common-2027-clang22.4.cdx.json"), + ], + ["docker", "rm", "cid123"], + ], + ) + + @mock.patch.object(releaser.subprocess, "run") + def test_export_sboms_removes_container_on_failure(self, mock_run): + created = mock.MagicMock(stdout="cid123\n") + mock_run.side_effect = [ + created, + subprocess.CalledProcessError(1, "docker cp"), + mock.MagicMock(), + ] + with tempfile.TemporaryDirectory() as tmp: + with self.assertRaises(subprocess.CalledProcessError): + releaser.export_sboms([self.RELEASE], tmp) + self.assertEqual( + mock_run.call_args_list[-1].args[0], ["docker", "rm", "cid123"] + ) + + class TestReleaser(unittest.TestCase): def setUp(self): self.maxDiff = None self.build_info = aswfinfo.ASWFInfo( - repo_uri="notauri", source_branch="testing", aswf_version="2019.123" + repo_uri="notauri", source_branch="testing", aswf_version="2027.123" ) - def test_package_baseqt_2019_dict(self): - r = releaser.Releaser( + @mock.patch.object(releaser, "GitHub") + def test_image_base_2027_dict(self, mock_github): + # Run by the release-images.yml workflow, with its own token, once + # the images are pushed. + publisher = releaser.ReleasePublisher( self.build_info, groupinfo.GroupInfo( - names=["base1-3"], - versions=["2019"], - type_=constants.ImageType.PACKAGE, - targets=["boost"], + names=["base"], + versions=["2027"], + type_=constants.ImageType.IMAGE, + targets=["base"], ), - sha=utils.get_current_sha(), + sha="abc123", + token="gha-token", + repository="me/aswf-docker", + ) + mock_github.assert_called_once_with( + token="gha-token", repository="me/aswf-docker" + ) + publisher.publish() + base_version = next( + v + for v in index.Index().iter_versions(constants.ImageType.IMAGE, "base") + if v.startswith("2027.") + ) + gh = mock_github.return_value + gh.publish_release.assert_called_once_with( + "abc123", + releaser.ImageRelease( + name=f"aswflocaltesting/ci-base:{base_version}", + message="Inspect released Docker image here: " + f"https://hub.docker.com/r/aswflocaltesting/ci-base/tags?name={base_version}", + prerelease=False, + ), + gh.draft_releases.return_value, + "", ) - r.gh.repo.create_git_tag_and_release = mock.MagicMock() - - class U: - name = "testuser" - email = "testuser@test.user" - - r.gh.github.get_user = mock.MagicMock(return_value=U()) - r.gather() - r.release(dry_run=False) - boost_version = list( - index.Index().iter_versions(constants.ImageType.PACKAGE, "boost") - )[0] - r.gh.repo.create_git_tag_and_release.assert_called_once_with( - tag=f"aswflocaltesting/ci-package-boost/{boost_version}", - draft=False, - object=utils.get_current_sha(), - prerelease=False, - release_message="Inspect released Docker image here: " - f"https://hub.docker.com/r/aswflocaltesting/ci-package-boost/tags?name={boost_version}", - release_name=f"aswflocaltesting/ci-package-boost:{boost_version}", - tag_message=f"aswflocaltesting/ci-package-boost:{boost_version}", - type="commit", - tagger=mock.ANY, + def test_full_release_image_groups_match_workflow(self): + # release-all.yml releases the images FullReleaser creates drafts of + path = os.path.join( + utils.get_git_top_level(), ".github", "workflows", "release-all.yml" ) + with open(path, encoding="utf-8") as f: + jobs = yaml.safe_load(f)["jobs"] + groups = [ + job["with"]["groups"] + for job in jobs.values() + if job["uses"].endswith("/release-images.yml") + ] + self.assertEqual(sorted(groups), sorted(constants.FULL_RELEASE_IMAGE_GROUPS)) class TestReleaserCli(unittest.TestCase): @@ -66,32 +293,391 @@ def setUp(self): def tearDown(self): logging.getLogger("").handlers = self._log_handlers - def test_release_cli(self): + @mock.patch.object(releaser, "GitHub") + def test_release_cli(self, mock_github): + # An image release starts the image release workflow, which builds, + # pushes and creates the GitHub releases from GitHub Actions. + mock_github.return_value.repo.default_branch = "main" current_version = list( - index.Index().iter_versions(constants.ImageType.PACKAGE, "boost") + index.Index().iter_versions(constants.ImageType.IMAGE, "base") )[1] - runner = CliRunner() - result = runner.invoke( + sha = utils.get_current_sha() + result = CliRunner().invoke( aswfdocker.cli, [ "release", "-n", - f"aswf/ci-package-boost:{current_version}", + f"aswf/ci-base:{current_version}", "--sha", - utils.get_current_sha(), - "--dry-run", + sha, + "-m", + "Hello", ], input="y\n", ) - self.assertFalse(result.exception) - self.assertEqual(result.exit_code, 0) + self.assertEqual(result.exit_code, 0, msg=result.output) + self.assertIn(f"aswf/ci-base:{current_version}", result.output) + gh = mock_github.return_value + # The draft release, attributed to the person releasing, is created + # before the workflow is started. self.assertEqual( + [c[0] for c in gh.mock_calls if c[0] != "repo.default_branch"][-3:], + ["draft_releases", "create_draft_release", "dispatch_workflow"], + ) + draft = gh.create_draft_release.call_args.args[1] + self.assertEqual(draft.name, f"aswf/ci-base:{current_version}") + self.assertTrue(draft.message.startswith("Hello\n\n")) + self.assertFalse(draft.prerelease) + gh.dispatch_workflow.assert_called_once_with( + constants.IMAGE_RELEASE_WORKFLOW, + "main", + { + "sha": sha, + "docker_org": "aswf", + "groups": "base", + "versions": current_version.rsplit(".", 1)[0], + "targets": "base", + "message": "Hello", + }, + ) + + @mock.patch.object(releaser, "GitHub") + def test_release_cli_image_group_dry_run(self, mock_github): + result = CliRunner().invoke( + aswfdocker.cli, + ["release", "-g", "vfx", "-v", "2027", "--sha", "abc123", "-d"], + input="y\n", + ) + self.assertEqual(result.exit_code, 0, msg=result.output) + # Per-clang images are listed for every clang version of the year + self.assertIn("aswftesting/ci-osl:2027-clang22", result.output) + self.assertIn( + f"Would start the {constants.IMAGE_RELEASE_WORKFLOW} workflow", + result.output, + ) + self.assertIn( + "Would create draft GitHub release aswftesting/ci-osl:2027-clang22", result.output, - # pylint: disable=line-too-long - f"""Are you sure you want to create the following 1 release on sha={utils.get_current_sha()}? -aswf/ci-package-boost:{current_version} - [y/N]: y -INFO:aswfdocker.releaser:Would create this GitHub release on current commit: aswf/ci-package-boost:{current_version} -Release done. -""", ) + mock_github.return_value.create_draft_release.assert_not_called() + mock_github.return_value.dispatch_workflow.assert_not_called() + + @mock.patch.object(releaser, "GitHub") + def test_release_cli_refuses_other_orgs(self, mock_github): + # The release workflows only release to aswf or aswftesting + result = CliRunner().invoke( + aswfdocker.cli, + ["release", "-n", "aswflocaltesting/ci-base:2027.4", "--sha", "abc"], + input="y\n", + ) + self.assertNotEqual(result.exit_code, 0) + self.assertIn("not aswflocaltesting", result.output) + mock_github.return_value.dispatch_workflow.assert_not_called() + + @mock.patch.object(releaser, "GitHub") + def test_release_cli_full_release(self, mock_github): + mock_github.return_value.repo.default_branch = "main" + result = CliRunner().invoke( + aswfdocker.cli, + [ + "release", + "--full-release", + "-v", + "2027", + "-v", + "2026", + "--docker-org", + "aswf", + "--sha", + "abc123", + "-m", + "VFX Platform 2027", + ], + input="y\n", + ) + self.assertEqual(result.exit_code, 0, msg=result.output) + mock_github.return_value.dispatch_workflow.assert_called_once_with( + constants.FULL_RELEASE_WORKFLOW, + "main", + { + "sha": "abc123", + "org": "aswf", + "versions": "2026 2027", + "force_rebuild": "false", + "message": "VFX Platform 2027", + }, + ) + # Drafts of every image of every year + drafts = [ + c.args[1].name + for c in mock_github.return_value.create_draft_release.call_args_list + ] + for name in ( + "aswf/ci-baseos-gl-conan:2026", + "aswf/ci-common:2027-clang22", + "aswf/ci-base:2026", + "aswf/ci-vfxall:2027-clang22", + ): + self.assertTrue(any(d.startswith(name + ".") for d in drafts), name) + self.assertFalse(any("ci-openrv" in d for d in drafts)) + + @mock.patch.object(releaser, "GitHub") + def test_release_cli_full_release_all_years(self, mock_github): + mock_github.return_value.repo.default_branch = "main" + result = CliRunner().invoke( + aswfdocker.cli, + ["release", "--full-release", "-v", "all", "--sha", "abc123"], + input="y\n", + ) + self.assertEqual(result.exit_code, 0, msg=result.output) + years = sorted(vi.version for vi in index.Index().iter_years()) + inputs = mock_github.return_value.dispatch_workflow.call_args.args[2] + self.assertEqual(inputs["versions"], " ".join(years)) + self.assertEqual(inputs["org"], "aswftesting") + + @mock.patch.object(releaser, "GitHub") + def test_release_cli_full_release_refuses_bad_options(self, mock_github): + for args, error in ( + (["-g", "vfx", "-v", "2027"], "can't be combined"), + ([], "needs years"), + (["-v", "2027-clang22"], "needs years"), + ): + result = CliRunner().invoke( + aswfdocker.cli, + ["release", "--full-release", "--sha", "abc123", *args], + input="y\n", + ) + self.assertNotEqual(result.exit_code, 0, msg=args) + self.assertIn(error, result.output) + mock_github.return_value.dispatch_workflow.assert_not_called() + + @mock.patch.object(releaser, "GitHub") + def test_release_cli_package(self, mock_github): + # A package release starts the package release workflow, which builds + # and uploads the packages from GitHub Actions, without creating any + # GitHub release. + mock_github.return_value.repo.default_branch = "main" + sha = utils.get_current_sha() + result = CliRunner().invoke( + aswfdocker.cli, + ["release", "-n", "aswf/ci-package-boost:2027", "--sha", sha], + input="y\n", + ) + self.assertEqual(result.exit_code, 0, msg=result.output) + self.assertIn("aswf/ci-package-boost:2027", result.output) + gh = mock_github.return_value + gh.create_draft_release.assert_not_called() + gh.dispatch_workflow.assert_called_once_with( + constants.PACKAGE_RELEASE_WORKFLOW, + "main", + { + "sha": sha, + "package_org": "aswf", + "groups": "base1", + "versions": "2027", + "targets": "boost", + "force_rebuild": "false", + }, + ) + + @mock.patch.object(releaser, "GitHub") + def test_release_cli_package_group(self, mock_github): + result = CliRunner().invoke( + aswfdocker.cli, + [ + "release", + "-t", + "PACKAGE", + "-g", + "common", + "-v", + "2027", + "--docker-org", + "aswf", + "--sha", + "abc123", + "--force-rebuild", + "--workflow-ref", + "my-branch", + ], + input="y\n", + ) + self.assertEqual(result.exit_code, 0, msg=result.output) + # Every clang version of the year is listed + self.assertIn("aswf/ci-package-clang:2027-clang22", result.output) + self.assertIn("aswf/ci-package-cmake:2027", result.output) + mock_github.return_value.dispatch_workflow.assert_called_once_with( + constants.PACKAGE_RELEASE_WORKFLOW, + "my-branch", + { + "sha": "abc123", + "package_org": "aswf", + "groups": "common", + "versions": "2027", + "targets": "", + "force_rebuild": "true", + }, + ) + + @mock.patch.object(releaser, "GitHub") + def test_release_cli_package_dry_run(self, mock_github): + result = CliRunner().invoke( + aswfdocker.cli, + ["release", "-n", "aswf/ci-package-boost:2027", "--sha", "abc123", "-d"], + input="y\n", + ) + self.assertEqual(result.exit_code, 0, msg=result.output) + self.assertIn( + f"Would start the {constants.PACKAGE_RELEASE_WORKFLOW} workflow", + result.output, + ) + mock_github.return_value.commit_exists.assert_not_called() + mock_github.return_value.dispatch_workflow.assert_not_called() + + @mock.patch.object(releaser, "GitHub") + def test_release_cli_package_unknown_commit(self, mock_github): + # e.g. a local commit that was never pushed + mock_github.return_value.commit_exists.return_value = False + result = CliRunner().invoke( + aswfdocker.cli, + ["release", "-n", "aswf/ci-package-boost:2027", "--sha", "abc123"], + input="y\n", + ) + self.assertNotEqual(result.exit_code, 0) + self.assertIn("Commit abc123 not found", result.output) + mock_github.return_value.dispatch_workflow.assert_not_called() + + @mock.patch.object(releaser, "GitHub") + def test_release_cli_image_refuses_package_options(self, mock_github): + result = CliRunner().invoke( + aswfdocker.cli, + ["release", "-n", "aswf/ci-base:2027.4", "--sha", "abc", "--force-rebuild"], + input="y\n", + ) + self.assertNotEqual(result.exit_code, 0) + self.assertIn("only applies to Conan package releases", result.output) + mock_github.return_value.dispatch_workflow.assert_not_called() + + +class TestPublishReleasesCli(unittest.TestCase): + @mock.patch.object(releaser, "GitHub") + def test_refused_outside_github_actions(self, mock_github): + with mock.patch.dict(os.environ): + os.environ.pop("GITHUB_ACTIONS", None) + result = CliRunner().invoke( + aswfdocker.cli, + [ + "publishreleases", + "-g", + "base", + "-v", + "2027", + "-s", + "abc", + "-do", + "aswf", + ], + ) + self.assertNotEqual(result.exit_code, 0) + self.assertIn("only be published from GitHub Actions", result.output) + mock_github.assert_not_called() + + @mock.patch.object(releaser, "GitHub") + def test_publishes_releases_with_workflow_token(self, mock_github): + env = { + "GITHUB_ACTIONS": "true", + "GITHUB_TOKEN": "gha-token", + "GITHUB_REPOSITORY": "AcademySoftwareFoundation/aswf-docker", + } + with mock.patch.dict(os.environ, env): + result = CliRunner().invoke( + aswfdocker.cli, + [ + "publishreleases", + "-g", + "base", + "-v", + "2027", + "-s", + "abc", + "-do", + "aswf", + "-m", + "Hello", + ], + ) + self.assertEqual(result.exit_code, 0, msg=result.output) + mock_github.assert_called_once_with( + token="gha-token", repository="AcademySoftwareFoundation/aswf-docker" + ) + calls = mock_github.return_value.publish_release.call_args_list + self.assertEqual( + sorted(c.args[1].name.split(":")[0] for c in calls), + ["aswf/ci-base", "aswf/ci-baseqt"], + ) + for c in calls: + self.assertEqual(c.args[0], "abc") + self.assertTrue(c.args[1].message.startswith("Hello\n\n")) + self.assertFalse(c.args[1].prerelease) + + @mock.patch.object(releaser, "GitHub") + def test_attaches_sboms(self, mock_github): + env = { + "GITHUB_ACTIONS": "true", + "GITHUB_TOKEN": "gha-token", + "GITHUB_REPOSITORY": "AcademySoftwareFoundation/aswf-docker", + } + args = ["publishreleases", "-g", "base", "-v", "2027", "-s", "abc"] + args += ["-do", "aswf", "-tg", "base"] + with tempfile.TemporaryDirectory() as tmp, mock.patch.dict(os.environ, env): + # Refused, before publishing anything, when an SBOM is missing. + result = CliRunner().invoke(aswfdocker.cli, args + ["--sbom-dir", tmp]) + self.assertNotEqual(result.exit_code, 0) + self.assertIn("Missing image SBOMs", result.output) + mock_github.return_value.publish_release.assert_not_called() + + release = mock_github.return_value.publish_release + releases = releaser.image_releases( + aswfinfo.ASWFInfo(repo_uri="x", source_branch="y"), + groupinfo.GroupInfo( + names=["base"], + versions=["2027"], + type_=constants.ImageType.IMAGE, + targets=["base"], + ), + "", + ) + for r in releases: + with open(os.path.join(tmp, r.sbom_file), "w", encoding="utf-8") as f: + f.write("{}") + result = CliRunner().invoke(aswfdocker.cli, args + ["--sbom-dir", tmp]) + self.assertEqual(result.exit_code, 0, msg=result.output) + self.assertEqual(len(release.call_args_list), len(releases)) + for c in release.call_args_list: + self.assertEqual(c.args[3], os.path.join(tmp, c.args[1].sbom_file)) + + +class TestExportSbomsCli(unittest.TestCase): + @mock.patch.object(releaser, "export_sboms") + def test_exports_image_sboms(self, mock_export): + result = CliRunner().invoke( + aswfdocker.cli, + ["exportsboms", "-g", "common", "-v", "2027", "-do", "aswf", "-o", "out"], + ) + self.assertEqual(result.exit_code, 0, msg=result.output) + releases, output_dir = mock_export.call_args.args + self.assertEqual(output_dir, "out") + names = sorted(r.name.split(":")[1] for r in releases) + self.assertTrue(names) + self.assertTrue( + all(r.name.startswith("aswf/ci-common:2027-clang") for r in releases) + ) + + @mock.patch.object(releaser, "export_sboms") + def test_refuses_packages(self, mock_export): + result = CliRunner().invoke( + aswfdocker.cli, + ["exportsboms", "-t", "PACKAGE", "-g", "common", "-v", "2027", "-o", "out"], + ) + self.assertNotEqual(result.exit_code, 0) + mock_export.assert_not_called() diff --git a/python/aswfdocker/tests/test_utils.py b/python/aswfdocker/tests/test_utils.py index 9dc2fa918..85dee988f 100644 --- a/python/aswfdocker/tests/test_utils.py +++ b/python/aswfdocker/tests/test_utils.py @@ -4,8 +4,12 @@ Tests for the utility commands """ +import os +import subprocess +import tempfile import unittest import logging +from unittest.mock import patch from click.testing import CliRunner @@ -13,6 +17,108 @@ from aswfdocker.cli import aswfdocker +class TestConanRemotePolicy(unittest.TestCase): + def test_auto_is_local_outside_github_actions(self): + with patch.dict(os.environ): + os.environ.pop("GITHUB_ACTIONS", None) + self.assertEqual( + utils.resolve_conan_remote(constants.CONAN_REMOTE_AUTO, "aswf"), + constants.CONAN_REMOTE_LOCAL, + ) + + def test_auto_is_package_org_on_github_actions(self): + with patch.dict(os.environ, {"GITHUB_ACTIONS": "true"}): + self.assertEqual( + utils.resolve_conan_remote(constants.CONAN_REMOTE_AUTO, "aswf"), + "aswf", + ) + + def test_explicit_policy_ignores_environment(self): + with patch.dict(os.environ, {"GITHUB_ACTIONS": "true"}): + self.assertEqual( + utils.resolve_conan_remote(constants.CONAN_REMOTE_LOCAL, "aswf"), + constants.CONAN_REMOTE_LOCAL, + ) + self.assertEqual( + utils.resolve_conan_remote("aswftesting", "aswf"), "aswftesting" + ) + + def test_remote_args(self): + self.assertEqual( + utils.conan_remote_args(constants.CONAN_REMOTE_LOCAL), ["--no-remote"] + ) + self.assertEqual(utils.conan_remote_args("aswf"), ["--remote", "aswf"]) + with self.assertRaises(ValueError): + utils.conan_remote_args(constants.CONAN_REMOTE_AUTO) + + +class TestGitProvenance(unittest.TestCase): + def setUp(self): + tmp = tempfile.TemporaryDirectory() # pylint: disable=consider-using-with + self.addCleanup(tmp.cleanup) + self.repo = tmp.name + self._git("init", "-q") + self._write(".gitignore", "ignored.txt\n") + self._write("tracked.txt", "one\n") + self._git("add", ".") + self._git( + "-c", + "user.name=Test", + "-c", + "user.email=test@example.com", + "commit", + "-q", + "-m", + "initial", + ) + self.head = self._git("rev-parse", "HEAD").strip() + + def _git(self, *args): + return subprocess.check_output(["git", *args], cwd=self.repo, encoding="UTF-8") + + def _write(self, name, content): + with open(os.path.join(self.repo, name), "w", encoding="utf-8") as f: + f.write(content) + + def test_clean_tree(self): + self.assertEqual( + utils.git_provenance(self.repo), + { + "ASWF_GIT_SHA": self.head, + "ASWF_GIT_DIRTY": "false", + "ASWF_GIT_DIFF_HASH": "", + }, + ) + + def test_ignored_files_keep_tree_clean(self): + self._write("ignored.txt", "noise\n") + self.assertEqual(utils.git_provenance(self.repo)["ASWF_GIT_DIRTY"], "false") + + def test_modified_tracked_file(self): + self._write("tracked.txt", "two\n") + first = utils.git_provenance(self.repo) + self.assertEqual(first["ASWF_GIT_SHA"], self.head) + self.assertEqual(first["ASWF_GIT_DIRTY"], "true") + self.assertEqual(len(first["ASWF_GIT_DIFF_HASH"]), 64) + # Same tree, same hash; a different change, a different hash. + self.assertEqual(utils.git_provenance(self.repo), first) + self._write("tracked.txt", "three\n") + self.assertNotEqual( + utils.git_provenance(self.repo)["ASWF_GIT_DIFF_HASH"], + first["ASWF_GIT_DIFF_HASH"], + ) + + def test_untracked_file_contents_are_hashed(self): + self._write("new.txt", "a\n") + first = utils.git_provenance(self.repo) + self.assertEqual(first["ASWF_GIT_DIRTY"], "true") + self._write("new.txt", "b\n") + self.assertNotEqual( + utils.git_provenance(self.repo)["ASWF_GIT_DIFF_HASH"], + first["ASWF_GIT_DIFF_HASH"], + ) + + class TestUtils(unittest.TestCase): def test_get_docker_org(self): self.assertEqual(utils.get_docker_org("", ""), "aswftesting") @@ -70,22 +176,22 @@ def test_get_docker_push(self): def test_image_def_from_name(self): with self.assertRaises(RuntimeError): - utils.get_image_spec("aswf/ci-package-openvdb_2018") + utils.get_image_spec("aswf/ci-package-openvdb_2027") self.assertEqual( - utils.get_image_spec("aswftesting/ci-common:1"), - ("aswftesting", constants.ImageType.IMAGE, "common", "1"), + utils.get_image_spec("aswftesting/ci-common:7"), + ("aswftesting", constants.ImageType.IMAGE, "common", "7"), ) self.assertEqual( - utils.get_image_spec("aswf/ci-package-openvdb:2018"), - ("aswf", constants.ImageType.PACKAGE, "openvdb", "2018"), + utils.get_image_spec("aswf/ci-package-openvdb:2027"), + ("aswf", constants.ImageType.PACKAGE, "openvdb", "2027"), ) self.assertEqual( - utils.get_image_spec("refs/tags/aswf/ci-package-openvdb/2018"), - ("aswf", constants.ImageType.PACKAGE, "openvdb", "2018"), + utils.get_image_spec("refs/tags/aswf/ci-package-openvdb/2027"), + ("aswf", constants.ImageType.PACKAGE, "openvdb", "2027"), ) self.assertEqual( - utils.get_image_spec("aswf/ci-package-clang:1-clang6"), - ("aswf", constants.ImageType.PACKAGE, "clang", "1-clang6"), + utils.get_image_spec("aswf/ci-package-clang:7-clang22"), + ("aswf", constants.ImageType.PACKAGE, "clang", "7-clang22"), ) @@ -136,7 +242,7 @@ def test_cli_packages(self): )[0] self.assertEqual( pkgs[0], - f"common-wrappers/ci-package-openssl:{clang_version}", + f"common/ci-package-openssl:{clang_version}", ) def test_cli_images(self): diff --git a/python/aswfdocker/utils.py b/python/aswfdocker/utils.py index de7fe2e75..cc3316812 100644 --- a/python/aswfdocker/utils.py +++ b/python/aswfdocker/utils.py @@ -4,13 +4,16 @@ Utility functions """ +import hashlib +import os import re import subprocess import datetime import logging +import typing import requests -from aswfdocker import constants +from aswfdocker import constants, versioninfo logger = logging.getLogger(__name__) @@ -31,6 +34,37 @@ def get_git_top_level() -> str: )[:-1] +def git_provenance(repo_root: str) -> typing.Dict[str, str]: + """The git state a package build comes from, as the build ARGs + packages/common/Dockerfile passes to the hook_aswf_provenance Conan hook: + the HEAD commit, whether the working tree differs from it (including + untracked, non-ignored files), and if so a hash of those differences. + + Release builds run from a clean checkout, so the SHA alone identifies + them. Local builds are often dirty; the hash then at least tells two + local builds from identical trees apart from ones that differ. + """ + + def git(*args: str) -> bytes: + return subprocess.check_output(["git", *args], cwd=repo_root) + + status = git("status", "--porcelain", "--untracked-files=all") + provenance = { + "ASWF_GIT_SHA": git("rev-parse", "HEAD").decode().strip(), + "ASWF_GIT_DIRTY": "true" if status.strip() else "false", + "ASWF_GIT_DIFF_HASH": "", + } + if status.strip(): + digest = hashlib.sha256(git("diff", "HEAD", "--binary")) + untracked = git("ls-files", "--others", "--exclude-standard", "-z") + for path in sorted(p for p in untracked.split(b"\0") if p): + digest.update(b"\0untracked\0" + path + b"\0") + with open(os.path.join(repo_root, os.fsdecode(path)), "rb") as f: + digest.update(f.read()) + provenance["ASWF_GIT_DIFF_HASH"] = digest.hexdigest() + return provenance + + def get_current_date() -> str: # 2020-01-19T08:04:51Z return datetime.datetime.now().isoformat(timespec="seconds") + "Z" @@ -90,6 +124,67 @@ def get_image_spec(name: str): return org, image_type, image, version +def on_github_actions() -> bool: + """Whether this runs on GitHub Actions (GITHUB_ACTIONS=true is set on + every runner): the only place holding the Artifactory credentials, so + the only place Conan packages may be uploaded from.""" + return os.environ.get("GITHUB_ACTIONS") == "true" + + +def resolve_conan_remote(conan_remote: str, package_org: str) -> str: + """Which Conan remote(s) package resolution may use: "local" (the local + Conan cache only) or the name of the one remote to consult. + + "auto" picks by environment: local builds only ever use the local cache, + while on GitHub Actions (GITHUB_ACTIONS=true, set on every runner) the + one remote is `package_org` -- the same Artifactory remote packages get + uploaded to, so later builds find earlier uploads. Any other value is + an explicit choice and returned as-is. + """ + if conan_remote != constants.CONAN_REMOTE_AUTO: + return conan_remote + if on_github_actions(): + return package_org + return constants.CONAN_REMOTE_LOCAL + + +def conan_remote_args(conan_remote: str) -> typing.List[str]: + """Conan command-line arguments enforcing an already-resolved remote + policy (see resolve_conan_remote()).""" + if conan_remote == constants.CONAN_REMOTE_AUTO: + raise ValueError("conan_remote must be resolved before use") + if conan_remote == constants.CONAN_REMOTE_LOCAL: + return ["--no-remote"] + return ["--remote", conan_remote] + + +def package_version_key(package_name: str) -> str: + """The versions.yaml key pinning a Conan package's version, e.g. + "util-linux-libuuid" -> "ASWF_UTIL_LINUX_LIBUUID_VERSION".""" + return f"ASWF_{package_name.upper().replace('-', '_')}_VERSION" + + +def common_conan_bake_args( + docker_org: str, package_org: str, version_info: versioninfo.VersionInfo +) -> typing.Dict[str, str]: + """The subset of packages/common/Dockerfile build ARGs needed by every + bake target built from it, whether a real `conan create` package build + (builder.py) or the read-only dependency-graph grapher (buildorder.py). + Packages are built in the ci-baseos-gl-conan image of the VFX Platform + release (year and minor version) `version_info` belongs to, in its + Conan channel and with its year's Conan profile. + """ + return { + "ASWF_ORG": docker_org, + "ASWF_PKG_ORG": package_org, + "ASWF_VFXPLATFORM_VERSION": version_info.major_version, + "ASWF_VFXPLATFORM_MINOR_VERSION": str(version_info.minor_version), + "ASWF_CONAN_PROFILE": str(version_info.conan_profile), + "ASWF_CONAN_CHANNEL": version_info.conan_channel, + "ASWF_CONAN_HOME": constants.ASWF_CONAN_HOME, + } + + def get_dockerhub_token(username, password): body = {"username": username, "password": password} response = requests.post( diff --git a/python/aswfdocker/versioninfo.py b/python/aswfdocker/versioninfo.py index d1c71a859..c45fbce52 100644 --- a/python/aswfdocker/versioninfo.py +++ b/python/aswfdocker/versioninfo.py @@ -18,14 +18,16 @@ def __init__( # noqa too many arguments version: str, major_version: str, tags: typing.List[str], - ci_common_version: str, parent_versions: typing.List[str], package_versions: typing.Dict[str, str], use_major_version_as_tag=True, + legacy_common_version: typing.Optional[str] = None, + minor_version: typing.Optional[str] = None, ): self.version = version self.major_version = major_version - self.ci_common_version = ci_common_version + self.minor_version = minor_version + self.legacy_common_version = legacy_common_version self.tags = tags self.parent_versions = parent_versions self.package_versions = package_versions @@ -33,6 +35,24 @@ def __init__( # noqa too many arguments self.all_package_versions: typing.Dict[str, str] = {} self.conan_profile: typing.Optional[str] = None self.generate_profile: bool = False + # A VFX Platform year's clang versions (major -> full version)... + self.clang_versions: typing.Dict[str, str] = {} + # ...or, for a "-clang" version derived from one of + # them, that major version. + self.clang_major_version: typing.Optional[str] = None + + @property + def release(self) -> str: + """The VFX Platform release, e.g. "2027.4": the + ci-baseos-gl-conan image tag Conan packages are built in.""" + return f"{self.major_version}.{self.minor_version}" + + @property + def conan_channel(self) -> str: + """The release's Conan channel, e.g. "vfx2027_4" (Conan warns about + dots in channels), so that a release never reuses packages built + for a previous one.""" + return f"{self.conan_profile}_{self.minor_version}" def get_tags( self, @@ -48,6 +68,16 @@ def get_tags( else: tags = [self.version] tags.append(aswf_version) + if ( + self.legacy_common_version + and image_name in constants.LEGACY_COMMON_TAGGED_IMAGES + ): + # e.g. 2027-clang22.3 -> 7-clang22.3 + tags.extend( + self.legacy_common_version + tag[len(self.major_version) :] + for tag in list(tags) + if tag.startswith(self.major_version) + ) tags.extend(self.tags) if extra_suffix: tags.append(self.major_version + "-" + extra_suffix) diff --git a/scripts/common/install_conan_packages.sh b/scripts/common/install_conan_packages.sh new file mode 100755 index 000000000..b65e151a4 --- /dev/null +++ b/scripts/common/install_conan_packages.sh @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Installs the Conan packages of an image, listed in +# ${ASWF_INSTALL_PREFIX}/conanfile.txt, into ${ASWF_INSTALL_PREFIX} with the +# aswf_deploy deployer (packages/conan/settings/extensions/deployers), which +# also writes the image's SBOM to ${ASWF_INSTALL_PREFIX}/aswf/sbom.cdx.json. +# Run by the RUN of ci-image-dockerfile.jinja2 installing them, with the +# image's build ARGs in its environment. +# +# Usage: install_conan_packages.sh +# : the image's own package (e.g. openexr for ci-openexr), not +# installed, as the image is for building it +# : the SBOM's subject, e.g. ci-openexr/2027.4 + +set -euo pipefail + +image_name=$1 +sbom_name=$2 + +# e.g. "--remote aswf", or "--no-remote" for local builds (see +# aswfdocker's utils.conan_remote_args()). +read -ra remote_args <<< "${ASWF_CONAN_REMOTE_ARGS}" + +# conan install doesn't download package metadata, which holds the build +# provenance aswf_deploy records in the image SBOM, so packages coming from +# a remote are first downloaded with it. +if [[ "${ASWF_CONAN_REMOTE_ARGS}" != "--no-remote" ]]; then + graph=$(mktemp --suffix=.json) + conan graph info "${ASWF_INSTALL_PREFIX}" \ + --profile:all "${ASWF_CONAN_PROFILE}" \ + "${remote_args[@]}" \ + --format=json > "${graph}" + conan aswf-download-metadata "${graph}" \ + "${remote_args[@]}" \ + --metadata aswf_provenance.json + rm "${graph}" +fi + +conan install "${ASWF_INSTALL_PREFIX}" \ + --profile:all "${ASWF_CONAN_PROFILE}" \ + "${remote_args[@]}" \ + --deployer aswf_deploy \ + --deployer-folder "${ASWF_INSTALL_PREFIX}" \ + --conf user.aswf:exclude_package="${image_name}" \ + --conf user.aswf:sbom_name="${sbom_name}" diff --git a/scripts/common/install_opengl.sh b/scripts/common/install_opengl.sh index 37d39cdf5..5fc3345c6 100755 --- a/scripts/common/install_opengl.sh +++ b/scripts/common/install_opengl.sh @@ -12,11 +12,6 @@ set -ex -# Don't need to do this on centos7, cudagl container still available -if [[ ${ASWF_BASEOS_DISTRO} == "centos7" ]]; then - exit 0 -fi - mkdir /tmp/libglvnd cd /tmp/libglvnd git clone --branch="v${ASWF_GLVND_VERSION}" https://github.com/NVIDIA/libglvnd.git . diff --git a/scripts/common/install_pippackages.sh b/scripts/common/install_pippackages.sh index 730858f0b..bb4b8ed75 100755 --- a/scripts/common/install_pippackages.sh +++ b/scripts/common/install_pippackages.sh @@ -4,12 +4,8 @@ set -ex -BASEOS_MAJORVERSION=$(sed -n 's/^.* release \([0-9]*\)\..*$/\1/p' /etc/redhat-release) +python3 -m ensurepip --upgrade -if [[ "$BASEOS_MAJORVERSION" -gt "7" ]]; then - python3 -m ensurepip --upgrade - - # There is a package called python3-html5lib through yum/dnf but it installs - # for the system Python - which is not the same one that it used by downstream projects. - python3 -m pip install html5lib -fi +# There is a package called python3-html5lib through yum/dnf but it installs +# for the system Python - which is not the same one that it used by downstream projects. +python3 -m pip install html5lib diff --git a/scripts/common/install_yumpackages.sh b/scripts/common/install_yumpackages.sh index 3eeee6d7a..62326107b 100755 --- a/scripts/common/install_yumpackages.sh +++ b/scripts/common/install_yumpackages.sh @@ -12,49 +12,47 @@ XORG_X11_XKB_UTILS_RPM="xorg-x11-xkb-utils xorg-x11-xkb-utils-devel" LIBXVMC_DEVEL_RPM="libXvMC-devel" BASEOS_MAJORVERSION=$(sed -n 's/^.* release \([0-9]*\)\..*$/\1/p' /etc/redhat-release) -if [[ "$BASEOS_MAJORVERSION" -gt "7" ]]; then - dnf -y install 'dnf-command(config-manager)' - if [[ "$BASEOS_MAJORVERSION" -eq "8" ]]; then - # Rocky 8 needs PowerTools and Devel repos enabled for some of these packages - dnf config-manager --set-enabled powertools - # The Rocky 8 mirror repos seem to be getting increasingly unreliable, prefer going to the source - sed -i -e 's/^mirrorlist=/#mirrorlist=/g' -e 's/#baseurl=/baseurl=/g' /etc/yum.repos.d/Rocky-{BaseOS,AppStream,Extras,PowerTools}.repo - # libbluray-devel is in EPEL 9, we may no longer need devel repo then - # same for yasm-devel and libdc1394-devel - # But the devel repo in Rocky 8 warns that "WARNING! FOR BUILDROOT AND KOJI USE" - # And as of late August 2025 it is causing conflicts with BaseOS / AppStream. - # So we will only enable it for specific installs. - # dnf config-manager --set-enabled devel +dnf -y install 'dnf-command(config-manager)' +if [[ "$BASEOS_MAJORVERSION" -eq "8" ]]; then + # Rocky 8 needs PowerTools and Devel repos enabled for some of these packages + dnf config-manager --set-enabled powertools + # The Rocky 8 mirror repos seem to be getting increasingly unreliable, prefer going to the source + sed -i -e 's/^mirrorlist=/#mirrorlist=/g' -e 's/#baseurl=/baseurl=/g' /etc/yum.repos.d/Rocky-{BaseOS,AppStream,Extras,PowerTools}.repo + # libbluray-devel is in EPEL 9, we may no longer need devel repo then + # same for yasm-devel and libdc1394-devel + # But the devel repo in Rocky 8 warns that "WARNING! FOR BUILDROOT AND KOJI USE" + # And as of late August 2025 it is causing conflicts with BaseOS / AppStream. + # So we will only enable it for specific installs. + # dnf config-manager --set-enabled devel - # Rocky 8 base image doesn't have a system Python (3), install and make default - dnf -y install python3 - alternatives --set python /usr/bin/python3 - else - # Rocky 9 needs CRB repo enabled for some of these packages - dnf config-manager --set-enabled crb - # Some packages are gone or renamed in EL 9 - GAMIN_RPM="" - MESA_LIBOSMESA_DEVEL_RPM="mesa-compat-libOSMesa-devel" - MESA_VULKAN_DEVEL_RPM="mesa-vulkan-drivers" - # In Rocky 9 xkbcomp-devel is in the devel repo which we don't want, all it provides is a single - # pkgconfig file we don't need. - XORG_X11_XKB_UTILS_RPM="setxkbmap xkbcomp" - LIBXVMC_DEVEL_RPM="" - fi - # Ignore any DNF metadata cached in base image - dnf clean all - # Some nvidia/cuda base images spuriously ship an enabled RHEL UBI 8 AppStream - # repo (/etc/yum.repos.d/ubi-8-appstream.repo), which mixes incompatible RHEL UBI 8 - # and Rocky Linux 8 package versions and breaks dnf upgrade. Disable it if present. - if dnf repolist --enabled ubi-8-appstream 2>/dev/null | grep -q ubi-8-appstream; then - dnf config-manager --set-disabled ubi-8-appstream - fi - # Disable CUDA repo since that doesn't upgrade cleanly - dnf config-manager --set-disabled cuda - dnf -y upgrade - # Re-enable the CUDA repo after the upgrade - dnf config-manager --set-enabled cuda + # Rocky 8 base image doesn't have a system Python (3), install and make default + dnf -y install python3 + alternatives --set python /usr/bin/python3 +else + # Rocky 9 needs CRB repo enabled for some of these packages + dnf config-manager --set-enabled crb + # Some packages are gone or renamed in EL 9 + GAMIN_RPM="" + MESA_LIBOSMESA_DEVEL_RPM="mesa-compat-libOSMesa-devel" + MESA_VULKAN_DEVEL_RPM="mesa-vulkan-drivers" + # In Rocky 9 xkbcomp-devel is in the devel repo which we don't want, all it provides is a single + # pkgconfig file we don't need. + XORG_X11_XKB_UTILS_RPM="setxkbmap xkbcomp" + LIBXVMC_DEVEL_RPM="" fi +# Ignore any DNF metadata cached in base image +dnf clean all +# Some nvidia/cuda base images spuriously ship an enabled RHEL UBI 8 AppStream +# repo (/etc/yum.repos.d/ubi-8-appstream.repo), which mixes incompatible RHEL UBI 8 +# and Rocky Linux 8 package versions and breaks dnf upgrade. Disable it if present. +if dnf repolist --enabled ubi-8-appstream 2>/dev/null | grep -q ubi-8-appstream; then + dnf config-manager --set-disabled ubi-8-appstream +fi +# Disable CUDA repo since that doesn't upgrade cleanly +dnf config-manager --set-disabled cuda +dnf -y upgrade +# Re-enable the CUDA repo after the upgrade +dnf config-manager --set-enabled cuda yum install --setopt=tsflags=nodocs -y \ alsa-lib \ @@ -243,22 +241,7 @@ dbus-uuidgen > /etc/machine-id yum -y groupinstall "Development Tools" -if [[ "$BASEOS_MAJORVERSION" -gt "7" ]]; then - dnf -y install gcc-toolset-$ASWF_DTS_VERSION gcc-toolset-$ASWF_DTS_VERSION-libatomic-devel -else - yum install -y --setopt=tsflags=nodocs centos-release-scl-rh - - if [[ $ASWF_DTS_VERSION == 6 ]]; then - # Use the centos vault as the original devtoolset-6 is not part of CentOS-7 anymore - sed -i 's/7/7.6.1810/g; s|^#\s*\(baseurl=http://\)mirror|\1vault|g; /mirrorlist/d' /etc/yum.repos.d/CentOS-SCLo-*.repo - fi - - # Workaround for occasional error: "Not using downloaded centos-sclo-rh/repomd.xml because it is older than what we have" - yum clean all - - yum install -y --setopt=tsflags=nodocs \ - "devtoolset-$ASWF_DTS_VERSION-toolchain" -fi +dnf -y install gcc-toolset-$ASWF_DTS_VERSION gcc-toolset-$ASWF_DTS_VERSION-libatomic-devel yum install -y epel-release @@ -304,51 +287,43 @@ if [[ "$BASEOS_MAJORVERSION" -eq "8" ]]; then dnf config-manager --set-disabled devel fi -if [[ "$BASEOS_MAJORVERSION" -gt "7" ]]; then - # Rocky 8 has git 2.31 and OpenSSL 1.1.1k by default - # Recent Qt 5.15.x wants wayland-devel - # Qt 6 wants python3-html5lib, python3-importlib-metadata, nodejs, brotli, - # double-conversion, perl-IPC-Cmd, perl-Digest-SHA, python 3.9 - # An unknown dependency is pulling Python 3.11.5, might as well - # have the devel package as well +# Rocky 8 has git 2.31 and OpenSSL 1.1.1k by default +# Recent Qt 5.15.x wants wayland-devel +# Qt 6 wants python3-html5lib, python3-importlib-metadata, nodejs, brotli, +# double-conversion, perl-IPC-Cmd, perl-Digest-SHA, python 3.9 +# An unknown dependency is pulling Python 3.11.5, might as well +# have the devel package as well - # On EL 9 Python 3.9 is the default and perl-FindBin is no longer in - # the perl-interpreter package, but instead in its own. - if [[ "$BASEOS_MAJORVERSION" -eq "8" ]]; then - PYTHON39_RPM="python39 python39-devel" - else - PERL_FIND_BIN_RPM="perl-FindBin" - fi +# On EL 9 Python 3.9 is the default and perl-FindBin is no longer in +# the perl-interpreter package, but instead in its own. +if [[ "$BASEOS_MAJORVERSION" -eq "8" ]]; then + PYTHON39_RPM="python39 python39-devel" +else + PERL_FIND_BIN_RPM="perl-FindBin" +fi - dnf -y install \ - git \ - wayland-devel \ - wayland-protocols-devel \ - python3-importlib-metadata \ - brotli brotli-devel \ - double-conversion double-conversion-devel \ - ${PERL_FIND_BIN_RPM} \ - perl-IPC-Cmd \ - perl-Digest-SHA \ - perl-open \ - ${PYTHON39_RPM} \ - python3.11 \ - python3.11-devel \ - python3.11-pip \ - python3.11-setuptools - dnf -y module install nodejs:18 +dnf -y install \ + git \ + wayland-devel \ + wayland-protocols-devel \ + python3-importlib-metadata \ + brotli brotli-devel \ + double-conversion double-conversion-devel \ + ${PERL_FIND_BIN_RPM} \ + perl-IPC-Cmd \ + perl-Digest-SHA \ + perl-open \ + ${PYTHON39_RPM} \ + python3.11 \ + python3.11-devel \ + python3.11-pip \ + python3.11-setuptools +dnf -y module install nodejs:18 - # Make Python 3.11 the default Python. Can't change default system python on EL 9. - if [[ "$BASEOS_MAJORVERSION" -eq "8" ]]; then - alternatives --set python /usr/bin/python3 - alternatives --set python3 /usr/bin/python3.11 - fi -else - yum install -y \ - libdb4-devel \ - openjpeg-devel \ - openssl11-devel \ - rh-git218 +# Make Python 3.11 the default Python. Can't change default system python on EL 9. +if [[ "$BASEOS_MAJORVERSION" -eq "8" ]]; then + alternatives --set python /usr/bin/python3 + alternatives --set python3 /usr/bin/python3.11 fi yum clean all diff --git a/scripts/tests/1/test_common.sh b/scripts/tests/1/test_common.sh deleted file mode 100755 index 70827b043..000000000 --- a/scripts/tests/1/test_common.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -set -ex - -clang_v=$(clang --version) -if [[ $clang_v != clang\ version\ 7.1* ]] -then - exit 1 -fi - -clang_tidy_v=$(clang-tidy --version) -if [[ $clang_tidy_v != *LLVM\ version\ 7.1* ]] -then - exit 1 -fi - -gcc_v=$(gcc --version) -if [[ $gcc_v != gcc\ \(GCC\)\ 6.3* ]] -then - exit 1 -fi - -ninja_v=$(ninja --version) -if [[ $ninja_v != 1.* ]] -then - exit 1 -fi - -git_v=$(git --version) -if [[ $git_v != 2.* ]] -then - exit 1 -fi diff --git a/scripts/tests/2/test_common.sh b/scripts/tests/2/test_common.sh deleted file mode 100755 index 68aae9cbf..000000000 --- a/scripts/tests/2/test_common.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -set -ex - -os_v=$(cat /etc/redhat-release) -if [[ $os_v != CentOS\ Linux\ release\ 7.9.2009* ]] -then - exit 1 -fi - -clang_v=$(clang --version) -if [[ $clang_v != clang\ version\ 10.0* ]] -then - exit 1 -fi - -clang_tidy_v=$(clang-tidy --version) -if [[ $clang_tidy_v != *LLVM\ version\ 10.0* ]] -then - exit 1 -fi - -gcc_v=$(gcc --version) -if [[ $gcc_v != gcc\ \(GCC\)\ 9.3* ]] -then - exit 1 -fi - -ninja_v=$(ninja --version) -if [[ $ninja_v != 1.* ]] -then - exit 1 -fi - -git_v=$(git --version) -if [[ $git_v != 2.* ]] -then - exit 1 -fi diff --git a/scripts/tests/2018/test_base.sh b/scripts/tests/2018/test_base.sh deleted file mode 100755 index 057860648..000000000 --- a/scripts/tests/2018/test_base.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -set -ex - -pypath=$(which python) -if [[ $pypath != /usr/local/bin/python ]] -then - echo "Wrong python location: $pypath" - exit 1 -fi - -pyversion=$(python --version 2>&1) -if [[ $pyversion != Python\ 2.7* ]] -then - echo "Wrong python version: $pyversion" - exit 1 -fi - -numpyversion=$(python -c "import numpy; print(numpy.__version__)") -if [[ $numpyversion != 1.14* ]] -then - echo "Wrong numpy version: $numpyversion" - exit 1 -fi diff --git a/scripts/tests/2018/test_openvdb.sh b/scripts/tests/2018/test_openvdb.sh deleted file mode 100755 index ac5f864c8..000000000 --- a/scripts/tests/2018/test_openvdb.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -set -ex - -git clone https://github.com/AcademySoftwareFoundation/openvdb -cd openvdb - -git checkout b5af82007f869a29f6fa1af729f14763e99f85be # Known working at that commit... - -source activate_ccache.sh - -ccache --show-stats - -ci/build.sh clang++ Release 6 ON - -ccache --show-stats diff --git a/scripts/tests/2019/test_base.sh b/scripts/tests/2019/test_base.sh deleted file mode 100755 index 057860648..000000000 --- a/scripts/tests/2019/test_base.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -set -ex - -pypath=$(which python) -if [[ $pypath != /usr/local/bin/python ]] -then - echo "Wrong python location: $pypath" - exit 1 -fi - -pyversion=$(python --version 2>&1) -if [[ $pyversion != Python\ 2.7* ]] -then - echo "Wrong python version: $pyversion" - exit 1 -fi - -numpyversion=$(python -c "import numpy; print(numpy.__version__)") -if [[ $numpyversion != 1.14* ]] -then - echo "Wrong numpy version: $numpyversion" - exit 1 -fi diff --git a/scripts/tests/2019/test_openvdb.sh b/scripts/tests/2019/test_openvdb.sh deleted file mode 100755 index ac5f864c8..000000000 --- a/scripts/tests/2019/test_openvdb.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -set -ex - -git clone https://github.com/AcademySoftwareFoundation/openvdb -cd openvdb - -git checkout b5af82007f869a29f6fa1af729f14763e99f85be # Known working at that commit... - -source activate_ccache.sh - -ccache --show-stats - -ci/build.sh clang++ Release 6 ON - -ccache --show-stats diff --git a/scripts/tests/2020/test_base.sh b/scripts/tests/2020/test_base.sh deleted file mode 100755 index 7c922ff0c..000000000 --- a/scripts/tests/2020/test_base.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -set -ex - -pypath=$(which python) -if [[ $pypath != /usr/local/bin/python ]] -then - echo "Wrong python location: $pypath" - exit 1 -fi - -pyversion=$(python --version) -if [[ $pyversion != Python\ 3.7* ]] -then - echo "Wrong python version: $pyversion" - exit 1 -fi - -numpyversion=$(python -c "import numpy; print(numpy.__version__)") -if [[ $numpyversion != 1.16* ]] -then - echo "Wrong numpy version: $numpyversion" - exit 1 -fi diff --git a/scripts/tests/2022/test_base.sh b/scripts/tests/2022/test_base.sh deleted file mode 100755 index a1555c89c..000000000 --- a/scripts/tests/2022/test_base.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash -# Copyright (c) Contributors to the aswf-docker Project. All rights reserved. -# SPDX-License-Identifier: Apache-2.0 - -set -ex - -pypath=$(which python) -if [[ $pypath != /usr/local/bin/python ]] -then - echo "Wrong python location: $pypath" - exit 1 -fi - -pyversion=$(python --version) -if [[ $pyversion != Python\ 3.9* ]] -then - echo "Wrong python version: $pyversion" - exit 1 -fi - -numpyversion=$(python -c "import numpy; print(numpy.__version__)") -if [[ $numpyversion != 1.20* ]] -then - echo "Wrong numpy version: $numpyversion" - exit 1 -fi - -yumversion=$(yum --version) -if [[ $yumversion != 3.4* ]] -then - echo "Wrong yum version: $yumversion" - exit 1 -fi diff --git a/uv.lock b/uv.lock index 758c4594a..a8c95902d 100644 --- a/uv.lock +++ b/uv.lock @@ -57,17 +57,21 @@ dependencies = [ dev = [ { name = "atomicwrites", marker = "sys_platform == 'win32'" }, { name = "black" }, + { name = "jactionlint" }, { name = "mypy" }, { name = "pre-commit" }, { name = "pylint" }, { name = "pytest" }, { name = "pytest-cov" }, { name = "pytest-pylint" }, + { name = "shellcheck-py" }, { name = "twine" }, { name = "types-click" }, { name = "types-jinja2" }, { name = "types-pyyaml" }, { name = "types-requests" }, + { name = "zizmor", version = "1.30.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.11'" }, + { name = "zizmor", version = "1.32.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.11'" }, ] [package.metadata] @@ -85,6 +89,7 @@ requires-dist = [ { name = "fasteners", specifier = "==0.19" }, { name = "idna", specifier = "==3.15" }, { name = "importlib-resources", specifier = "==5.12.0" }, + { name = "jactionlint", marker = "extra == 'dev'" }, { name = "jinja2", specifier = "==3.1.6" }, { name = "markupsafe", specifier = "==2.1.5" }, { name = "mypy", marker = "extra == 'dev'" }, @@ -102,6 +107,7 @@ requires-dist = [ { name = "python-dateutil", specifier = "==2.9.0.post0" }, { name = "pyyaml", specifier = "==6.0.3" }, { name = "requests", specifier = "==2.33.0" }, + { name = "shellcheck-py", marker = "extra == 'dev'" }, { name = "six", specifier = "==1.16.0" }, { name = "tqdm", specifier = "==4.66.3" }, { name = "twine", marker = "extra == 'dev'" }, @@ -113,6 +119,7 @@ requires-dist = [ { name = "urllib3", specifier = ">=1.26.6,<3" }, { name = "wrapt", specifier = "==1.16.0" }, { name = "zipp", marker = "python_full_version < '3.10'", specifier = "==3.19.1" }, + { name = "zizmor", marker = "extra == 'dev'" }, ] provides-extras = ["dev"] @@ -701,6 +708,19 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/d1/b3/8def84f539e7d2289a02f0524b944b15d7c75dab7628bedf1c4f0992029c/isort-5.13.2-py3-none-any.whl", hash = "sha256:8ca5e72a8d85860d5a3fa69b8745237f2939afe12dbf656afbcb47fe72d947a6", size = 92310, upload-time = "2023-12-13T20:37:23.244Z" }, ] +[[package]] +name = "jactionlint" +version = "2.6.0" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/01/7d/5299d354518eed2cc12c7cebca9b17cd46e601f508fab94a33f4b3c57b78/jactionlint-2.6.0-py3-none-macosx_10_9_x86_64.whl", hash = "sha256:55a0c67cdd228910aa5d520a6935205f09aade3a02acea2119b41f86605b7c1d", size = 20113297, upload-time = "2026-11-12T17:59:05.038Z" }, + { url = "https://files.pythonhosted.org/packages/6e/64/4d4de1263fbf08939e878c664aa2e17b20c33a3922d3d2bd5b61623b0f54/jactionlint-2.6.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:53ff5a9b211d235b29fd747de70b6ce0316d40f302b1ffd8a151c57d4494ad54", size = 18684870, upload-time = "2026-11-12T17:59:07.544Z" }, + { url = "https://files.pythonhosted.org/packages/74/52/b63faf525184d25107b99a617b02b5f0bdd478afa19907cb5119c188a5cd/jactionlint-2.6.0-py3-none-manylinux_2_17_aarch64.whl", hash = "sha256:831093514388f37afee588aaf1a33cb1fd21ddd597a3d545a79815a4e93281dd", size = 18291687, upload-time = "2026-11-12T17:59:10.13Z" }, + { url = "https://files.pythonhosted.org/packages/91/d6/c9d3eb17364b50d574e9abd280ea399aeca95c0dcf26abd0bc0ed26c4c69/jactionlint-2.6.0-py3-none-manylinux_2_17_x86_64.whl", hash = "sha256:b8b16e1e1f13411a7611cec18705e3211c4376fd5cb8b073dae4332c07abcd06", size = 19782631, upload-time = "2026-11-12T17:59:15.712Z" }, + { url = "https://files.pythonhosted.org/packages/8c/e2/67cb8e0bf1943ac5d0c67b761971ef06aba1182f0b8af06ac7912e83282f/jactionlint-2.6.0-py3-none-win_amd64.whl", hash = "sha256:a15f6f5a46d80f38f8b7b32d0c430faf0c2cbf00f9c7ea4924b12b304b8b6e18", size = 20283717, upload-time = "2026-11-12T17:59:18.625Z" }, + { url = "https://files.pythonhosted.org/packages/8a/a9/e4d709cfd35491ea256948d44fee90a27d300aca75e46331cb51dafc206b/jactionlint-2.6.0-py3-none-win_arm64.whl", hash = "sha256:9682cedc90a29e45a19298c90ab2d0365e2aba3c7e98874dd5a0dace8a506163", size = 18494789, upload-time = "2026-11-12T17:59:20.828Z" }, +] + [[package]] name = "jaraco-classes" version = "3.4.0" @@ -1458,6 +1478,18 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/b7/46/f5af3402b579fd5e11573ce652019a67074317e18c1935cc0b4ba9b35552/secretstorage-3.5.0-py3-none-any.whl", hash = "sha256:0ce65888c0725fcb2c5bc0fdb8e5438eece02c523557ea40ce0703c266248137", size = 15554, upload-time = "2025-11-23T19:02:51.545Z" }, ] +[[package]] +name = "shellcheck-py" +version = "0.11.0.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/df/55/455b097417b3df3d330eff029c72c32f08b25739e3010acb30ad06d268ef/shellcheck_py-0.11.0.1.tar.gz", hash = "sha256:5c620c88901e8f1d3be5934b31ea99e3310065e1245253741eafd0a275c8c9cc", size = 3139, upload-time = "2025-08-09T17:53:42.492Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/27/d75b03e5458cefdb6d3b674566cd20476c3e4d3fe6cc9d68b7e3b854b296/shellcheck_py-0.11.0.1-py2.py3-none-macosx_10_9_x86_64.whl", hash = "sha256:b6a3fee28efda2e16e38d6e6d59faf7224300256456639727370d404730849e8", size = 6774472, upload-time = "2025-08-09T17:53:34.573Z" }, + { url = "https://files.pythonhosted.org/packages/61/ac/2a84c37171c0cf5a10ea4b0a27d43eb0a1d29bd98b49c2c5ffe17ad24bbe/shellcheck_py-0.11.0.1-py2.py3-none-macosx_11_0_arm64.whl", hash = "sha256:6b88d0a244c82ed07e06a53e444da841f69330ca59ae15d4a66c391655dae7a0", size = 11381835, upload-time = "2025-08-09T17:53:36.852Z" }, + { url = "https://files.pythonhosted.org/packages/96/55/250e0e3367613a5c22bd82e33b16b889287d81ab0f7dda67e6514a4cccf4/shellcheck_py-0.11.0.1-py2.py3-none-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:1b274df81de5b000ff78db433e7328b87e52e3c38481c60f8e488c3095beef05", size = 3800600, upload-time = "2025-08-09T17:53:38.643Z" }, + { url = "https://files.pythonhosted.org/packages/15/5b/bb14c0a7474463b1aa3c09e866cb172dffc66ed2993b7ea8f1db581e86ee/shellcheck_py-0.11.0.1-py2.py3-none-win_amd64.whl", hash = "sha256:784156289ecb17e91c692cd783ab5152333309588cabb10032a047331c63e759", size = 8027541, upload-time = "2025-08-09T17:53:40.889Z" }, +] + [[package]] name = "six" version = "1.16.0" @@ -1702,3 +1734,47 @@ sdist = { url = "https://files.pythonhosted.org/packages/4f/a1/ac66fba5917fb7860 wheels = [ { url = "https://files.pythonhosted.org/packages/82/1a/ac67760425f2477b1da593b347db66d474130747e6e5285d08c7f2d5884a/zipp-3.19.1-py3-none-any.whl", hash = "sha256:2828e64edb5386ea6a52e7ba7cdb17bb30a73a858f5eb6eb93d8d36f5ea26091", size = 8951, upload-time = "2024-05-31T16:39:19.68Z" }, ] + +[[package]] +name = "zizmor" +version = "1.30.1" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.11'", +] +sdist = { url = "https://files.pythonhosted.org/packages/a7/c5/3d3dc61c0b64c082e1f704f5cf44f6a38153adbccf8787dd06a1a0ed14e0/zizmor-1.30.1.tar.gz", hash = "sha256:cbb7e5cb2fec471066d5c326bcaa69ed3eefdcf6a76d7ad38335b924acf86c07", size = 575745, upload-time = "2026-09-09T05:27:21.325Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/22/a1/a877361a6c6ae13fb0ff4ed3c9d681ccddb9c838c5c3ca8f163a0fcfded9/zizmor-1.30.1-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:17fda74e15fe41a6aa354ea4cf71fc7ff3cd025cda6584bb6d7466b3f1d00fe6", size = 9148491, upload-time = "2026-09-09T05:26:58.842Z" }, + { url = "https://files.pythonhosted.org/packages/eb/0e/ea44a8f466b9a080dc0634497f6c9ee63dd586a94f5e2cd743e06c4df140/zizmor-1.30.1-py3-none-macosx_11_0_arm64.whl", hash = "sha256:f9eb092f089e35fa9fb3b70aeec0a19eca7dacf2ab161f1d50b18351895f085c", size = 8743712, upload-time = "2026-09-09T05:27:01.342Z" }, + { url = "https://files.pythonhosted.org/packages/37/9c/43764a6e9eb5ad5a332202afc3e63622e3380669ecf7079b6b0de892e474/zizmor-1.30.1-py3-none-manylinux_2_24_aarch64.whl", hash = "sha256:92906f448365672ebb657fb50d36f997290a3aaba8cac723214741ea9054845d", size = 9009843, upload-time = "2026-09-09T05:27:03.522Z" }, + { url = "https://files.pythonhosted.org/packages/cf/2d/96c9c7b37e46e2b092e5daac3c6e9d4966ed7b58845f3f04950043d89c34/zizmor-1.30.1-py3-none-manylinux_2_28_armv7l.whl", hash = "sha256:5e8a3d54c3d9d51307371f4d1d49f8f9e56de00205c6cc660c6846a95ad4e135", size = 8620204, upload-time = "2026-09-09T05:27:06.001Z" }, + { url = "https://files.pythonhosted.org/packages/63/55/1900b53d34dcebc207cf3ceb7957b3748e8bb40958f062e3853ab72f2395/zizmor-1.30.1-py3-none-manylinux_2_28_x86_64.whl", hash = "sha256:eee12266b793cb87ad4a7e3af2e72404f8a63e3de5eb099b80bf7b1cfd232a8e", size = 9467893, upload-time = "2026-09-09T05:27:08.07Z" }, + { url = "https://files.pythonhosted.org/packages/9b/aa/d998bbdebf1f40e0d3dd027f94bceb961065640b29bc82bf5ffa9266fdb9/zizmor-1.30.1-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:15679642e8c4f825ba3f22537c698b1bbbad19ead23640f62ec45ebbe7abc803", size = 9038587, upload-time = "2026-09-09T05:27:10.226Z" }, + { url = "https://files.pythonhosted.org/packages/e0/16/0512afae720fd4b7e22bbb6f5bdd24fad49d6b1b92cd34ac71e0d8076109/zizmor-1.30.1-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:bf63099a27ef3bf1329dbab44bb9d1027124855c71bd0eca864d5c8e1c5c0db1", size = 8583701, upload-time = "2026-09-09T05:27:12.73Z" }, + { url = "https://files.pythonhosted.org/packages/ca/ff/72efacfb79177835609fe712e9d543a0e5a05d41e3774e907f0b610c8619/zizmor-1.30.1-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:4a5ef2fa4fbd2984f794cfc2f95790bd03fa0bae801487ed550e044675874e60", size = 9558806, upload-time = "2026-09-09T05:27:15.124Z" }, + { url = "https://files.pythonhosted.org/packages/bb/64/1746121c819319ad7e9d0dfaa96de38dc52d4ac5f6485472b11362f3c6ba/zizmor-1.30.1-py3-none-win32.whl", hash = "sha256:42512bb4a1bce4c787d221d1572ff6b691fa52a3d129b2910be8afaf860c5871", size = 7773805, upload-time = "2026-09-09T05:27:17.218Z" }, + { url = "https://files.pythonhosted.org/packages/db/fe/2889fcbcf7728dd5e013bae7cf5c4e634d981a9e26d55e1da6ab9006404f/zizmor-1.30.1-py3-none-win_amd64.whl", hash = "sha256:06e039fae8e185e2a1a8b002f2d95a6f5c3b548048bdd79e004dcb501fcd0868", size = 8925696, upload-time = "2026-09-09T05:27:19.159Z" }, +] + +[[package]] +name = "zizmor" +version = "1.32.0" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.12'", + "python_full_version == '3.11.*'", +] +sdist = { url = "https://files.pythonhosted.org/packages/84/c5/9c9d931f6d4d3e55c14467a579dfea567d1bc15e4bb4a2fc6e5fbf931ca2/zizmor-1.32.0.tar.gz", hash = "sha256:f0b664d394576e08605fe8094e8e992056d74b808f30c0c9ca9ed227001dcf67", size = 604400, upload-time = "2026-11-02T23:31:21.6Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/98/19/e5eeae31466ee7fe7919050bca7993ecade4878801cd2174d05b1c2da166/zizmor-1.32.0-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:aa4b4e216321dd5cf202cd79fc83296468f0eed79d850cd65ac8187a6bbc5496", size = 9416965, upload-time = "2026-11-02T23:30:59.361Z" }, + { url = "https://files.pythonhosted.org/packages/cd/68/a258299c0fdb3c266c2df0d422da6380df5602c6b0373af3fbe461231290/zizmor-1.32.0-py3-none-macosx_11_0_arm64.whl", hash = "sha256:0a999c98015becd9f69919ce01febadfb1c2be9b8ec2ce9ef7eb13ff23ba8eba", size = 8979489, upload-time = "2026-11-02T23:31:01.724Z" }, + { url = "https://files.pythonhosted.org/packages/be/18/8d66db6e98c89f5d647236e282062d8ccc73f7ba759f7ef8dd6204683518/zizmor-1.32.0-py3-none-manylinux_2_24_aarch64.whl", hash = "sha256:0cdd38fca6eb34ceb567548548d706332e3535ea66894b9168c048e03207b68c", size = 9319662, upload-time = "2026-11-02T23:31:03.763Z" }, + { url = "https://files.pythonhosted.org/packages/68/14/8f4750ef28bdb7234abd0c9be5ebc8c328cdcafa84dd8f7082db711bdd31/zizmor-1.32.0-py3-none-manylinux_2_28_armv7l.whl", hash = "sha256:bddcdb0e37d1aa53c9f831c55627a5829d0d552cb0afb4b80fbe16a3a3140366", size = 8884062, upload-time = "2026-11-02T23:31:05.671Z" }, + { url = "https://files.pythonhosted.org/packages/6f/b2/45f4fcb6f428e774750709ecf5320ba6d96393c03b941d9f37a4586f6924/zizmor-1.32.0-py3-none-manylinux_2_28_x86_64.whl", hash = "sha256:84a6acb975accc13408786a2bd274b572537ca19c933ebbc13e78f3988562071", size = 9722222, upload-time = "2026-11-02T23:31:07.513Z" }, + { url = "https://files.pythonhosted.org/packages/ac/86/50f103c3a9f705297807c5dced4554b9fd675837f600eaa9582a97988e52/zizmor-1.32.0-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:d34dcfa702875202b4163d90ebb9cc5222f3d1a7d4b72bf796d87b5a15b24194", size = 9335684, upload-time = "2026-11-02T23:31:09.544Z" }, + { url = "https://files.pythonhosted.org/packages/71/9c/a465f96566aefb152c3411f6b30867913b6ae4e7a730242a801b6a1216ff/zizmor-1.32.0-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:3f404b26791ed06a5ea9eaa0bfd5b973fc5228bac7db8b3c5ec7f0c7ad2ed16d", size = 8846777, upload-time = "2026-11-02T23:31:11.898Z" }, + { url = "https://files.pythonhosted.org/packages/00/ec/aafd81a32c317509de5a3482c3d8c3c165b4c073d0fdf1e0a54671e1ad63/zizmor-1.32.0-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:dd818f99d833b86cd432d5412d620d936b5df074b33404fff8b67acff55d3259", size = 9819812, upload-time = "2026-11-02T23:31:14.098Z" }, + { url = "https://files.pythonhosted.org/packages/21/aa/535adba18c93ed5739ed1ea3e4742a42a29e26ae2071026eae01d586538c/zizmor-1.32.0-py3-none-win32.whl", hash = "sha256:eaedf57859f026a0a7da2a6b574517b1fe01e256c6875b3319a06ee1cee026a7", size = 8029245, upload-time = "2026-11-02T23:31:15.871Z" }, + { url = "https://files.pythonhosted.org/packages/0f/1f/1ed88cac316f248c7851860bd209ce2a2abf1a2481d887b8a78619dd4a39/zizmor-1.32.0-py3-none-win_amd64.whl", hash = "sha256:9cd1dd7734042f40ca0faa2a31fb4e9033dede620d996af2f903744b8f04fca9", size = 9194896, upload-time = "2026-11-02T23:31:17.425Z" }, + { url = "https://files.pythonhosted.org/packages/ff/74/4629954a4ccfcd3434509b5228f0357f934a16abc455cf1d2a1b4f7346cc/zizmor-1.32.0-py3-none-win_arm64.whl", hash = "sha256:913fd3943bc1358aa6e23b33fe01cc98bf67af23985258b8fbf24eaa2f8728ea", size = 8654150, upload-time = "2026-11-02T23:31:19.812Z" }, +]