~noise/tanuki-agent/api-ref-tweaks

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
Snappy Product Integration agent prototype.

Setting Up
==========

Create a virtualenv with required dependencies::

    make bootstrap

Activate the virtualenv::

    . env/bin/activate

Running the App
===============

The application takes a config file. You can see a sample one to start
your own like this::

    ./agent.py --default-config agent.cfg

That example will create ``agent.cfg``, edit as needed, and run the app::

    ./agent.py -v agent.cfg

If you want to get test opportunities from our staging server, set the URL
to http://message-hub.tanuki.staging.ubuntu.com/

Setting Up a Provisioning Kit
=============================

To setup a provisioning kit, please read the spi-user-docs PDF at http://people.canonical.com/~ralsina/

End-to-End Test Script
======================

There are two e2e testing scripts, e2e-snap-rev.py and e2e-image.py, they work similarly
but each tests a different workflow::

  ./scripts/e2e-image.py --default-config > e2e.ini

Edit as necessary for targeting the right environment, then::

  ./scripts/e2e-image.py e2e.ini

License
=======

This software is licensed under the AGPLv3. Please read
LICENSE.txt for details.

Release Notes
=============

November 24 2015
----------------

* From this revision forward, only the new organization-less workflows
  are supported.

October 27 2015
---------------

* The provisioning kit commands in the configuration file should be moved into
  a separate [provkit] section. Currently the agent will warn if they are still
  in the [config] section. For backwards compatibility, the old usage is still
  supported.

October 15 2015
---------------

* Agent will retry network operations 3 times to mitigate transient failures.
* Agent will pass contents of the [environment] section of its configuration to
  the provisioning kit scripts as part of their environment.

September 24 2015
-----------------

* The SPI system now uses a single HTTPS endpoint: https://spi.canonical.com
  All other endpoints have been removed.
* Authentication is now mandatory for all API methods, unless otherwise stated
  in the API documentation.

August 27 2015
--------------

* Agent doesn't provide default organization, configuring it is required
* Removed test credentials from tutorial, configuration is required
* By default, use the API gateway, so authentication is mandatory (can still use
  the alternative old URLs using older versions of the agent for 
  non-auth access until next release)

August 20 2015
--------------

SPI System/API changes:

The SPI system is introducing authentication and organizations.

Authentication is, at this point, only used by the agent (see below), and is not
mandatory for this cycle. In the next cycle authentication for the agent will become
mandatory.

Please start setting up accounts, and talk with your SPI contact to create your organization
and to connect your accounts to it.

Agent changes:

* The agent now supports authenticating using U1 accounts.
* To authenticate, use ./agent.py --interactive-login (more details in the documentation)
* Agent retries posting results to mitigate transient network failures

August 7 2015
-------------

SPI System/API changes:

* Production is LIVE! New endpoints can be discovered with the ./agent.py --default-config and in the User Documentation.
* organization_id is no longer required in POST payloads (in the URL path now)
* manifest.base_image_reference, image.image_reference, test_spec.test_payload all allow arbitrary JSON values now.
* New Result Query APIs, see the User Documentation for details.
* Docs: the System Overview section has been extended to provide more information before having to delve into the API details.
* [BUG] Docs: fixed a number of incorrect examples.
* [BUG] Docs: clarified when Manifests are required/optional

Agent changes:

* [BUG] Provisioning kit scripts were not properly invoked with the spi_test_opportunity.json parameter
* New ./scripts/tutorial.py getting-started script
* Requires a config file to be specified now.
* Pass environment variables to provisioning kit

July 31st 2015
--------------

New e2e test scripts, old e2e.py is now e2e-image.py, new e2e-snap-rev.py tests
the "announce a snap revision" workflow.

July 21st 2015:
---------------

This version changes the names of two fields in the test opportunity data:

* image_url becomes image_reference
* image_hash becomes image_unique_id