test(lab): import adapters in legacy runtimes
This commit is contained in:
+12
-1
@@ -21,6 +21,10 @@ $Components = [ordered]@{
|
||||
adapter_name = "run_portable_lab_v1_eomt_component.py"
|
||||
adapter_sha256 = "b48ef255403abcfd177a6550688410a52b0fbd29d2a54c8417cb5a0daa330ad5"
|
||||
python_check = "python3 -B -m py_compile"
|
||||
import_check = (
|
||||
"python3 -B -c 'import portable_lab_v1_component_adapter; " +
|
||||
"import run_portable_lab_v1_eomt_component'"
|
||||
)
|
||||
entrypoint = '["python3"]'
|
||||
command = '["/opt/nodedc/adapter/run_portable_lab_v1_eomt_component.py"]'
|
||||
environment = @(
|
||||
@@ -36,6 +40,11 @@ $Components = [ordered]@{
|
||||
adapter_name = "run_portable_lab_v1_ddrnet_component.py"
|
||||
adapter_sha256 = "a398a43fe4069bf1b1fc2ec61b44df53dad6072cccb6d10a2627e76a96a94056"
|
||||
python_check = "conda run --no-capture-output --name goose python -B -m py_compile"
|
||||
import_check = (
|
||||
"conda run --no-capture-output --name goose python -B -c " +
|
||||
"'import portable_lab_v1_component_adapter; " +
|
||||
"import run_portable_lab_v1_ddrnet_component'"
|
||||
)
|
||||
entrypoint = '["conda","run","--no-capture-output","--name","goose","python"]'
|
||||
command = '["/opt/nodedc/adapter/run_portable_lab_v1_ddrnet_component.py"]'
|
||||
environment = @(
|
||||
@@ -99,7 +108,8 @@ function Invoke-InstalledImageSmoke {
|
||||
"test `$(sha256sum /opt/nodedc/adapter/portable_lab_v1_component_adapter.py " +
|
||||
"| cut -d' ' -f1) = $SharedAdapterSha256; " +
|
||||
"test `$(sha256sum /opt/nodedc/adapter/$($Descriptor.adapter_name) " +
|
||||
"| cut -d' ' -f1) = $($Descriptor.adapter_sha256)"
|
||||
"| cut -d' ' -f1) = $($Descriptor.adapter_sha256); " +
|
||||
"cd /opt/nodedc/adapter; $($Descriptor.import_check)"
|
||||
)
|
||||
docker run `
|
||||
--rm `
|
||||
@@ -185,6 +195,7 @@ function Install-ComponentImage {
|
||||
"$($Descriptor.python_check) " +
|
||||
"/opt/nodedc/adapter/portable_lab_v1_component_adapter.py " +
|
||||
"/opt/nodedc/adapter/$($Descriptor.adapter_name); " +
|
||||
"cd /opt/nodedc/adapter; $($Descriptor.import_check); " +
|
||||
"rm -rf /opt/nodedc/adapter/__pycache__"
|
||||
)
|
||||
$mount = "type=bind,source=$componentRoot,target=/nodedc-build-source,readonly"
|
||||
|
||||
@@ -22,6 +22,10 @@ def test_component_image_installer_is_exact_local_and_offline() -> None:
|
||||
assert 'docker image ls `' in script
|
||||
assert '--filter "reference=$tag"' in script
|
||||
assert "Invoke-InstalledImageSmoke" in script
|
||||
assert "import_check" in script
|
||||
assert script.count("import portable_lab_v1_component_adapter") == 2
|
||||
assert "import run_portable_lab_v1_eomt_component" in script
|
||||
assert "import run_portable_lab_v1_ddrnet_component" in script
|
||||
assert "docker commit @changes $containerId $tag" in script
|
||||
assert "docker rm -f $containerId" in script
|
||||
assert "com.nodedc.build-method" in script
|
||||
|
||||
Reference in New Issue
Block a user