1 Last update 18 MAR. 2015
4 =================================================================
5 Complete Guide: http://trac.myslice.info/wiki/Manifold/Install
9 Debian GNU/Linux 7.5 (wheezy) x64
13 sudo apt-get install python-pip or sudo easy_install pip==1.4.1
14 sudo apt-get install python-dev (for paramiko and pyOpenSSL)
15 sudo apt-get install libffi-dev (for pyOpenSSL)
17 $ pip install django=="1.5.2"
18 $ apt-get install python-django-south
19 $ pip install requests
20 $ pip install djangorestframework
21 $ pip install django-celery
23 $ pip install paramiko
24 $ pip install pyparsing
25 $ pip install python-dateutil
26 $ pip instal pyOpenSSL
30 git clone ssh://yourlogin@git.onelab.eu/git/myslice.git
34 edit/create myslice/myslice.ini and enter the details of your manifold backend
37 copy unfold.sqlite3 to /var/unfold
42 use the unfold.sqlite3 i gave to u
45 $ ./devel/server-loop.sh
49 git clone git://git.onelab.eu/manifold.git
56 $ git clone -b geni-v3 git://git.onelab.eu/sfa.git
58 $ git checkout geni-v3
61 $ python ./setup.py install
63 =====================================================================
65 ## Whenever doing a git pull the following operations are recommended:
67 $ make static # will refresh static/ from all the pieces in the project
68 $ make templates # same, for templates
69 $ make redo-static # clears up (rm -rf) static/ first, then make static
70 $ make redo-templates # ditto for templates
71 $ make redo == make redo-static redo-templates
75 $ ./manage.py runserver 0.0.0.0:8000
77 $ devel/server-loop.sh
78 when you just need to hit ^C yourself when your static files need to be refreshed - see below
80 * use it from your browser
81 (See more notes on using the development server below)
83 * install dependencies
84 $ pip install -r path/to/requirements/file.txt
85 Note. not quite sure what this is about, I could not spot this file..
87 =====APACHE Config=====
88 if are running apache please do:
90 $ chown www-data:www-data /var/myslice-f4f
92 otherwise you may get the following error:
93 "DatabaseError: unable to open database file"
95 ==================== Status
97 *** Authentication ***
100 Not quite sure if/how the user gets proper notifications when
101 . his session has expired (i.e. his frontend is not logged into the backend any longer)
102 . his credentials have expired (i.e. the uploaded credentials, e.g. SFA delegated cred)
103 expired and she needs to run e.g. sfi myslice again
105 Hard-coded accounts (from a very early stage) are gone
110 I've done a very rough attempt at packaging for rpm.
111 The logic seems about right but needs more work, in particular in terms of installing myslice.conf
112 in the httpd conf.d directory.
113 It seems like our app won't work on f14 as is because Django is only 1.3.1 on f14
114 Plan is to target f18 but I lack a test machine.
115 Also of course I'll try to tackle debian/ubunti at some point.
117 There also is a working packaging for debian(s) and ubuntu(s) that we use
118 on an almost daily basis to upgrade manifold.pl.sophia.inria.fr
123 Third party tools shipped:
130 Others are added as we build the system when they become needed
131 Look in third-party/ for a more detailed list
133 As a rule of thumb, please try to keep in mind that these will need to
134 be upgraded over time I've tried to keep track of the version I picked
135 and to have an easy upgrade path (depending on the way the original
136 package is published)
138 ==================== Contents: 1st level subdirs
140 ========== code from git
143 this is the django 'project', where to look for
148 the code for dealing with queries, sending them to the backend, and offering the /manifold/proxy/ URL
151 the code for building / rendering plugins
154 the actual code for plugins
157 a django 'app' that deals with authentication; see especially
158 auth.backend.MyCustomBackend
159 for how to use a separate authentication system,
160 as well as settings.py for how to enable it
163 provides building blocks for the UI, especially layouts (1 or 2 columns) as
164 well as the topmenu widget
165 + some global static files (css, js, images..)
168 this is where the first implementation of myslice, with complete
169 user-management including registration, is taking place
172 rough/preliminary scaffolding views are in here
173 as the name suggests this is temporary
176 a third-party django app for adding on-the-fly mentions to css or js files that need to go in the header
179 * third party javascript and css stuff (bootstrapfs, jquery, this kind of things)
180 see more about that below too
183 no code in there, only various notes and other scripts useful for developers
185 ========== automatically generated
187 * static/: (generated by collectstatic, see above, do not source-control)
188 $ manage.py [ --noinput ] collectstatic
193 this is where django stores its own stuff, as per settings.py
195 ==================== conventions for templates & static files
196 ==================== and NOTES on using the development server
198 . first off, running manage.py runserver is provided by django as a development convenience but
199 SHOULD NOT be used in production
201 . second, when you do use it for developement purposes, please be aware that:
203 .. the recommended layout for the various files and pieces (py, html, js and css) with django is e.g.
204 plugins/quickfilter/___init__.py,
205 plugins/quickfilter/templates/quickfilter.html,
206 plugins/quickfilter/static/js/quickfilter.js
207 plugins/quickfilter/static/css/quickfilter.css
208 plugins/quickfilter/static/img/some-image.png
210 .. the files actually used by the development server are the ones located in
214 you can and should use the following make targets to refresh the
215 contents of these directories when running a developement server
216 $ make static to refresh static/
217 $ make redo-static to clean up static/ and then refresh its contents
218 $ make templates to refresh templates/
219 $ make redo-templates to clean up templates/ and then refresh its contents
220 $ make redo equivalent to make redo-static redo-templates
222 .. as far as possible, please make sure to use third-party to store
223 any javascript tool or utility that your plugin depends upon
225 also we have the convention that all material in third-party should be
226 tagged with a version number, with a symlink pointing to the version
227 being used, like this
229 ~/git/myslice/third-party $ ls -ld spin*
230 lrwxr-xr-x 1 parmentelat staff 10 Sep 6 17:55 spin -> spin-1.3.0
231 drwxr-xr-x 7 parmentelat staff 238 Sep 6 17:55 spin-1.2.8
232 drwxr-xr-x 7 parmentelat staff 238 Sep 6 17:55 spin-1.3.0
234 finally, as far as possible we keep track of the urls used to pull
235 stuff in the first place so that upgrades are easier
237 . third, be careful when importing third party material, to stay away from demo-oriented material
239 e.g. at some point we were using demo_page.css and demo_table.css from the datatables demo and sample pages
240 unfortunately these are not tailored for production use as they are setting styles on a very wide scope
241 that breaks a lot of stuff, so please refrain from using these altogether
244 ======== update django database to reflect changes in existing models without any migration system (e.g., south) =========
247 $python manage.py reset <your_app>
249 #Django 1.5.1 or later
250 $python manage.py flush
252 This will update the database tables for your app, but will completely destroy any data that existed in those tables.
253 If the changes you made to your app model do not break your old schema (for instance, you added a new, optional field)
254 you can simply dump the data before and reload it afterwards, like so:
256 $python manage.py syncdb
257 $python manage.py dumpdata <your_app> > temp_data.json
258 $python manage.py flush
259 $python manage.py loaddata temp_data.json
261 If your changes break your old schema this won't work - in which case tools like south or django evolution are great.
264 Add a new model to the DB
266 $python manage.py schemamigration <your_app> --auto
267 $python manage.py migrate
269 ======== update django database to reflect changes in existing models with migration system (e.g., south) =========
271 As south is already installed , you just have to do:
273 # ./manage.py schemamigration portal --initial
274 # sqlite3 /var/unfold/unfold.sqlite3
275 sqlite> DROP TABLE "portal_institution";
276 sqlite> DROP TABLE "portal_pendinguser";
277 sqlite> DROP TABLE "portal_pendingauthority";
278 sqlite> DROP TABLE "portal_pendingslice";
280 # ./manage.py migrate portal