These are chat archives for allegro/ralph

16th
Aug 2017
Paweł
@ziompaul
Aug 16 2017 05:52
@romcheg Hi Roman, sorry for my absence, I had a sick leave
Loïc Tosser
@wowi42
Aug 16 2017 06:24

Good morning, I'm facing some issues to install Ralph:

 loictosser@Loics-iMac  /tmp  git clone https://github.com/allegro/ralph.git
Cloning into 'ralph'...
remote: Counting objects: 62017, done.
remote: Compressing objects: 100% (12/12), done.
remote: Total 62017 (delta 1), reused 6 (delta 1), pack-reused 62003
Receiving objects: 100% (62017/62017), 32.35 MiB | 562.00 KiB/s, done.
Resolving deltas: 100% (34327/34327), done.
 loictosser@Loics-iMac  /tmp  cd ralph
 loictosser@Loics-iMac  /tmp/ralph  python3 -m venv env
 loictosser@Loics-iMac  /tmp/ralph  source env/bin/activate
(env)  loictosser@Loics-iMac  /tmp/ralph  make install

Then I cannot execute ralph migrate (command not found).

then make install-dev, and ralph command is working
./env/bin/ralph
but no configuration file
Loïc Tosser
@wowi42
Aug 16 2017 06:31
where do I configure the Database parameters?
Loïc Tosser
@wowi42
Aug 16 2017 06:44
found
complicated to manage this project :-)
Roman Prykhodchenko
@romcheg
Aug 16 2017 06:46
@wowi42 great to see you've nailed it while the maintainers were still sleeping :-P
Loïc Tosser
@wowi42
Aug 16 2017 06:46
I think I will have a PR for the doc
we don't have Ubuntu/Debian here, and the manual installation doc is not good enough
Roman Prykhodchenko
@romcheg
Aug 16 2017 06:47
We would really appreciate that!
Paweł
@ziompaul
Aug 16 2017 06:50
@romcheg I am ready to run the upstart script
Loïc Tosser
@wowi42
Aug 16 2017 06:53
it's really sad, because the product seems good, but it's a pain to deploy
Roman Prykhodchenko
@romcheg
Aug 16 2017 06:53
@wowi42 frankly we only test Ralph on Ubuntu, however it should work on other distributions as well
Loïc Tosser
@wowi42
Aug 16 2017 06:53
I can guess
This message was deleted
Roman Prykhodchenko
@romcheg
Aug 16 2017 06:53
@wowi42 I'm actually working on making good debian packages for now
and I would like to add centos/rhel support as well
Loïc Tosser
@wowi42
Aug 16 2017 06:54
I will do AUR
I need it for my company
and FreeBSD package if I have some time
Roman Prykhodchenko
@romcheg
Aug 16 2017 06:55
Saing that I have to admit I don't have enough time for that so cannot guarantee that is going to be available asap
@wowi42 cool!
Loïc Tosser
@wowi42
Aug 16 2017 06:55
but I still don't understand why if I do make install, ./env/bin/ralph is not installed
Roman Prykhodchenko
@romcheg
Aug 16 2017 06:56
As I see make install actually does not installs ralph
it only installs it's requirements
Loïc Tosser
@wowi42
Aug 16 2017 06:57
so how do you build it after?
Roman Prykhodchenko
@romcheg
Aug 16 2017 06:58
We use dh-virtualenv for debian packages and docker for the rest.
Loïc Tosser
@wowi42
Aug 16 2017 06:59
ok
Roman Prykhodchenko
@romcheg
Aug 16 2017 06:59
dh-vitualenv does not depend on this Makefile IIRC, neither we rely on it in docker
@ziompaul sure, however, you will not actually need upstart for that
Paweł
@ziompaul
Aug 16 2017 07:01
@romcheg hm, sorry, but you said upstart script will run ralph 24/7
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:04
@ziompaul sure, however, after re-thinking that I realized it's better to not create a separate daemon for ralph. Instead, it's better to let uWSGI to manage workers for you.
That will also run 24/7 but is a produciton ready solution
Also it will be much easier for you to configure
Paweł
@ziompaul
Aug 16 2017 07:05
ok, as you say
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:06
Just install uwsgi: apt-get install uwsgi
Loïc Tosser
@wowi42
Aug 16 2017 07:06
small question: DATABASE_PORT is a valid option?
Paweł
@ziompaul
Aug 16 2017 07:06
done
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:07
then put this http://xsnippet.org/362705/ to a file named /etc/uwsgi/apps-enabled/ralph.ini
Don't forget to change the content according to your needs -- at least the DB parameters and the number of processes
Then you restart wsgi daemon with "service uwsgi restart" and ralph should be up and running
Paweł
@ziompaul
Aug 16 2017 07:10
what is <NUMBER-OF-PROCESSES> value?
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:10
I assume you have tested Ralph before on the same database, so you don't need to run migrations or to create a superuser
Paweł
@ziompaul
Aug 16 2017 07:11
yes, ralph was tested
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:11
put at least 2, however, you may adjust that to the number of processor cores you have
Paweł
@ziompaul
Aug 16 2017 07:14
ok, i have to find DB parameters
do you remember where is configuration file? :->
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:19
It's in Ralph's virtualenv. However, I assume, you've configured ralph according to the official manual, didn't you?
Paweł
@ziompaul
Aug 16 2017 07:20
yes, but i can't find anything in my profile :)
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:21
At least that means you have your DB server running on your localhost :)
Paweł
@ziompaul
Aug 16 2017 07:22
everything is on VM
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:22
I would recommend creating a separate db user for ralph and granting it access to your database
Paweł
@ziompaul
Aug 16 2017 07:25
yes, now is root user
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:25
I wouldn't recommend keeping it like that for produciton use :)
Paweł
@ziompaul
Aug 16 2017 07:25
you are right
ok, lets check thiz shit ;)
not avaiable yet
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:30
could you please check if something is listening the port?
sudo lsof -i :8000
or whichever port you've selected
Paweł
@ziompaul
Aug 16 2017 07:31
'''root@skierlp01:/home# sudo lsof -i :8000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
uwsgi 30019 www-data 5u IPv4 2721650 0t0 TCP :8000 (LISTEN)
uwsgi 30022 www-data 5u IPv4 2721650 0t0 TCP
:8000 (LISTEN)
uwsgi 30023 www-data 5u IPv4 2721650 0t0 TCP *:8000 (LISTEN)'''
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:32
then what's in your /var/log/uwsgi/app/ralph.log ?
Paweł
@ziompaul
Aug 16 2017 07:33
can I add a file here?
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:34
I am not that experienced with gitter :)
You can paste it here
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:40
Looks like it didn't load ralph
Could you please check all paths we've specified in that uwsgi config are in place?
Paweł
@ziompaul
Aug 16 2017 07:43
yes
/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:44
Then could you please check that uwsgi-plugin-python3 package is installed?
Paweł
@ziompaul
Aug 16 2017 07:45
dpkg -l uwsgi-plugin-python3 ?
no
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:46
Please install it then
Paweł
@ziompaul
Aug 16 2017 07:47
root@skierlp01:/home# dpkg -l uwsgi-plugin-python3
dpkg-query: no packages found matching uwsgi-plugin-python3
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:47
apt-get install uwsgi-plugin-python3
Paweł
@ziompaul
Aug 16 2017 07:48
done
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:48
now please restart uwsgi and check again
Paweł
@ziompaul
Aug 16 2017 07:48
now it is closer
in the we browser there is an error
Server Error (500)
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:50
If you add
export RALPH_DEBUG=1
to the env of your uswgi config it should help you identifying the issue
don't forget to restart uswgi
Paweł
@ziompaul
Aug 16 2017 07:53
...
env = DATABASE_HOST=127.0.0.1
env = export RALPH_DEBUG=1
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:53
Looks correct
Paweł
@ziompaul
Aug 16 2017 07:53
rather without export command
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:54
Oh, right :)
Paweł
@ziompaul
Aug 16 2017 07:54
ok
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:55
We are after a day off here, probably the same as you are, so sometimes noticing even obvious things could be an issue :-P
Paweł
@ziompaul
Aug 16 2017 07:55
now i have the login form without CSS
Loïc Tosser
@wowi42
Aug 16 2017 07:55
you need to serve your assets with a web server (nginx, apache)
Roman Prykhodchenko
@romcheg
Aug 16 2017 07:56
That's a right way to do it
Paweł
@ziompaul
Aug 16 2017 07:57
ok, I am logged in to the ralph web console, but CSS are not found
nor JS
That's an example for nginx server configuration
You can install nginx and put that configuration to it's sites-enables directory
Just remember to change the paths
the proxy_pass line should be also be changed to proxy requests to localhost, instead of "web"
Paweł
@ziompaul
Aug 16 2017 08:17
ralph runserver 0.0.0.0:8000 - CSS and all the ralph is working good, but via uWSGI not at all
Loïc Tosser
@wowi42
Aug 16 2017 08:19
same here
so the access path is changed when ran via uWSGI
if you are able to se the CSS refresh the page with SHIFT
Loïc Tosser
@wowi42
Aug 16 2017 08:26
@ziompaul uwsgi doesn't serve static files
so you need to configure Nginx to serve it
Paweł
@ziompaul
Aug 16 2017 08:28
:(
Roman Prykhodchenko
@romcheg
Aug 16 2017 08:28
You can use the template config I've posted earlier
Loïc Tosser
@wowi42
Aug 16 2017 08:28
let me a minute, I'm at the same step, I will have one valid soon
Paweł
@ziompaul
Aug 16 2017 08:28
ok I will try
Loïc Tosser
@wowi42
Aug 16 2017 08:28
@romcheg /opt/static and /opt/media what are those ?
collectstatic mandatory, no?
Roman Prykhodchenko
@romcheg
Aug 16 2017 08:45
@wowi42 basically paths to static files and attachments. Static files are at /opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/static/
/opt/media could be any writable directory
Paweł
@ziompaul
Aug 16 2017 08:58
I cant fint the nginx configuration file :)
By default, the configuration file is named nginx.conf and placed in the directory /usr/local/nginx/conf, /etc/nginx, or /usr/local/etc/nginx.
Roman Prykhodchenko
@romcheg
Aug 16 2017 09:01
/etc/nginx/sites-enabled
you just put your ralph.conf there
Make sure there is no other configuration file there that uses the port #80
Paweł
@ziompaul
Aug 16 2017 09:03
i don't now if am I blind or what, but i can't findn nginx in etc
Roman Prykhodchenko
@romcheg
Aug 16 2017 09:03
Did you install the package?
Paweł
@ziompaul
Aug 16 2017 09:03
yes, ant the http server is working on port 80
ok
it is now
Roman Prykhodchenko
@romcheg
Aug 16 2017 09:05

Well, I've just installed nginx to my Trusty box and

$ ll /etc/nginx/sites-enabled/
total 0
lrwxrwxrwx 1 root root 34 Aug 16 09:00 default -> /etc/nginx/sites-available/default

Paweł
@ziompaul
Aug 16 2017 09:05
after WINSCP reconnect
Roman Prykhodchenko
@romcheg
Aug 16 2017 09:07
That default configuration uses 80 port, so you need to de-activate it in any way you prefer
Paweł
@ziompaul
Aug 16 2017 09:09
i would preffer to move ralph to port 80
Roman Prykhodchenko
@romcheg
Aug 16 2017 09:10
Right, the config that you have now is set up to serve ralph on the port 80
However, that default web site already uses it, so you need to de-activate that default web site
Paweł
@ziompaul
Aug 16 2017 09:11
so first i have to change the uWSGI comfig?
Roman Prykhodchenko
@romcheg
Aug 16 2017 09:12
No, uwsgi should serve on 8000
Nginx will serve on 80 and pass requests to uwsgi while seving requests to static files by itself
Loïc Tosser
@wowi42
Aug 16 2017 09:13
@romcheg done, but still not all assets are loaded
/static/admin/js/core.js
for example
Roman Prykhodchenko
@romcheg
Aug 16 2017 09:15
@wowi42 did you build the static files?
Loïc Tosser
@wowi42
Aug 16 2017 09:16
I did a ralph collectstatic
how do you build this assets?
(btw Im on Debian 8 right now, to understand how it's working)
Roman Prykhodchenko
@romcheg
Aug 16 2017 09:16
By gulp
Did you install it from the package?
Loïc Tosser
@wowi42
Aug 16 2017 09:17
yep
Roman Prykhodchenko
@romcheg
Aug 16 2017 09:18
hmm, let me think
there is no need too build static files, if ralph is installed from the package
Loïc Tosser
@wowi42
Aug 16 2017 09:18
but assets are missing
Paweł
@ziompaul
Aug 16 2017 09:19
what should be ralph static files aliases?
those in config are wrong
Loïc Tosser
@wowi42
Aug 16 2017 09:20
/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/static/
jquery missing also
/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/var/static/
Paweł
@ziompaul
Aug 16 2017 09:21
the second is media ?
Loïc Tosser
@wowi42
Aug 16 2017 09:22
nope
still static
so
ralph collectstatic
then edit nginx conf:
server {
    listen 80;
    server_name ralph;

    location /docs {
        alias /opt/ralph/docs/_build/html;
    }

    location /static {
       alias /opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/var/static/;
    }

    location /media {
       alias /opt/media;
       add_header Content-disposition "attachment";
    }

    location / {
        proxy_pass http://127.0.0.1:8000;

        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}
Roman Prykhodchenko
@romcheg
Aug 16 2017 09:23
@wowi42 After I've run collectstatic I can see all libraries in opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/var/static/
Loïc Tosser
@wowi42
Aug 16 2017 09:24
yep, but you have opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/static/ also
Roman Prykhodchenko
@romcheg
Aug 16 2017 09:24
that .../var/... was an error perhaps
Loïc Tosser
@wowi42
Aug 16 2017 09:24
I think your collectstatic is not done properly
(which is one more argument, let's clean the cli deployment, then we can package)
Mateusz Kurek
@mkurek
Aug 16 2017 09:26
@wowi42 so if you point(ed) nginx to /opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/var/static/ for static file, is it working properly right now?
Loïc Tosser
@wowi42
Aug 16 2017 09:27
yep
@mkurek I did a collectstatic before
Paweł
@ziompaul
Aug 16 2017 09:31
for me it is still not working :(

/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/static/
or
/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/var/static/

?

Mateusz Kurek
@mkurek
Aug 16 2017 09:34
/opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/var/static/
Loïc Tosser
@wowi42
Aug 16 2017 09:34
@ziompaul ralph collectstatic
just in case
Paweł
@ziompaul
Aug 16 2017 09:34
why?
whai is this?
Roman Prykhodchenko
@romcheg
Aug 16 2017 09:35
That puts all static files together in one place
Paweł
@ziompaul
Aug 16 2017 09:37
ok I see
Roman Prykhodchenko
@romcheg
Aug 16 2017 09:48
@ziompaul does it work after you've run collectstatic?
Paweł
@ziompaul
Aug 16 2017 09:48
no :(
Roman Prykhodchenko
@romcheg
Aug 16 2017 09:50
could you please elaborate on that?
Paweł
@ziompaul
Aug 16 2017 09:51
I am trying
ralph collectstatic - is done

'''
server {
listen 80;
server_name ralph;

location /docs {
    alias /opt/ralph/docs/_build/html;
}

location /static {
   alias /opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/var/static/;
}

location /media {
   alias /opt/media;
   add_header Content-disposition "attachment";
}

location / {
    proxy_pass http://10.1.12.113:8000;

    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
}

}
'''

nginx -s reload
Roman Prykhodchenko
@romcheg
Aug 16 2017 09:55
So does it serve the static files now?
Paweł
@ziompaul
Aug 16 2017 09:55
no
can earlier docker installation make something wrong?
Roman Prykhodchenko
@romcheg
Aug 16 2017 10:01
do you have your docker installation running?
Paweł
@ziompaul
Aug 16 2017 10:01
yes
and the service is running
Roman Prykhodchenko
@romcheg
Aug 16 2017 10:01
on the same VM?
Paweł
@ziompaul
Aug 16 2017 10:01
yes
I have VM snapshot without docker
I can restore it and install uWSGI & aginx again
Roman Prykhodchenko
@romcheg
Aug 16 2017 10:06
it should be enough if you just stop docker instances
or ofc you can rollback to the snapshot, depends on what you prefer
Paweł
@ziompaul
Aug 16 2017 10:09
ok
[ - ] docker - is down
but docker-compose is still working
✪ vi4m Marcin Kliks
@vi4m
Aug 16 2017 10:29
@ziompaul we will issue new release with all-in-one package to simplify this installation to one apt-get install ralph-core command
but for now make sure your docker-compose is down too
type docker-compose ps output
to show it’s state
Paweł
@ziompaul
Aug 16 2017 10:30
I am making again uwsgi and nginx installation on fresh mashine from snapshot
✪ vi4m Marcin Kliks
@vi4m
Aug 16 2017 10:31
good idea
Paweł
@ziompaul
Aug 16 2017 10:33
it would be good idea to make OVM maschine :)
Paweł
@ziompaul
Aug 16 2017 12:01
ok, something is not done at all,
nginx does not serve static files yet
neither on fresk mashine
neither on local VM Player
Paweł
@ziompaul
Aug 16 2017 12:25
it seems that the nginx file has not been read
yeah, I have deleted default config and it seems it is working
Paweł
@ziompaul
Aug 16 2017 12:30
and it worsk on port 80
✪ vi4m Marcin Kliks
@vi4m
Aug 16 2017 12:36
:thumbsup:
Paweł
@ziompaul
Aug 16 2017 12:44
ok now it is time to mage ldap autentification
Will Rouesnel
@wrouesnel
Aug 16 2017 14:13
is there any particular reason DC's are limited to 100x100 grid size? it's a trifle but...technically mine should be 104x<some number I should find out>
✪ vi4m Marcin Kliks
@vi4m
Aug 16 2017 14:16
we didn’t have such a huge dc so far ;-)
we can change it without a problem
Paweł
@ziompaul
Aug 16 2017 14:18
Why should I configure hypevisor and service env to add a Virtual Machine to ralph?
Hypevisor is a Blade Server
What is the Service and wtah is the Envirnoment?
Roman Prykhodchenko
@romcheg
Aug 16 2017 14:21
@ziompaul service the purpose you need your vm
Paweł
@ziompaul
Aug 16 2017 14:22
I don't understand
Roman Prykhodchenko
@romcheg
Aug 16 2017 14:22
environment is place or state of a service
it's hard to explain without writing something like "environment is environment" :)
let me provide some examples
Paweł
@ziompaul
Aug 16 2017 14:23
So Exchange serwers are environment or service?
Roman Prykhodchenko
@romcheg
Aug 16 2017 14:23
Let's say you have your company's exchange
Paweł
@ziompaul
Aug 16 2017 14:24
yes
Roman Prykhodchenko
@romcheg
Aug 16 2017 14:24
you have a few servers, a switch that connects them and a shotgun used by the security guads to protect that
for all those equipment I've mentioned exchange is a service
Then, say, you have a produciton installation of exchange that is used by users and a test instance, you use to play with
so produciton and test are environments
✪ vi4m Marcin Kliks
@vi4m
Aug 16 2017 14:26
@ziompaul here’s the quickstart which describe service/environment http://ralph.readthedocs.io/en/latest/quickstart.html
sorry, wrong link, here’s the latest ralph 3 version quickstart: http://ralph-ng.readthedocs.io/en/latest/user/quickstart/
Roman Prykhodchenko
@romcheg
Aug 16 2017 14:27
Now, in order to say what service is ocupying some hardware it's not enough to mention the service since it can be running on two environments -- produciton or test
For that purpose we have special objects called Service Environments that connects services and environments
then you can connect Service Environments to your assets in order to be able to say "These servers are serving Exchange on production"
Paweł
@ziompaul
Aug 16 2017 14:31
Ok I understand the Service
Paweł
@ziompaul
Aug 16 2017 14:37
I don't now if the envinoment should be required, I dont have anything to place here :)
Roman Prykhodchenko
@romcheg
Aug 16 2017 14:37
Just create one for produciton
Paweł
@ziompaul
Aug 16 2017 14:42
OK, so first I add some services and nest will add VMs
it is 250VMs to add
Will Rouesnel
@wrouesnel
Aug 16 2017 15:55
hm, would i be right in thinking you can't create an ethernet adapter without a mac address if it would just have an attached IP?
the rest api succeeds, but it looks like it doesn't attach the IP
thelamer
@thelamer
Aug 16 2017 19:31
Googling always brings me to Ralph 2.x documentation, It looks like there used to be a concept of linking/unlinking a part to a hardware asset. Did that concept get EOL'd in 3.x or do you have a new accepted methodology of achieving the same thing ?
thelamer
@thelamer
Aug 16 2017 19:38
When creating backroom or DC assets there is a pane for components, but I am not seeing menus for editing the components or managing them as assets
Rudy Pinochet
@rudy500
Aug 16 2017 23:41
Hi @ar4s We have modified the following files, since we did not find the file you are referring to, can you please tell us where it is ?, this installation was performed from the debian packages and Python 3.4:
vim /opt/ralph/ralph-core/lib/python3.4/site-packages/django/conf/global_settings.py

vim /opt/ralph/ralph-core/lib/python3.4/site-packages/ralph/settings/base.py