Commit 1f854956 authored by Vladimir Malenovsky's avatar Vladimir Malenovsky
Browse files

Merge branch 'main' into basop-ci/add-encoder-logging

parents 3e9058c4 4e66cc1f
Loading
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -15,4 +15,9 @@
    <li><a href="ivas-pytest-compare_ref-long-enc-lev+10-index.html">ivas-pytest-compare_ref-long-enc-lev+10</a></li>
    <li><a href="ivas-pytest-compare_ref-long-enc-lev-10-index.html">ivas-pytest-compare_ref-long-enc-lev-10</a></li>
  </ul>

  <h3>Complexity Reports</h3>

  {}

</body>
+20 −18
Original line number Diff line number Diff line
@@ -42,14 +42,15 @@ JOBS_FLOAT_REPO = {
    # "timeless" jobs (not complexity)
    "coverage-test-on-main-scheduled": "Coverage",
}
JOBS_BASOP_REPO = [
    "ivas-pytest-compare_ref-long-dec",
    "ivas-pytest-compare_ref-long-dec-lev+10",
    "ivas-pytest-compare_ref-long-dec-lev-10",
    "ivas-pytest-compare_ref-long-enc",
    "ivas-pytest-compare_ref-long-enc-lev+10",
    "ivas-pytest-compare_ref-long-enc-lev-10",    
]
JOBS_BASOP_REPO = {
    "ivas-pytest-compare_ref-long-dec": "Pytest decoder compare to ref LTV",
    "ivas-pytest-compare_ref-long-dec-lev+10": "Pytest decoder compare to ref LTV +10dB",
    "ivas-pytest-compare_ref-long-dec-lev-10": "Pytest decoder compare to ref LTV -10dB",
    "ivas-pytest-compare_ref-long-enc": "Pytest encoder compare to ref LTV",
    "ivas-pytest-compare_ref-long-enc-lev+10": "Pytest encoder compare to ref LTV +10dB",
    "ivas-pytest-compare_ref-long-enc-lev-10": "Pytest encoder compare to ref LTV -10dB",
    "complexity-stereo-in-stereo-out": "Stereo in, Stereo out",
}

JOBS_FOR_PROJECT_ID = {
    PROJECT_ID_FLOAT_REPO: JOBS_FLOAT_REPO,
@@ -76,16 +77,12 @@ def main():
        sys.exit(1)

    index_html = PUBLIC_FOLDER.joinpath("index.html")
    if project_id == PROJECT_ID_FLOAT_REPO:
        create_landing_page_float_repo(jobs, index_html)
    elif project_id == PROJECT_ID_BASOP_REPO:
        src = pathlib.Path("ci/basop-pages/basop_index.html").absolute()
        shutil.move(src, index_html)
    create_landing_page(jobs, index_html, project_id)

    sys.exit(0)


def create_landing_page_float_repo(jobs, index_html):
def create_landing_page(jobs, index_html, project_id):
    # dynamically create the complexity links on the landing page
    link_html = list()
    link_html = ["<ul>"]
@@ -97,8 +94,13 @@ def create_landing_page_float_repo(jobs, index_html):
    link_html.append("</ul>")
    link_html_text = "\n".join(link_html)

    if project_id == PROJECT_ID_FLOAT_REPO:
        index_template = "index-pages.html"
    elif project_id == PROJECT_ID_BASOP_REPO:
        index_template = "basop-pages/basop_index.html"

    index_pages_tmpl_path = (
        pathlib.Path(__file__).parent.joinpath("index-pages.html").absolute()
        pathlib.Path(__file__).parent.joinpath(index_template).absolute()
    )

    with open(index_pages_tmpl_path) as f:
@@ -130,7 +132,7 @@ def get_artifacts_for_jobs_and_return_num_failed(
        print(f"{job_id} - {job}")
        try:
            with TemporaryDirectory() as tmp_dir:
                curl_for_artifacts(job_id, tmp_dir)
                curl_for_artifacts(job_id, project_id, tmp_dir)

                tmp_dir = pathlib.Path(tmp_dir)

@@ -147,12 +149,12 @@ def get_artifacts_for_jobs_and_return_num_failed(
    return failed_count


def curl_for_artifacts(job_id: int, exdir: str):
def curl_for_artifacts(job_id: int, project_id: int, exdir: str):
    cmd = [
        "curl",
        "--request",
        "GET",
        API_URL_BASE.format(os.environ["CI_PROJECT_ID"]) + f"/{job_id}/artifacts",
        API_URL_BASE.format(project_id) + f"/{job_id}/artifacts",
        "--output",
        ARTIFACTS,
    ]