[Fuego] Jenkins build history Issue

Bird, Tim Tim.Bird at sony.com
Tue Mar 31 16:53:27 UTC 2020



> -----Original Message-----
> From: Kumar Thangavel <thangavel.k at hcl.com>
> 
> Hi Tim,
>  
> When I run a build using Jenkins, in the build history on each build number there used to be "testlog,run.json,fuegolog,devlog and
> prolog.sh" which were allowing to see the logs. A snapshot of that
> 
> Now , I have reinstalled fuego from mainline and now using serial as transport , I am unable to see those logs.
> 
> However , In the build machine , all files/logs are available in /fuego-rw/logs/Functional_hello_world/Build-num/
> 

This is a known bug (or missing feature, depending on how you look at it).  It is something
I've had on my to-do list to fix for quite a while.  Basically, Fuego run artifacts live in 2 places:
in the Fuego log directory: /fuego-rw/logs/<test>/<board>.<spec>.<build-num>.<build-num>
and in the Jenkins build directory: /var/lib/jenkins/jobs/<jobname>/builds/<build-num>

Everything is fine when you start your Fuego docker container from scratch.  These two locations
are kept in sync as you execute jobs.  Even if you execute a test on the command line (not initiated
from Jenkins), ftc will populate the /var/lib/Jenkins directory with appropriate run artifacts.

However, as you have noted, when you start a new container and have existing data in the Fuego
log area, the Jenkins directory is not populated with that data.  If you start executing jobs when
there are existing Fuego runs, then it creates a real mess as the directories and build numbers are
out of sync. This is a fairly serious bug, that I've wanted to fix for some time.

There is code inside the 'ftc' script to populate the Jenkins directory, on completion of a
command line test run (ie 'ftc run-test').  I have long thought that it should not be too difficult
to re-use this code to take existing Fuego run artifacts, and use those to populate the Jenkins
directories.

The code to populate the Jenkins directory from an existing (just executed) run, is in
the function do_run_test(), and goes from line 4248 to line 4341 (starting with the comment
"# update all the Jenkins build-related files"  This code, and one of the critical subroutines
is uses (called write_build_xml_file_v2()), uses data from the 'build_data' structure to populate
these directories.

There are a few different options here, to add 'orphan' runs to Jenkins:
1) add a special command to 'ftc' to do this (refactoring the existing code to put most
of it into a reusable sub-routine)
2) add a separate command (outside of ftc) to do this.  (A lot of the required code could
be copied from ftc).  The command would:
  a) detect one or more orphan runs in /fuego-rw/logs
  b) populate the Jenkins job area for each one

There are pros and cons to each approach.  I'm leaning towards option 2, even though
it means that the code would be duplicated between the two programs (ftc and the new
script).

I can probably take a look at this, but not super soon (maybe later this week).
Would you like to take a look at implementing something?  If not, that's OK.
I'll try to get to it soon.  I've been busy with other issues and haven't done
a lot of work on ftc recently, but this is an issue I'd like to get resolved.

Thanks for bringing it back to my attention.
 -- Tim



More information about the Fuego mailing list