Merge lp:~thumper/juju-core/local-topic into lp:~go-bot/juju-core/trunk

Proposed by Tim Penhey
Status: Merged
Approved by: Tim Penhey
Approved revision: no longer in the source branch.
Merged at revision: 1638
Proposed branch: lp:~thumper/juju-core/local-topic
Merge into: lp:~go-bot/juju-core/trunk
Diff against target: 373 lines (+331/-1)
3 files modified
cmd/juju/help_topics.go (+320/-1)
cmd/juju/main.go (+6/-0)
cmd/juju/main_test.go (+5/-0)
To merge this branch: bzr merge lp:~thumper/juju-core/local-topic
Reviewer Review Type Date Requested Status
Juju Engineering Pending
Review via email: mp+179449@code.launchpad.net

Commit message

Add help topics for providers and glossary.

https://codereview.appspot.com/12699043/

Description of the change

Add help topics for providers and glossary.

https://codereview.appspot.com/12699043/

To post a comment you must log in.
Revision history for this message
Tim Penhey (thumper) wrote :

Reviewers: mp+179449_code.launchpad.net,

Message:
Please take a look.

Description:
Add help topics for providers and glossary.

https://code.launchpad.net/~thumper/juju-core/local-topic/+merge/179449

(do not edit description out of merge proposal)

Please review this at https://codereview.appspot.com/12699043/

Affected files:
   A [revision details]
   M cmd/juju/help_topics.go
   M cmd/juju/main.go
   M cmd/juju/main_test.go

Revision history for this message
William Reade (fwereade) wrote :
Revision history for this message
William Reade (fwereade) wrote :

On 2013/08/09 13:58:33, fwereade wrote:
> LGTM!

Trivial!

https://codereview.appspot.com/12699043/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cmd/juju/help_topics.go'
2--- cmd/juju/help_topics.go 2013-05-02 15:55:42 +0000
3+++ cmd/juju/help_topics.go 2013-08-09 13:52:46 +0000
4@@ -8,7 +8,7 @@
5 https://juju.ubuntu.com/
6
7 Juju provides easy, intelligent service orchestration on top of environments
8-such as OpenStack, Amazon AWS, or bare metal.
9+such as OpenStack, Amazon AWS, bare metal, or your own local machine.
10
11 Basic commands:
12 juju init generate boilerplate configuration for juju environments
13@@ -20,5 +20,324 @@
14
15 juju help bootstrap more help on e.g. bootstrap command
16 juju help commands list all commands
17+ juju help glossary glossary of terms
18 juju help topics list all help topics
19+
20+Provider information:
21+ juju help local use on this computer
22+ juju help aws use on AWS
23+ juju help openstack use on OpenStack
24+ juju help hpcloud use on HP Cloud
25+`
26+
27+const helpLocalProvider = `
28+First install Juju and some dependencies it needs. Keep in mind that LXC and
29+mongodb are needed for the local provider to work.
30+
31+ sudo add-apt-repository ppa:juju/stable
32+ sudo apt-get update
33+ sudo apt-get install juju-core lxc mongodb-server
34+
35+After that you might get error for SSH authorized/public key not found. ERROR
36+SSH authorized/public key not found.
37+
38+ ssh-keygen -t rsa
39+
40+First configure your environment local environment, if you've not set up Juju
41+before do a:
42+
43+ juju init -w
44+
45+This will write out an example config file that will work. Then you need to
46+tell Juju to use the local provider and then bootstrap:
47+
48+ juju switch local
49+ sudo juju bootstrap
50+
51+The first time this runs it might take a bit, as it's doing a netinstall for
52+the container, it's around a 300 megabyte download. Subsequent bootstraps
53+should be much quicker. 'sudo' is needed because only root can create LXC
54+containers. After the initial bootstrap, you do not need 'sudo' anymore,
55+except to 'sudo juju destroy-environment' when you want to tear everything
56+down.
57+
58+You deploy charms from the charm store using the following commands:
59+
60+ juju deploy mysql
61+ juju deploy wordpress
62+ juju add-relation wordpress mysql
63+
64+References:
65+
66+ - Source: Question on Ask Ubuntu [1]
67+ - [Documentation][2]
68+
69+ [1]: http://askubuntu.com/questions/65359/how-do-i-configure-juju-for-local-usage
70+ [2]: https://juju.ubuntu.com/docs/getting-started.html
71+`
72+
73+const helpOpenstackProvider = `
74+
75+First off you need juju and charm-tools, ensure you have the latest stable
76+juju:
77+
78+ sudo add-apt-repository ppa:juju/stable
79+ sudo apt-get update && sudo apt-get install juju-core charm-tools
80+
81+Do a 'juju generate-config -w' to generate a config for OpenStack that you can
82+customize for your needs.
83+
84+Here's an example OpenStack configuration for '~/.juju/environments.yaml',
85+including the commented out sections:
86+
87+ openstack:
88+ type: openstack
89+ # Specifies whether the use of a floating IP address is required to
90+ # give the nodes a public IP address. Some installations assign public
91+ # IP addresses by default without requiring a floating IP address.
92+ # use-floating-ip: false
93+ admin-secret: 13850d1b9786065cadd0f477e8c97cd3
94+ # Globally unique swift bucket name
95+ control-bucket: juju-fd6ab8d02393af742bfbe8b9629707ee
96+ # Usually set via the env variable OS_AUTH_URL, but can be specified here
97+ # auth-url: https://yourkeystoneurl:443/v2.0/
98+ # override if your workstation is running a different series to which
99+ # you are deploying
100+ # default-series: precise
101+ # The following are used for userpass authentication (the default)
102+ auth-mode: userpass
103+ # Usually set via the env variable OS_USERNAME, but can be specified here
104+ # username: <your username>
105+ # Usually set via the env variable OS_PASSWORD, but can be specified here
106+ # password: <secret>
107+ # Usually set via the env variable OS_TENANT_NAME, but can be specified here
108+ # tenant-name: <your tenant name>
109+ # Usually set via the env variable OS_REGION_NAME, but can be specified here
110+ # region: <your region>
111+
112+References:
113+
114+ - Source: Question on Ask Ubuntu [1]
115+ - Official Docs [2]
116+
117+ [1]: http://askubuntu.com/questions/132411/how-can-i-configure-juju-for-deployment-on-openstack
118+ [2]: http://juju.ubuntu.com/docs/provider-configuration-openstack.html
119+
120+Other OpenStack Based Clouds:
121+
122+This answer is for generic upstream OpenStack support, if you're using an
123+OpenStack-based provider check these questions out for provider-specific
124+information:
125+
126+ - http://askubuntu.com/questions/116174/how-can-i-configure-juju-for-deployment-to-the-hp-cloud
127+ - http://askubuntu.com/questions/166102/how-do-i-configure-juju-for-deployment-on-rackspace-cloud
128+
129+`
130+
131+const helpEC2Provider = `
132+First install Juju:
133+
134+ sudo add-apt-repository ppa:juju/stable
135+ sudo apt-get update && sudo apt-get -y install juju-core
136+
137+Do a 'juju generate-config -w' to generate a config for AWS that you can
138+customize for your needs. This will create the file
139+'~/.juju/environments.yaml'.
140+
141+Which is a sample environment configured to run with EC2 machines and S3
142+permanent storage.
143+
144+To make this environment actually useful, you will need to tell juju about an
145+AWS access key and secret key. To do this, you can either set the
146+'AWS_ACCESS_KEY_ID' and 'AWS_SECRET_ACCESS_KEY' [environment variables][1] (as
147+usual for other EC2 tools) or you can add access-key and secret-key options to
148+your environments.yaml. These are already in place in the generated config,
149+you just need to uncomment them out. For example:
150+
151+ default: sample
152+ environments:
153+ sample:
154+ type: ec2
155+ access-key: YOUR-ACCESS-KEY-GOES-HERE
156+ secret-key: YOUR-SECRET-KEY-GOES-HERE
157+ control-bucket: juju-faefb490d69a41f0a3616a4808e0766b
158+ admin-secret: 81a1e7429e6847c4941fda7591246594
159+ default-series: precise
160+ ssl-hostname-verification: true
161+
162+See the [EC2 provider documentation][2] for more options. The S3 bucket does
163+not need to exist already.
164+
165+Note If you already have an AWS account, you can determine your access key by
166+visiting [your account page][3], clicking "Security Credentials" and then
167+clicking "Access Credentials". You'll be taken to a table that lists your
168+access keys and has a "show" link for each access key that will reveal the
169+associated secret key.
170+
171+And that's it, you're ready to go!
172+
173+ - https://juju.ubuntu.com/docs/getting-started.html
174+ - https://juju.ubuntu.com/docs/provider-configuration-ec2.html
175+
176+References:
177+
178+ - Source: Question on Ask Ubuntu [4]
179+
180+ [1]: http://askubuntu.com/questions/730/how-do-i-set-environment-variables
181+ [2]: https://juju.ubuntu.com/docs/provider-configuration-ec2.html
182+ [3]: http://aws.amazon.com/account
183+ [4]: http://askubuntu.com/questions/225513/how-do-i-configure-juju-to-use-amazon-web-services-aws
184+`
185+
186+const helpHPCloud = `
187+
188+You should start by generating a generic configuration file for Juju, using
189+the command:
190+
191+ 'juju generate-config -w'
192+
193+This will generate a file, 'environments.yaml', which will live in your
194+'~/.juju/' directory (and will create the directory if it doesn't already
195+exist).
196+
197+The essential configuration sections for HP Cloud look like this:
198+
199+ hpcloud:
200+ type: openstack
201+ admin-secret: 6638bebf0c54ffff1007e0247d4dae98
202+ control-bucket: juju-bc66a4a4adbee50b2ceeee70436528e5
203+ tenant-name: "juju-project1"
204+ auth-url: https://region-a.geo-1.identity.hpcloudsvc.com:35357/v2.0
205+ auth-mode: userpass
206+ username: "xxxyour-hpcloud-usernamexxx"
207+ password: "xxxpasswordxxx"
208+ region: az-1.region-a.geo-1
209+ public-bucket-url: https://region-a.geo-1.objects.hpcloudsvc.com/v1/60502529753910
210+
211+Please refer to the question on Ask Ubuntu [1] for details on how to get
212+the relevant information to finish configuring your hpcloud environment.
213+
214+Official docs:
215+
216+ - [Documentation][2]
217+ - General OpenStack configuration: [3]
218+
219+References:
220+
221+ - Source: Question on Ask Ubuntu [1]
222+
223+ [1]: http://askubuntu.com/questions/116174/how-can-i-configure-juju-for-deployment-on-hp-cloud
224+ [2]: https://juju.ubuntu.com/docs/provider-configuration-openstack.html#openstack-configuration
225+ [3]: http://askubuntu.com/questions/132411/how-can-i-configure-juju-for-deployment-on-openstack
226+`
227+
228+const helpGlossary = `
229+Bootstrap
230+ To boostrap an environment means initializing it so that Services may be
231+ deployed on it.
232+
233+Charm
234+ A Charm provides the definition of the service, including its metadata,
235+ dependencies to other services, packages necessary, as well as the logic
236+ for management of the application. It is the layer that integrates an
237+ external application component like Postgres or WordPress into juju. A juju
238+ Service may generally be seen as the composition of its juju Charm and the
239+ upstream application (traditionally made available through its package).
240+
241+Charm URL
242+ A Charm URL is a resource locator for a charm, with the following format
243+ and restrictions:
244+
245+ <schema>:[~<user>/]<collection>/<name>[-<revision>]
246+
247+ schema must be either "cs", for a charm from the Juju charm store, or
248+ "local", for a charm from a local repository.
249+
250+ user is only valid in charm store URLs, and allows you to source charms
251+ from individual users (rather than from the main charm store); it must be a
252+ valid Launchpad user name.
253+
254+ collection denotes a charm's purpose and status, and is derived from the
255+ Ubuntu series targeted by its contained charms: examples include "precise",
256+ "quantal", "oneiric-universe".
257+
258+ name is just the name of the charm; it must start and end with lowercase
259+ (ascii) letters, and can otherwise contain any combination of lowercase
260+ letters, digits, and "-"s.
261+
262+ revision, if specified, points to a specific revision of the charm pointed
263+ to by the rest of the URL. It must be a non-negative integer.
264+
265+Endpoint
266+ The combination of a service name and a relation name.
267+
268+Environment
269+ An Environment is a configured location where Services can be deployed
270+ onto. An Environment typically has a name, which can usually be omitted
271+ when there's a single Environment configured, or when a default is
272+ explicitly defined. Depending on the type of Environment, it may have to be
273+ bootstrapped before interactions with it may take place (e.g. EC2). The
274+ local environment configuration is defined in the ~/.juju/environments.yaml
275+ file.
276+
277+Machine Agent
278+ Software which runs inside each machine that is part of an Environment, and
279+ is able to handle the needs of deploying and managing Service Units in this
280+ machine.
281+
282+Provisioning Agent
283+ Software responsible for automatically allocating and terminating machines
284+ in an Environment, as necessary for the requested configuration.
285+
286+Relation
287+ Relations are the way in which juju enables Services to communicate to each
288+ other, and the way in which the topology of Services is assembled. The
289+ Charm defines which Relations a given Service may establish, and what kind
290+ of interface these Relations require.
291+
292+ In many cases, the establishment of a Relation will result into an actual
293+ TCP connection being created between the Service Units, but that's not
294+ necessarily the case. Relations may also be established to inform Services
295+ of configuration parameters, to request monitoring information, or any
296+ other details which the Charm author has chosen to make available.
297+
298+Repository
299+ A location where multiple charms are stored. Repositories may be as simple
300+ as a directory structure on a local disk, or as complex as a rich smart
301+ server supporting remote searching and so on.
302+
303+Service
304+ juju operates in terms of services. A service is any application (or set of
305+ applications) that is integrated into the framework as an individual
306+ component which should generally be joined with other components to perform
307+ a more complex goal.
308+
309+ As an example, WordPress could be deployed as a service and, to perform its
310+ tasks properly, might communicate with a database service and a load
311+ balancer service.
312+
313+Service Configuration
314+ There are many different settings in a juju deployment, but the term
315+ Service Configuration refers to the settings which a user can define to
316+ customize the behavior of a Service.
317+
318+ The behavior of a Service when its Service Configuration changes is
319+ entirely defined by its Charm.
320+
321+Service Unit
322+ A running instance of a given juju Service. Simple Services may be deployed
323+ with a single Service Unit, but it is possible for an individual Service to
324+ have multiple Service Units running in independent machines. All Service
325+ Units for a given Service will share the same Charm, the same relations,
326+ and the same user-provided configuration.
327+
328+ For instance, one may deploy a single MongoDB Service, and specify that it
329+ should run 3 Units, so that the replica set is resilient to
330+ failures. Internally, even though the replica set shares the same
331+ user-provided configuration, each Unit may be performing different roles
332+ within the replica set, as defined by the Charm.
333+
334+Service Unit Agent
335+ Software which manages all the lifecycle of a single Service Unit.
336+
337 `
338
339=== modified file 'cmd/juju/main.go'
340--- cmd/juju/main.go 2013-08-05 01:25:35 +0000
341+++ cmd/juju/main.go 2013-08-09 13:52:46 +0000
342@@ -46,6 +46,12 @@
343 MissingCallback: RunPlugin,
344 })
345 jujucmd.AddHelpTopic("basics", "Basic commands", helpBasics)
346+ jujucmd.AddHelpTopic("local", "How to configure a local (LXC) provider", helpLocalProvider)
347+ jujucmd.AddHelpTopic("openstack", "How to configure an OpenStack provider", helpOpenstackProvider)
348+ jujucmd.AddHelpTopic("aws", "How to configure an AWS (EC2) provider", helpEC2Provider)
349+ jujucmd.AddHelpTopic("hpcloud", "How to configure an HP Cloud provider", helpHPCloud)
350+ jujucmd.AddHelpTopic("glossary", "Glossary of terms", helpGlossary)
351+
352 jujucmd.AddHelpTopicCallback("plugins", "Show Juju plugins", PluginHelpTopic)
353
354 // Creation commands.
355
356=== modified file 'cmd/juju/main_test.go'
357--- cmd/juju/main_test.go 2013-08-05 01:25:35 +0000
358+++ cmd/juju/main_test.go 2013-08-09 13:52:46 +0000
359@@ -276,9 +276,14 @@
360 }
361
362 var topicNames = []string{
363+ "aws",
364 "basics",
365 "commands",
366 "global-options",
367+ "glossary",
368+ "hpcloud",
369+ "local",
370+ "openstack",
371 "plugins",
372 "topics",
373 }

Subscribers

People subscribed via source and target branches

to status/vote changes: