diff --git a/.github/workflows/root-ci-config/build_root.py b/.github/workflows/root-ci-config/build_root.py index 7ae789e70baf6..9a8f4ace24d51 100755 --- a/.github/workflows/root-ci-config/build_root.py +++ b/.github/workflows/root-ci-config/build_root.py @@ -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) @@ -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') diff --git a/.github/workflows/root-ci-config/build_utils.py b/.github/workflows/root-ci-config/build_utils.py index 5ace08990c732..8983478f63bf2 100755 --- a/.github/workflows/root-ci-config/build_utils.py +++ b/.github/workflows/root-ci-config/build_utils.py @@ -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 @@ -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: diff --git a/.github/workflows/root-ci.yml b/.github/workflows/root-ci.yml index 10ba68e8e88ff..19d961ba55270 100644 --- a/.github/workflows/root-ci.yml +++ b/.github/workflows/root-ci.yml @@ -90,7 +90,7 @@ jobs: # 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') @@ -248,7 +248,7 @@ jobs: # 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') @@ -527,7 +527,7 @@ jobs: 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 }} @@ -561,14 +561,14 @@ jobs: " - 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 }} "