Skip to content

Commit

Permalink
Resolve environment variables in framework manifest file
Browse files Browse the repository at this point in the history
Signed-off-by: hoangtungdinh <[email protected]>
  • Loading branch information
hoangtungdinh committed Sep 2, 2024
1 parent aba8b24 commit 120b73a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-on-change-linux-bare.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ jobs:

- name: Execute checker bundles runtime
run: |
export ASAM_QC_FRAMEWORK_MANIFEST_DIR=${{ github.workspace }}/.github/workflows/linux-manifest
pip install -e ${{ github.workspace }}/runtime
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-on-change-windows.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ jobs:

- name: Execute checker bundles runtime
run: |
$env:ASAM_QC_FRAMEWORK_MANIFEST_DIR="$env:WORKING_PATH\qc-framework\qc-framework\.github\workflows\windows-manifest"
git config --system core.longpaths true
pip install -e $env:WORKING_PATH\qc-framework\qc-framework\runtime
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linux-manifest/framework.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_file_path": [
"$ASAM_QC_FRAMEWORK_MANIFEST_DIR/.github/workflows/linux-manifest/osc.json",
"${ASAM_QC_FRAMEWORK_MANIFEST_DIR}/.github/workflows/linux-manifest/odr.json",
"$ASAM_QC_FRAMEWORK_MANIFEST_DIR/osc.json",
"${ASAM_QC_FRAMEWORK_MANIFEST_DIR}/odr.json",
"/home/runner/work/qc-framework/qc-framework/.github/workflows/linux-manifest/otx.json",
"/home/runner/work/qc-framework/qc-framework/.github/workflows/linux-manifest/result_pooling.json",
"/home/runner/work/qc-framework/qc-framework/.github/workflows/linux-manifest/text_report.json"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/windows-manifest/framework.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"manifest_file_path": [
"$ASAM_QC_FRAMEWORK_MANIFEST_DIR\\.github\\workflows\\windows-manifest\\osc.json",
"${ASAM_QC_FRAMEWORK_MANIFEST_DIR}\\.github\\workflows\\windows-manifest\\odr.json",
"%ASAM_QC_FRAMEWORK_MANIFEST_DIR%\\.github\\workflows\\windows-manifest\\otx.json",
"$ASAM_QC_FRAMEWORK_MANIFEST_DIR\\osc.json",
"${ASAM_QC_FRAMEWORK_MANIFEST_DIR}\\odr.json",
"%ASAM_QC_FRAMEWORK_MANIFEST_DIR%\\otx.json",
"D:\\a\\qc-framework\\qc-framework\\.github\\workflows\\windows-manifest\\result_pooling.json",
"D:\\a\\qc-framework\\qc-framework\\.github\\workflows\\windows-manifest\\text_report.json"
]
Expand Down
10 changes: 7 additions & 3 deletions runtime/runtime/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ def execute_modules(
run_module_command(report_module, config_file_path, output_path)


def execute_runtime(config_file_path: str, manifest_file_path: str, working_dir: str) -> None:
def execute_runtime(
config_file_path: str, manifest_file_path: str, working_dir: str
) -> None:
"""Execute all runtime operations defined in the input manifest over the
defined configuration.
Expand All @@ -124,8 +126,10 @@ def execute_runtime(config_file_path: str, manifest_file_path: str, working_dir:
json_data = framework_manifest_file.read().decode()
framework_manifest = models.FrameworkManifest.model_validate_json(json_data)

for module_manifest_path in framework_manifest.manifest_file_path:
with open(module_manifest_path, "rb") as module_manifest_file:
for raw_module_manifest_path in framework_manifest.manifest_file_path:
resolved_module_manifest_path = os.path.expandvars(raw_module_manifest_path)

with open(resolved_module_manifest_path, "rb") as module_manifest_file:
json_data = module_manifest_file.read().decode()
module_manifest = models.ModuleManifest.model_validate_json(json_data)

Expand Down

0 comments on commit 120b73a

Please sign in to comment.