Merge lp:~cgregan/checkbox/hybrid-graphics-screenshot into lp:checkbox

Proposed by Chris Gregan
Status: Merged
Approved by: Daniel Manrique
Approved revision: 3595
Merged at revision: 3596
Proposed branch: lp:~cgregan/checkbox/hybrid-graphics-screenshot
Merge into: lp:checkbox
Diff against target: 34 lines (+27/-0)
1 file modified
providers/plainbox-provider-checkbox/jobs/graphics.txt.in (+27/-0)
To merge this branch: bzr merge lp:~cgregan/checkbox/hybrid-graphics-screenshot
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Zygmunt Krynicki (community) Needs Fixing
Review via email: mp+250945@code.launchpad.net

Description of the change

Creation of 2 new jobs in Graphics:
graphics/generator_screen-capture-internal
graphics/generator_screen-capture-internal.png

To post a comment you must log in.
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Please don't change permissions of existing files.

review: Needs Fixing
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I wonder if we could use templates for that job as well.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Looking at the output of that script, I think we can use templates for this job.

PATH=./providers/plainbox-provider-resource-generic/bin:$PATH ./providers/plainbox-provider-resource-generic/bin/graphics_card_resource
bus: pci
category: VIDEO
driver: i915
index: 1
path: /devices/pci0000:00/0000:00:02.0
product: 3rd Gen Core processor Graphics Controller
product_id: 358
subproduct_id: 14711
subvendor_id: 6058
vendor: Intel Corporation
vendor_id: 32902

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I see three units: the resource job that runs graphics_card_resource, the template that does the screenshot and the template that attaches it. (untested). This also fixes a few issues present in the original jobs (bad references between jobs, duplicate keys, etc.

unit: job
id: graphics_card_resource
plugin: resource
command: graphics_card_resource

unit: template
template-unit: job
template-resource: graphics_card_resource
plugin: shell
id: graphics/{index}_screen-capture-internal_{product}
_summary: Obtains a simple screen capture of {product}
estimated_duration: 1.0
requires: package.name == 'gnome-screenshot'
command: gnome-screenshot --file ${PLAINBOX_SESSION_SHARE}/screen-capture-{index}.png
_description: Obtains a simple screen capture of {product} using gnome-screenshot if present

unit: template
template-unit: job
template-resource: graphics_card_resource
plugin: attachment
id: graphics/${index}_screen-capture-internal_{product}
depends: graphics/${index}_screen-capture-internal_{product}
_summary: Attaches a simple screen capture of {product}
estimated_duration: 1.0
command: [ -f ${PLAINBOX_SESSION_SHARE}/screen-capture-{index}.png ] && base64 ${PLAINBOX_SESSION_SHARE}/screen-capture-{index}.png
_description: Attaches the simple screen capture file of {product}

Revision history for this message
Daniel Manrique (roadmr) wrote :

woot, are template units now ready to be used? yay

3591. By Chris Gregan

Updated the new hybrid graphics jobs to use templates

Revision history for this message
Daniel Manrique (roadmr) wrote :

This looks OK, however it fails:

$ plainbox run -i 2013.com.canonical.certification::graphics_card_resource -i 2013.com.canonical.certification::graphics/1_screen.*
ERROR plainbox.ctrl: Ignoring invalid instantiated unit Obtains a simple screen capture of Haswell-ULT Integrated Graphics Controller: Problem with field command: wrong
ERROR plainbox.ctrl: Ignoring invalid instantiated unit Attaches a simple screen capture of Haswell-ULT Integrated Graphics Controller: Problem with field command: wrong
Outcome: job passed
==================================[ Results ]===================================
 ☑ : graphics_card_resource

The reason is that the command mentions ${PLAINBOX_SESSION_SHARE}, and I suspect plainbox is erroneously trying to interpolate {PLAINBOX_SESSION_SHARE} as if it came from the resource; since the resource doesn't provide this, substitution obviously fails.

I tested the theory by replacing the variable syntax to just $PLAINBOX_SESSION_SHARE and it worked.

I filed https://bugs.launchpad.net/plainbox/+bug/1425707, but in the meanwhile the suggested workaround is to fix $PLAINBOX_SESSION_SHARE as mentioned above. I'll set to Needs Fixing since, as is, it doesn't work (though it's because of the plainbox bug).

review: Needs Fixing
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Yes, that is correct. In templates to type { use {{ and ditto for }.

Thanks for catching this!

On Wed, Feb 25, 2015 at 10:38 PM, Daniel Manrique
<email address hidden> wrote:
> Review: Needs Fixing
>
> This looks OK, however it fails:
>
> $ plainbox run -i 2013.com.canonical.certification::graphics_card_resource -i 2013.com.canonical.certification::graphics/1_screen.*
> ERROR plainbox.ctrl: Ignoring invalid instantiated unit Obtains a simple screen capture of Haswell-ULT Integrated Graphics Controller: Problem with field command: wrong
> ERROR plainbox.ctrl: Ignoring invalid instantiated unit Attaches a simple screen capture of Haswell-ULT Integrated Graphics Controller: Problem with field command: wrong
> Outcome: job passed
> ==================================[ Results ]===================================
> ☑ : graphics_card_resource
>
>
> The reason is that the command mentions ${PLAINBOX_SESSION_SHARE}, and I suspect plainbox is erroneously trying to interpolate {PLAINBOX_SESSION_SHARE} as if it came from the resource; since the resource doesn't provide this, substitution obviously fails.
>
> I tested the theory by replacing the variable syntax to just $PLAINBOX_SESSION_SHARE and it worked.
>
> I filed https://bugs.launchpad.net/plainbox/+bug/1425707, but in the meanwhile the suggested workaround is to fix $PLAINBOX_SESSION_SHARE as mentioned above. I'll set to Needs Fixing since, as is, it doesn't work (though it's because of the plainbox bug).
>
> --
> https://code.launchpad.net/~cgregan/checkbox/hybrid-graphics-screenshot/+merge/250945
> You are reviewing the proposed merge of lp:~cgregan/checkbox/hybrid-graphics-screenshot into lp:checkbox.

3592. By Chris Gregan

updated $PLAINBOX_SESSION_SHARE

3593. By Chris Gregan

Removing eroneous $ from depends and id lines

Revision history for this message
Daniel Manrique (roadmr) wrote :

OK, two more things.

The id for the attachment job is still weird, as it's identical to the screenshot job. I suspect the screenshot needs a .png at the end of the id.

Also, this won't work yet due to bug 1425722 which I discovered while testing this. A fix for that is proposed:

https://code.launchpad.net/~roadmr/checkbox/1425722-graphics-card-resource/+merge/251016

I'll mark this merge as depending on that one, but don't forget to commit the id fix :)

review: Needs Fixing
Revision history for this message
Daniel Manrique (roadmr) wrote :

oops, actually I can't add a prerequisite branch :( so let's just hold this until the bug fix is merged.

Revision history for this message
Daniel Manrique (roadmr) wrote :

Hi Chris,

Zygmunt ended up doing a different fix, so the only change needed here is to quote the job name in the dependency, because {product} can contain spaces. See inline comment in the affected line.

Once that's done, we should be OK to merge.

review: Needs Fixing
3594. By Chris Gregan

updated the depends call

Revision history for this message
Chris Gregan (cgregan) wrote :

Done.

Revision history for this message
Daniel Manrique (roadmr) wrote :

Oh,sorry! one *final* change needed (I tested it locally and it's the only missing bit). see below...

review: Needs Fixing
Revision history for this message
Daniel Manrique (roadmr) wrote :

Sorry, here's the required change.

Revision history for this message
Chris Gregan (cgregan) wrote :

Ah..I wondered when I committed, but then skipped because I was not sure if
it applied to id and depends or just depends

On Thu, Feb 26, 2015 at 3:06 PM, Daniel Manrique <
<email address hidden>> wrote:

> Sorry, here's the required change.
>
> Diff comments:
>
> > === modified file 'providers/plainbox-provider-checkbox/jobs/
> graphics.txt.in'
> > --- providers/plainbox-provider-checkbox/jobs/graphics.txt.in
> 2015-02-03 11:05:57 +0000
> > +++ providers/plainbox-provider-checkbox/jobs/graphics.txt.in
> 2015-02-26 19:08:18 +0000
> > @@ -550,3 +550,30 @@
> > _description: Attaches the simple screen capture file
> >
> >
> > +unit: job
> > +id: graphics_card_resource
> > +plugin: resource
> > +command: graphics_card_resource
> > +
> > +unit: template
> > +template-unit: job
> > +template-resource: graphics_card_resource
> > +plugin: shell
> > +id: graphics/{index}_screen-capture-internal_{product}
> > +_summary: Obtains a simple screen capture of {product}
> > +estimated_duration: 1.0
> > +requires: package.name == 'gnome-screenshot'
> > +command: gnome-screenshot --file
> $PLAINBOX_SESSION_SHARE/screen-capture-{index}.png
> > +_description: Obtains a simple screen capture of {product} using
> gnome-screenshot if present
> > +
> > +unit: template
> > +template-unit: job
> > +template-resource: graphics_card_resource
> > +plugin: attachment
> > +id: graphics/{index}_screen-capture-internal_{product}
>
> The ID is the same as the above job. CHange to:
>
> id: graphics/{index}_screen-capture-internal_{product}.png
>
> > +depends: "graphics/{index}_screen-capture-internal_{product}"
> > +_summary: Attaches a simple screen capture of {product}
> > +estimated_duration: 1.0
> > +command: [ -f $PLAINBOX_SESSION_SHARE/screen-capture-{index}.png ] &&
> base64 $PLAINBOX_SESSION_SHARE/screen-capture-{index}.png
> > +_description: Attaches the simple screen capture file of {product}
> > +
> >
>
>
> --
>
> https://code.launchpad.net/~cgregan/checkbox/hybrid-graphics-screenshot/+merge/250945
> You are the owner of lp:~cgregan/checkbox/hybrid-graphics-screenshot.
>

--
Chris Gregan
Project Manager
Professional and Engineering Services
Canonical USA Inc.
<email address hidden>
cgregan[irc.freenode.net]
W-781-761-9448

----
1024/8806032D
E70F 7391 6C78 9B9E 6461 1CC7 B168 E1E7 8806 032D

3595. By Chris Gregan

typo for id of attachment

Revision history for this message
Daniel Manrique (roadmr) wrote :

Thanks, let's merge this!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'providers/plainbox-provider-checkbox/jobs/graphics.txt.in'
2--- providers/plainbox-provider-checkbox/jobs/graphics.txt.in 2015-02-03 11:05:57 +0000
3+++ providers/plainbox-provider-checkbox/jobs/graphics.txt.in 2015-02-26 20:21:18 +0000
4@@ -550,3 +550,30 @@
5 _description: Attaches the simple screen capture file
6
7
8+unit: job
9+id: graphics_card_resource
10+plugin: resource
11+command: graphics_card_resource
12+
13+unit: template
14+template-unit: job
15+template-resource: graphics_card_resource
16+plugin: shell
17+id: "graphics/{index}_screen-capture-internal_{product}"
18+_summary: Obtains a simple screen capture of {product}
19+estimated_duration: 1.0
20+requires: package.name == 'gnome-screenshot'
21+command: gnome-screenshot --file $PLAINBOX_SESSION_SHARE/screen-capture-{index}.png
22+_description: Obtains a simple screen capture of {product} using gnome-screenshot if present
23+
24+unit: template
25+template-unit: job
26+template-resource: graphics_card_resource
27+plugin: attachment
28+id: graphics/{index}_screen-capture-internal_{product}.png
29+depends: "graphics/{index}_screen-capture-internal_{product}"
30+_summary: Attaches a simple screen capture of {product}
31+estimated_duration: 1.0
32+command: [ -f $PLAINBOX_SESSION_SHARE/screen-capture-{index}.png ] && base64 $PLAINBOX_SESSION_SHARE/screen-capture-{index}.png
33+_description: Attaches the simple screen capture file of {product}
34+

Subscribers

People subscribed via source and target branches