Skip to content

Commit

Permalink
More updates...
Browse files Browse the repository at this point in the history
  • Loading branch information
alliepiper committed Apr 22, 2024
1 parent b5e3c8d commit 3446797
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 21 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci-dispatch-group.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
include: ${{fromJSON(inputs.jobs)['standalone']}}
uses: ./.github/workflows/ci-dispatch-job.yml
with:
dispatch: ${{ matrix.dispatch }}
name: ${{ matrix.name }}
runner: ${{ matrix.runner }}
image: ${{ matrix.image }}
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/ci-dispatch-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ on:
success:
value: ${{ contains(toJSON(jobs.*.outputs.success), 'true') }}
inputs:
dispatch: {type: string, required: true}
name: {type: string, required: true}
image: {type: string, required: true}
runner: {type: string, required: true}
Expand All @@ -40,15 +39,15 @@ permissions:
jobs:
linux:
name: ${{inputs.name}}
# continue-on-error: ${{ ! startsWith(inputs.dispatch, 'linux') }}
continue-on-error: ${{ ! startsWith(inputs.runner, 'linux') }}
outputs:
success: ${{ steps.done.outputs.SUCCESS }}
permissions:
id-token: write
contents: read
strategy:
matrix:
include: ${{ fromJSON(startsWith(inputs.dispatch, 'linux') && inputs.dummy_matrix || '[]') }}
include: ${{ fromJSON(startsWith(inputs.runner, 'linux') && inputs.dummy_matrix || '[]') }}
runs-on: ${{inputs.runner}}
container:
options: -u root
Expand All @@ -57,7 +56,7 @@ jobs:
NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }}
steps:
- name: Checkout repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: cccl
persist-credentials: false
Expand Down Expand Up @@ -98,7 +97,7 @@ jobs:

windows:
name: ${{inputs.name}}
# continue-on-error: ${{ ! startsWith(inputs.dispatch, 'windows') }}
continue-on-error: ${{ ! startsWith(inputs.runner, 'windows') }}
outputs:
success: ${{ steps.done.outputs.SUCCESS }}
permissions:
Expand All @@ -107,7 +106,7 @@ jobs:
strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(startsWith(inputs.dispatch, 'windows') && inputs.dummy_matrix || '[]') }}
include: ${{ fromJSON(startsWith(inputs.runner, 'windows') && inputs.dummy_matrix || '[]') }}
runs-on: ${{inputs.runner}}
env:
SCCACHE_BUCKET: rapids-sccache-devs
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/ci-dispatch-two-stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ jobs:
include: ${{fromJSON(inputs.producers)}}
uses: ./.github/workflows/ci-dispatch-job.yml
with:
dispatch: ${{ matrix.dispatch }}
name: ${{ matrix.name }}
runner: ${{ matrix.runner }}
image: ${{ matrix.image }}
Expand All @@ -47,7 +46,6 @@ jobs:
include: ${{fromJSON(inputs.consumers)}}
uses: ./.github/workflows/ci-dispatch-job.yml
with:
dispatch: ${{ matrix.dispatch }}
name: ${{ matrix.name }}
runner: ${{ matrix.runner }}
image: ${{ matrix.image }}
Expand Down
18 changes: 7 additions & 11 deletions ci/compute-matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
- job_json: A json object that represents a single job in a workflow. Used with ci-dispatch-job.yml.
Example:
{
dispatch: "...", # (linux|windows)-(cpu|gpu)
name: "...",
runner: "...",
image: "...",
Expand Down Expand Up @@ -88,21 +87,25 @@ def get_formatted_projected_name(project_name):
return matrix_yaml['formatted_project_names'][project_name]
return project_name


def get_formatted_host_compiler_name(host_compiler):
config_name = host_compiler['name']
if config_name in matrix_yaml['formatted_host_compiler_names']:
return matrix_yaml['formatted_host_compiler_names'][config_name]
return config_name


def get_formatted_job_type(job_type):
if job_type in matrix_yaml['formatted_job_types']:
return matrix_yaml['formatted_job_types'][job_type]
# Return with first letter capitalized:
return job_type.capitalize()


def is_windows(matrix_job):
return matrix_job['os'].startswith('windows')


def validate_matrix_job(matrix_job):
for tag in matrix_yaml['required_tags']:
if tag not in matrix_job:
Expand Down Expand Up @@ -149,6 +152,7 @@ def explode_matrix_job(matrix_job):

return new_jobs if len(new_jobs) > 0 else None


def generate_dispatch_group_name(matrix_job):
project_name = get_formatted_projected_name(matrix_job['projects'][0])
ctk = matrix_job['ctk']
Expand All @@ -166,13 +170,6 @@ def generate_dispatch_group_name(matrix_job):
return f"{project_name} {compiler_info} CTK{ctk}"


def generate_dispatch_job_runner_dispatch(matrix_job, job_type):
runner_os = "windows" if is_windows(matrix_job) else "linux"
cpu_gpu = "gpu" if job_type in matrix_yaml['gpu_required_job_types'] else "cpu"

return f"{runner_os}-{cpu_gpu}"


def generate_dispatch_job_name(matrix_job, job_type):
std_ver = matrix_job['std'][0]
cpu_str = matrix_job['cpu']
Expand All @@ -189,7 +186,6 @@ def generate_dispatch_job_name(matrix_job, job_type):

return f"[{config_tag}] {formatted_job_type}({cpu_str}{gpu_str})"


return "[{}-{} C++{}] {}({}{}){}".format(
matrix_job['host_compiler']['name'],
matrix_job['host_compiler']['version'],
Expand Down Expand Up @@ -256,7 +252,6 @@ def generate_dispatch_job_command(matrix_job, job_type):

def generate_dispatch_job_json(matrix_job, job_type):
return {
'dispatch': generate_dispatch_job_runner_dispatch(matrix_job, job_type),
'name': generate_dispatch_job_name(matrix_job, job_type),
'runner': generate_dispatch_job_runner(matrix_job, job_type),
'image': generate_dispatch_job_image(matrix_job, job_type),
Expand Down Expand Up @@ -393,7 +388,8 @@ def finalize_workflow_dispatch_groups(workflow_dispatch_groups_orig):
producer_names = ""
for job in two_stage_json['producers']:
producer_names += f" - {job['name']}\n"
raise Exception(f"ci-dispatch-two-stage.yml currently only supports a single producer. Found {num_producers} producers in '{group_name}':\n{producer_names}")
raise Exception(
f"ci-dispatch-two-stage.yml currently only supports a single producer. Found {num_producers} producers in '{group_name}':\n{producer_names}")

return workflow_dispatch_groups

Expand Down
2 changes: 1 addition & 1 deletion ci/matrix.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pull_request:
# - {job_types: ['build'], ctk: *ctk_curr, host_compiler: *msvc2022, std: [14, 17, 20] }
# - {job_types: ['build'], ctk: *ctk_curr, host_compiler: *oneapi, std: [11, 14, 17] }
# nvrtc:
# - {job_types: ['nvrtc'], projects: ['libcudacxx'], ctk: *ctk_curr, host_compiler: *gcc12, std: [11, 14, 17, 20]}
- {job_types: ['nvrtc'], projects: ['libcudacxx'], ctk: *ctk_curr, host_compiler: *gcc12, std: [11, 14, 17, 20]}
# clang-cuda:
# - {job_types: ['build'], device_compiler: *llvm-newest, host_compiler: *llvm-newest, std: [17, 20]}
# cccl-infra:
Expand Down

0 comments on commit 3446797

Please sign in to comment.