-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
287 additions
and
88 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: 'Compute Matrix Action' | ||
description: 'Computes matrix' | ||
outputs: | ||
MATRIX: | ||
description: "Computed matrix" | ||
value: ${{ steps.compute-matrix.outputs.MATRIX }} | ||
LATEST_LINUX_VER: | ||
description: "Latest Linux version" | ||
value: ${{ steps.latest-values.outputs.LATEST_LINUX_VER }} | ||
LATEST_CUDA_VER: | ||
description: "Latest CUDA version" | ||
value: ${{ steps.latest-values.outputs.LATEST_CUDA_VER }} | ||
LATEST_PYTHON_VER: | ||
description: "Latest Python version" | ||
value: ${{ steps.latest-values.outputs.LATEST_PYTHON_VER }} | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Compute latest values | ||
id: latest-values | ||
run: ./ci/compute-latest-versions.sh | ||
shell: bash | ||
- name: Compute matrix | ||
id: compute-matrix | ||
run: | | ||
MATRIX=$(ci/compute-matrix.sh) | ||
echo "MATRIX=${MATRIX}" | tee -a ${GITHUB_OUTPUT} | ||
shell: bash |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Build and push image variant | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
ARCHES: | ||
required: true | ||
type: string | ||
CUDA_VER: | ||
required: true | ||
type: string | ||
LINUX_VER: | ||
required: true | ||
type: string | ||
PYTHON_VER: | ||
required: true | ||
type: string | ||
IMAGE_REPO: | ||
required: true | ||
type: string | ||
IMAGE_NAME: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
run: | ||
name: build (${{ matrix.CUDA_VER }}, ${{ matrix.PYTHON_VER }}, ${{ matrix.LINUX_VER }}, ${{ matrix.ARCH }}) | ||
strategy: | ||
matrix: | ||
ARCH: ${{ fromJSON(inputs.ARCHES) }} | ||
CUDA_VER: ["${{ inputs.CUDA_VER }}"] | ||
LINUX_VER: ["${{ inputs.LINUX_VER }}"] | ||
PYTHON_VER: ["${{ inputs.PYTHON_VER }}"] | ||
fail-fast: false | ||
runs-on: linux-${{ matrix.ARCH }}-cpu4 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.GPUCIBOT_DOCKERHUB_USER }} | ||
password: ${{ secrets.GPUCIBOT_DOCKERHUB_TOKEN }} | ||
- name: Set up Docker Context for Buildx | ||
run: | | ||
docker context create builders | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
with: | ||
driver: docker | ||
endpoint: builders | ||
- name: Build image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: ./${{ inputs.IMAGE_REPO }} | ||
file: ./${{ inputs.IMAGE_REPO }}/Dockerfile | ||
push: true | ||
pull: true | ||
build-args: | | ||
CUDA_VER=${{ inputs.CUDA_VER }} | ||
LINUX_VER=${{ inputs.LINUX_VER }} | ||
PYTHON_VER=${{ inputs.PYTHON_VER }} | ||
TARGETPLATFORM=${{ matrix.ARCH }} | ||
tags: ${{ inputs.IMAGE_NAME }}-${{ matrix.ARCH }} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
name: publish | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- "main" | ||
workflow_dispatch: | ||
- main | ||
|
||
concurrency: | ||
group: "${{ github.workflow }} @ ${{ github.ref }}" | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-images: | ||
uses: ./.github/workflows/build-and-publish-images.yml | ||
with: | ||
push: true | ||
build_type: branch | ||
secrets: inherit |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
def compute_arch($x): | ||
["amd64"] | | ||
if | ||
["ubuntu18.04", "centos7"] | index($x.LINUX_VER) != null | ||
then | ||
. | ||
else | ||
. + ["arm64"] | ||
end | | ||
$x + {ARCHES: .}; | ||
|
||
def compute_repo($x): | ||
if | ||
env.BUILD_TYPE == "pull-request" | ||
then | ||
"staging" | ||
else | ||
$x.IMAGE_REPO | ||
end; | ||
|
||
def compute_tag_prefix($x): | ||
if | ||
env.BUILD_TYPE == "branch" | ||
then | ||
"" | ||
else | ||
$x.IMAGE_REPO + "-" + env.PR_NUM + "-" | ||
end; | ||
|
||
def compute_image_name($x): | ||
compute_repo($x) as $repo | | ||
compute_tag_prefix($x) as $tag_prefix | | ||
"rapidsai/" + $repo + ":" + $tag_prefix + "cuda" + $x.CUDA_VER + "-" + $x.LINUX_VER + "-" + "py" + $x.PYTHON_VER | | ||
$x + {IMAGE_NAME: .}; | ||
|
||
# Checks the current entry to see if it matches the given exclude | ||
def matches($entry; $exclude): | ||
all($exclude | to_entries | .[]; $entry[.key] == .value); | ||
|
||
# Checks the current entry to see if it matches any of the excludes. | ||
# If so, produce no output. Otherwise, output the entry. | ||
def filter_excludes($entry; $excludes): | ||
select(any($excludes[]; matches($entry; .)) | not); | ||
|
||
def lists2dict($keys; $values): | ||
reduce range($keys | length) as $ind ({}; . + {($keys[$ind]): $values[$ind]}); | ||
|
||
def compute_matrix($input): | ||
($input.exclude // []) as $excludes | | ||
$input | del(.exclude) | | ||
keys_unsorted as $matrix_keys | | ||
to_entries | | ||
map(.value) | | ||
[ | ||
combinations | | ||
lists2dict($matrix_keys; .) | | ||
filter_excludes(.; $excludes) | | ||
compute_arch(.) | | ||
compute_image_name(.) | ||
] | | ||
{include: .}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,16 @@ | ||
#!/bin/bash | ||
# Computes matrix based on "axis.yaml" values. Will also | ||
# remove any keys (e.g. LATEST_VERSIONS) that are not used | ||
# for the matrix build. | ||
# Example Usage: | ||
# ./ci/compute-matrix.sh | ||
set -eu | ||
set -euo pipefail | ||
|
||
MATRIX=$(yq -o json '. | del(.LATEST_VERSIONS)' axis.yaml | jq -c) | ||
echo "MATRIX=${MATRIX}" | tee --append ${GITHUB_OUTPUT:-/dev/null} | ||
case "${BUILD_TYPE}" in | ||
pull-request) | ||
export PR_NUM="${GITHUB_REF_NAME##*/}" | ||
;; | ||
branch) | ||
;; | ||
*) | ||
echo "Invalid build type: '${BUILD_TYPE}'" | ||
exit 1 | ||
;; | ||
esac | ||
|
||
yq -o json matrix.yaml | jq -c 'include "ci/compute-matrix"; compute_matrix(.)' |
Oops, something went wrong.