|
| 1 | +# Copyright (c) Meta Platforms, Inc. and affiliates. |
| 2 | +# All rights reserved. |
| 3 | +# This source code is licensed under the BSD-style license found in the |
| 4 | +# LICENSE file in the root directory of this source tree. |
| 5 | + |
| 6 | +# This workflow is used for DCPerf CI. |
| 7 | +name: DCPerf Health_check CI |
| 8 | + |
| 9 | +on: |
| 10 | + # PR Trigger |
| 11 | + # |
| 12 | + pull_request: |
| 13 | + |
| 14 | + # Push Trigger (enable to catch errors coming out of multiple merges) |
| 15 | + # |
| 16 | + push: |
| 17 | + branches: |
| 18 | + - main |
| 19 | + |
| 20 | + # Manual Trigger |
| 21 | + # |
| 22 | + workflow_dispatch: |
| 23 | + |
| 24 | +concurrency: |
| 25 | + # Cancel previous runs in the PR if a new commit is pushed |
| 26 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 27 | + cancel-in-progress: true |
| 28 | + |
| 29 | +jobs: |
| 30 | + # Build on CPU hosts (generic GitHub runners) |
| 31 | + build_artifact: |
| 32 | + runs-on: ${{ matrix.host-machine.instance }} |
| 33 | + container: |
| 34 | + image: ${{ matrix.host-machine.container }} |
| 35 | + options: --user root --privileged --pid=host |
| 36 | + volumes: |
| 37 | + - /var/run/docker.sock:/var/run/docker.sock |
| 38 | + defaults: |
| 39 | + run: |
| 40 | + shell: bash |
| 41 | + env: |
| 42 | + PRELUDE: .github/scripts/setup_env.bash |
| 43 | + BUILD_ENV: build_env |
| 44 | + continue-on-error: false |
| 45 | + strategy: |
| 46 | + fail-fast: false |
| 47 | + matrix: |
| 48 | + host-machine: [ |
| 49 | + { arch: x86, instance: "ubuntu-latest", container: "ubuntu:22.04", type: "ubuntu" }, |
| 50 | + { arch: aarch64, instance: "ubuntu-24.04-arm", container: "ubuntu:22.04", type: "ubuntu" }, |
| 51 | + ] |
| 52 | + python-version: [ "3.12" ] |
| 53 | + steps: |
| 54 | + - name: Setup Build Container (ubuntu-based) |
| 55 | + if: ${{ matrix.host-machine.type == 'ubuntu' }} |
| 56 | + run: apt update -y; apt install -y build-essential git pciutils socat sudo wget dmidecode |
| 57 | + |
| 58 | + - name: Setup Build Container (centos-based) |
| 59 | + if: ${{ matrix.host-machine.type == 'centos' }} |
| 60 | + run: | |
| 61 | + dnf update -y |
| 62 | + dnf install -y git pciutils which dmidecode sudo shadow-utils passwd |
| 63 | +
|
| 64 | + - name: Checkout the Repository |
| 65 | + uses: actions/checkout@v4 |
| 66 | + with: |
| 67 | + submodules: true |
| 68 | + |
| 69 | + - name: Fix PAM configuration for sudo |
| 70 | + if: ${{ matrix.host-machine.type == 'centos' }} |
| 71 | + run: | |
| 72 | + echo "auth sufficient pam_rootok.so" > /etc/pam.d/sudo |
| 73 | +
|
| 74 | + - name: Enable Sudo without password |
| 75 | + if: ${{ matrix.host-machine.type == 'centos' }} |
| 76 | + run: | |
| 77 | + echo "root ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers |
| 78 | +
|
| 79 | + - name: Unlock root user account |
| 80 | + if: ${{ matrix.host-machine.type == 'centos' }} |
| 81 | + run: | |
| 82 | + passwd -u root |
| 83 | +
|
| 84 | + - name: Free Disk Space on Host |
| 85 | + run: . $PRELUDE; free_disk_space_on_host |
| 86 | + |
| 87 | + - name: Display System Info |
| 88 | + run: . $PRELUDE; print_system_info |
| 89 | + |
| 90 | + - name: Install Build Tools |
| 91 | + run: . $PRELUDE; install_build_tools |
| 92 | + |
| 93 | + - name: Setup Miniconda |
| 94 | + run: . $PRELUDE; setup_miniconda $HOME/miniconda |
| 95 | + |
| 96 | + - name: Create Conda Environment |
| 97 | + run: . $PRELUDE; create_conda_environment $BUILD_ENV ${{ matrix.python-version }} |
| 98 | + |
| 99 | + - name: Install Python Tools |
| 100 | + run: . $PRELUDE; install_python_tools $BUILD_ENV |
| 101 | + |
| 102 | + - name: Install Health_check |
| 103 | + run: . $PRELUDE; install_health_check $BUILD_ENV |
0 commit comments