Commit 1f2a0d81 authored by Jan Kiene's avatar Jan Kiene
Browse files

add CI hacks to build from ivas-float-update

parent 5a29b6aa
Loading
Loading
Loading
Loading
Loading
+165 −98
Original line number Diff line number Diff line
@@ -58,6 +58,9 @@ workflow:

# These can be used later on to do common tasks

.get-ivas-float-update: &get-ivas-float-update
  - git clone -b ivas-float-update --depth 1 $BASOP_REPO_URL

.print-common-info-windows: &print-common-info-windows
  - |
    echo "Printing common information for build job."
@@ -330,65 +333,67 @@ build-codec-linux-make:
  script:
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/activate-Werror-linux.sh
    - make -j

build-codec-linux-cmake:
  extends:
    - .build-job-linux
    - .rules-basis
  script:
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/activate-Werror-linux.sh
    - mkdir build
    - cd build
    - cmake ..
    - cd ..
    - make -C build -j

build-codec-instrumented-linux:
  extends:
    - .build-job-linux
    - .rules-basis
  timeout: "10 minutes"
  script:
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
    - ./scripts/prepare_instrumentation.sh
    - make -j -C scripts/c-code_instrument
  artifacts:
    when: always
    access: all
    expire_in: "30 days"
    paths:
      - wmc_tool_output.txt

# make sure that the codec builds with msan, asan and usan
build-codec-sanitizers-linux:
  extends:
    - .build-job-linux
    - .rules-basis
  script:
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/activate-Werror-linux.sh
    - bash ci/build_codec_sanitizers_linux.sh

build-codec-windows-cmake:
  extends:
    - .build-job-windows
    - .rules-basis
  script:
    - *print-common-info-windows
    - *activate-WX-windows
    - cmake -G "Visual Studio 15 2017" . -Bbuild
    - cmake --build build -j
    - *get-ivas-float-update
    - cd ivas-basop
    - make -j "${nproc}"

build-codec-windows-msbuild:
  extends:
    - .build-job-windows
    - .rules-basis
  script:
    - *print-common-info-windows
    - *activate-WX-windows
    - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug
# build-codec-linux-cmake:
#   extends:
#     - .build-job-linux
#     - .rules-basis
#   script:
#     - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
#     - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/activate-Werror-linux.sh
#     - mkdir build
#     - cd build
#     - cmake ..
#     - cd ..
#     - make -C build -j
#
# build-codec-instrumented-linux:
#   extends:
#     - .build-job-linux
#     - .rules-basis
#   timeout: "10 minutes"
#   script:
#     - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
#     - ./scripts/prepare_instrumentation.sh
#     - make -j -C scripts/c-code_instrument
#   artifacts:
#     when: always
#     access: all
#     expire_in: "30 days"
#     paths:
#       - wmc_tool_output.txt
#
# # make sure that the codec builds with msan, asan and usan
# build-codec-sanitizers-linux:
#   extends:
#     - .build-job-linux
#     - .rules-basis
#   script:
#     - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
#     - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/activate-Werror-linux.sh
#     - bash ci/build_codec_sanitizers_linux.sh
#
# build-codec-windows-cmake:
#   extends:
#     - .build-job-windows
#     - .rules-basis
#   script:
#     - *print-common-info-windows
#     - *activate-WX-windows
#     - cmake -G "Visual Studio 15 2017" . -Bbuild
#     - cmake --build build -j
#
# build-codec-windows-msbuild:
#   extends:
#     - .build-job-windows
#     - .rules-basis
#   script:
#     - *print-common-info-windows
#     - *activate-WX-windows
#     - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Debug

# ---------------------------------------------------------------
# Test jobs for merge requests
@@ -405,16 +410,18 @@ codec-smoke-test:
  stage: test
  needs:
    [
      "build-codec-linux-cmake",
      # "build-codec-linux-cmake",
      "build-codec-linux-make",
      "build-codec-instrumented-linux",
      "build-codec-sanitizers-linux",
      # "build-codec-instrumented-linux",
      # "build-codec-sanitizers-linux",
    ]
  script:
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
    # LTV update needed as ltv ISM metadata files are used
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh

    - *get-ivas-float-update

    # for MRs to basop-ci-branch, we want to test with the BASOP float reference build
    # per default, the smoke test builds the current repo again with WMOPS activated to catch unbalanced instrumentation macros
    - if [ "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" = "basop-ci-branch" ]; then
@@ -490,16 +497,16 @@ pytest-compare-20ms-and-5ms-rendering:
  stage: test
  needs:
    [
      "build-codec-linux-cmake",
      "build-codec-linux-make",
      "build-codec-instrumented-linux",
      "build-codec-sanitizers-linux",
    ]
  script:
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/disable-limiter.sh
    - *get-ivas-float-update
    - pushd ivas-basop
    - make clean
    - make -j
    - popd
    ### prepare pytest
    - cp IVAS_cod IVAS_cod_ref
    - cp IVAS_dec IVAS_dec_ref
@@ -543,7 +550,11 @@ renderer-smoke-test:
  needs: ["build-codec-linux-make"]
  stage: test
  script:
    - *get-ivas-float-update
    - pushd ivas-basop
    - make -j IVAS_rend
    - cp IVAS_rend ../
    - popd
    - testcase_timeout=60
    - python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/renderer/test_renderer.py --testcase_timeout=$testcase_timeout
  artifacts:
@@ -575,8 +586,12 @@ renderer-smoke-test:
      junit:
        - report-junit.xml
  before_script:
    - *get-ivas-float-update
    - pushd ivas-basop
    - cmake -B cmake-build -G "Unix Makefiles" -DCLANG=$SANITIZER_BUILD_STRING -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true
    - cmake --build cmake-build -- -j
    - cp IVAS_rend ../
    - popd
    - testcase_timeout=180

# test renderer executable with cmake + asan
@@ -642,6 +657,11 @@ renderer-pytest-on-merge-request:
    ### Run test using branch scripts and input
    - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi

    - *get-ivas-float-update
    - pushd ivas-basop
    - make -j IVAS_rend
    - cp IVAS_rend ../
    - popd
    # run test
    - python3 -m pytest -q --log-level ERROR -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/renderer/test_renderer.py --create_cut --testcase_timeout=$testcase_timeout || exit_code=$?
    - zero_errors=$(cat report-junit.xml | grep -c 'errors="0"') || true
@@ -671,7 +691,11 @@ split-rendering-smoke-test:
  needs: ["build-codec-linux-make"]
  stage: test
  script:
    - *get-ivas-float-update
    - pushd ivas-basop
    - make -j
    - cp IVAS_* ISAR_* ../
    - popd
    - testcase_timeout=10
    - python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/split_rendering/test_split_rendering.py --testcase_timeout=$testcase_timeout
  artifacts:
@@ -693,7 +717,11 @@ split-rendering-voip-be-to-binaural:
  needs: ["build-codec-linux-make"]
  stage: test
  script:
    - *get-ivas-float-update
    - pushd ivas-basop
    - make -j
    - cp IVAS_* ISAR_* ../
    - popd
    - testcase_timeout=30
    - python3 -m pytest -q -n auto -rA --junit-xml=report-junit.xml tests/split_rendering/test_voip_be_splitrend_vs_binaural.py --testcase_timeout=$testcase_timeout
  artifacts:
@@ -708,38 +736,38 @@ split-rendering-voip-be-to-binaural:
        - report-junit.xml

# test rtpdump
rtpdump-test:
  extends:
    - .test-job-linux
    - .rules-merge-request-to-main
  needs: ["build-codec-linux-make"]
  stage: test
  script:
    - make -j
    - testcase_timeout=15
    - python3 -m pytest -q --tb=no -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/rtp/test_rtp.py --testcase_timeout=$testcase_timeout
  artifacts:
    name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
    expire_in: 1 week
    when: always
    paths:
      - report-junit.xml
      - report.html
    expose_as: "rtpdump pytest results"
    reports:
      junit:
        - report-junit.xml
# rtpdump-test:
#   extends:
#     - .test-job-linux
#     - .rules-merge-request-to-main
#   needs: ["build-codec-linux-make"]
#   stage: test
#   script:
#     - make -j
#     - testcase_timeout=15
#     - python3 -m pytest -q --tb=no -n auto -rA --html=report.html --self-contained-html --junit-xml=report-junit.xml tests/rtp/test_rtp.py --testcase_timeout=$testcase_timeout
#   artifacts:
#     name: "mr-$CI_MERGE_REQUEST_IID--sha-$CI_COMMIT_SHORT_SHA--job-$CI_JOB_NAME--results"
#     expire_in: 1 week
#     when: always
#     paths:
#       - report-junit.xml
#       - report.html
#     expose_as: "rtpdump pytest results"
#     reports:
#       junit:
#         - report-junit.xml

lc3-wrapper-unit-test:
  extends:
    - .test-job-linux
    - .rules-merge-request-to-main
  needs: ["build-codec-linux-cmake"]
  stage: test
  script:
    - cmake -B cmake-build -G "Unix Makefiles" -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true
    - cmake --build cmake-build -- -j
    - scripts/split_rendering/lc3plus_float/ivas_lc3plus_unit_test
# lc3-wrapper-unit-test:
#   extends:
#     - .test-job-linux
#     - .rules-merge-request-to-main
#   needs: ["build-codec-linux-cmake"]
#   stage: test
#   script:
#     - cmake -B cmake-build -G "Unix Makefiles" -DCOPY_EXECUTABLES_FROM_BUILD_DIR=true
#     - cmake --build cmake-build -- -j
#     - scripts/split_rendering/lc3plus_float/ivas_lc3plus_unit_test

# compare split-rendering bitexactness between target and source branch
split-rendering-pytest-on-merge-request:
@@ -786,8 +814,12 @@ split-rendering-pytest-on-merge-request:
    # back to source branch
    - git restore lib_com/options.h # Revert changes back before checking out another branch to avoid conflicts
    - git checkout $source_branch_commit_sha
    - *get-ivas-float-update
    - pushd ivas-basop
    - make clean
    - make -j
    - cp IVAS_* ISAR_* ../
    - popd

    ### Run test using scripts and input from main
    - if [ $ref_using_main == 1 ]; then git restore lib_com/options.h; fi # Revert changes back before checking out another branch to avoid conflicts
@@ -850,6 +882,12 @@ ivas-pytest-on-merge-request:
    ### Run test using branch scripts and input
    - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi

    - *get-ivas-float-update
    - pushd ivas-basop
    - make -j
    - cp IVAS_* ../
    - popd

    ### run pytest
    - exit_code=0
    - testcase_timeout=60
@@ -896,6 +934,12 @@ ivas-interop-on-merge-request:

    ### prepare pytest

    - *get-ivas-float-update
    - pushd ivas-basop
    - make -j
    - cp IVAS_cod ../
    - popd

    # Run reference creation, using source branch encoder and main decoder (see .merge-request-comparison-setup-codec)
    - exit_code=0
    - exit_code2=0
@@ -953,6 +997,12 @@ evs-pytest-on-merge-request:
    ### Run test using branch scripts and input
    - if [ $ref_using_main == 1 ]; then git checkout $source_branch_commit_sha; fi

    - *get-ivas-float-update
    - pushd ivas-basop
    - make -j
    - cp IVAS_* ../
    - popd

    ### run pytest for EVS cases
    - exit_code=0
    - python3 -m pytest $TESTS_DIR_CODEC_BE_ON_MR/test_param_file.py -v --param_file scripts/config/self_test_evs.prm --html=report.html --self-contained-html --junit-xml=report-junit-evs.xml --testcase_timeout=$testcase_timeout || exit_code=$?
@@ -984,8 +1034,12 @@ voip-be-on-merge-request:
  timeout: "10 minutes"
  script:
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
    - *get-ivas-float-update
    - pushd ivas-basop
    - make clean
    - make -j
    - cp IVAS_* ../
    - popd
    - python3 -m pytest tests/test_be_for_jbm_neutral_dly_profile.py

clang-format-check:
@@ -1047,6 +1101,7 @@ check-first-frame-is-sid:
    # this rm makes check-for-testvectors only check for the signals we actually need in this test
    - rm scripts/config/ci_linux_ltv.json scripts/config/ci_linux.json
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/check-for-testvectors.sh
    - *get-ivas-float-update
    - bash ci/run-first-frame-is-sid-test.sh

  artifacts:
@@ -1084,8 +1139,12 @@ check-bitexactness-hrtf-rom-and-file:
  timeout: "5 minutes"
  script:
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
    - *get-ivas-float-update
    - pushd ivas-basop
    - cmake .
    - make -j
    - cp IVAS_* ../
    - popd
    - python3 tests/create_short_testvectors.py --cut_len 1.0
    - python3 -m pytest tests/hrtf_binary_loading --html=report.html --junit-xml=report-junit.xml --self-contained-html
  artifacts:
@@ -1106,8 +1165,12 @@ check-bitexactness-ext-and-transport-format:
  timeout: "5 minutes"
  script:
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
    - *get-ivas-float-update
    - pushd ivas-basop
    - cmake .
    - make -j
    - cp IVAS_* ../
    - popd
    - python3 tests/create_short_testvectors.py --cut_len 1.0
    - python3 -m pytest tests/test_be_for_ext_outputs.py --html=report.html --junit-xml=report-junit.xml --self-contained-html
  artifacts:
@@ -1134,9 +1197,10 @@ be-2-evs-windows:
  timeout: "20 minutes" # To be revisited
  script:
    - *print-common-info-windows
    - *get-ivas-float-update

    - $winoutdata = $null
    - MSBuild.exe -maxcpucount .\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Release | tee -variable winoutdata
    - MSBuild.exe -maxcpucount .\ivas-basop\Workspace_msvc\Workspace_msvc.sln /property:Configuration=Release | tee -variable winoutdata
    - $winoutdata | Out-File $BUILD_OUTPUT -Encoding Utf8

    # copy over to never change the testvector dir
@@ -1500,10 +1564,13 @@ test-long-self-test:
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/update-ltv-repo.sh

    ### build branch binaries
    - *get-ivas-float-update
    - pushd ivas-basop
    - cmake . -Bbuild-test
    - cmake --build build-test -- -j
    - mv build-test/IVAS_cod ./IVAS_cod
    - mv build-test/IVAS_dec ./IVAS_dec
    - mv build-test/IVAS_cod ../IVAS_cod
    - mv build-test/IVAS_dec ../IVAS_dec
    - popd

    ### store the current commit hash
    - source_branch_commit_sha=$(git rev-parse HEAD)
+1 −0
Original line number Diff line number Diff line
@@ -33,3 +33,4 @@ variables:
  COVERAGE_OUTPUT_FILE_LTV: "coverage-ltv.info"
  COVERAGE_OUTPUT_FILE_CONFORMANCE: "coverage-conformance.info"
  COVERAGE_OUTPUT_FILE_MERGED: "coverage-merged.info"
  BASOP_REPO_URL: "https://forge.3gpp.org/rep/sa4/audio/ivas-basop.git"
+12 −5
Original line number Diff line number Diff line
#! /usr/bin/bash

# build encoder without sanitizers for faster runtime
pushd ivas-basop
make clean
make -j IVAS_cod
mv IVAS_cod IVAS_cod_nosan
mv IVAS_cod ../IVAS_cod_nosan
popd

# run all modes and cut bitstream to start with an SID. Use mono output to limit runtime, test is only about decoding the first frame
modes_no_sba=$(scripts/runIvasCodec.py -l | grep dtx | grep -vE "stereo|FOA|HOA")
@@ -19,10 +21,12 @@ common_args="-z console -p scripts/config/ci_linux_sidstart_test.json -s --oc mo
# first encoder + MSAN decoder
# hack to use the encoder with no sanitizers
mkdir CLANG1
pushd ivas-basop
make clean
make IVAS_dec -j CLANG=1
cp IVAS_dec CLANG1/IVAS_dec
cp IVAS_cod_nosan CLANG1/IVAS_cod
cp IVAS_dec ../CLANG1/IVAS_dec
cp IVAS_cod_nosan ../CLANG1/IVAS_cod
popd

exit_code_msan=0
echo "-------------- 1. Encoder + Msan decoder -------------- "
@@ -58,4 +62,7 @@ scripts/IvasBuildAndRunChecks.py --checks CLANG2 CLANG3 --decoder_only -m $modes
mv CLANG2/logs logs_dec_asan
mv CLANG3/logs logs_dec_usan

if [ $exit_code_msan -ne 0 ] || [ $exit_code_asan_usan -ne 0 ]; then echo "There was either a crash or a sanitizer error encountered when decoding a bitstream that starts with an SID. Check the artifacts for the logfiles."; exit 1; fi
if [ $exit_code_msan -ne 0 ] || [ $exit_code_asan_usan -ne 0 ]; then
  echo "There was either a crash or a sanitizer error encountered when decoding a bitstream that starts with an SID. Check the artifacts for the logfiles."
  exit 1
fi
+2 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ timeout_cmd="--timeout 20"
if [ $BUILD -eq 1 ]; then
  # Enable memory macros to find unbalanced memory allocations/deallocations
  # Does not implement full memory analysis
  pushd ivas-basop
  make clean

  # Replace free -> free_, malloc -> malloc_, calloc -> calloc_
@@ -73,6 +74,7 @@ if [ $BUILD -eq 1 ]; then
  #	sed -i.bak -e "s/\s*\(#define\s*DEBUGGING\)/\/\*\1*\//g" lib_com/options.h

  make all -j
  popd

fi