From 6eeb171ba572f3ba118dfc7a2e5a7fb298d02c0c Mon Sep 17 00:00:00 2001 From: Nikita Menkovich Date: Mon, 3 Feb 2025 15:04:52 +0100 Subject: [PATCH] fix: truncate .err files to 1GiB --- .github/actions/test/action.yaml | 18 ++++++++++++++++-- .github/workflows/build_and_test_ya.yaml | 1 + .github/workflows/create_and_delete_vm.yaml | 4 ++-- GITHUB.md | 1 + 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/actions/test/action.yaml b/.github/actions/test/action.yaml index d2045116d24..2fda6ee2423 100644 --- a/.github/actions/test/action.yaml +++ b/.github/actions/test/action.yaml @@ -56,6 +56,10 @@ inputs: required: false default: 'no' description: 'Use nebius' + truncate_enabled: + required: false + default: 'yes' + description: 'Truncate err files' runs: using: composite @@ -283,8 +287,18 @@ runs: find "$TESTS_DATA_DIR" -type f -print0 | xargs -0 -n 10 file -i | grep "application/x-executable" | awk -F: '{print $1}' | xargs rm echo "::endgroup::" echo "::group::remove-images-from-tests-data-dir" - find "$TESTS_DATA_DIR" -name generated_raw_image -o -name generated_vmdk_image -o -name invalid_qcow2_image -o -name qcow2_fuzzing_image - find "$TESTS_DATA_DIR" \( -name generated_raw_image -o -name generated_vmdk_image -o -name invalid_qcow2_image -o -name qcow2_fuzzing_image \) -delete + find "$TESTS_DATA_DIR" -name generated_raw_image -o -name generated_vmdk_image -o -name invalid_qcow2_image -o -name qcow2_fuzzing_image -name NVMENBS01 + find "$TESTS_DATA_DIR" \( -name generated_raw_image -o -name generated_vmdk_image -o -name invalid_qcow2_image -o -name qcow2_fuzzing_image -name NVMENBS01 \) -delete + echo "::endgroup::" + echo "::group::truncate-err-files::" + find "$TESTS_DATA_DIR" -type f -name "*.err" -size +1G -print0 | while IFS= read -r -d '' file; do + orig_size=$(du -h "$file" | cut -f1) + echo "$file - $orig_size" + if [ "${{ inputs.truncate_enabled }}" == "yes" ]; then + truncate -s 1G "$file" + echo "... truncated (original size was $orig_size) ..." >> "$file" + fi + done echo "::endgroup::" echo "::group::s3-sync" if [ "$SYNC_TO_S3" = "true" ]; diff --git a/.github/workflows/build_and_test_ya.yaml b/.github/workflows/build_and_test_ya.yaml index 02d6cacee32..305716f911c 100644 --- a/.github/workflows/build_and_test_ya.yaml +++ b/.github/workflows/build_and_test_ya.yaml @@ -166,6 +166,7 @@ jobs: clean_ya_dir: ${{ inputs.run_build && 'no' || inputs.clean_ya_dir }} use_network_cache: ${{ inputs.use_network_cache }} nebius: ${{ inputs.nebius }} + truncate_enabled: ${{ contains(github.event.pull_request.labels.*.name, 'disable_truncate') && 'no' || 'yes' }} - id: failure name: set sleep_after_tests in case of failure diff --git a/.github/workflows/create_and_delete_vm.yaml b/.github/workflows/create_and_delete_vm.yaml index f0010dabe8e..97aacebfc5b 100644 --- a/.github/workflows/create_and_delete_vm.yaml +++ b/.github/workflows/create_and_delete_vm.yaml @@ -163,8 +163,8 @@ jobs: runner_label: ${{ needs.provide-runner.outputs.label }} runner_instance_id: ${{ needs.provide-runner.outputs.instance-id }} runner_ipv4: ${{ needs.provide-runner.outputs.runner_ipv4 }} - build_target: ${{ needs.provide-runner.outputs.large_tests == 'yes' && 'cloud/blockstore/apps/,cloud/filestore/apps/,cloud/disk_manager/,cloud/tasks/' || 'cloud/tasks' }} - test_target: ${{ needs.provide-runner.outputs.large_tests == 'yes' && 'cloud/blockstore/,cloud/filestore/,cloud/disk_manager/,cloud/tasks/' || 'cloud/tasks' }} + build_target: 'cloud/filestore/apps/' + test_target: 'cloud/filestore/tests/fio_index/qemu-kikimr-nemesis-test/' build_preset: "relwithdebinfo" run_build: true run_tests: true diff --git a/GITHUB.md b/GITHUB.md index a718159f5c7..681d23685ef 100644 --- a/GITHUB.md +++ b/GITHUB.md @@ -10,6 +10,7 @@ There is also a list of labels that slightly alters how and which tests are run: 4. `asan` or `tsan` to add address sanitizer or thread sanitizer builds on top of the regular build. 5. `recheck` trigger checks without commit. Removed automatically after launch. 6. `allow-downgrade` allows to downgrade VM preset dynamically in case of problems with resources +7. `disable_truncate`, by default, .err files are truncated to 1GiB, this disables that for this PR Also, you can launch [ya make](https://github.com/ydb-platform/nbs/actions/workflows/build_and_test_on_demand.yaml) or [cmake](https://github.com/ydb-platform/nbs/actions/workflows/build_and_test_on_demand_cmake.yaml) builds on your branch with any timeout you want (but please do not do more than 12 hours, VMs are expensive). You can find the IP of the VM inside of the jobs. The first occurrence happens in the `Prepare runner` job in the `Configure NCP` step, later IP is set in the header of jobs. You must use your GitHub key for it. User `github`. Feature not available for non-members.