Deployment process from DEV to PROD VM

Ok - started as root - tried ‘indico shell’ - indico not found
switched to indico user and started env and still got issues
show status of indico-celery

i am out of my depth here (as you will already have guessed) so any help gratefully received.

[root@centos ~]# 
[root@centos ~]# 
[root@centos ~]# 
[root@centos ~]# 
[root@centos ~]# indico shell
bash: indico: command not found...
[root@centos ~]# 
[root@centos ~]# 
[root@centos ~]# su - indico
Last login: Thu Apr 25 10:22:06 BST 2019 on pts/0
[indico@centos ~]$ 
[indico@centos ~]$ virtualenv ~/.venv
New python executable in /opt/indico/.venv/bin/python
Installing setuptools, pip, wheel...done.
[indico@centos ~]$ source ~/.venv/bin/activate
(.venv) [indico@centos ~]$ indico shell
(.venv) [indico@centos ~]$ 
(.venv) [indico@centos ~]$ 
(.venv) [indico@centos ~]$ systemctl status indico-celery
● indico-celery.service - Indico Celery
   Loaded: loaded (/etc/systemd/system/indico-celery.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Thu 2019-04-25 10:24:58 BST; 9min ago
  Process: 18575 ExecStart=/opt/indico/.venv/bin/indico celery worker -B (code=exited, status=203/EXEC)
 Main PID: 18575 (code=exited, status=203/EXEC)
(.venv) [indico@centos ~]$ systemctl start indico-celery
(.venv) [indico@centos ~]$ systemctl status indico-celery
● indico-celery.service - Indico Celery
   Loaded: loaded (/etc/systemd/system/indico-celery.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Thu 2019-04-25 10:35:15 BST; 8s ago
  Process: 21018 ExecStart=/opt/indico/.venv/bin/indico celery worker -B (code=exited, status=203/EXEC)
 Main PID: 21018 (code=exited, status=203/EXEC)
(.venv) [indico@centos ~]$ 
(.venv) [indico@centos ~]$ indico shell
(.venv) [indico@centos ~]$ 

This makes no sense… it should open the ipython shell, and not just exit without any output!

What output do you get from which indico, and does indico --help show anything?

Also, what does pip freeze | grep -i indico show?

PS: All commands related to indico need to be executed as the indico user while the virtualenv is active. The only commands that need root are things like systemctl.

.venv) [indico@centos ~]$ 
(.venv) [indico@centos ~]$ 
(.venv) [indico@centos ~]$ 
(.venv) [indico@centos ~]$ which indico
~/.venv/bin/indico
(.venv) [indico@centos ~]$ indico --help
(.venv) [indico@centos ~]$ 
(.venv) [indico@centos ~]$ pip freeze | grep -i indico
indico==2.2.dev0+20190423.1332.df161ea
indico-fonts==1.1
(.venv) [indico@centos ~]$ 

This is all after I ran the pip wheel install yeaterday which seemed to run with no errors - and i could access indico beforehand. i did take the wheel from a different VM set up as a development environment - this VM is set up as a prod environment (both as per indico install instructions - centos 7)

it couldn’t be anything like a ‘path’ issue that you can get on Windows could it (not a Linux person)

I do also have a clone of machine just before installing wheel so can get back to that to retest anything quite easily

Very strange. Try pip uninstall -y indico and then pip install XXX.whl again (replace XXX.whl with the correct path to the wheel)

(.venv) [indico@centos ~]$ pip uninstall -y indico
Can't uninstall 'indico'. No files were found to uninstall.
(.venv) [indico@centos ~]$ 

Then just try installing the wheel…

 [indico@centos ~]$ pip install indico-2.2.dev0+20190423.1332.df161ea-py2-none-any.whl 
Requirement already satisfied: indico==2.2.dev0+20190423.1332.df161ea from file:///opt/indico/indico-2.2.dev0%2B20190423.1332.df161ea-py2-none-any.whl in ./.venv/lib/python2.7/site-packages
(.venv) [indico@centos ~]$ 

yesterday i got LOADS more output and ity took minutes, not less than a second LOL

Just trying to figure this all out – assuming a wheel just installs to a folder structure, could it be that the folder structure on the dev machine and the prod machine are different so something has happened on the original pip install that has messed things up or am I talking rubbish? – it is just the setup of VM is quite different between Prod and DEV

The wheel is basically a zip file containing the python files - but unless there’s something seriously wrong in your changes (that fail in some what not causing an exception), or you changed something vital in setup.py, I don’t see how you end up with the problems you have.

If you don’t mind sharing your code, maybe you could attach the wheel here so we can have a look if there’s anything obviously wrong with it?

The output of ls -al ~/.venv/lib/python2.7/site-packages/indico/ and ls -dal ~/.venv/lib/python2.7/site-packages/indico* could be interesting as well.

ok - that would be great - thanks

fist the ls’s and then the 40MB file in second post

(.venv) [indico@centos ~]$ 
(.venv) [indico@centos ~]$ ls -al ~/.venv/lib/python2.7/site-packages/indico/
total 40
drwxr-xr-x.  11 indico apache   200 Apr 24 11:54 .
drwxr-xr-x. 246 indico apache 12288 Apr 25 10:34 ..
drwxr-xr-x.   2 indico apache  4096 Apr 24 11:53 cli
drwxr-xr-x.   8 indico apache  4096 Apr 24 11:53 core
-rw-r--r--.   1 indico apache     0 Apr 24 11:52 __init__.py
-rw-r-----.   1 indico apache   151 Apr 24 11:54 __init__.pyc
drwxr-xr-x.   7 indico apache   130 Apr 24 11:53 legacy
-rw-r--r--.   1 indico apache     0 Apr 24 11:52 logging.yaml.sample
drwxr-xr-x.   3 indico apache    92 Apr 24 11:53 migrations
drwxr-xr-x.  22 indico apache  4096 Apr 24 11:53 modules
drwxr-xr-x.   3 indico apache   141 Apr 24 11:53 testing
drwxr-xr-x.   5 indico apache   114 Apr 24 11:53 translations
drwxr-xr-x.   5 indico apache  4096 Apr 24 11:53 util
drwxr-xr-x.   9 indico apache  4096 Apr 24 11:54 web
(.venv) [indico@centos ~]$ 
(.venv) [indico@centos ~]$ ls -dal ~/.venv/lib/python2.7/site-packages/indico/
drwxr-xr-x. 11 indico apache 200 Apr 24 11:54 /opt/indico/.venv/lib/python2.7/site-packages/indico/
(.venv) [indico@centos ~]$ 
(.venv) [indico@centos ~]$ 

will not let me attach whl to message - email address???

Try again, I just added whl to the allowed extensions.

haha - it is now too big - it is 40 MB (zipped 34) - max allowed is 4.

raised to 50MB -> try now

my files is 40,581 KB - but it still says it is too big - will give it another go. - a 7z of it is 34,453 kb

nope - gets to about 87% and fails - allow a zip?

ok just use something like wetransfer and post the link or try emailing it to me. not sure if the cern mail server allows attachments that big, but my private one should be fine with it -> adrian@planetcoding.net

cheers - sent a zip to email - hope it gets there