This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | ||
workflow_call: | ||
inputs: | ||
build_type: | ||
required: true | ||
type: string | ||
branch: | ||
type: string | ||
date: | ||
type: string | ||
sha: | ||
type: string | ||
repo: | ||
type: string | ||
node_type: | ||
type: string | ||
default: "cpu8" | ||
build_script: | ||
type: string | ||
default: "ci/build_cpp.sh" | ||
matrix_filter: | ||
type: string | ||
default: "." | ||
defaults: | ||
run: | ||
shell: bash | ||
permissions: | ||
actions: read | ||
checks: none | ||
contents: read | ||
deployments: none | ||
discussions: none | ||
id-token: write | ||
issues: none | ||
packages: read | ||
pages: none | ||
pull-requests: read | ||
repository-projects: none | ||
security-events: none | ||
statuses: none | ||
jobs: | ||
compute-matrix: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
MATRIX: ${{ steps.compute-matrix.outputs.MATRIX }} | ||
steps: | ||
- name: Compute Build Matrix | ||
id: compute-matrix | ||
run: | | ||
set -eo pipefail | ||
export MATRIX=" | ||
- { CUDA_VER: '11.8.0', LINUX_VER: 'ubuntu22.04', ARCH: 'amd64', PY_VER: '3.10' } | ||
" | ||
echo "MATRIX=$( | ||
yq -n -o json 'env(MATRIX)' | \ | ||
jq -c '${{ inputs.matrix_filter }} | {include: .}' \ | ||
)" | tee --append "${GITHUB_OUTPUT}" | ||
build: | ||
needs: compute-matrix | ||
timeout-minutes: 480 | ||
strategy: | ||
fail-fast: false | ||
matrix: ${{ fromJSON(needs.compute-matrix.outputs.MATRIX) }} | ||
runs-on: "linux-${{ matrix.ARCH }}-${{ inputs.node_type }}" | ||
env: | ||
RAPIDS_ARTIFACTS_DIR: ${{ github.workspace }}/artifacts | ||
container: | ||
image: rapidsai/ci-conda:cuda${{ matrix.CUDA_VER }}-${{ matrix.LINUX_VER }}-py${{ matrix.PY_VER }} | ||
env: | ||
RAPIDS_BUILD_TYPE: ${{ inputs.build_type }} | ||
PARALLEL_LEVEL: ${{ env.PARALLEL_LEVEL }} | ||
steps: | ||
- uses: aws-actions/configure-aws-credentials@v3 | ||
with: | ||
role-to-assume: ${{ vars.AWS_ROLE_ARN }} | ||
aws-region: ${{ vars.AWS_REGION }} | ||
role-duration-seconds: 43200 # 12h | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ inputs.repo }} | ||
ref: ${{ inputs.sha }} | ||
fetch-depth: 0 | ||
- name: Standardize repository information | ||
run: | | ||
echo "RAPIDS_REPOSITORY=${{ inputs.repo || github.repository }}" >> "${GITHUB_ENV}" | ||
echo "RAPIDS_SHA=$(git rev-parse HEAD)" >> "${GITHUB_ENV}" | ||
echo "RAPIDS_REF_NAME=${{ inputs.branch || github.ref_name }}" >> "${GITHUB_ENV}" | ||
echo "RAPIDS_NIGHTLY_DATE=${{ inputs.date }}" >> "${GITHUB_ENV}" | ||
# "cpp-build" prefix is necessary because all jobs get bundled as part of one workflow called e.g. "build" or "pr" | ||
echo "RAPIDS_ARTIFACT_PREFIX=cpp-build-${{ matrix.CUDA_VER }}-${{ matrix.LINUX_VER }}-${{ matrix.ARCH }}-${{ matrix.PY_VER }}" >> "${GITHUB_ENV}" | ||
# - name: C++ build | ||
# run: ${{ inputs.build_script }} | ||
# env: | ||
# GH_TOKEN: ${{ github.token }} | ||
- name: (testing) generate artifacts | ||
run: | | ||
mkdir -p ./artifacts | ||
head -c 1000000 /dev/urandom > "./artifacts/1mb.bin" | ||
head -c 10000000 /dev/urandom > "./artifacts/10mb.bin" | ||
head -c 100000000 /dev/urandom > "./artifacts/100mb.bin" | ||
head -c 500000000 /dev/urandom > "./artifacts/500mb.bin" | ||
head -c 1000000000 /dev/urandom > "./artifacts/1gb.bin" | ||
head -c 2000000000 /dev/urandom > "./artifacts/2gb.bin" | ||
head -c 5000000000 /dev/urandom > "./artifacts/5gb.bin" | ||
ls -alF . | ||
echo "-----" | ||
ls -alF "./artifacts" | ||
- name: (testing) upload 1MB artifact | ||
if: "!cancelled()" | ||
uses: actions/upload-artifact@v4-beta | ||
with: | ||
name: "${{ env.RAPIDS_ARTIFACT_PREFIX }}-1mb" | ||
path: "artifacts/1mb.bin" | ||
retention-days: 1 | ||
if-no-files-found: error | ||
- name: (testing) upload 10MB artifact | ||
if: "!cancelled()" | ||
uses: actions/upload-artifact@v4-beta | ||
with: | ||
name: "${{ env.RAPIDS_ARTIFACT_PREFIX }}-10mb" | ||
path: "artifacts/10mb.bin" | ||
retention-days: 1 | ||
if-no-files-found: error | ||
- name: (testing) upload 100MB artifact | ||
if: "!cancelled()" | ||
uses: actions/upload-artifact@v4-beta | ||
with: | ||
name: "${{ env.RAPIDS_ARTIFACT_PREFIX }}-100mb" | ||
path: "artifacts/100mb.bin" | ||
retention-days: 1 | ||
if-no-files-found: error | ||
- name: (testing) upload 500MB artifact | ||
if: "!cancelled()" | ||
uses: actions/upload-artifact@v4-beta | ||
with: | ||
name: "${{ env.RAPIDS_ARTIFACT_PREFIX }}-500mb" | ||
path: "artifacts/500mb.bin" | ||
retention-days: 1 | ||
if-no-files-found: error | ||
- name: (testing) upload 1GB artifact | ||
if: "!cancelled()" | ||
uses: actions/upload-artifact@v4-beta | ||
with: | ||
name: "${{ env.RAPIDS_ARTIFACT_PREFIX }}-1gb" | ||
path: "artifacts/1gb.bin" | ||
retention-days: 1 | ||
if-no-files-found: error | ||
- name: (testing) upload 2GB artifact | ||
if: "!cancelled()" | ||
uses: actions/upload-artifact@v4-beta | ||
with: | ||
name: "${{ env.RAPIDS_ARTIFACT_PREFIX }}-2gb" | ||
path: "artifacts/2gb.bin" | ||
retention-days: 1 | ||
if-no-files-found: error | ||
- name: (testing) upload 5GB artifact | ||
if: "!cancelled()" | ||
uses: actions/upload-artifact@v4-beta | ||
with: | ||
name: "${{ env.RAPIDS_ARTIFACT_PREFIX }}-5gb" | ||
path: "artifacts/5gb.bin" | ||
retention-days: 1 | ||
if-no-files-found: error | ||
- name: (testing) upload bundle of test artifacts | ||
if: "!cancelled()" | ||
uses: actions/upload-artifact@v4-beta | ||
with: | ||
name: "${{ env.RAPIDS_ARTIFACT_PREFIX }}-bundle" | ||
path: "artifacts/" | ||
retention-days: 1 | ||
if-no-files-found: error | ||
- name: (testing) Upload real build artifacts | ||
if: "!cancelled()" | ||
uses: actions/upload-artifact@v4-beta | ||
with | ||
name: "${{ env.RAPIDS_ARTIFACT_PREFIX }}" | ||
path: "artifacts/" | ||
retention-days: 1 | ||
if-no-files-found: error |