Fix SDK downloads for builds
v2 cover Fix SDK downloads for builds
V2:
Rebased on toaster-next and fixed conflicts.
V1:
Artifacts could not be downloaded for a build as they were not being listed. It was not possible to download them manually either, as the artifact download code was broken for SDK artifacts produced by command line builds.
Fix how toaster.bbclass hooks onto bitbake's build tasks, so that the SDK artifacts are picked up after do_populate_sdk runs.
Fix Toaster code for returning SDK artifacts in HTTP responses.
Changes since b53df3c (toaster-next) are ingit://git.yoctoproject.org/poky-contrib, elliot/toaster/sdk_artifacts-7603
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=elliot/toaster/sdk_artifacts-7603
NB one of the commits on this branch (fbc2024) has been submitted to oe-core:
http://lists.openembedded.org/pipermail/openembedded-core/2016-January/115366.html
This patch set contains the other commits on the branch.
Related bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7603
To test:
1. Ensure that your database has no build artifacts in it, either by removing the database, clearing the relevant table with SQL via the command line (delete from orm_buildartifact), or removing the objects via the Django shell (orm.models.BuildArtifact.objects.all().delete()).
Note that the current behaviour, where we only associate SDK artifacts with the first build which produces them, has not been modified. So if you have already run a build and have files in tmp/deploy/sdk associated with it, subsequent builds will not be associated with those files.
2. Start a new build from the command line or Toaster, invoking the populate_sdk target:
# command line bitbake -c populate_sdk core-image-minimal
# Toaster (NB you must use the "Local" release) run a build like "core-image-minimal:populate_sdk"
3. View the build dashboard for the build when it completes and ensure it contains an "Other artifacts" section, as shown in the bug report.
4. Click on one of the "Other artifact" links and ensure that the artifact downloads correctly.
As this code slightly modifies all other artifact downloads, you could also check downloads for the following, too:
* cooker logs
* task logs
* image files
* licence manifests
Elliot Smith (3):
toaster: toasterui: listen for bb.event.MetadataEvent
toaster: toasterui: log OSErrorException metadata events
toaster: toastergui: make artifact download more robust
bitbake/lib/bb/ui/toasterui.py | 5 +- .../toastergui/templates/unavailable_artifact.html | 13 ++- bitbake/lib/toaster/toastergui/views.py | 97 +++++++++------------- 3 files changed, 51 insertions(+), 64 deletions(-)
--
Elliot Smith
Software Engineer
Intel OTC
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
PATCH v2 1/3 toaster: toasterui: listen for bb.event.MetadataEvent
The event mask for toasterui doesn't include MetadataEvents. This means that we're missing the ArtifactFileSize event (among others), which is the one we use to populate the SDK artifact table.
Add that event type to the toasterui event mask so we can record SDK artifacts as they are created.
[YOCTO #7603]
--- bitbake/lib/bb/ui/toasterui.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
bitbake/lib/bb/ui/toasterui.py +2 -1
@@ -99,7 +99,8 @@ _evt_list = [ "bb.runqueue.runQueueExitWait", "bb.event.LogExecTTY", "logging.Lo "bb.command.CommandExit", "bb.command.CommandCompleted", "bb.cooker.CookerExit", "bb.event.MultipleProviders", "bb.event.NoProvider", "bb.runqueue.sceneQueueTaskStarted", "bb.runqueue.runQueueTaskStarted", "bb.runqueue.runQueueTaskFailed", "bb.runqueue.sceneQueueTaskFailed", - "bb.event.BuildBase", "bb.build.TaskStarted", "bb.build.TaskSucceeded", "bb.build.TaskFailedSilent"] + "bb.event.BuildBase", "bb.build.TaskStarted", "bb.build.TaskSucceeded", "bb.build.TaskFailedSilent", + "bb.event.MetadataEvent"] def main(server, eventHandler, params): # set to a logging.FileHandler instance when a build starts;
Signature · 14 lines
Elliot Smith Software Engineer Intel OTC --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
PATCH v2 2/3 toaster: toasterui: log OSErrorException metadata events
In reply to Elliot SmithOSErrors occurring in toaster.bbclass are converted to OSErrorException metadata events. They were then being swallowed as unprocessed events by toasterui, which made them difficult to spot.
Explicitly catch OSErrorException events and log them so they are easier to spot and debug.
--- bitbake/lib/bb/ui/toasterui.py | 2 ++ 1 file changed, 2 insertions(+)
bitbake/lib/bb/ui/toasterui.py +2 -0
@@ -366,6 +366,8 @@ def main(server, eventHandler, params): buildinfohelper.store_license_manifest_path(event) elif event.type == "SetBRBE": buildinfohelper.brbe = buildinfohelper._get_data_from_event(event) + elif event.type == "OSErrorException": + logger.error(event) else: logger.error("Unprocessed MetadataEvent %s ", str(event)) continue
Signature · 14 lines
Elliot Smith Software Engineer Intel OTC --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
PATCH v2 3/3 toaster: toastergui: make artifact download more robust
In reply to Elliot SmithWhen an artifact download is requested, Toaster goes through a convoluted series of conditions to decide which file to push to the response. In the case of build artifact downloads for command line builds, this caused an ugly exception, as command line builds don't have a build request.
To simplify and catch more corner cases, remove the code which fetches files via the build environment (we only support the local build environment anyway). Then push all requests along a single path, catching any missing file errors, missing object errors or poorly-formed URLs in a single except clause which always returns a valid response.
Also modify the text on the "unavailable artifact" page so it says that the artifact doesn't exist, rather than it "no longer" exists (exceptions may occur because an invalid artifact was requested, rather than an artifact which was removed).
[YOCTO #7603]
--- .../toastergui/templates/unavailable_artifact.html | 13 ++- bitbake/lib/toaster/toastergui/views.py | 97 +++++++++------------- 2 files changed, 47 insertions(+), 63 deletions(-)
bitbake/lib/toaster/toastergui/templates/unavailable_artifact.html +6 -7
@@ -3,15 +3,14 @@ {% load humanize %} {% load static %} -{% block title %} Build artifact no longer exists - Toaster {% endblock %} +{% block title %} Build artifact does not exist - Toaster {% endblock %} {% block pagecontent %} - -<div class="row-fluid air"> - <div class="alert alert-info span8 lead"> - <p"> The build artifact you are trying to download no longer exists.</p> - <p><a href="javascript:window.history.back()">Back to previous page</a></p> + <div class="row-fluid air"> + <div class="alert alert-info span8 lead"> + <p>The build artifact you are trying to download does not exist.</p> + <p><a href="javascript:window.history.back()">Back to previous page</a></p> + </div> </div> -</div> {% endblock %}
bitbake/lib/toaster/toastergui/views.py +41 -56
126 lines not on this page · raw message
Signature · 14 lines
Elliot Smith Software Engineer Intel OTC --------------------------------------------------------------------- Intel Corporation (UK) Limited Registered No. 1134945 (England) Registered Office: Pipers Way, Swindon SN3 1RJ VAT No: 860 2173 47 This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Quoted 3 lines · On 15/01/2016 16:30, "[email protected] on behalf of Elliot…
V2:
Rebased on toaster-next and fixed conflicts.
Hi Elliot,
Somehow this is not working for me. I built an sdk for core-image-minimal from Toaster on a clean build directory, but I cannot see the sdk artifacts shown in the build dashboard, although they are in /build/tmp/deploy/sdk. I've attached a screenshot of what I see.
Am I doing something wrong?
Thanks!
Belén
Quoted 101 lines
V1:
Artifacts could not be downloaded for a build as they were not being listed.
It was not possible to download them manually either, as the artifact download
code was broken for SDK artifacts produced by command line builds.Fix how toaster.bbclass hooks onto bitbake's build tasks, so that the SDK artifacts are picked up after
do_populate_sdkruns.Fix Toaster code for returning SDK artifacts in HTTP responses.
Changes since b53df3c (toaster-next) are in
git://git.yoctoproject.org/poky-contrib, elliot/toaster/sdk_artifacts-7603
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=elliot/toaster/sd
k_artifacts-7603NB one of the commits on this branch (fbc2024) has been submitted to oe-core:
http://lists.openembedded.org/pipermail/openembedded-core/2016-January/115
366.html
This patch set contains the other commits on the branch.Related bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7603
To test:
1. Ensure that your database has no build artifacts in it, either by removing the database, clearing the relevant table with SQL via the command line
(delete fromorm_buildartifact), or removing the objects via the Django shell
(orm.models.BuildArtifact.objects.all().delete()).Note that the current behaviour, where we only associate SDK artifacts with the
first build which produces them, has not been modified. So if you have already
run a build and have files in tmp/deploy/sdk associated with it, subsequent
builds will not be associated with those files.2. Start a new build from the command line or Toaster, invoking the
populate_sdk
target:# command line bitbake -c populate_sdk core-image-minimal# Toaster (NB you must use the "Local" release) run a build like "core-image-minimal:populate_sdk"
3. View the build dashboard for the build when it completes and ensure it contains an "Other artifacts" section, as shown in the bug report.
4. Click on one of the "Other artifact" links and ensure that the artifact downloads correctly.
As this code slightly modifies all other artifact downloads, you could also
check downloads for the following, too:* cooker logs
* task logs
* image files
* licence manifestsElliot Smith (3):
toaster: toasterui: listen for bb.event.MetadataEvent
toaster: toasterui: log OSErrorException metadata events
toaster: toastergui: make artifact download more robustbitbake/lib/bb/ui/toasterui.py | 5 +- .../toastergui/templates/unavailable_artifact.html | 13 ++- bitbake/lib/toaster/toastergui/views.py | 97 +++++++++------------- 3 files changed, 51 insertions(+), 64 deletions(-)--
Elliot Smith
Software Engineer
Intel OTC---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Signature · 4 lines
_______________________________________________ toaster mailing list [email protected] https://lists.yoctoproject.org/listinfo/toaster
On 16 January 2016 at 12:23, Barros Pena, Belen <[email protected]
Quoted 9 lines
wrote:
Quoted 2 lines · On 15/01/2016 16:30, "[email protected] on behalf of Elliot…
V2:
Quoted 9 lines
Quoted 1 line
Rebased on toaster-next and fixed conflicts.
Hi Elliot,
Somehow this is not working for me. I built an sdk for core-image-minimal from Toaster on a clean build directory, but I cannot see the sdk artifacts shown in the build dashboard, although they are in /build/tmp/deploy/sdk. I've attached a screenshot of what I see.
I don't think I mentioned it in my review request, but you must build against the *local* release, otherwise the changes to bitbake (in meta/classes/toaster.bbclass) won't be active.
Elliot
Quoted 114 lines
Am I doing something wrong?
Thanks!
Belén
Quoted 9 lines
V1:
Artifacts could not be downloaded for a build as they were not being listed.
It was not possible to download them manually either, as the artifact download
code was broken for SDK artifacts produced by command line builds.Quoted 7 lines
Fix how toaster.bbclass hooks onto bitbake's build tasks, so that the SDK artifacts are picked up after
do_populate_sdkruns.Fix Toaster code for returning SDK artifacts in HTTP responses.
Changes since b53df3c (toaster-next) are in
git://git.yoctoproject.org/poky-contrib,elliot/toaster/sdk_artifacts-7603
Quoted 1 line
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=elliot/toaster/sd
Quoted 5 lines
k_artifacts-7603
NB one of the commits on this branch (fbc2024) has been submitted to oe-core:
http://lists.openembedded.org/pipermail/openembedded-core/2016-January/115
Quoted 79 lines
366.html
This patch set contains the other commits on the branch.Related bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=7603
To test:
1. Ensure that your database has no build artifacts in it, either by removing the database, clearing the relevant table with SQL via the command line
(delete fromorm_buildartifact), or removing the objects via the Django shell
(orm.models.BuildArtifact.objects.all().delete()).Note that the current behaviour, where we only associate SDK artifacts with the
first build which produces them, has not been modified. So if you have already
run a build and have files in tmp/deploy/sdk associated with it, subsequent
builds will not be associated with those files.2. Start a new build from the command line or Toaster, invoking the
populate_sdk
target:# command line bitbake -c populate_sdk core-image-minimal# Toaster (NB you must use the "Local" release) run a build like "core-image-minimal:populate_sdk"
3. View the build dashboard for the build when it completes and ensure it contains an "Other artifacts" section, as shown in the bug report.
4. Click on one of the "Other artifact" links and ensure that the artifact downloads correctly.
As this code slightly modifies all other artifact downloads, you could also
check downloads for the following, too:* cooker logs
* task logs
* image files
* licence manifestsElliot Smith (3):
toaster: toasterui: listen for bb.event.MetadataEvent
toaster: toasterui: log OSErrorException metadata events
toaster: toastergui: make artifact download more robustbitbake/lib/bb/ui/toasterui.py | 5 +- .../toastergui/templates/unavailable_artifact.html | 13 ++- bitbake/lib/toaster/toastergui/views.py | 97 +++++++++------------- 3 files changed, 51 insertions(+), 64 deletions(-)--
Elliot Smith
Software Engineer
Intel OTC---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toaster
Signature · 3 lines
Elliot Smith Software Engineer Intel Open Source Technology Centre
Quoted 22 lines · Elliot
On 16 January 2016 at 12:23, Barros Pena, Belen
<[email protected]> wrote:Quoted 3 lines · On 15/01/2016 16:30, "[email protected] on behalf of Elliot…
V2:
Rebased on toaster-next and fixed conflicts.
Hi Elliot,
Somehow this is not working for me. I built an sdk for core-image-minimal from Toaster on a clean build directory, but I cannot see the sdk artifacts shown in the build dashboard, although they are in /build/tmp/deploy/sdk. I've attached a screenshot of what I see.
Quoted 3 lines
I don't think I mentioned it in my review request, but you must build against the local release, otherwise the changes to bitbake (in meta/classes/toaster.bbclass) won't be active.
Right, that was the problem. If I build with the local release I can see the sdk artifacts listed.
Thanks!
Belén
Quoted 141 lines
Elliot
Am I doing something wrong?
Thanks!
Belén
Quoted 22 lines
V1:
Artifacts could not be downloaded for a build as they were not being listed.
It was not possible to download them manually either, as the artifact download
code was broken for SDK artifacts produced by command line builds.Fix how toaster.bbclass hooks onto bitbake's build tasks, so that the SDK artifacts are picked up after
do_populate_sdkruns.Fix Toaster code for returning SDK artifacts in HTTP responses.
Changes since b53df3c (toaster-next) are in
git://git.yoctoproject.org/poky-contrib
<http://git.yoctoproject.org/poky-contrib>,
elliot/toaster/sdk_artifacts-7603
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=elliot/toaster/s
d
k_artifacts-7603Quoted 8 lines
NB one of the commits on this branch (fbc2024) has been submitted to oe-core:
http://lists.openembedded.org/pipermail/openembedded-core/2016-January/11
5
366.html
This patch set contains the other commits on the branch.Related bug:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=7603
<https://bugzilla.yoctoproject.org/show_bug.cgi?id=7603>Quoted 78 lines
To test:
1. Ensure that your database has no build artifacts in it, either by removing the database, clearing the relevant table with SQL via the command line
(delete fromorm_buildartifact), or removing the objects via the Django shell
(orm.models.BuildArtifact.objects.all().delete()).Note that the current behaviour, where we only associate SDK artifacts with the
first build which produces them, has not been modified. So if you have already
run a build and have files in tmp/deploy/sdk associated with it, subsequent
builds will not be associated with those files.2. Start a new build from the command line or Toaster, invoking the
populate_sdk
target:# command line bitbake -c populate_sdk core-image-minimal# Toaster (NB you must use the "Local" release) run a build like "core-image-minimal:populate_sdk"
3. View the build dashboard for the build when it completes and ensure it contains an "Other artifacts" section, as shown in the bug report.
4. Click on one of the "Other artifact" links and ensure that the artifact
downloads correctly.As this code slightly modifies all other artifact downloads, you could also
check downloads for the following, too:* cooker logs
* task logs
* image files
* licence manifestsElliot Smith (3):
toaster: toasterui: listen for bb.event.MetadataEvent
toaster: toasterui: log OSErrorException metadata events
toaster: toastergui: make artifact download more robustbitbake/lib/bb/ui/toasterui.py | 5 +- .../toastergui/templates/unavailable_artifact.html | 13 ++- bitbake/lib/toaster/toastergui/views.py | 97 +++++++++------------- 3 files changed, 51 insertions(+), 64 deletions(-)--
Elliot Smith
Software Engineer
Intel OTC---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toasterSignature · 3 lines
Elliot Smith Software Engineer Intel Open Source Technology Centre
Hi,
I've sent this patchset upstream & updated toaster-next.
Quoted 185 lines · Belen
Quoted 22 lines · Elliot
On 16 January 2016 at 12:23, Barros Pena, Belen
<[email protected]> wrote:Quoted 3 lines · On 15/01/2016 16:30, "[email protected] on behalf of Elliot…
V2:
Rebased on toaster-next and fixed conflicts.
Hi Elliot,
Somehow this is not working for me. I built an sdk for core-image-minimal from Toaster on a clean build directory, but I cannot see the sdk artifacts shown in the build dashboard, although they are in /build/tmp/deploy/sdk. I've attached a screenshot of what I see.
Quoted 3 lines
I don't think I mentioned it in my review request, but you must build against the local release, otherwise the changes to bitbake (in meta/classes/toaster.bbclass) won't be active.
Right, that was the problem. If I build with the local release I can see the sdk artifacts listed.
Thanks!
Belén
Quoted 141 lines
Elliot
Am I doing something wrong?
Thanks!
Belén
Quoted 22 lines
V1:
Artifacts could not be downloaded for a build as they were not being listed.
It was not possible to download them manually either, as the artifact download
code was broken for SDK artifacts produced by command line builds.Fix how toaster.bbclass hooks onto bitbake's build tasks, so that the SDK artifacts are picked up after
do_populate_sdkruns.Fix Toaster code for returning SDK artifacts in HTTP responses.
Changes since b53df3c (toaster-next) are in
git://git.yoctoproject.org/poky-contrib
<http://git.yoctoproject.org/poky-contrib>,
elliot/toaster/sdk_artifacts-7603
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=elliot/toaster/s
d
k_artifacts-7603Quoted 8 lines
NB one of the commits on this branch (fbc2024) has been submitted to oe-core:
http://lists.openembedded.org/pipermail/openembedded-core/2016-January/11
5
366.html
This patch set contains the other commits on the branch.Related bug:
https://bugzilla.yoctoproject.org/show_bug.cgi?id=7603
<https://bugzilla.yoctoproject.org/show_bug.cgi?id=7603>Quoted 78 lines
To test:
1. Ensure that your database has no build artifacts in it, either by removing the database, clearing the relevant table with SQL via the command line
(delete fromorm_buildartifact), or removing the objects via the Django shell
(orm.models.BuildArtifact.objects.all().delete()).Note that the current behaviour, where we only associate SDK artifacts with the
first build which produces them, has not been modified. So if you have already
run a build and have files in tmp/deploy/sdk associated with it, subsequent
builds will not be associated with those files.2. Start a new build from the command line or Toaster, invoking the
populate_sdk
target:# command line bitbake -c populate_sdk core-image-minimal# Toaster (NB you must use the "Local" release) run a build like "core-image-minimal:populate_sdk"
3. View the build dashboard for the build when it completes and ensure it contains an "Other artifacts" section, as shown in the bug report.
4. Click on one of the "Other artifact" links and ensure that the artifact
downloads correctly.As this code slightly modifies all other artifact downloads, you could also
check downloads for the following, too:* cooker logs
* task logs
* image files
* licence manifestsElliot Smith (3):
toaster: toasterui: listen for bb.event.MetadataEvent
toaster: toasterui: log OSErrorException metadata events
toaster: toastergui: make artifact download more robustbitbake/lib/bb/ui/toasterui.py | 5 +- .../toastergui/templates/unavailable_artifact.html | 13 ++- bitbake/lib/toaster/toastergui/views.py | 97 +++++++++------------- 3 files changed, 51 insertions(+), 64 deletions(-)--
Elliot Smith
Software Engineer
Intel OTC---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
--
_______________________________________________
toaster mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/toasterSignature · 3 lines
Elliot Smith Software Engineer Intel Open Source Technology CentreSignature · 4 lines
_______________________________________________ toaster mailing list [email protected] https://lists.yoctoproject.org/listinfo/toaster
Signature · 3 lines
-- Regards, Ed