Cloud9 pour jouer avec ZdS...

...et faire du dev, de la QA, des tests, du mentorat etc

a marqué ce sujet comme résolu.

@Situphen : le problème est la dépendance gulp-imagemin qui, installée avec le reste, nécessite trop de mémoire.

Je vais tout reprendre de zéro.

+0 -0

@Situphen : le problème est la dépendance gulp-imagemin qui, installée avec le reste, nécessite trop de mémoire.

Je vais tout reprendre de zéro.

Si ça ne fonctionne pas, tu peux commenter cette ligne ce qui fera que gulp-imagemin ne sera pas utilisé lors de npm run gulp -- build

+0 -0

C'est bon. :)

La procédure :

  • S'inscrire gratuitement sur Cloud9
  • Se connecter
  • Créer un workspace de type Custom

Installer les dépendances back-end :

  • Passer en root : sudo su
  • Installer la locale fr_FR.UTF-8 : locale-gen fr_FR.UTF-8
  • Installer les dépendances

Installer les dépendances front-end :

  • Installer Node
  • Installer npm

Installer le projet :

  • Se rendre dans votre espace de travail : cd ~/workspace
  • Cloner le dépôt sur lequel vous travaillez : git clone https://github.com/Vayel/zds-site dans mon cas
  • Se rendre dans le dossier du projet : cd ~/workspace/zds-site dans mon cas

Installer le back-end :

  • Enlever lxml de requirements.txt
  • Installer les dépendances : pip install --upgrade -r requirements.txt -r requirements-dev.txt
  • Installer lxml : CFLAGS="-O0" pip install --upgrade lxml==3.4.4

Installer le front-end :

  • Enlever la dépendance gulp-imagemin de package.json
  • Installer les dépendances npm : npm install
  • Rebooter : sudo reboot
  • Remettre la dépendance gulp-imagemin
  • Refaire l'installation : npm install

Démarrer le serveur :

  • python manage.py migrate
  • Démarrer le serveur Web : python manage.py runserver $IP:$PORT
  • Se rendre sur le site : http://projectname.username.c9.io
+1 -0

Comme cette solution semble avoir du potentiel pour faire de la QA, j'ai commencé à automatiser le truc :

  • Créer un workspace :
  • Une fois la machine créée, exécutez le script install.sh en lui donnant en paramètre l'adresse de votre fork du site : ./install.sh https://github.com/Vayel/zds-site.

Par contre, j'installe actuellement tout le back-end dans l'environnement global, sans passer par virtualenv. Dans la mesure où la VM ne sera utilisée que pour ZdS, je ne suis pas sûr que ce soit un souci.

Il me reste l'installation du front à faire, pour lequel il faut un reboot.

PS : je n'ai pas encore testé l'installation, c'est-à-dire démarré Django.

+0 -0

J'ai une erreur quand je lance mon script run.sh (source) :( :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
vayel:~/workspace (master) $ ./run.sh 
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 353, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 327, in execute
    django.setup()
  File "/usr/local/lib/python2.7/dist-packages/django/__init__.py", line 18, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/usr/local/lib/python2.7/dist-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
    __import__(name)
ImportError: No module named easy_thumbnails

Sachant que pour l'installation, j'ai uniquement fait :

1
2
vayel:~/workspace$ ./install.sh
vayel:~/workspace$ ./install-next.sh

Ces deux scripts sont dans le même dépôt que le précédent.

Merci.

+0 -0

@victor : https://github.com/Vayel/zds-cloud9/blob/master/install.sh#L31

Vayel

D'accord, donc c'était pas là. Pourquoi ce hack à la ligne que tu donnes d'ailleurs ? Pourquoi pas laisser pip parser le fichier ?

+0 -0

Le back

Pour le back le plus gros problème est la dépendance pip lxml. Il faut la virer du fichier de requirement et l'installer a la main via :

1
CFLAGS="-O0" pip install --upgrade lxml==3.4.2

le morceau du début vire l'optimisation et ca permet a l'install de réussir.

Le front

Pour le front c'est un peu la même galère. La plupart des outils passent correctement sauf celui de traitement des images gulp-imagemin. Pour réussir, virer le paquet fautif de la liste des dépendances, faites une première install, rebooter la machine puis recommencer l'install des dépendances en rajoutant le paquet fautif.

Eskimon

+0 -0

J'ai ajouté un système de log : https://github.com/Vayel/zds-cloud9/blob/master/install.sh#L39. J'obtiens cela :

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
Downloading/unpacking https://github.com/zestedesavoir/Python-ZMarkdown/archive/2.6.0-zds.7.zip
  Running setup.py (path:/tmp/pip-xmYTLG-build/setup.py) egg_info for package from https://github.com/zestedesavoir/Python-ZMarkdown/archive/2.6.0-zds.7.zip

    warning: no files found matching '*.txt' under directory 'tests'
    warning: no files found matching '*.html' under directory 'tests'
    warning: no files found matching '*.cfg' under directory 'tests'
    warning: no files found matching '*.py' under directory 'tests'
    warning: no files found matching 'MANIFEST'
Downloading/unpacking pysolr==3.3.1
  Downloading pysolr-3.3.1.tar.gz
  Running setup.py (path:/tmp/pip_build_ubuntu/pysolr/setup.py) egg_info for package pysolr

Downloading/unpacking pygments==2.0.2
Downloading/unpacking python-social-auth==0.2.9
Downloading/unpacking django==1.7.10
Downloading/unpacking coverage==4.0.1
  Running setup.py (path:/tmp/pip_build_ubuntu/coverage/setup.py) egg_info for package coverage

    warning: no previously-included files found matching 'ci/appveyor.token'
    no previously-included directories found matching 'doc/_build'
    no previously-included directories found matching 'tests/eggsrc/build'
    no previously-included directories found matching 'tests/eggsrc/dist'
    no previously-included directories found matching 'tests/eggsrc/*.egg-info'
    warning: no previously-included files matching '*.py[co]' found anywhere in distribution
Downloading/unpacking django-crispy-forms==1.4.0
  Running setup.py (path:/tmp/pip_build_ubuntu/django-crispy-forms/setup.py) egg_info for package django-crispy-forms

    warning: no files found matching '*' under directory 'crispy_forms/static'
Downloading/unpacking django-haystack==2.4.1
Downloading/unpacking django-model-utils==2.2
  Downloading django-model-utils-2.2.tar.gz
  Running setup.py (path:/tmp/pip_build_ubuntu/django-model-utils/setup.py) egg_info for package django-model-utils

Downloading/unpacking django-munin==0.2.0
  Downloading django_munin-0.2.0-py2-none-any.whl
Downloading/unpacking python-memcached==1.54
  Downloading python_memcached-1.54-py2.py3-none-any.whl
Downloading/unpacking factory-boy==2.4.1
  Running setup.py (path:/tmp/pip_build_ubuntu/factory-boy/setup.py) egg_info for package factory-boy

    no previously-included directories found matching 'docs/_build'
Downloading/unpacking pygeoip==0.3.2
  Downloading pygeoip-0.3.2-py2.py3-none-any.whl
Downloading/unpacking pillow==2.9.0
  Running setup.py (path:/tmp/pip_build_ubuntu/pillow/setup.py) egg_info for package pillow

Downloading/unpacking gitpython==1.0.1
  Running setup.py (path:/tmp/pip_build_ubuntu/gitpython/setup.py) egg_info for package gitpython
    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'test_requirements'
      warnings.warn(msg)

    warning: no files found matching 'README'
Downloading/unpacking easy-thumbnails==2.2
  Running setup.py (path:/tmp/pip_build_ubuntu/easy-thumbnails/setup.py) egg_info for package easy-thumbnails

    no previously-included directories found matching 'docs/_build'
Downloading/unpacking CairoSVG==1.0.13
  Downloading CairoSVG-1.0.13.tar.gz
  Running setup.py (path:/tmp/pip_build_ubuntu/CairoSVG/setup.py) egg_info for package CairoSVG

Downloading/unpacking beautifulsoup4==4.3.2
  Running setup.py (path:/tmp/pip_build_ubuntu/beautifulsoup4/setup.py) egg_info for package beautifulsoup4

Downloading/unpacking django-recaptcha==1.0.4
  Downloading django-recaptcha-1.0.4.tar.gz
  Running setup.py (path:/tmp/pip_build_ubuntu/django-recaptcha/setup.py) egg_info for package django-recaptcha

Downloading/unpacking djangorestframework==3.1.1
Downloading/unpacking djangorestframework-xml==1.0.1
  Downloading djangorestframework_xml-1.0.1-py2.py3-none-any.whl
Downloading/unpacking django-filter==0.9.2
  Downloading django_filter-0.9.2-py2.py3-none-any.whl
Downloading/unpacking django-oauth-toolkit==0.9.0
  Running setup.py (path:/tmp/pip_build_ubuntu/django-oauth-toolkit/setup.py) egg_info for package django-oauth-toolkit

Downloading/unpacking drf-extensions==0.2.7
  Running setup.py (path:/tmp/pip_build_ubuntu/drf-extensions/setup.py) egg_info for package drf-extensions

  Running setup.py (path:/tmp/pip_build_ubuntu/gitdb/setup.py) egg_info for package gitdb

Downloading/unpacking cairocffi (from CairoSVG==1.0.13)
  Running setup.py (path:/tmp/pip_build_ubuntu/cairocffi/setup.py) egg_info for package cairocffi

    Installed /tmp/pip_build_ubuntu/cairocffi/cffi-1.4.2-py2.7-linux-x86_64.egg
    Searching for pycparser
    Reading https://pypi.python.org/simple/pycparser/
    Best match: pycparser 2.14
    Downloading https://pypi.python.org/packages/source/p/pycparser/pycparser-2.14.tar.gz#md5=a2bc8d28c923b4fe2b2c3b4b51a4f935
    Processing pycparser-2.14.tar.gz
    Writing /tmp/easy_install-czat6o/pycparser-2.14/setup.cfg
    Running pycparser-2.14/setup.py -q bdist_egg --dist-dir /tmp/easy_install-czat6o/pycparser-2.14/egg-dist-tmp-0967gP
    warning: no previously-included files matching 'yacctab.*' found under directory 'tests'
    warning: no previously-included files matching 'lextab.*' found under directory 'tests'
    warning: no previously-included files matching 'yacctab.*' found under directory 'examples'
    warning: no previously-included files matching 'lextab.*' found under directory 'examples'
    zip_safe flag not set; analyzing archive contents...

    Installed /tmp/pip_build_ubuntu/cairocffi/pycparser-2.14-py2.7.egg

    no previously-included directories found matching 'docs/_build'
    warning: no previously-included files found matching 'cairocffi/_ffi*.py'
Downloading/unpacking defusedxml>=0.3 (from djangorestframework-xml==1.0.1)
  Running setup.py (path:/tmp/pip_build_ubuntu/defusedxml/setup.py) egg_info for package defusedxml

Downloading/unpacking django-braces>=1.2.2 (from django-oauth-toolkit==0.9.0)
  Downloading django_braces-1.8.1-py2.py3-none-any.whl
Downloading/unpacking PyYAML>=3.10 from https://pypi.python.org/packages/source/P/PyYAML/PyYAML-3.11.tar.gz#md5=f50e08ef0fe55178479d3a618efe21db (from django-rest-swagger==0.2.9)
  Running setup.py (path:/tmp/pip_build_ubuntu/PyYAML/setup.py) egg_info for package PyYAML

Downloading/unpacking python-slugify>=0.1.0 (from django-uuslug==1.0.3)
  Downloading python-slugify-1.1.4.tar.gz
  Running setup.py (path:/tmp/pip_build_ubuntu/python-slugify/setup.py) egg_info for package python-slugify

Downloading/unpacking smmap>=0.8.5 (from gitdb>=0.6.4->gitpython==1.0.1)
  Downloading smmap-0.9.0.tar.gz
  Running setup.py (path:/tmp/pip_build_ubuntu/smmap/setup.py) egg_info for package smmap

Downloading/unpacking cffi>=1.1.0 (from cairocffi->CairoSVG==1.0.13)
  Running setup.py (path:/tmp/pip_build_ubuntu/cffi/setup.py) egg_info for package cffi

Downloading/unpacking Unidecode>=0.04.16 (from python-slugify>=0.1.0->django-uuslug==1.0.3)
  Running setup.py (path:/tmp/pip_build_ubuntu/Unidecode/setup.py) egg_info for package Unidecode

Downloading/unpacking pycparser (from cffi>=1.1.0->cairocffi->CairoSVG==1.0.13)
  Running setup.py (path:/tmp/pip_build_ubuntu/pycparser/setup.py) egg_info for package pycparser

    warning: no previously-included files matching 'yacctab.*' found under directory 'tests'
    warning: no previously-included files matching 'lextab.*' found under directory 'tests'
    warning: no previously-included files matching 'yacctab.*' found under directory 'examples'
    warning: no previously-included files matching 'lextab.*' found under directory 'examples'
Installing collected packages: pysolr, pygments, python-social-auth, django, coverage, django-crispy-forms, django-haystack, django-model-utils, django-munin, python-memcached, factory-boy, pygeoip, pillow, gitpython, easy-thumbnails, CairoSVG, beautifulsoup4, django-recaptcha, djangorestframework, djangorestframework-xml, django-filter, django-oauth-toolkit, drf-extensions, django-rest-swagger, django-cors-headers, django-uuslug, Markdown, requests, oauthlib, requests-oauthlib, PyJWT, six, gitdb, cairocffi, defusedxml, django-braces, PyYAML, python-slugify, smmap, cffi, Unidecode, pycparser
  Running setup.py install for pysolr
    error: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/pysolr.py'
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_ubuntu/pysolr/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Vez5qt-record/install-record.txt --single-version-externally-managed --compile:
    running install

running build

running build_py

creating build

creating build/lib.linux-x86_64-2.7

copying pysolr.py -> build/lib.linux-x86_64-2.7

running install_lib

copying build/lib.linux-x86_64-2.7/pysolr.py -> /usr/local/lib/python2.7/dist-packages

error: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/pysolr.py'

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_ubuntu/pysolr/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Vez5qt-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_ubuntu/pysolr
Storing debug log for failure in /home/ubuntu/.pip/pip.log

Et, étrangement :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
vayel:~/workspace (master) $ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import django
>>> import pygments
>>> import easy_thumbnails
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named easy_thumbnails
>>>
vayel:~/workspace (master) $ sudo pip install easy-thumbnails==2.2
Downloading/unpacking easy-thumbnails==2.2
  Downloading easy-thumbnails-2.2.tar.gz (71kB): 71kB downloaded
  Running setup.py (path:/tmp/pip_build_root/easy-thumbnails/setup.py) egg_info for package easy-thumbnails

    no previously-included directories found matching 'docs/_build'
Requirement already satisfied (use --upgrade to upgrade): django>=1.4.2 in /usr/local/lib/python2.7/dist-packages (from easy-thumbnails==2.2)
Requirement already satisfied (use --upgrade to upgrade): pillow in /usr/lib/python2.7/dist-packages (from easy-thumbnails==2.2)
Installing collected packages: easy-thumbnails
  Running setup.py install for easy-thumbnails

    no previously-included directories found matching 'docs/_build'
Successfully installed easy-thumbnails
Cleaning up...
vayel:~/workspace (master) $ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import easy_thumbnails
>>> 

Une fois easy-thumbnails installé manuellement, ./run.sh m'affiche :

1
ImportError: No module named crispy_forms

Et peu de paquets semblent installés :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
vayel:~/workspace (master) $ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pillow
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pillow
>>> import coverage
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named coverage
>>> import pygeoip
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pygeoip
>>> import gitpython
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named gitpython
>>> import pysolr
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named pysolr
>>> import python_social_auth                                                                                                                                                                                                          
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named python_social_auth
>>> import beautifulsoup4
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named beautifulsoup4
>>> import beautifulsoup4
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named beautifulsoup4
>>> 
+0 -0
Connectez-vous pour pouvoir poster un message.
Connexion

Pas encore membre ?

Créez un compte en une minute pour profiter pleinement de toutes les fonctionnalités de Zeste de Savoir. Ici, tout est gratuit et sans publicité.
Créer un compte