docnow / dnflow-ansible Goto Github PK
View Code? Open in Web Editor NEWAnsible playbooks for setting up dnflow
License: MIT License
Ansible playbooks for setting up dnflow
License: MIT License
rq worker
throws an exception when pulling search jobs off the queue.
'module' object has no attribute 'run'
On a new workstation when I deploy w/ Vagrant+Ansible the login throws a 502 error. I didn't see this on my laptop at home yesterday so it must be some environmental type of thing.
Ansible is unable to start the uwsgi service on Ubuntu 16.04.1.
ubuntu@ip-172-30-1-27:/etc/init$ sudo service docnow start
Failed to start docnow.service: Unit docnow.service not found.
I guess the upstart config needs to be tweaked in some way?
HI,
The search feature wasn't working at all. PUzzling through it with Ed, it seems as if the database wasn't formed correctly (vagrant, on a Mac). There was no data directory created:
vagrant@vagrant-ubuntu-trusty-64:/home/docnow/dnflow$ ls
db.sqlite3 __init__.py queue_tasks.py static
dnflow.cfg LICENSE README.md summarize.py
dnflow.cfg.template luigi.cfg requirements.txt templates
docnow.ini __pycache__ schema.sql ui.py
I cd /home/docnow/dnflow
and then sqlite3 db.sqlite3
with the result:
sqlite> SELECT * FROM searches; Error: no such table: searches
so we:
sudo -u docnow -s ; sqlite3 db.sqlite3 < schema.sql
but I had to re-enter the sqlite3 db.sqlite3 < schema.sql
to get it to take. And then the search in the webapp performed as expected.
It would be nice if there was a way to run the playbook without wiping out the database.
It would simplify development if the dnflow repo was available in /vagrant so that it could be edited live from the host operating system.
It doesn't look like redis.yml
is used anymore -- since it's covered in docnow
. Can it be removed to keep things simple?
It doesn't look it is being used?
Hi folks – when running the steps here, a change to Ansible 2.1+ now leads to a failure. Here's the error:
TASK [db to track searches] ****************************************************
fatal: [default]: FAILED! => {"failed": true, "msg": "Failed to set permissions on the temporary files Ansible needs to create when becoming an unprivileged user (rc: 1, err: chown: changing ownership of ‘/tmp/ansible-tmp-1505919437.39-193639852573128/’: Operation not permitted\nchown: changing ownership of ‘/tmp/ansible-tmp-1505919437.39-193639852573128/command.py’: Operation not permitted\n}). For information on working around this, see https://docs.ansible.com/ansible/become.html#becoming-an-unprivileged-user"}
to retry, use: --limit @/vagrant/docnow.retry
PLAY RECAP *********************************************************************
default : ok=33 changed=29 unreachable=0 failed=1
The solution is if you trust your remote provider, to change the ansible.cfg
file to include:
allow_world_readable_tmpfiles = true
Like so:
[defaults]
host_key_checking = False
allow_world_readable_tmpfiles = true
[ssh_connection]
pipelining = True
ssh_args = -o ControlMaster=auto -o ControlPersist=30m -o StrictHostKeyChecking=no
Not sure if this is worth adding or not.
Hi folks –
I've been trying to get this deployed on AWS for longer than I'm willing to admit now (I'll hopefully push some tweaks to your README.md file). But I'm finally hitting the wall here on an issue related to #8.
Build fails on AWS with:
TASK [remove nginx default virtual host] ***************************************
changed: [default]
TASK [copy nginx virtualhost] **************************************************
fatal: [default]: FAILED! => {"changed": false, "failed": true, "msg": "AnsibleUndefinedVariable: {{ ansible_eth1.ipv4.address }}: 'ansible_eth1' is undefined"}
to retry, use: --limit @/vagrant/docnow.retry
PLAY RECAP *********************************************************************
default : ok=23 changed=20 unreachable=0 failed=1
Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.
My group_vars/all
is as follows, with keys removed but everything else the same:
---
hostname: "{{ ansible_eth1.ipv4.address }}"
twitter_consumer_key: JSp5BzLifNopFcmPdpzKcYSUC
twitter_consumer_secret: bNwef7erMVbdmj8fDNW6kuVgyoYBCJpeWWsd1zMo4ruyc5nH1Q
http_basicauth_user:
http_basicauth_pass:
#google_analytics: blah
I know the problem is in there somewhere.. Thanks all.
Hi folks,
Me again. When the app goes to login to twitter, the callback for the authentication is to:
http://10.0.2.15/oauth-authorized?next=http%3A%2F%2F192.168.60.14%2F&oauth_token= [etc] &oauth_verifier= [etc]
? and nothing else occurs.
Hi folks,
I get to this:
TASK [copy nginx virtualhost] **************************************************
fatal: [default]: FAILED! => {"changed": false, "failed": true, "msg": "AnsibleUndefinedVariable: 'http_basicauth_user' is undefined"}
NO MORE HOSTS LEFT *************************************************************
[WARNING]: Could not create retry file 'docnow.retry'. [Errno 2] No
such file or directory: ''
my 'all' file:
hostname: "{{ ansible_eth0.ipv4.address }}"
twitter_consumer_key:
twitter_consumer_secret:
... I'm missing something quite basic, right?
Me again. I have managed to get a successful build (perhaps resolving #14 although I will leave that open until fixed). I am at the step where we edit /home/docnow/dnflow/dnflow.cfg
and /etc/nginx/sites-enabled/docnow
to provide hostname and servername. But after stopping and starting docnow
, I can't get through.
Is this a security group issue w/ AWS (I only have SSH on port 22) or with the two files?
I'll provide them below.
dnflow.cfg
HOSTNAME = 'ec2-35-161-208-251.us-west-2.compute.amazonaws.com'
DEBUG = True
DATABASE = 'db.sqlite3'
SECRET_KEY = 'a super secret key'
STATIC_URL_PATH = '/static'
DATA_DIR = 'data'
MAX_TIMEOUT = 2 * 60 * 60 # two hours should be long enough
REDIS_HOST = 'localhost'
REDIS_PORT = 6379
REDIS_DB = 4
TWITTER_CONSUMER_KEY = 'KEY IAN ADDED HERE'
TWITTER_CONSUMER_SECRET = 'SECRETKEY IAN ADDED HERE'
HTTP_BASICAUTH_USER = 'TWITTER LOGIN HERE'
HTTP_BASICAUTH_PASS = 'TWITTER PASSWORD HERE'
docnow
server {
listen 80;
listen [::]:80 default_server ipv6only=on;
server_name ec2-35-161-208-251.us-west-2.compute.amazonaws.com;
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:8001;
auth_basic "Speak, Friend and Enter";
auth_basic_user_file /etc/nginx/.htpasswd;
}
location /static {
alias /home/docnow/dnflow/static;
auth_basic "Speak, Friend and Enter";
auth_basic_user_file /etc/nginx/.htpasswd;
}
}
server {
listen 8080 default_server;
listen [::]:8080 default_server ipv6only=on;
location / {
proxy_pass http://localhost:8082;
auth_basic "Speak, Friend and Enter";
auth_basic_user_file /etc/nginx/.htpasswd;
}
}
Thanks team. My goal is to give back by adding some more instructions for regular users like me. 😄
Here's a fun error for when you have users with butterfingers like me. When logging into the local version (http://192.168.60.14), if the user presses enter before entering their password, it brings them to a 403 Forbidden page.
There doesn't seem to be robust error handling for typos, etc. My hacky workaround was vagrant destroy && vagrant up
but there is surely a better way. 😁
ETA: maybe I should leave the username and password blank in the all
config?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.