Merge lp://staging/~doanac/ubuntu-ci-services-itself/deployment-variables into lp://staging/ubuntu-ci-services-itself

Proposed by Andy Doan
Status: Merged
Approved by: Andy Doan
Approved revision: 252
Merged at revision: 258
Proposed branch: lp://staging/~doanac/ubuntu-ci-services-itself/deployment-variables
Merge into: lp://staging/ubuntu-ci-services-itself
Diff against target: 169 lines (+56/-30)
4 files modified
juju-deployer/deploy.py (+28/-21)
juju-deployer/test_deploy.py (+15/-0)
tests/ppa_assigner/test.py (+12/-8)
tests/run.py (+1/-1)
To merge this branch: bzr merge lp://staging/~doanac/ubuntu-ci-services-itself/deployment-variables
Reviewer Review Type Date Requested Status
Andy Doan (community) Approve
Vincent Ladeuil (community) Approve
Paul Larson Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+207312@code.staging.launchpad.net

Commit message

deploy: make a clear list of required environment variables to user

This change makes a consistent single place to enumerate the
environment variables required for deployment. These should ideally
just be added to novarc files.

NOTE: the CI_OAUTH_* and CI_LAUNCHPAD_USER values don't exist in
novarc by default and must be created manually. Please read:

 https://help.launchpad.net/API/SigningRequests

Description of the change

This helps move us to where we can all deploy unique production-ready environments by just having the proper novarc file in place.

To post a comment you must log in.
Revision history for this message
Andy Doan (doanac) wrote :

note: revno 251 is almost orthogonal to this MP, but was discovered as a result of the changes this MP adds.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

PASSED: Continuous integration, rev:251
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/190/
Executed test runs:

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/uci-engine-ci/190/rebuild

review: Approve (continuous-integration)
Revision history for this message
Paul Larson (pwlars) wrote :

After a bit of beating my head against a silly local configuration problem, this seems to be working well for me. It might be nice to do some kind of tool to generate the oauth stuff, or in the absense of that, some basic steps. It could even be the basic curl commands like:
1. curl --dump-header - -X POST --data 'oauth_consumer_key=airlinetest&oauth_signature_method=PLAINTEXT&oauth_signature=%26' https://launchpad.net/+request-token

2. copy the long string after 'oauth_token=' and go to: https://launchpad.net/+authorize-token?oauth_token={oauth_token} in a browser
https://launchpad.net/+authorize-token?oauth_token={oauth_token}

3. Authorize read/write (no private data) in the web browser

4. Look at the long string above again, pull out the oauth token and oauth secret. Set the following environment vars...

I'm having problems where it looks like bsb doesn't actually use the oauth creds I provided it, but that doesn't appear to be related to this change.

review: Approve
Revision history for this message
Vincent Ladeuil (vila) wrote :

> 3. Authorize read/write (no private data) in the web browser

In https://code.launchpad.net/~vila/ubuntu-ci-services-itself/e2e/+merge/207615, I'm working on a script to automate that. I've just merged this branch and will continue on top of that (so I approve this branch and hope it will land soon ;)

I don't get 'Authorize read/write (no private data)' but 'Change anything': The application will be able to access Launchpad on your behalf for reading and changing anything, including private data.

Not sure why we diverge here but the way this script works is what has been used for lp:udd (and similar to lp:hydrazine).

> I'm having problems where it looks like bsb doesn't actually use the oauth
> creds I provided it, but that doesn't appear to be related to this change.

I'm working on the assumption that the content of the lp_creds.txt file I create in revno 254 of the branch above should:
- be associated to the right env vars
- so these env vars get populated into unit_config generated from configs/unit_config.yaml.tmpl

review: Approve
Revision history for this message
Chris Johnston (cjohnston) wrote :

Attempt to merge into lp:ubuntu-ci-services-itself failed due to conflicts:

text conflict in juju-deployer/deploy.py

Revision history for this message
Andy Doan (doanac) wrote :

merged with trunk to fix conflict in deploy.py's change to swift by default

review: Approve
Revision history for this message
Chris Johnston (cjohnston) wrote :
Download full text (25.4 KiB)

The attempt to merge lp:~doanac/ubuntu-ci-services-itself/deployment-variables into lp:ubuntu-ci-services-itself failed. Below is the output from the failed tests.

New python executable in /tmp/tmp.LtYxB9DPYJ/bin/python
Installing distribute.............................................................................................................................................................................................done.
Installing pip...............done.
== Testing ci-utils ....
Downloading/unpacking python-swiftclient==1.8.0
  Running setup.py egg_info for package python-swiftclient

    Installed /tmp/tmp.LtYxB9DPYJ/build/python-swiftclient/pbr-0.6-py2.7.egg
    [pbr] Processing SOURCES.txt
    warning: LocalManifestMaker: standard file '-c' not found

    warning: no previously-included files found matching '.gitignore'
    warning: no previously-included files found matching '.gitreview'
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no files found matching '*' under directory 'tools'
Downloading/unpacking simplejson>=2.0.9 (from python-swiftclient==1.8.0)
  Running setup.py egg_info for package simplejson

Installing collected packages: python-swiftclient, simplejson
  Running setup.py install for python-swiftclient
    [pbr] Reusing existing SOURCES.txt
    changing mode of build/scripts-2.7/swift from 664 to 775
    changing mode of /tmp/tmp.LtYxB9DPYJ/bin/swift to 775
  Running setup.py install for simplejson
    building 'simplejson._speedups' extension
    gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c simplejson/_speedups.c -o build/temp.linux-x86_64-2.7/simplejson/_speedups.o
    gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro build/temp.linux-x86_64-2.7/simplejson/_speedups.o -o build/lib.linux-x86_64-2.7/simplejson/_speedups.so

Successfully installed python-swiftclient simplejson
Cleaning up...
Downloading/unpacking python-glanceclient==0.12.0
  Running setup.py egg_info for package python-glanceclient

    Installed /tmp/tmp.LtYxB9DPYJ/build/python-glanceclient/pbr-0.6-py2.7.egg
    [pbr] Excluding argparse: Python 2.6 only dependency
    [pbr] Processing SOURCES.txt
    warning: LocalManifestMaker: standard file '-c' not found

    warning: no previously-included files found matching '.gitignore'
    warning: no previously-included files found matching '.gitreview'
    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files found matching '.gitignore'
    warning: no previously-included files found matching '.gitreview'
Downloading/unpacking pbr>=0.5.21,<1.0 (from python-glanceclient==0.12.0)
  Running setup.py egg_info for package pbr
    [pbr] Processing SOURCES.txt
    warning: LocalManifestMaker: standard file '-c' not found

    warning: no previously-included files found matching '.gitignore'
    warning: no previously-included files found matching '.gitreview'
    warning: no previously-included files matching '*.pyc' found anywhere in dist...

Revision history for this message
Francis Ginther (fginther) wrote :

> After a bit of beating my head against a silly local configuration problem,
> this seems to be working well for me. It might be nice to do some kind of
> tool to generate the oauth stuff, or in the absense of that, some basic steps.
> It could even be the basic curl commands like:
> 1. curl --dump-header - -X POST --data 'oauth_consumer_key=airlinetest&oauth_s
> ignature_method=PLAINTEXT&oauth_signature=%26' https://launchpad.net/+request-
> token
>
> 2. copy the long string after 'oauth_token=' and go to: https://launchpad.net
> /+authorize-token?oauth_token={oauth_token} in a browser
> https://launchpad.net/+authorize-token?oauth_token={oauth_token}
>
> 3. Authorize read/write (no private data) in the web browser
>
> 4. Look at the long string above again, pull out the oauth token and oauth
> secret. Set the following environment vars...
>
> I'm having problems where it looks like bsb doesn't actually use the oauth
> creds I provided it, but that doesn't appear to be related to this change.

There are more steps apparently:
5. You need to exhcange the request token for an access token:
curl --dump-header - -H "Content-Type: application/x-www-form-urlencoded" -X POST --data "oauth_signature=%26{oauth_token_secret}&oauth_consumer_key={oauth_key}&oauth_token={oauth_token}&oauth_signature_method=PLAINTEXT" https://launchpad.net/+access-token

This will return a new oauth_token and oauth_token_secret. These are the value that need to be plugged into the environment.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches