From b39c6e3788dce3fa5fed58cc9eabc8a29390cce5 Mon Sep 17 00:00:00 2001 From: frederick Date: Mon, 12 Oct 2026 14:17:15 +0100 Subject: [PATCH 1/2] adding grathering step to grather all the mib files to convert, this will then be used as input to withParams mib conversion step which in theory then convert all the mib files instead of erroring due to give lists instead of singlar values --- e02/templates/mib2x-complete.yaml | 57 +++++++++++++++++++++++++------ 1 file changed, 47 insertions(+), 10 deletions(-) diff --git a/e02/templates/mib2x-complete.yaml b/e02/templates/mib2x-complete.yaml index ddde5a6..e503c4c 100644 --- a/e02/templates/mib2x-complete.yaml +++ b/e02/templates/mib2x-complete.yaml @@ -40,12 +40,8 @@ spec: ### templates: - name: mib2x-complete - #inputs: - # parameters: - - #- name: #name parameters here - steps: #steps is on the name level as inputs + steps: - - name: raw template: find-raw - - name: find @@ -55,17 +51,21 @@ spec: - name: sample_name value: "{{`{{item}}`}}" withParam: "{{`{{steps.raw.outputs.result}}`}}" - #arguments: - #parameters: - #- name: base_path - + + - - name: aggregate + template: aggregate-mib + arguments: + parameters: + - name: mibs + value: "{{`{{steps.find.outputs.result}}`}}" + - - name: convert-mib template: convert-found-mib-files arguments: parameters: - name: mibfiles value: "{{`{{item}}`}}" - withParam: "{{`{{steps.find.outputs.result}}`}}" + withParam: "{{`{{steps.aggregate.outputs.result}}`}}" ### - name: find-raw outputs: @@ -205,6 +205,8 @@ spec: logging.append('%i: %s' % (num, mib_files[mib_index])) data_to_convert.append(mib_files[mib_index]) + logging.append("***\nData to convert: %s" % (data_to_convert)) + #ToDo think about this printing in the context of an Error #this should be try statement with open("/tmp/find_files_logging.txt",'w') as ofile: @@ -214,6 +216,41 @@ spec: #This is used to produce the input for the next step .i.e inputs.parameters.mibfiles json.dump(data_to_convert, sys.stdout) + - name: aggregate-mib + inputs: + parameters: + - name: mibs + outputs: + artifacts: + - name: log_mibs + path: /tmp/log_mibs.txt + archive: + none: {} + script: + image: python:3.10 + volumeMounts: + - name: session + mountPath: "{{`{{ workflow.parameters.visitdir }}`}}" + - name: tmpdir + mountPath: /tmp + command: [python] + source: | + # + import os + import sys + import json + logging = [] + logging.append('The input to this step is: %s' % ("{{`{{inputs.parameters.mib}}`}}")) + + input = "{{`{{inputs.parameters.mib}}`}}" + + with open("/tmp/log_mibs.txt",'w') as ofile: + for item in logging: + print(item,file=ofile) + + json.dump(input, sys.stdout) + + - name: convert-found-mib-files inputs: parameters: From ef619df75227b95c76db288fe678cc88cb94ab0f Mon Sep 17 00:00:00 2001 From: frederick Date: Mon, 12 Oct 2026 14:24:36 +0100 Subject: [PATCH 2/2] fixinf spelling mistake in varible name mib->mibs --- e02/templates/mib2x-complete.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/e02/templates/mib2x-complete.yaml b/e02/templates/mib2x-complete.yaml index e503c4c..d451ef8 100644 --- a/e02/templates/mib2x-complete.yaml +++ b/e02/templates/mib2x-complete.yaml @@ -240,9 +240,9 @@ spec: import sys import json logging = [] - logging.append('The input to this step is: %s' % ("{{`{{inputs.parameters.mib}}`}}")) + logging.append('The input to this step is: %s' % ("{{`{{inputs.parameters.mibs}}`}}")) - input = "{{`{{inputs.parameters.mib}}`}}" + input = "{{`{{inputs.parameters.mibs}}`}}" with open("/tmp/log_mibs.txt",'w') as ofile: for item in logging: