Merge lp:~caio1982/capomastro/kthxbye-deploy into lp:~ubuntuone-hackers/capomastro/deploy

Proposed by Caio Begotti on 2015-02-06
Status: Merged
Approved by: Daniel Manrique on 2015-02-06
Approved revision: 45
Merged at revision: 43
Proposed branch: lp:~caio1982/capomastro/kthxbye-deploy
Merge into: lp:~ubuntuone-hackers/capomastro/deploy
Diff against target: 177 lines (+1/-162)
3 files modified
README (+1/-0)
README.md (+0/-108)
mojo.sh (+0/-54)
To merge this branch: bzr merge lp:~caio1982/capomastro/kthxbye-deploy
Reviewer Review Type Date Requested Status
Daniel Manrique 2015-02-06 Approve on 2015-02-06
Review via email: mp+248839@code.launchpad.net

Description of the change

The old deploy branch of Capomastro is no longer useful but people might still refer to it (either because it was a known URL or because they would expect deployment instructions to be under the project tree) so this change keeps a brief note pointing people to the right place.

To post a comment you must log in.
Daniel Manrique (roadmr) wrote :

+1, less confusion.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'README'
2--- README 1970-01-01 00:00:00 +0000
3+++ README 2015-02-06 00:43:30 +0000
4@@ -0,0 +1,1 @@
5+This branch has been abandoned, please see lp:canonical-mojo-specs instead. Or possibly lp:~canonical-is/canonical-mojo-specs/mojo-pes-capomastro for non-merged spec changes.
6
7=== removed file 'README.md'
8--- README.md 2015-01-12 11:34:00 +0000
9+++ README.md 1970-01-01 00:00:00 +0000
10@@ -1,108 +0,0 @@
11-Deploying Capomastro
12-====================
13-
14-Requirements
15-------------
16-
17- * Launchpad:
18- * Access to the spec code at lp:~canonical-is/canonical-mojo-specs/mojo-pes-capomastro/
19- * Access to Jenkins bot keys at lp:~ce-infrastructure/bygmester/ce-jenkins-bot
20- * Access to the PPA at lp:~ce-infrastructure/+archive/ubuntu/capomastro
21- * OS:
22- * Trusty (14.04)
23-
24-Setup
25------
26-
27-Install the Mojo package from its PPA (and juju-local if doing local test):
28-
29- sudo apt-add-repository --yes ppa:mojo-maintainers/ppa && sudo apt-get update
30- sudo apt-get --yes install mojo juju-local
31-
32-Initialize the local environment for Juju so you can deploy Capomastro:
33-
34- juju init
35- juju switch local
36- juju bootstrap
37-
38-It is also highly recommended to use the company VPN to run any deployment, see
39-https://wiki.canonical.com/InformationInfrastructure/IS/HowTo/CompanyOpenVPN
40-for instructions on how to set it up. You may have problems accessing IS-owned
41-resources if you do not use the VPN when running the Mojo script.
42-
43-
44-Mojo configuration
45-------------------
46-
47-There are two important vars in the deployment script: MOJO_REPO and MOJO_STAGE.
48-
49-MOJO_REPO should have the Launchpad address of the repository containing the spec
50-of Capomastro. It can be a local repository, i.e. a local directory in the file
51-system, as long as all changes have been committed (not necessarily pushed though).
52-
53-MOJO_STAGE point to the working spec directory inside the Mojo repository. You
54-may need to tweak that if you are working on a new spec which does not follow the
55-IS organization, but most likely that never needs to be changed.
56-
57-Also, before running the deployment script, you must have both the secret of Capomastro's
58-PPA and the SSH key pair used by the Jenkins bot to fetch and build images.
59-
60-The script expects the Capomastro PPA to be configured through a charm option
61-and it is copied over the rest of the Mojo files automatically. Just put the
62-option formatted as YAML in /tmp/secrets, like this:
63-
64-capomastro:
65- services:
66- capomastro:
67- options:
68- repository: "<private PPA credentials here>"
69-
70-As for the Jenkins bot configuration, simply create a directory /tmp/keys
71-and add both SSH key and its .pub inside it. The script will use them for some
72-post desployment steps, otherwise Jenkins won't be able to fetch and build
73-images correctly right after the setup of the service.
74-
75-All this ensures no secrets or credentials are stored anywhere in the spec.
76-
77-Deploying
78----------
79-
80-You may need to provide a password for sudo at the start of it:
81-
82- ./mojo.sh
83-
84-Considerations
85---------------
86-
87-1. you should avoid using this script for any serious production deployment. This
88-was meant for testing and development only, though it could be used just fine
89-on staging servers if needed. Local deployments with Juju and Mojo are supported
90-but you may encounter unknown problems, so beware. Ideally you should always
91-deploy to Canonistack, but that is quite slow, that's why this script exists.
92-
93-2. if using a non-local provider you will need to associate a floating IP with
94-the "apache2/0" service unit for web access. Optionally associate a floating
95-IP with the "jenkins/0" service unit if you require web access to it as well,
96-but keep in mind that would be insecure as all artifacts by default are visible
97-in Jenkins.
98-
99-3. when using this locally, you won't be able to actually build images with
100-Capomastro right away as the default policy for LXC units is not to allow
101-nesting. You'll need to stop the Jenkins unit, update its policy to allow that,
102-restart the unit and then try again. These are the config options you'll need:
103-
104- lxc.aa_profile = lxc-container-default-with-nesting
105- lxc.mount.auto = cgroup:mixed
106-
107-Old references
108--------------
109-
110-Previously, in the shellscripts used to deploy the Capomastro charm manually,
111-these were the equivalent to the new Mojo spec commands we are using:
112-
113- init.sh -> collect script
114- deploy.sh -> the manifest file at the root of the spec
115- bootstrap.sh -> manually done only when needed now
116- post-deploy-config.sh -> also part of the manifest file
117- upgrade-charm.sh -> collect-upgrade script
118- config/ directory -> services file
119
120=== removed file 'mojo.sh'
121--- mojo.sh 2015-01-12 13:28:50 +0000
122+++ mojo.sh 1970-01-01 00:00:00 +0000
123@@ -1,54 +0,0 @@
124-#!/bin/bash
125-#
126-# caio.begotti@canonical.com
127-# Mon 2015-01-05 15:32:20 -0200
128-
129-echo "
130-WARNING: this script is meant for testing mojo specs only,
131- please do not use this for real production work
132- as the script creates temporary unique LXC environments
133- and it never cleans them up... you've been warned!
134-
135- [press any key to continue]
136- "
137-read
138-
139-# env vars are used for practical reasons only
140-# as mojo still have problems parsing them so
141-# you should stick with command line parameters
142-
143-export MOJO_TIMESTAMP=$(date +%s)
144-export MOJO_PROJECT=capomastro-${MOJO_TIMESTAMP}
145-export MOJO_WORKSPACE=capomastro-${MOJO_TIMESTAMP}
146-export MOJO_SERIES=trusty
147-export MOJO_STAGE=pes/mojo-pes-capomastro/devel
148-
149-# this can be a local directory in the filesystem,
150-# as long it is a working bzr repository and that you
151-# have committed any changes (no need to push them though)
152-export MOJO_REPO=lp:~canonical-is/canonical-mojo-specs/mojo-pes-capomastro/
153-
154-set -xev
155-
156-# not sure why it can't call sudo itself
157-sudo --preserve-env mojo project-new --series ${MOJO_SERIES} ${MOJO_PROJECT}
158-
159-# known bug with mojo
160-sudo chmod 755 /var/lib/lxc/${MOJO_PROJECT}.${MOJO_SERIES}
161-
162-# creates a temporary workspace for the repo
163-mojo workspace-new --series ${MOJO_SERIES} --project ${MOJO_PROJECT} --stage ${MOJO_STAGE} ${MOJO_REPO} ${MOJO_WORKSPACE}
164-
165-# prepare the secrets for local deployment
166-sudo mkdir -p /srv/mojo/LOCAL/${MOJO_PROJECT}/pes/mojo-pes-capomastro/devel
167-
168-# private ppa option for the capomastro charm
169-sudo cp -a /tmp/secrets /srv/mojo/LOCAL/${MOJO_PROJECT}/pes/mojo-pes-capomastro/devel/
170-
171-# directory with key pair for ce-jenkins-bot
172-sudo cp -a /tmp/keys /srv/mojo/LOCAL/${MOJO_PROJECT}/pes/mojo-pes-capomastro/devel/
173-
174-# will execute all phases listed inside the manifest file
175-mojo run --series ${MOJO_SERIES} --project ${MOJO_PROJECT} --stage ${MOJO_STAGE} ${MOJO_REPO} ${MOJO_WORKSPACE}
176-
177-exit 0

Subscribers

People subscribed via source and target branches