Commit 336347da authored by Archit Tamarapu's avatar Archit Tamarapu
Browse files

try to move jobs to their own file

parent f5310a03
Loading
Loading
Loading
Loading
+115 −0
Original line number Diff line number Diff line
loudness-measurement:
  tags:
    - processing-scripts-linux

  extends:
    - .test-job-linux-needs-testv-dir

  stage: test
  timeout: 24 hours
  rules:
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'loudness'
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'loudness-measurement-only'

  variables:
    FORMAT_LIST: >
      mono stereo
      MC_5_1 MC_5_1_2 MC_5_1_4 MC_7_1 MC_7_1_4
      ISM1 ISM2 ISM3 ISM4
      FOA HOA2 HOA3
      MASA_1TC MASA_2TC
      OMASA_ISM1_1TC OMASA_ISM2_1TC OMASA_ISM3_1TC OMASA_ISM4_1TC
      OMASA_ISM1_2TC OMASA_ISM2_2TC OMASA_ISM3_2TC OMASA_ISM4_2TC
      OSBA_ISM1_FOA OSBA_ISM2_FOA OSBA_ISM3_FOA OSBA_ISM4_FOA
      OSBA_ISM1_HOA2 OSBA_ISM2_HOA2 OSBA_ISM3_HOA2 OSBA_ISM4_HOA2
      OSBA_ISM1_HOA3 OSBA_ISM2_HOA3 OSBA_ISM3_HOA3 OSBA_ISM4_HOA3
    CONFIG_JSON: "scripts/config/ci_loudness_linux.json"
  allow_failure:
    exit_codes:
      - 123

  script:
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
    - set -x
    - git clone --single-branch --branch main https://gitlab-ci-token:${CI_JOB_TOKEN}@forge.3gpp.org/rep/ivas-codec-pc/ivas-processing-scripts.git
    - make -j
    - >

      for fmt in ${FORMAT_LIST};
      do
        ./scripts/runIvasCodec.py -z console -U 1:2 -p ${CONFIG_JSON} -x ${fmt}_b | tee -a smoke_test_output.txt
      done
    - ./scripts/get_loudness_data.py ${CONFIG_JSON} --formats ${FORMAT_LIST}

  artifacts:
    name: "loudness-measurements--sha-$CI_COMMIT_SHORT_SHA--results"
    when: always
    expire_in: 2 weeks
    paths:
      - loudness.csv
      - smoke_test_output.txt

    expose_as: "loudness measurements"

loudness-analysis:
  tags:
    - processing-scripts-linux

  extends:
    - .test-job-linux-needs-testv-dir

  stage: compare
  rules:
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'loudness'
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'loudness-analysis-only'

  needs:
    - job: loudness-measurement

      artifacts: true
      optional: true
  before_script:
    - |

      if [ ! -f "loudness.csv" ]; then
        echo "No loudness.csv found in current pipeline, fetching from last successful measurement job..."
        
        job_id=$(python3 ci/get_id_of_last_job_occurence.py $CI_COMMIT_REF_NAME "loudness-measurement" $CI_PROJECT_ID --success_only)
        echo "Found job ID: $job_id"
        
        if [ "$JOB_ID_INJECT" != "" ]; then 
          job_id=$JOB_ID_INJECT
          echo "Using injected job ID: $job_id"
        fi
        
        if [ "$job_id" == "-1" ]; then
          echo "ERROR: No successful loudness-measurement job found on branch $CI_COMMIT_REF_NAME"
          exit 1
        fi
        
        # Download and extract artifacts
        curl --silent --show-error --request GET "$CI_API_V4_URL/projects/$CI_PROJECT_ID/jobs/$job_id/artifacts" --output artifacts.zip
        unzip -qq artifacts.zip || true
        
        if [ ! -f "loudness.csv" ]; then
          echo "ERROR: loudness.csv not found in artifacts from job $job_id"
          exit 1
        fi
        
        echo "Successfully fetched loudness.csv from job $job_id"
      else
        echo "loudness.csv found in current pipeline artifacts"
      fi
  script:
    - ./scripts/parse_loudness_data.py

  artifacts:
    name: "loudness-analysis--sha-$CI_COMMIT_SHORT_SHA--results"
    when: always
    expire_in: 2 weeks
    paths:
      - loudness.csv
      - smoke_test_output.txt
      - plots/

    expose_as: "loudness analysis results"
+3 −49
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ include:
  - local: includes/default-variables.yml
  - local: includes/job-templates.yml
  - local: includes/complexity-jobs.yml
  - local: includes/loudness-jobs.yml
  - local: includes/smoke-test.yml
  - local: includes/build-jobs.yml
  - local: includes/rules.yml
@@ -45,6 +46,8 @@ variables:
      - 'coverage'
      - 'complexity'
      - 'loudness'
      - 'loudness-measurement-only'
      - 'loudness-analysis-only'

  PYTEST_ARGS: ""
  COVERAGE_OUTPUT_FILE_STV: "coverage-stv.info"
@@ -1575,55 +1578,6 @@ test-branch-vs-input-passthrough:
      junit:
        - report-junit.xml

loudness-measurement:
  tags:
   - processing-scripts-linux
  extends:
    - .test-job-linux-needs-testv-dir
  stage: compare
  timeout: 24 hours
  rules:
    - if: $CI_PIPELINE_SOURCE == 'web' && $MANUAL_PIPELINE_TYPE == 'loudness'
  variables:
    FORMAT_LIST: >
      mono stereo
      MC_5_1 MC_5_1_2 MC_5_1_4 MC_7_1 MC_7_1_4
      ISM1 ISM2 ISM3 ISM4
      FOA HOA2 HOA3
      MASA_1TC MASA_2TC
      OMASA_ISM1_1TC OMASA_ISM2_1TC OMASA_ISM3_1TC OMASA_ISM4_1TC
      OMASA_ISM1_2TC OMASA_ISM2_2TC OMASA_ISM3_2TC OMASA_ISM4_2TC
      OSBA_ISM1_FOA OSBA_ISM2_FOA OSBA_ISM3_FOA OSBA_ISM4_FOA
      OSBA_ISM1_HOA2 OSBA_ISM2_HOA2 OSBA_ISM3_HOA2 OSBA_ISM4_HOA2
      OSBA_ISM1_HOA3 OSBA_ISM2_HOA3 OSBA_ISM3_HOA3 OSBA_ISM4_HOA3
    CONFIG_JSON: "scripts/config/ci_loudness_linux.json"
  allow_failure:
    exit_codes:
      - 123
  script:
    - bash "${CI_PROJECT_DIR}"/ivas-codec-ci/snippets/print-common-info.sh
    - set -x
    - git clone --single-branch --branch main https://gitlab-ci-token:${CI_JOB_TOKEN}@forge.3gpp.org/rep/ivas-codec-pc/ivas-processing-scripts.git
    - make -j
    - >
      for fmt in ${FORMAT_LIST};
      do
        ./scripts/runIvasCodec.py -z console -U 1:2 -p ${CONFIG_JSON} -x ${fmt}_b | tee -a smoke_test_output.txt
      done
    - ./scripts/get_loudness_data.py
    - ./scripts/parse_loudness_data.py

  artifacts:
    name: "loudness-measurements--sha-$CI_COMMIT_SHORT_SHA--results"
    when: always
    expire_in: 2 weeks
    paths:
      - loudness.csv
      - smoke_test_output.txt
      - plots/
    expose_as: "loudness results"
  

# ---------------------------------------------------------------
# Scheduled jobs on main
# ---------------------------------------------------------------