Skip to content

Commit 940cc4e

Browse files
committed
Feat: get input artifacts from LAVA jobs
Signed-off-by: Simone Tollardo <[email protected]>
1 parent dc97009 commit 940cc4e

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

src/lava_callback.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929

3030
from base import validate_url
3131

32-
3332
SETTINGS = toml.load(os.getenv('KCI_SETTINGS', 'config/kernelci.toml'))
3433
CONFIGS = kernelci.config.load(
3534
SETTINGS.get('DEFAULT', {}).get('yaml_config', 'config')
@@ -211,6 +210,23 @@ def async_job_submit(api_helper, node_id, job_callback):
211210
job_result = job_callback.get_job_status()
212211
device_id = job_callback.get_device_id()
213212
storage_config_name = job_callback.get_meta('storage_config_name')
213+
input_file_types = [
214+
'nfsrootfs',
215+
'rootfs',
216+
'ramdisk',
217+
'initrd',
218+
'ndbroot',
219+
'persistent_nfs'
220+
]
221+
job_actions = job_callback.get_job_definition('actions')
222+
if job_actions and len(job_actions) > 0:
223+
deploy = job_actions[0].get('deploy')
224+
if deploy:
225+
for input_file in input_file_types:
226+
if deploy.get('images') and deploy['images'].get(input_file):
227+
url = deploy['images'][input_file].get('url')
228+
if url:
229+
job_node['artifacts']["input_"+input_file] = url
214230
storage = _get_storage(storage_config_name)
215231
log_txt_url = _upload_log(log_parser, job_node, storage)
216232
if log_txt_url:

0 commit comments

Comments
 (0)