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
38 $ ./manage.py collectstatic
40 Run the development server
41 $ ./devel/server-loop.sh
45 git clone git://git.onelab.eu/manifold.git
52 $ git clone -b geni-v3 git://git.onelab.eu/sfa.git
54 $ git checkout geni-v3
57 $ python ./setup.py install
59 =====================================================================
61 ## Whenever doing a git pull the following operations are recommended:
63 $ make static # will refresh static/ from all the pieces in the project
64 $ make templates # same, for templates
65 $ make redo-static # clears up (rm -rf) static/ first, then make static
66 $ make redo-templates # ditto for templates
67 $ make redo == make redo-static redo-templates
71 $ ./manage.py runserver 0.0.0.0:8000
73 $ devel/server-loop.sh
74 when you just need to hit ^C yourself when your static files need to be refreshed - see below
76 * use it from your browser
77 (See more notes on using the development server below)
79 * install dependencies
80 $ pip install -r path/to/requirements/file.txt
81 Note. not quite sure what this is about, I could not spot this file..
83 =====APACHE Config=====
84 if are running apache please do:
86 $ chown www-data:www-data /var/myslice-f4f
88 otherwise you may get the following error:
89 "DatabaseError: unable to open database file"
91 ==================== Status
93 *** Authentication ***
96 Not quite sure if/how the user gets proper notifications when
97 . his session has expired (i.e. his frontend is not logged into the backend any longer)
98 . his credentials have expired (i.e. the uploaded credentials, e.g. SFA delegated cred)
99 expired and she needs to run e.g. sfi myslice again
101 Hard-coded accounts (from a very early stage) are gone
106 I've done a very rough attempt at packaging for rpm.
107 The logic seems about right but needs more work, in particular in terms of installing myslice.conf
108 in the httpd conf.d directory.
109 It seems like our app won't work on f14 as is because Django is only 1.3.1 on f14
110 Plan is to target f18 but I lack a test machine.
111 Also of course I'll try to tackle debian/ubunti at some point.
113 There also is a working packaging for debian(s) and ubuntu(s) that we use
114 on an almost daily basis to upgrade manifold.pl.sophia.inria.fr
119 Third party tools shipped:
126 Others are added as we build the system when they become needed
127 Look in third-party/ for a more detailed list
129 As a rule of thumb, please try to keep in mind that these will need to
130 be upgraded over time I've tried to keep track of the version I picked
131 and to have an easy upgrade path (depending on the way the original
132 package is published)
134 ==================== Contents: 1st level subdirs
136 ========== code from git
139 this is the django 'project', where to look for
144 the code for dealing with queries, sending them to the backend, and offering the /manifold/proxy/ URL
147 the code for building / rendering plugins
150 the actual code for plugins
153 a django 'app' that deals with authentication; see especially
154 auth.backend.MyCustomBackend
155 for how to use a separate authentication system,
156 as well as settings.py for how to enable it
159 provides building blocks for the UI, especially layouts (1 or 2 columns) as
160 well as the topmenu widget
161 + some global static files (css, js, images..)
164 this is where the first implementation of myslice, with complete
165 user-management including registration, is taking place
168 rough/preliminary scaffolding views are in here
169 as the name suggests this is temporary
172 a third-party django app for adding on-the-fly mentions to css or js files that need to go in the header
175 * third party javascript and css stuff (bootstrapfs, jquery, this kind of things)
176 see more about that below too
179 no code in there, only various notes and other scripts useful for developers
181 ========== automatically generated
183 * static/: (generated by collectstatic, see above, do not source-control)
184 $ manage.py [ --noinput ] collectstatic
189 this is where django stores its own stuff, as per settings.py
191 ==================== conventions for templates & static files
192 ==================== and NOTES on using the development server
194 . first off, running manage.py runserver is provided by django as a development convenience but
195 SHOULD NOT be used in production
197 . second, when you do use it for developement purposes, please be aware that:
199 .. the recommended layout for the various files and pieces (py, html, js and css) with django is e.g.
200 plugins/quickfilter/___init__.py,
201 plugins/quickfilter/templates/quickfilter.html,
202 plugins/quickfilter/static/js/quickfilter.js
203 plugins/quickfilter/static/css/quickfilter.css
204 plugins/quickfilter/static/img/some-image.png
206 .. the files actually used by the development server are the ones located in
210 you can and should use the following make targets to refresh the
211 contents of these directories when running a developement server
212 $ make static to refresh static/
213 $ make redo-static to clean up static/ and then refresh its contents
214 $ make templates to refresh templates/
215 $ make redo-templates to clean up templates/ and then refresh its contents
216 $ make redo equivalent to make redo-static redo-templates
218 .. as far as possible, please make sure to use third-party to store
219 any javascript tool or utility that your plugin depends upon
221 also we have the convention that all material in third-party should be
222 tagged with a version number, with a symlink pointing to the version
223 being used, like this
225 ~/git/myslice/third-party $ ls -ld spin*
226 lrwxr-xr-x 1 parmentelat staff 10 Sep 6 17:55 spin -> spin-1.3.0
227 drwxr-xr-x 7 parmentelat staff 238 Sep 6 17:55 spin-1.2.8
228 drwxr-xr-x 7 parmentelat staff 238 Sep 6 17:55 spin-1.3.0
230 finally, as far as possible we keep track of the urls used to pull
231 stuff in the first place so that upgrades are easier
233 . third, be careful when importing third party material, to stay away from demo-oriented material
235 e.g. at some point we were using demo_page.css and demo_table.css from the datatables demo and sample pages
236 unfortunately these are not tailored for production use as they are setting styles on a very wide scope
237 that breaks a lot of stuff, so please refrain from using these altogether
240 ======== update django database to reflect changes in existing models without any migration system (e.g., south) =========
243 $python manage.py reset <your_app>
245 #Django 1.5.1 or later
246 $python manage.py flush
248 This will update the database tables for your app, but will completely destroy any data that existed in those tables.
249 If the changes you made to your app model do not break your old schema (for instance, you added a new, optional field)
250 you can simply dump the data before and reload it afterwards, like so:
252 $python manage.py syncdb
253 $python manage.py dumpdata <your_app> > temp_data.json
254 $python manage.py flush
255 $python manage.py loaddata temp_data.json
257 If your changes break your old schema this won't work - in which case tools like south or django evolution are great.
260 Add a new model to the DB
262 $python manage.py schemamigration <your_app> --auto
263 $python manage.py migrate
265 ======== update django database to reflect changes in existing models with migration system (e.g., south) =========
267 As south is already installed , you just have to do:
269 # ./manage.py schemamigration portal --initial
270 # sqlite3 /var/unfold/unfold.sqlite3
271 sqlite> DROP TABLE "portal_institution";
272 sqlite> DROP TABLE "portal_pendinguser";
273 sqlite> DROP TABLE "portal_pendingauthority";
274 sqlite> DROP TABLE "portal_pendingslice";
276 # ./manage.py migrate portal