Merge ~suligap/canonical-identity-provider:update-readme-setup-instructions into canonical-identity-provider:master

Proposed by Przemysław Suliga
Status: Merged
Approved by: Przemysław Suliga
Approved revision: 6e18ea288ca133ecfba00c0bc503670f88c9006e
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~suligap/canonical-identity-provider:update-readme-setup-instructions
Merge into: canonical-identity-provider:master
Diff against target: 105 lines (+56/-19)
1 file modified
README (+56/-19)
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Hasan Ammar (community) Approve
Review via email: mp+383874@code.launchpad.net

Commit message

Update the initial setup section of the README

Description of the change

More information on how to setup the container and removal of some
outdated conflicting information.

To post a comment you must log in.
Revision history for this message
Hasan Ammar (hasanammar) wrote :

Thanks for updating the instructions! If the instructions are similar enough, it may remove duplication to just point the user to: https://wiki.canonical.com/engineering/SnapStore/ContainerSetup (snapdevicegw README is a good example).

Revision history for this message
Przemysław Suliga (suligap) wrote :

Thanks Hasan. The wiki is private though. Are you aware of a public equivalent?

And now I realize that my change also links to the wiki, but more as "additional information".

Revision history for this message
Hasan Ammar (hasanammar) wrote :

Ah; in that case its probably a good idea to just have the updated instructions directly in the README. Thanks!

review: Approve
Revision history for this message
Daniel Manrique (roadmr) :
Revision history for this message
Przemysław Suliga (suligap) :
Revision history for this message
Daniel Manrique (roadmr) wrote :

+1 let's merge this.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/README b/README
2index a9701df..873e2b7 100644
3--- a/README
4+++ b/README
5@@ -5,30 +5,65 @@ Development environment setup
6 Getting started
7 ===============
8
9-The supported way to develop Canonical Identity Provider is using LXC.
10-There's some additional documentation on LXC gotchas in the following
11-page (check there specially if you can't resolve the LXC address when
12-ssh'ing and if you want to open GUI apps seeing them in your host machine):
13+0. The supported way to develop canonical-identity-provider is using Linux
14+ containers via LXD.
15
16- https://wiki.canonical.com/UbuntuOne/Developer/LXC
17+To get started, make sure you have LXD installed and ready to use on the host
18+computer::
19
20-To get started, make sure you have LXC installed and ready to use on
21-the host computer::
22+ $ sudo snap install lxd
23
24- $ sudo apt-get install libvirt-bin lxc
25+After doing this, you can either logout and log back in, or use newgrp in your
26+current shell session to switch to the lxd group::
27
28-Once it's installed, the current supported version of Ubuntu is Trusty 14.04.
29+ $ newgrp lxd
30+
31+A bare LXD container is completely isolated from the host; for development
32+convenience, it is recommended to configure the container to:
33+
34+ - Mount your home directory from the host into the container. This allows you
35+ to use your local configuration.
36+ - Allow SSH without password, which may work once you mount your home if your
37+ SSH configuration allows the host's key; if not, adding an
38+ explicitly-allowed key might be necessary.
39+ - Add your username to the container so you don't need to switch users when
40+ using it.
41+ - Map your UID from the host to the same one in the container, so files can
42+ be written in the container without conflicts.
43+
44+If you are unsure on how to achieve all this, this script does the above, and
45+it can be run verbatim or taken as a starting point to configure your
46+container:
47+
48+https://gist.github.com/bloodearnest/ebf044476e70c4baee59c5000a10f4c8
49+
50+You can also see here if you have questions, want to know more about some
51+possible LXD setups, or have some unusual configuration that might need
52+adjusting the LXD profile:
53+
54+https://wiki.canonical.com/UbuntuOne/Developer/LXC#Installation_.28LXD.29
55+
56+Once LXD is installed, the current supported version of Ubuntu is Xenial 16.04.
57 We'll create a new container specifically for this project to isolate it from
58 the system and other projects::
59
60- $ lxc launch ubuntu:xenial sso-xenial
61+ $ lxc launch ubuntu:16.04 -p default -p $USER sso-xenial
62+
63+Once it's up, log in (use SSH in forwarding mode so your host's keys apply and
64+you can e.g. ``git clone`` from Launchpad without problems)::
65
66-Once it's created, let's log in with your existing credentials::
67+ $ ssh -A $SSO_XENIAL_CONTAINER_IP
68
69- $ ssh -A sso-xenial
70+.. note::
71
72-From now on, instructions will assume you're inside the sso-xenial LXC, unless
73-otherwise noted.
74+ There are several ways to obtain a suitable IP or hostname to connect via
75+ SSH. The easiest is to do `lxc list` and note the IP address assigned to
76+ the container. Other options provide consistent "hostnames" which are
77+ easier to use but more involved to set up. See the wiki page referenced
78+ above for some pointers on how to set this up.
79+
80+From now on, instructions will assume you're inside the sso-xenial container,
81+unless otherwise noted.
82
83 1. Get the code
84
85@@ -41,13 +76,15 @@ otherwise noted.
86 $ git clone lp:canonical-identity-provider
87 $ cd canonical-identity-provider
88
89-To set the prerequisites up inside the container, you can run the setup-container script
90-with sudo (needed to install packages and change system config inside the container)::
91
92- $ sudo ./setup-container
93+To set the prerequisites up inside the container, you can run the
94+setup-container script with sudo (needed to install packages and change system
95+config inside the container)::
96+
97+ $ sudo ./setup-container
98
99-If you run into trouble or want to perform one or more steps manually, have a look at the
100-setup-container script, which is quite simple and commented.
101+If you run into trouble or want to perform one or more steps manually, have a
102+look at the setup-container script.
103
104
105 2. Bootstrap the project

Subscribers

People subscribed via source and target branches