Skip to content
Closed
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
11 changes: 11 additions & 0 deletions .github/workflows/root-ci-config/build_root.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@
WORKDIR = (os.environ['HOME'] + '/ROOT-CI') if not WINDOWS else 'C:/ROOT-CI'
COMPRESSIONLEVEL = 1 if WINDOWS else 2

def sizeof_fmt(num, suffix="B"):
for unit in ("", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi"):
if abs(num) < 1024.0:
return f"{num:3.1f} {unit}{suffix}"
num /= 1024.0
return f"{num:.1f} Yi{suffix}"


def main():
# openstack.enable_logging(debug=True)

Expand Down Expand Up @@ -437,6 +445,9 @@ def archive_and_upload(archive_name, prefix):
targz.add("src")
targz.add("build")

archive_size = os.path.getsize(f"{WORKDIR}/{new_archive}")
print(f"Archive {new_archive} size: {archive_size} bytes ({sizeof_fmt(archive_size)})")

try:
import openstack
CONNECTION = openstack.connect(cloud='envvars')
Expand Down
20 changes: 16 additions & 4 deletions .github/workflows/root-ci-config/build_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,20 +265,31 @@ def upload_file(connection, container: str, dest_object: str, src_file: str) ->
if not os.path.exists(src_file):
raise Exception(f"No such file: {src_file}")

gigabyte = 1024**3
week_in_seconds = 60*60*24*7
segment_size = 5 * gigabyte

file_size = os.path.getsize(src_file)
num_segments = max(1, (file_size + segment_size - 1) // segment_size)
print_info(
f"Upload config for {dest_object}: "
f"file_size={file_size} bytes, "
f"segment_size={segment_size} bytes, "
f"expected_segments={num_segments}, "
f"delete_after={2*week_in_seconds}s"
)

def create_object_local():
connection.create_object(
container=container,
name=dest_object,
filename=src_file,
segment_size=5*gigabyte,
segment_size=segment_size,
**{
'X-Delete-After': str(2*week_in_seconds)
}
)

gigabyte = 1024**3
week_in_seconds = 60*60*24*7

max_attempts = 5
sleep_time_unit = 4
success = False
Expand All @@ -291,6 +302,7 @@ def create_object_local():
sleep_time = sleep_time_unit * attempt
print_warning(
f"""Attempt {attempt} to upload {src_file} to {dest_object} failed. Retrying in {sleep_time} seconds..."""
f" (file_size={file_size} bytes, expected_segments={num_segments})"
)
time.sleep(sleep_time)
if success:
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/root-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
# can be skipped if the tag [skip-ci] or [skip ci] is written in the title.
if: |
(github.repository_owner == 'root-project' && github.event_name != 'pull_request') ||
(github.event_name == 'pull_request' && !(
(github.event_name == 'pull_request' && false && !(
contains(github.event.pull_request.title, '[skip-ci]') ||
contains(github.event.pull_request.title, '[skip ci]') ||
contains(github.event.pull_request.labels.*.name, 'skip ci')
Expand Down Expand Up @@ -120,7 +120,7 @@
matrix:
# Specify platform + optional build option overrides
# Build options: https://root.cern/install/build_from_source/#all-build-options
platform: [mac26, mac27, mac-beta]

Check failure on line 123 in .github/workflows/root-ci.yml

View workflow job for this annotation

GitHub Actions / lint-action-files

label "mac27" is unknown. available labels are "windows-latest", "windows-latest-8-cores", "windows-2025", "windows-2025-vs2026", "windows-2022", "windows-11-arm", "ubuntu-slim", "ubuntu-latest", "ubuntu-latest-4-cores", "ubuntu-latest-8-cores", "ubuntu-latest-16-cores", "ubuntu-24.04", "ubuntu-24.04-arm", "ubuntu-22.04", "ubuntu-22.04-arm", "macos-latest", "macos-latest-xlarge", "macos-latest-large", "macos-26-intel", "macos-26-xlarge", "macos-26-large", "macos-26", "macos-15-intel", "macos-15-xlarge", "macos-15-large", "macos-15", "macos-14-xlarge", "macos-14-large", "macos-14", "self-hosted", "x64", "arm", "arm64", "linux", "macos", "windows", "mac14", "mac15", "mac26", "mac-beta", "cpu", "latest", "preview". if it is a custom label for self-hosted runner, set list of labels in actionlint.yaml config file
arch: [ARM64]
include:
- platform: mac15
Expand All @@ -132,7 +132,7 @@
- self-hosted
- ${{ matrix.platform }}

name: |

Check failure on line 135 in .github/workflows/root-ci.yml

View workflow job for this annotation

GitHub Actions / lint-action-files

property "overrides" is not defined in object type {arch: string; is_special: bool; platform: string}
${{ matrix.platform }} ${{ matrix.arch }}
${{ (github.event_name != 'schedule' && github.event_name != 'workflow_dispatch' && join( matrix.overrides, ', ' )) || '' }}

Expand All @@ -151,8 +151,8 @@
if: github.event_name == 'pull_request'
env:
GITHUB_PR_ORIGIN: ${{ github.event.pull_request.head.repo.clone_url }}
OVERRIDES: ${{ join( matrix.overrides, ' ') }}

Check failure on line 154 in .github/workflows/root-ci.yml

View workflow job for this annotation

GitHub Actions / lint-action-files

property "overrides" is not defined in object type {arch: string; is_special: bool; platform: string}
run: |

Check failure on line 155 in .github/workflows/root-ci.yml

View workflow job for this annotation

GitHub Actions / lint-action-files

"github.event.pull_request.head.ref" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details
[ -d "${VIRTUAL_ENV_DIR}" ] && source ${VIRTUAL_ENV_DIR}/bin/activate
echo "Python is now $(which python3) $(python3 --version)"
src/.github/workflows/root-ci-config/build_root.py \
Expand Down Expand Up @@ -248,7 +248,7 @@
# can be skipped if the tag [skip-ci] or [skip ci] is written in the title.
if: |
(github.repository_owner == 'root-project' && github.event_name != 'pull_request') ||
(github.event_name == 'pull_request' && !(
(github.event_name == 'pull_request' && false && !(
contains(github.event.pull_request.title, '[skip-ci]') ||
contains(github.event.pull_request.title, '[skip ci]') ||
contains(github.event.pull_request.labels.*.name, 'skip ci')
Expand Down Expand Up @@ -527,7 +527,7 @@
build-directory: /github/home/ROOT-CI/src/

- name: Pull Request Build
if: ${{ github.event_name == 'pull_request' }}
if: ${{ github.event_name == 'pull_request' && false }} # TEMP DEBUG
env:
INCREMENTAL: ${{ !contains(github.event.pull_request.labels.*.name, 'clean build') }}
GITHUB_PR_ORIGIN: ${{ github.event.pull_request.head.repo.clone_url }}
Expand Down Expand Up @@ -561,14 +561,14 @@
"

- name: Nightly build
if: github.event_name == 'schedule'
if: github.event_name == 'schedule' || github.event_name == 'pull_request' # TEMP DEBUG
run: ".github/workflows/root-ci-config/build_root.py
--buildtype RelWithDebInfo
--platform ${{ matrix.image }}
--platform_config ${{ matrix.platform_config }}
--incremental false
--binaries true
--base_ref ${{ inputs.ref_name }}
--base_ref ${{ inputs.ref_name || github.base_ref }}
--repository ${{ github.server_url }}/${{ github.repository }}
"

Expand Down
Loading