* [PATCH 0/2] oeqa/postactions: save ptests artifacts as archive on host
@ 2024-08-12 15:14 Alexis Lothoré
2024-08-12 15:14 ` [PATCH 1/2] oeqa/postactions: fix exception handling Alexis Lothoré
2024-08-12 15:14 ` [PATCH 2/2] oeqa/postactions: do not uncompress retrieved archive on host Alexis Lothoré
0 siblings, 2 replies; 7+ messages in thread
From: Alexis Lothoré @ 2024-08-12 15:14 UTC (permalink / raw)
To: Openembedded-core; +Cc: Thomas Petazzoni, Alexandre Belloni
Hello,
on any ptest failure, testimage build a list of artifacts to retrieve from
the target under test, create an archive and pull the corresponding raw
stream onto the controlling host (eg: autobuilder), which uncompresses it
immediately.
This small series follows a request to keep those artifacts compressed
instead of uncompressing them on the host.
The first commit is kind of unrelated and fixes a trivial issue spotted
during some tests. The second commit makes sure that artifacts are kept
in a compressed archive on the host.
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
Alexis Lothoré (2):
oeqa/postactions: fix exception handling
oeqa/postactions: do not uncompress retrieved archive on host
meta/lib/oeqa/utils/postactions.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
--
2.46.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/2] oeqa/postactions: fix exception handling
2024-08-12 15:14 [PATCH 0/2] oeqa/postactions: save ptests artifacts as archive on host Alexis Lothoré
@ 2024-08-12 15:14 ` Alexis Lothoré
2024-08-12 15:14 ` [PATCH 2/2] oeqa/postactions: do not uncompress retrieved archive on host Alexis Lothoré
1 sibling, 0 replies; 7+ messages in thread
From: Alexis Lothoré @ 2024-08-12 15:14 UTC (permalink / raw)
To: Openembedded-core; +Cc: Thomas Petazzoni, Alexandre Belloni
From: Alexis Lothoré <alexis.lothore@bootlin.com>
The current exception handler in list_and_fetch_failed_tests_artifacts
expects a non-exisiting variable and then fail to display the original
exception message since it raises a new one. The issue has been introduced
with commit 6e80b2ab660e ("oeqa/utils/postactions: transfer whole archive
over ssh instead of doing individual copies"). Now that tests artifacts are
now handled individually, there's no point of trying to print individual
names in the exception.
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
meta/lib/oeqa/utils/postactions.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/lib/oeqa/utils/postactions.py b/meta/lib/oeqa/utils/postactions.py
index 2de2d18328ea..3b537146c50a 100644
--- a/meta/lib/oeqa/utils/postactions.py
+++ b/meta/lib/oeqa/utils/postactions.py
@@ -70,7 +70,7 @@ def list_and_fetch_failed_tests_artifacts(d, tc, artifacts_list, outputdir):
raise Exception("Error while fetching compressed artifacts")
p = subprocess.run(["tar", "zxf", "-", "-C", outputdir], input=output)
except Exception as e:
- bb.warn(f"Can not retrieve {artifact_path} from test target: {e}")
+ bb.warn(f"Can not retrieve artifacts from test target: {e}")
##################################################################
--
2.46.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/2] oeqa/postactions: do not uncompress retrieved archive on host
2024-08-12 15:14 [PATCH 0/2] oeqa/postactions: save ptests artifacts as archive on host Alexis Lothoré
2024-08-12 15:14 ` [PATCH 1/2] oeqa/postactions: fix exception handling Alexis Lothoré
@ 2024-08-12 15:14 ` Alexis Lothoré
2024-09-19 7:42 ` [OE-core] " Richard Purdie
[not found] ` <17F6955C7A69DDF6.31299@lists.openembedded.org>
1 sibling, 2 replies; 7+ messages in thread
From: Alexis Lothoré @ 2024-08-12 15:14 UTC (permalink / raw)
To: Openembedded-core; +Cc: Thomas Petazzoni, Alexandre Belloni
From: Alexis Lothoré <alexis.lothore@bootlin.com>
Current postaction module executes a remote tar command, pipe it in a SSH
connection, and uncompress the raw stream with another tar command. With
this command, the whole artifacts tree is directly available on the host
executing the test, but it is not very convenient if we want to download
the whole retrieved ptests directory.
Stop uncompressing the retrieved ptests archive onto host, just save the
archive as it is. The new output then looks like the following:
tmp/log/oeqa-artefacts
└── oeqa-target-artefacts-20240812-juzqdb80
├── host_disk_usage.txt
├── target_disk_usage.txt
└── tests_artifacts.tar.gz
Suggested-By: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
---
meta/lib/oeqa/utils/postactions.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/lib/oeqa/utils/postactions.py b/meta/lib/oeqa/utils/postactions.py
index 3b537146c50a..d5080523aa83 100644
--- a/meta/lib/oeqa/utils/postactions.py
+++ b/meta/lib/oeqa/utils/postactions.py
@@ -68,7 +68,8 @@ def list_and_fetch_failed_tests_artifacts(d, tc, artifacts_list, outputdir):
(status, output) = tc.target.run(cmd, raw = True)
if status != 0 or not output:
raise Exception("Error while fetching compressed artifacts")
- p = subprocess.run(["tar", "zxf", "-", "-C", outputdir], input=output)
+ with open(archive_name, "wb") as f:
+ f.write(output)
except Exception as e:
bb.warn(f"Can not retrieve artifacts from test target: {e}")
--
2.46.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [OE-core] [PATCH 2/2] oeqa/postactions: do not uncompress retrieved archive on host
2024-08-12 15:14 ` [PATCH 2/2] oeqa/postactions: do not uncompress retrieved archive on host Alexis Lothoré
@ 2024-09-19 7:42 ` Richard Purdie
[not found] ` <17F6955C7A69DDF6.31299@lists.openembedded.org>
1 sibling, 0 replies; 7+ messages in thread
From: Richard Purdie @ 2024-09-19 7:42 UTC (permalink / raw)
To: alexis.lothore, Openembedded-core; +Cc: Thomas Petazzoni, Alexandre Belloni
On Mon, 2024-08-12 at 17:14 +0200, Alexis Lothoré via lists.openembedded.org wrote:
> From: Alexis Lothoré <alexis.lothore@bootlin.com>
>
> Current postaction module executes a remote tar command, pipe it in a SSH
> connection, and uncompress the raw stream with another tar command. With
> this command, the whole artifacts tree is directly available on the host
> executing the test, but it is not very convenient if we want to download
> the whole retrieved ptests directory.
>
> Stop uncompressing the retrieved ptests archive onto host, just save the
> archive as it is. The new output then looks like the following:
>
> tmp/log/oeqa-artefacts
> └── oeqa-target-artefacts-20240812-juzqdb80
> ├── host_disk_usage.txt
> ├── target_disk_usage.txt
> └── tests_artifacts.tar.gz
>
> Suggested-By: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
> ---
> meta/lib/oeqa/utils/postactions.py | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/lib/oeqa/utils/postactions.py b/meta/lib/oeqa/utils/postactions.py
> index 3b537146c50a..d5080523aa83 100644
> --- a/meta/lib/oeqa/utils/postactions.py
> +++ b/meta/lib/oeqa/utils/postactions.py
> @@ -68,7 +68,8 @@ def list_and_fetch_failed_tests_artifacts(d, tc, artifacts_list, outputdir):
> (status, output) = tc.target.run(cmd, raw = True)
> if status != 0 or not output:
> raise Exception("Error while fetching compressed artifacts")
> - p = subprocess.run(["tar", "zxf", "-", "-C", outputdir], input=output)
> + with open(archive_name, "wb") as f:
> + f.write(output)
> except Exception as e:
> bb.warn(f"Can not retrieve artifacts from test target: {e}")
This change is causing failures since archive_name isn't defined anywhere :/
Cheers,
Richard
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OE-core] [PATCH 2/2] oeqa/postactions: do not uncompress retrieved archive on host
[not found] ` <17F6955C7A69DDF6.31299@lists.openembedded.org>
@ 2024-09-19 12:58 ` Richard Purdie
2024-09-19 14:29 ` Alexis Lothoré
0 siblings, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2024-09-19 12:58 UTC (permalink / raw)
To: alexis.lothore, Openembedded-core
Cc: Thomas Petazzoni, Alexandre Belloni, Steve Sakoman
On Thu, 2024-09-19 at 08:42 +0100, Richard Purdie via
lists.openembedded.org wrote:
> On Mon, 2024-08-12 at 17:14 +0200, Alexis Lothoré via
> lists.openembedded.org wrote:
> > From: Alexis Lothoré <alexis.lothore@bootlin.com>
> >
> > Current postaction module executes a remote tar command, pipe it in
> > a SSH
> > connection, and uncompress the raw stream with another tar command.
> > With
> > this command, the whole artifacts tree is directly available on the
> > host
> > executing the test, but it is not very convenient if we want to
> > download
> > the whole retrieved ptests directory.
> >
> > Stop uncompressing the retrieved ptests archive onto host, just
> > save the
> > archive as it is. The new output then looks like the following:
> >
> > tmp/log/oeqa-artefacts
> > └── oeqa-target-artefacts-20240812-juzqdb80
> > ├── host_disk_usage.txt
> > ├── target_disk_usage.txt
> > └── tests_artifacts.tar.gz
> >
> > Suggested-By: Alexandre Belloni <alexandre.belloni@bootlin.com>
> > Signed-off-by: Alexis Lothoré <alexis.lothore@bootlin.com>
> > ---
> > meta/lib/oeqa/utils/postactions.py | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/meta/lib/oeqa/utils/postactions.py
> > b/meta/lib/oeqa/utils/postactions.py
> > index 3b537146c50a..d5080523aa83 100644
> > --- a/meta/lib/oeqa/utils/postactions.py
> > +++ b/meta/lib/oeqa/utils/postactions.py
> > @@ -68,7 +68,8 @@ def list_and_fetch_failed_tests_artifacts(d, tc,
> > artifacts_list, outputdir):
> > (status, output) = tc.target.run(cmd, raw = True)
> > if status != 0 or not output:
> > raise Exception("Error while fetching compressed
> > artifacts")
> > - p = subprocess.run(["tar", "zxf", "-", "-C", outputdir],
> > input=output)
> > + with open(archive_name, "wb") as f:
> > + f.write(output)
> > except Exception as e:
> > bb.warn(f"Can not retrieve artifacts from test target:
> > {e}")
>
>
> This change is causing failures since archive_name isn't defined
> anywhere :/
I'd also note that scarthgap actually throws errors:
https://valkyrie.yoctoproject.org/#/builders/73/builds/135/steps/12/logs/stdio
Exception: NameError: name 'artifact_path' is not defined
which is related to some of these patches :/.
Cheers,
Richard
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OE-core] [PATCH 2/2] oeqa/postactions: do not uncompress retrieved archive on host
2024-09-19 12:58 ` Richard Purdie
@ 2024-09-19 14:29 ` Alexis Lothoré
2024-09-19 15:00 ` Alexandre Belloni
0 siblings, 1 reply; 7+ messages in thread
From: Alexis Lothoré @ 2024-09-19 14:29 UTC (permalink / raw)
To: Richard Purdie, Openembedded-core
Cc: Thomas Petazzoni, Alexandre Belloni, Steve Sakoman
Hello Richard,
On 9/19/24 14:58, Richard Purdie wrote:
> On Thu, 2024-09-19 at 08:42 +0100, Richard Purdie via
> lists.openembedded.org wrote:
>> On Mon, 2024-08-12 at 17:14 +0200, Alexis Lothoré via
>> lists.openembedded.org wrote:
>>> From: Alexis Lothoré <alexis.lothore@bootlin.com>
[...]
>>> --- a/meta/lib/oeqa/utils/postactions.py
>>> +++ b/meta/lib/oeqa/utils/postactions.py
>>> @@ -68,7 +68,8 @@ def list_and_fetch_failed_tests_artifacts(d, tc,
>>> artifacts_list, outputdir):
>>> (status, output) = tc.target.run(cmd, raw = True)
>>> if status != 0 or not output:
>>> raise Exception("Error while fetching compressed
>>> artifacts")
>>> - p = subprocess.run(["tar", "zxf", "-", "-C", outputdir],
>>> input=output)
>>> + with open(archive_name, "wb") as f:
>>> + f.write(output)
>>> except Exception as e:
>>> bb.warn(f"Can not retrieve artifacts from test target:
>>> {e}")
>>
>>
>> This change is causing failures since archive_name isn't defined
>> anywhere :/
>
> I'd also note that scarthgap actually throws errors:
>
> https://valkyrie.yoctoproject.org/#/builders/73/builds/135/steps/12/logs/stdio
>
> Exception: NameError: name 'artifact_path' is not defined
>
> which is related to some of these patches :/.
I am out of office right now with limited access to computer (I come back next
week but then I will be traveling to attend Kernel Recipes). If no one fixes it
before, I'll take a look and send a fix once I return to the office (end of next
week)
Alexis
--
Alexis Lothoré, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [OE-core] [PATCH 2/2] oeqa/postactions: do not uncompress retrieved archive on host
2024-09-19 14:29 ` Alexis Lothoré
@ 2024-09-19 15:00 ` Alexandre Belloni
0 siblings, 0 replies; 7+ messages in thread
From: Alexandre Belloni @ 2024-09-19 15:00 UTC (permalink / raw)
To: Alexis Lothoré, Mathieu Dubois-Briand
Cc: Richard Purdie, Openembedded-core, Thomas Petazzoni,
Steve Sakoman
On 19/09/2024 16:29:06+0200, Alexis Lothor� wrote:
> Hello Richard,
>
> On 9/19/24 14:58, Richard Purdie wrote:
> > On Thu, 2024-09-19 at 08:42 +0100, Richard Purdie via
> > lists.openembedded.org wrote:
> >> On Mon, 2024-08-12 at 17:14 +0200, Alexis Lothor� via
> >> lists.openembedded.org wrote:
> >>> From: Alexis Lothor� <alexis.lothore@bootlin.com>
>
> [...]
>
> >>> --- a/meta/lib/oeqa/utils/postactions.py
> >>> +++ b/meta/lib/oeqa/utils/postactions.py
> >>> @@ -68,7 +68,8 @@ def list_and_fetch_failed_tests_artifacts(d, tc,
> >>> artifacts_list, outputdir):
> >>> �������� (status, output) = tc.target.run(cmd, raw = True)
> >>> �������� if status != 0 or not output:
> >>> ������������ raise Exception("Error while fetching compressed
> >>> artifacts")
> >>> -������� p = subprocess.run(["tar", "zxf", "-", "-C", outputdir],
> >>> input=output)
> >>> +������� with open(archive_name, "wb") as f:
> >>> +����������� f.write(output)
> >>> ���� except Exception as e:
> >>> �������� bb.warn(f"Can not retrieve artifacts from test target:
> >>> {e}")
> >>
> >>
> >> This change is causing failures since archive_name isn't defined
> >> anywhere :/
> >
> > I'd also note that scarthgap actually throws errors:
> >
> > https://valkyrie.yoctoproject.org/#/builders/73/builds/135/steps/12/logs/stdio
> >
> > Exception: NameError: name 'artifact_path' is not defined
> >
> > which is related to some of these patches :/.
>
> I am out of office right now with limited access to computer (I come back next
> week but then I will be traveling to attend Kernel Recipes). If no one fixes it
> before, I'll take a look and send a fix once I return to the office (end of next
> week)
>
Mathieu is going to take care of this tomorrow/beginning of next week.
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-09-19 15:01 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-12 15:14 [PATCH 0/2] oeqa/postactions: save ptests artifacts as archive on host Alexis Lothoré
2024-08-12 15:14 ` [PATCH 1/2] oeqa/postactions: fix exception handling Alexis Lothoré
2024-08-12 15:14 ` [PATCH 2/2] oeqa/postactions: do not uncompress retrieved archive on host Alexis Lothoré
2024-09-19 7:42 ` [OE-core] " Richard Purdie
[not found] ` <17F6955C7A69DDF6.31299@lists.openembedded.org>
2024-09-19 12:58 ` Richard Purdie
2024-09-19 14:29 ` Alexis Lothoré
2024-09-19 15:00 ` Alexandre Belloni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox