Merge lp:~noise/tanuki-agent/just-the-facts into lp:tanuki-agent

Proposed by Bret Barker
Status: Merged
Approved by: Bret Barker
Approved revision: 164
Merged at revision: 164
Proposed branch: lp:~noise/tanuki-agent/just-the-facts
Merge into: lp:tanuki-agent
Diff against target: 256 lines (+29/-119)
1 file modified
docs/api-reference.md (+29/-119)
To merge this branch: bzr merge lp:~noise/tanuki-agent/just-the-facts
Reviewer Review Type Date Requested Status
Guillermo Gonzalez Approve
Review via email: mp+276710@code.launchpad.net

Commit message

remove extras from api ref; clean SPI refs

To post a comment you must log in.
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

lots of red, that's usually good. +1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'docs/api-reference.md'
--- docs/api-reference.md 2015-11-04 14:37:58 +0000
+++ docs/api-reference.md 2015-11-04 21:52:03 +0000
@@ -1,59 +1,14 @@
1Title: Snappy Product Integration API Guide1Title: Ubuntu Core Product Integration API Guide
2Version: 201510302Version: 20151105
33
4[TOC]4[TOC]
55
6System Overview6
7===============7Definitions
88============
9Snappy Product Integration(SPI) is system for
10coordinating integration testing of Snappy-based products
11across a matrix of supported platforms.
12
13
14
15It is important to note that SPI is not a build tool, image
16composer, or unit test runner.
17
18
19
20There are four main actors in SPI:
21
22- Product Owners managing product definitions
23- Developers providing Snaps or Images for test
24
25<!-- -->
26
27- Lab owners managing hardware installations that will consume
28 tests
29- Quality Assurance engineers that will manage tests and
30 evaluate test results
31
32
33
34This separation of concerns is enforced by the design of the SPI
35System and the APIs it provides. Below is a diagram of the
36overall architecture and data flow. The blue boxes form the SPI software
37provided by Canonical. The green boxes represent your organization’s
38different responsibilities. They also represent the middle layer you
39provide for the SPI system to talk to your hardware known as the
40Provisioning Kit.
41
42![](images/image02.png)
43
44SPI Definitions
45---------------
46
47
48
49SPI models product integration testing using the following core
50abstractions:
51
52
539
54- **Manifest**: used to define a Product10- **Manifest**: used to define a Product
55 that is based on Snaps. This is optional for image-based workflows11 that is based on Snaps. This is optional for image-based workflows.
56 as detailed below under [Workflows](#workflows).
57- **Image Reference**: information passed12- **Image Reference**: information passed
58 to the Provisioning Kit to use in setting up a device for testing13 to the Provisioning Kit to use in setting up a device for testing
59 the Product. It is free-form with data of your choosing (e.g. a14 the Product. It is free-form with data of your choosing (e.g. a
@@ -62,61 +17,13 @@
62- **Test Spec**: defines Tests to be run on17- **Test Spec**: defines Tests to be run on
63 matching images18 matching images
64- **Test Opportunity**: an instance of a19- **Test Opportunity**: an instance of a
65 test for a given image that will be delivered to an Agent.20 test for a given image and/or set of snaps that will be delivered to an Agent.
66- **Agent**: SPI client installed in a21- **Agent**: Client software installed on a host computer to run
67 "lab" to coordinate running tests.22 tests against a target device.
68- **Test Result**: metadata23- **Test Result**: metadata about output of a test run.
69 about output of a test run.
70
71
72
73
74
75Workflows
76---------
77
78
79
80There are two primary workflows supported by SPI:
81
82
83
841. Snappy Based Image
852. Custom Image
86
87
88
89In the Snappy scenario, the product owner will first create a
90Product (Manifest) and Test Specs in SPI. The product will point to a
91base image that defines the "released" product and specify the names of
92Snaps that comprise the product. Changes to the named Snaps, represented
93as new uploads to the Snappy Store,  will be automatically advertised to
94the SPI system to trigger tests of the base image with updated Snaps.
95
96
97
98
99As an example, Canonical’s Snappy Core team uses this workflow to
100perform integration, upgrade, and downgrade testing as each new revision
101of the WebDM Snap is uploaded to the Store.
102
103
104
105The Custom Image workflow is simpler and designed to
106help you transition from legacy product image testing to a
107Snappy-generated product while running the same tests in the same manner
108throughout this period. In this scenario, the product owner
109(or developer) can create Test Specs (no Manifest required) and then
110submit Images that match the Test Spec based on image\_name to trigger
111test runs.
112
113API Reference
114=============
11524
116Authentication25Authentication
117--------------26============
118
119
12027
121All API endpoints are authenticated, which ensures private access28All API endpoints are authenticated, which ensures private access
122to your Organization's information.29to your Organization's information.
@@ -129,7 +36,7 @@
129<!-- LINK TO CORRECT PLACE IN TUTORIAL? -->36<!-- LINK TO CORRECT PLACE IN TUTORIAL? -->
13037
131With those credentials, you can use an oauth library in your38With those credentials, you can use an oauth library in your
132language of choice to sign HTTP requests to the SPI API endpoints.39language of choice to sign HTTP requests to the API endpoints.
13340
13441
135We'll walk through an example of that in Python using <span42We'll walk through an example of that in Python using <span
@@ -203,10 +110,10 @@
203login process) into a file called conf.ini. Note, this script is meant only as an example and not110login process) into a file called conf.ini. Note, this script is meant only as an example and not
204intended for production use.111intended for production use.
205112
206API Errors113Errors
207----------114============
208115
209The SPI APIs use standard HTTP response codes. Most errors will116The APIs use standard HTTP response codes. Most errors will
210contain a human-readable "message" field in the JSON response body. Here117contain a human-readable "message" field in the JSON response body. Here
211are the most common error codes and guidelines for handling them.118are the most common error codes and guidelines for handling them.
212119
@@ -230,14 +137,17 @@
230 <p>There was an temporary error on the server. The request may be retried after a short wait. If the problem persists please contact support. Scripts should use an exponential backoff to avoid hammering the servers with retries.137 <p>There was an temporary error on the server. The request may be retried after a short wait. If the problem persists please contact support. Scripts should use an exponential backoff to avoid hammering the servers with retries.
231</table>138</table>
232139
140API Reference
141=============
142
233Product Management143Product Management
234------------------144------------------
235145
236Note: Product Manifests support products built from146Note: Product Manifests support products built from
237Snaps. If you are instead bootstrapping SPI with a pre-existing binary147Snaps. If you are instead bootstrapping Product Integration with a pre-existing binary
238image, please skip ahead to the next section - Test Management.148image, please skip ahead to the next section - Test Management.
239149
240In SPI, a Product is defined by a Manifest that has an image\_name150A Product is defined by a Manifest that has an image\_name
241and either a list of snaps that comprise the image (e.g. as specified in151and either a list of snaps that comprise the image (e.g. as specified in
242a Gadget Snap) or a base\_image\_reference.152a Gadget Snap) or a base\_image\_reference.
243153
@@ -266,7 +176,7 @@
266- ```release``` snappy release series, e.g.176- ```release``` snappy release series, e.g.
267 “15.04”. Maximum length is 200 characters.177 “15.04”. Maximum length is 200 characters.
268- ```base_image_reference``` is opaque to178- ```base_image_reference``` is opaque to
269 the SPI system; it is for your Provisioning Kit in your lab to179 the system; it is for your Provisioning Kit in your lab to
270 interpret and use. It can be any JSON180 interpret and use. It can be any JSON
271 value. This allows for URLs to actual image binaries,181 value. This allows for URLs to actual image binaries,
272 data for on-the-fly image composition, etc. Maximum length is 1000182 data for on-the-fly image composition, etc. Maximum length is 1000
@@ -478,7 +388,7 @@
478Test Management388Test Management
479---------------389---------------
480390
481Tests in SPI are defined with Test Specs. There may be multiple391Tests are defined with Test Specs. There may be multiple
482Test Specs per product and they are related via the image\_name field.392Test Specs per product and they are related via the image\_name field.
483TestSpecs are required for both Image and Snappy based workflows as they393TestSpecs are required for both Image and Snappy based workflows as they
484form the basis for TestOpportunity creation.394form the basis for TestOpportunity creation.
@@ -658,7 +568,7 @@
658### Image Submission568### Image Submission
659569
660Test opportunities are triggered by a new image reference being570Test opportunities are triggered by a new image reference being
661advertised by the user to the SPI system. An Image Reference571advertised by the user to the system. An Image Reference
662has the following required fields:572has the following required fields:
663573
664574
@@ -670,13 +580,13 @@
670 matching image_name, then two test opportunities will be created.580 matching image_name, then two test opportunities will be created.
671 Maximum length is 200 characters.581 Maximum length is 200 characters.
672- ```image_reference```: is opaque to the582- ```image_reference```: is opaque to the
673 SPI system; it is for your Provisioning Kit in your lab583 system; it is for your Provisioning Kit in your lab
674 to interpret and use. It can be any JSON584 to interpret and use. It can be any JSON
675 value. This allows for URLs to actual image binaries,585 value. This allows for URLs to actual image binaries,
676 data for on-the-fly image composition, etc. Maximum length is 1000586 data for on-the-fly image composition, etc. Maximum length is 1000
677 characters.587 characters.
678- ```image_unique_id```: also opaque to the588- ```image_unique_id```: also opaque to the
679 SPI system. It is recommended that this uniquely589 system. It is recommended that this uniquely
680 identifies the advertised version of the image so that the590 identifies the advertised version of the image so that the
681 provisioning script can verify the image\_reference and results can591 provisioning script can verify the image\_reference and results can
682 be queried by image\_unique\_id. For example it could592 be queried by image\_unique\_id. For example it could
@@ -737,10 +647,10 @@
737### Snap Revisions647### Snap Revisions
738648
739Test opportunities may be triggered by snap revisions being649Test opportunities may be triggered by snap revisions being
740advertised to the SPI system.650advertised to the system.
741651
742New snap revisions uploaded to the Store will be automatically652New snap revisions uploaded to the Store will be automatically
743advertised to SPI, however they can be re-advertised manually653advertised to the system, however they can be re-advertised manually
744afterwards, re-triggering tests with their original context.654afterwards, re-triggering tests with their original context.
745655
746The new revision advertised will be matched with all **Manifests** within the context **Organization**656The new revision advertised will be matched with all **Manifests** within the context **Organization**
@@ -782,7 +692,7 @@
782692
783693
784694
785SPI will return a list of test opportunity IDs and image unique IDs that can be used to [query for results](#querying-test-results) later.695Snap revision advertisement will return a list of test opportunity IDs and image unique IDs that can be used to [query for results](#querying-test-results) later.
786696
787<table class="table">697<table class="table">
788<tr>698<tr>
@@ -877,7 +787,7 @@
877<p>Using with_event=EVENT_TYPE will return only logs that contain that event type.787<p>Using with_event=EVENT_TYPE will return only logs that contain that event type.
878For example with_event=RESULT_POSTED returns only logs for tests for which a result has been posted back. Using without_event=EVENT_TYPE will return only logs that do not contain that event type. with_event and without_event cannot be used in the same query.788For example with_event=RESULT_POSTED returns only logs for tests for which a result has been posted back. Using without_event=EVENT_TYPE will return only logs that do not contain that event type. with_event and without_event cannot be used in the same query.
879789
880<p>For example, a large number of results that match without_event=PICKED_BY_AGENT could indicate either an under-resourced lab (all agents are busy) or that the agents have lost communication with the SPI servers. The combination of with_event=PICKED_BY_AGENT and without_event=RESULT_POSTED can be used to track down slow or stuck test runs, and the agent_id fields of the PICKED_BY_AGENT event can be used to identify the problem agent in the lab.790<p>For example, a large number of results that match without_event=PICKED_BY_AGENT could indicate either an under-resourced lab (all agents are busy) or that the agents have lost communication with Canonical's servers. The combination of with_event=PICKED_BY_AGENT and without_event=RESULT_POSTED can be used to track down slow or stuck test runs, and the agent_id fields of the PICKED_BY_AGENT event can be used to identify the problem agent in the lab.
881<tr>791<tr>
882 <td>Response <td><code>200 OK</code> with JSON list of matching progress event log documents792 <td>Response <td><code>200 OK</code> with JSON list of matching progress event log documents
883<tr>793<tr>
884794
=== removed file 'docs/images/image02.png'
885Binary files docs/images/image02.png 2015-11-02 16:58:53 +0000 and docs/images/image02.png 1970-01-01 00:00:00 +0000 differ795Binary files docs/images/image02.png 2015-11-02 16:58:53 +0000 and docs/images/image02.png 1970-01-01 00:00:00 +0000 differ

Subscribers

People subscribed via source and target branches

to all changes: