Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 65 additions & 1 deletion .github/workflows/sycl_linux_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ on:
type: number
required: false
default: 4
uniq:
description: Unique string to name dynamic runers in AWS
type: string
required: false
default: ${{ github.run_id }}-${{ github.run_attempt }}

jobs:
build:
Expand Down Expand Up @@ -191,8 +196,40 @@ jobs:
const script = require('./generate_test_matrix.js');
script({core, process});

aws-start-matrix:
name: Start AWS Matrix
needs: [ build, resolve_matrix ]
if: ${{ inputs.lts_config != '' }}
strategy:
fail-fast: false
max-parallel: ${{ inputs.max_parallel }}
matrix:
include: ${{ fromJSON(needs.resolve_matrix.outputs.lts) }}
runs-on: ubuntu-latest
environment: aws
steps:
- uses: actions/checkout@v3
if: ${{ matrix.aws-type }}
with:
path: llvm
- run: npm install ./llvm/devops/actions/aws-ec2
if: ${{ matrix.aws-type }}
- name: Start AWS EC2 runner
if: ${{ matrix.aws-type }}
uses: ./llvm/devops/actions/aws-ec2
with:
label: ${{ matrix.runs-on }}
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
aws-ami: ${{ matrix.aws-ami }}
aws-spot: ${{ matrix.aws-spot }}
aws-type: ${{ matrix.aws-type }}
aws-disk: ${{ matrix.aws-disk }}
one-job: ${{ matrix.one-job }}

llvm_test_suite:
needs: [build, resolve_matrix]
needs: [build, resolve_matrix, aws-start-matrix]
if: ${{ inputs.lts_config != '' }}
strategy:
fail-fast: false
Expand Down Expand Up @@ -240,3 +277,30 @@ jobs:
results_name_suffix: ${{ matrix.config }}_${{ inputs.build_artifact_suffix }}
cmake_args: '${{ matrix.cmake_args }} ${{ inputs.lts_cmake_extra_args }}'

aws-stop-matrix:
name: Stop AWS Matrix
needs: [ aws-start-matrix, resolve_matrix, llvm_test_suite ]
if: ${{ always() && inputs.lts_config != '' }}
strategy:
fail-fast: false
max-parallel: ${{ inputs.max_parallel }}
matrix:
include: ${{ fromJSON(needs.resolve_matrix.outputs.lts) }}
runs-on: ubuntu-latest
environment: aws
steps:
- uses: actions/checkout@v3
if: ${{ matrix.aws-type }}
with:
path: llvm
- run: npm install ./llvm/devops/actions/aws-ec2
if: ${{ matrix.aws-type }}
- name: Stop AWS EC2 runner
if: ${{ matrix.aws-type }}
uses: ./llvm/devops/actions/aws-ec2
with:
label: ${{ matrix.runs-on }}
mode: stop
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
AWS_ACCESS_KEY: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_KEY: ${{ secrets.AWS_SECRET_KEY }}
2 changes: 2 additions & 0 deletions .github/workflows/sycl_nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ jobs:
ubuntu2004_build_test:
if: github.repository == 'intel/llvm'
uses: ./.github/workflows/sycl_linux_build_and_test.yml
secrets: inherit
with:
build_cache_root: "/__w/"
build_artifact_suffix: default
Expand All @@ -22,6 +23,7 @@ jobs:
ubuntu2004_opaque_pointers_build_test:
if: github.repository == 'intel/llvm'
uses: ./.github/workflows/sycl_linux_build_and_test.yml
secrets: inherit
with:
build_cache_root: "/__w/"
build_cache_suffix: opaque_pointers
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/sycl_post_commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ jobs:
linux_default:
name: Linux Default
uses: ./.github/workflows/sycl_linux_build_and_test.yml
secrets: inherit
with:
build_cache_root: "/__w/llvm"
build_artifact_suffix: default
linux_no_assert:
name: Linux (no assert)
uses: ./.github/workflows/sycl_linux_build_and_test.yml
secrets: inherit
with:
build_cache_root: "/__w/llvm"
build_cache_suffix: gcc_no_assertions
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sycl_precommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
needs: lint
if: always() && (success() || contains(github.event.pull_request.labels.*.name, 'ignore-lint'))
uses: ./.github/workflows/sycl_linux_build_and_test.yml
secrets: inherit
with:
build_cache_root: "/__w/"
build_cache_size: "8G"
Expand Down
80 changes: 80 additions & 0 deletions devops/actions/aws-ec2/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: aws-ec2
description: Starts AWS EC2 instance with github actions runner agent in it to process one job

inputs:
label:
description: "Name of the unique label assigned to the runner used as 'runs-on' property for the following jobs"
required: true
GH_PERSONAL_ACCESS_TOKEN:
description: "Github personal access token with repo permission"
required: true
AWS_ACCESS_KEY:
description: "AWS access id"
required: true
AWS_SECRET_KEY:
description: "WS access secret key"
required: true
aws-region:
description: "AWS EC2 region"
required: false
default: "us-east-2" # Ohio
aws-ami:
description: "AWS AMI id. Makes sense only for start mode"
required: false
default: "ami-0966bccbb521ccb24" # Ubuntu 22.04 (ami-02f3416038bdb17fb with /dev/sda1 disk) with docker installed and gh_runner (1001) like this:
# sudo -s
# apt-get update
# curl -fsSL https://get.docker.com -o /tmp/get-docker.sh
# sh /tmp/get-docker.sh # or "yum install -y docker" for Amazon Linux or RHEL/CentOS
# groupadd -g 1001 gh_runner; useradd gh_runner -u 1001 -g 1001 -m -s /bin/bash; usermod -aG docker gh_runner; usermod -aG video gh_runner
# sync; shutdown -h now

# "ami-02ec0f344128253f9" # Amazon Linux 2 AMI with NVIDIA TESLA GPU Driver (ami-06bf0a3f89fe08f0a with /dev/xvda disk) with docker installed and gh_runner (1001) like this:
# sudo -s
# yum update -y
# amazon-linux-extras install docker
# sudo systemctl --now enable docker
# distribution=$(. /etc/os-release;echo $ID$VERSION_ID) && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.repo | sudo tee /etc/yum.repos.d/nvidia-container-toolkit.repo
# yum-config-manager --disable amzn2-graphics; yum clean expire-cache; yum install -y nvidia-docker2; systemctl restart docker
# groupadd -g 1001 gh_runner; useradd gh_runner -u 1001 -g 1001 -m -s /bin/bash; usermod -aG docker gh_runner; usermod -aG video gh_runner
# sync; shutdown -h now

# "ami-0ccda708841dde988" # Amazon Linux 2 AMI with AMD Radeon Pro Driver (ami-0bb1072e787242eb6 with /dev/xvda disk) with docker installed and gh_runner (1001) like this:
# sudo -s
# sh ./get-docker.sh # or "yum install -y docker" for Amazon Linux or RHEL/CentOS
# amazon-linux-extras install docker
# sudo systemctl --now enable docker
# groupadd -g 1001 gh_runner; useradd gh_runner -u 1001 -g 1001 -m -s /bin/bash; usermod -aG docker gh_runner; usermod -aG video gh_runner
# sync; shutdown -h now

aws-type:
description: "AWS EC2 instance type. Makes sense only for start mode"
required: false
default: "[ \"t2.micro\" ]"
# "[ \"g4dn.2xlarge\" ]": 1 NVIDIA T4 GPU, 8 CPU, 32 GB RAM
# "[ \"g4ad.4xlarge\" ]": 1 AMD Radeon Pro V520 GPU, 16 CPU, 64 GB RAM (overloaded pool so do not use spot here now)
aws-spot:
description: "Enable usage of spot instances to save money (less reliable). Makes sense only for start mode"
requred: false
default: true
aws-disk:
description: "AWS EC2 instance AMI specific disk device path and size in GB (8 by default). Makes sense only for start mode"
required: false
default: "/dev/sda1:16" # Github actions container engine will fail with lack of disk space for 8GB
aws-timebomb:
description: "AWS EC2 instance maximum live time. Makes sense only for start mode"
required: false
default: 1h

mode:
description: "Mode of operation: start or stop"
required: false
default: start
one-job:
description: "Will terminate AWS EC2 instance after one job (not waiting for stop job) saving money"
required: false
default: true

runs:
using: node12
main: ./aws-ec2.js
Loading