From 21781e2aebe6f8ac63e9bb404857b5349b0837be Mon Sep 17 00:00:00 2001 From: Marya Date: Wed, 22 Nov 2023 13:21:07 +0000 Subject: [PATCH] Create a basic nightly OCK build and test vector-add using oneAPI. The ock build is archived if the test passes which can then be used other builds. --- .../workflows/create_publish_artifacts.yml | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 .github/workflows/create_publish_artifacts.yml diff --git a/.github/workflows/create_publish_artifacts.yml b/.github/workflows/create_publish_artifacts.yml new file mode 100644 index 0000000000..38f28edf07 --- /dev/null +++ b/.github/workflows/create_publish_artifacts.yml @@ -0,0 +1,103 @@ +name: Build and Package +on: + pull_request: + paths: + - '.github/workflows/create_publish_artifacts.yml' + # schedule: + # - cron: '0 0 * * *' # Runs the workflow at midnight every day + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + + # build and run for RISCV + run_riscv_m1_nightly_package: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout repo + uses: actions/checkout@v3 + + # installs tools, ninja, installs llvm and sets up sccahe + - name: setup ubuntu + uses: ./.github/actions/setup_ubuntu_build + with: + llvm_version: 17 + llvm_build_type: RelAssert + + - name: setup python + uses: actions/setup-python@v4 + with: + python-version: '3.8' + + - name: build riscv M1 + uses: ./.github/actions/do_build_ock/do_build_m1 + + - name: Download Daily Release + run: | + wget "https://github.com/intel/llvm/releases/download/nightly-2023-11-22/sycl_linux.tar.gz" + mkdir linux_nightly_release + tar -xzf sycl_linux.tar.gz -C linux_nightly_release + ls + + - name: Clone oneAPI-samples + run: git clone https://github.com/oneapi-src/oneAPI-samples.git + + - name: Setup environment and test Vector Add + run: | + export ONEAPI_ROOT=$(pwd)/linux_nightly_release + export PATH=$(pwd)/linux_nightly_release/bin:$PATH + export LD_LIBRARY_PATH=$(pwd)/linux_nightly_release/lib:$(pwd)/build/lib:$LD_LIBRARY_PATH + + $(pwd)/linux_nightly_release/bin/clang++ -fsycl $(pwd)/oneAPI-samples/DirectProgramming/C++SYCL/DenseLinearAlgebra/vector-add/src/vector-add-buffers.cpp -o vect + CA_HAL_DEBUG=1 OCL_ICD_FILENAMES=$(pwd)/build/lib/libCL.so ONEAPI_DEVICE_SELECTOR=opencl::acc SYCL_CONFIG_FILE_NAME="" ./vect + + - name: Package Artifacts + run: | + ls + tar -czf ock_install.tar.gz $(pwd)/build + + - name: Upload Artifacts + uses: actions/upload-artifact@v2 + with: + name: riscv-build + path: ock_install.tar.gz + + ock_nightly: + name: OCK Nightly Build Upload + runs-on: ubuntu-22.04 + needs: [run_riscv_m1_nightly_package] + + steps: + - name: Download artifacts + uses: actions/download-artifact@v3 + with: + name: riscv-build + path: ock_install.tar.gz + + - name: Compute tag + id: tag + run: | + if [ "${{ github.event_name == 'schedule' }}" == "true" ]; then + echo "TAG=$(date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT" + else + # TODO: Use date of the commit? + echo "TAG=$(date +'%Y-%m-%d')-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT" + fi + + - name: Create Nightly OCK pre-release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + files: + $(pwd)/ock_install.tar.gz + tag_name: nightly-${{ steps.tag.outputs.TAG }} + name: OCK daily ${{ steps.tag.outputs.TAG }} + prerelease: true + body: "Daily build ${{ steps.tag.outputs.TAG }}" + target_commitish: ${{ github.sha }}