Skip to content
Draft
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
14 changes: 14 additions & 0 deletions .github/workflows/ur-build-hw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ on:
required: false
type: string
default: ""
min_free_disk_mb:
description: Minimum free disk space on / (MiB) before starting the job container
required: false
type: number
default: 20480

permissions: read-all

Expand All @@ -44,8 +49,17 @@ env:
UR_LOG_OPENCL: "level:error;flush:error"

jobs:
host_memory_check:
name: Host disk (pre-container)
# if: github.repository == 'intel/llvm'
uses: ./.github/workflows/ur-host-memory-check.yml
with:
runs_on: ${{ inputs.runner_name }}
min_free_disk_mb: ${{ inputs.min_free_disk_mb }}

adapter_build_hw:
name: Build & CTS
needs: [host_memory_check]
# run only on upstream; forks won't have the HW
if: github.repository == 'intel/llvm'
strategy:
Expand Down
24 changes: 23 additions & 1 deletion .github/workflows/ur-build-offload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,33 @@ name: UR - Build offload adapter

permissions: read-all

on: [ workflow_call, workflow_dispatch ]
on:
workflow_call:
inputs:
min_free_disk_mb:
description: Minimum free disk space on / (MiB) before starting the job container
required: false
type: number
default: 20480
workflow_dispatch:
inputs:
min_free_disk_mb:
description: Minimum free disk space on / (MiB) before starting the job container
required: false
type: number
default: 20480

jobs:
host_memory_check:
name: Host disk (pre-container)
uses: ./.github/workflows/ur-host-memory-check.yml
with:
runs_on: '["Linux", "build"]'
min_free_disk_mb: ${{ inputs.min_free_disk_mb }}

offload_build:
name: Build
needs: [host_memory_check]
strategy:
fail-fast: false
matrix:
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/ur-host-memory-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: UR - Host disk check (pre-container)

on:
workflow_call:
inputs:
runs_on:
required: true
type: string
min_free_disk_mb:
required: false
type: number
default: 20480

permissions: read-all

jobs:
check:
name: Host disk space
runs-on: ${{ startsWith(inputs.runs_on, '[') && fromJSON(inputs.runs_on) || inputs.runs_on }}
steps:
- name: Check available disk space
env:
MIN_FREE_DISK_MB: ${{ inputs.min_free_disk_mb }}
run: |
set -euo pipefail

if ! command -v df >/dev/null 2>&1; then
echo "::warning::df command not available; skipping disk check"
exit 0
fi

# Sprawdź wolne miejsce na root filesystem (/)
avail_kb=$(df -k / | awk 'NR==2 {print $4}')
avail_mb=$((avail_kb / 1024))

echo "Disk available: ${avail_mb} MiB (minimum: ${MIN_FREE_DISK_MB} MiB)"

if [ "$avail_mb" -lt "$MIN_FREE_DISK_MB" ]; then
echo "::error::Insufficient disk space (${avail_mb} MiB available, need at least ${MIN_FREE_DISK_MB} MiB)."
exit 1
fi
Loading