Re: [Fuego] Jenkins build history Issue
Kumar Thangavel <[email protected]>
| Newsgroups | dev.linux.lists.fuego |
|---|---|
| Message-ID | <PS2PR04MB3544CDF1CC73C1382DE1D041FDC90@PS2PR04MB3544.apcprd04.prod.outlook.com> |
Hi Tim,
Thanks a lot for your response. I would like to take a look and implement this feature. Will discuss about this later.
Thanks,
Kumar.
-----Original Message-----
From: Bird, Tim <[email protected]>
Sent: Tuesday, March 31, 2020 10:23 PM
To: Kumar Thangavel <[email protected]>
Cc: [email protected]
Subject: RE: Jenkins build history Issue
[CAUTION: This Email is from outside the Organization. Do not click links or open attachments unless you trust the sender.]
> -----Original Message-----
> From: Kumar Thangavel <[email protected]>
>
> 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
::DISCLAIMER::
________________________________
The contents of this e-mail and any attachment(s) are confidential and intended for the named recipient(s) only. E-mail transmission is not guaranteed to be secure or error-free as information could be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or may contain viruses in transmission. The e mail and its contents (with or without referred errors) shall therefore not attach any liability on the originator or HCL or its affiliates. Views or opinions, if any, presented in this email are solely those of the author and may not necessarily reflect the views or opinions of HCL or its affiliates. Any form of reproduction, dissemination, copying, disclosure, modification, distribution and / or publication of this message without the prior written consent of authorized representative of HCL is strictly prohibited. If you have received this email in error please delete it and notify the sender immediately. Before opening any email and/or attachments, please check them for viruses and other defects.
________________________________