ARM-software/workload-automation

Sample adding a workload example gives error

richidubey opened this issue · 2 comments

Hi,

in https://workload-automation.readthedocs.io/en/latest/developer_information.html#adding-a-workload section, the sample code provided gives an error about host_output_file not defined from context.add_artifact('ziptest-results', host_output_file, kind='raw'). I have trouble understanding how this works, so can someone please tell me what I should replace it with?

Also, what does self.target.pull(self.target_outfile, self.host_outfile) do? I tried searching for definition of pull, but all that I got was pull declarations that had 4 parameters (and not 2).

Hi,

context.add_artifact('ziptest-results', host_output_file, kind='raw'). I have trouble understanding how this works, so can someone please tell me what I should replace it with?

Thanks for pointing this out, host_output_file should be self.host_outfile, I'll get that fixed.

The high level flow here is to show how a results file generated on a target can be transferred to the local host machine and recorded in the job information.

We have our results file on the target (timing_results and is referred to by self.target_outfile), we want to copy (pull) this file from the target to the filepath generated on our local machine self.host_outfile.
Finally we add the retrieved file as a "raw" artifact [1] for our job before we process it in the next stage. The syntax here is:
add_artifact(<name_of_artifact>, <file_path_on_host>, <kind_of_artifact>)

Also, what does self.target.pull(self.target_outfile, self.host_outfile) do? I tried searching for definition of pull, but all that I got was pull declarations that had 4 parameters (and not 2).

self.target.pull refers to the devlib Target method documented here [2], The first 2 parameters are mandatory to provide the source (the file path on the target) and destination (on the local machine) with optional parameters if you want additional control.

Please let me know if this is any clearer.

[1] https://workload-automation.readthedocs.io/en/latest/api/output.html#artifact
[2] https://devlib.readthedocs.io/en/latest/target.html#devlib.target.Target.pull

Hi @marcbonnici,

Your explanation was way clearer than what I could have asked for.

Thanks a lot!