Comments (8)
Actually i tested it on CentOS7 with rh-python38 and Netbox 3.4.1. This setup works, i did the same thing what @tyler-8 mentioned in his opening comment. Unfortunately i cannot test other setup.
from ansible-role-netbox.
So I believe there was a reason why we used uwsgi from package repositories instead of within the virtualenv, but I can't quite remember why. I think it might have had something to do with compilation, possibly? Maybe missing features or maybe just the actual amount of time it takes to install uwsgi (faster to keep a single version externally than build it every time a new netbox release comes out).
which doesn't have any awareness of the venv as currently written.
This isn't exactly true. I'm pretty sure uwsgi
itself is aware of the virtualenv and drops into it, per the uwsgi.ini.j2
template. (also /usr/bin/env
is not intended to be in anyway related to virtualenvs)
Where exactly are you trying to gain more flexibility? Inside the virtualenv?
from ansible-role-netbox.
reason why we used uwsgi from package repositories instead of within the virtualenv
It's still being installed via pip
, just not in a venv
.
faster to keep a single version externally than build it every time a new netbox release comes out
This seems like a negligible difference compared to the overall install process, uwsgi
doesn't take a notably longer time to build than most other non-wheel packages I don't think.
This isn't exactly true. I'm pretty sure uwsgi itself is aware of the virtualenv and drops into it ... Where exactly are you trying to gain more flexibility? Inside the virtualenv?
What kicked off this exploration was I was testing with new Python versions installed via pyenv
. I install pyenv
and a new Python version before calling this role, then pointed netbox_python_binary
to the new binary and was getting errors from uwsgi
not being able to find Django installed (even though it was installed in the new venv
. I then realized that uwsgi
was still pointing to a version installed in /usr/local/bin/
and built with the older version of Python.
from ansible-role-netbox.
I should also mention that I was getting errors from this task
ansible-role-netbox/tasks/main.yml
Line 55 in dbead68
because psycopg2
wasn't being re-installed under the new version of Python. Not entirely sure why that was happening even on subsequent runs because it definitely was installed yet but the task completed without doing anything.
from ansible-role-netbox.
Just to not let this stagnate, I still haven't remembered the exact reasoning behind using uwsgi outside of the virtualenv (if not for one of the guesses I provided before). I just remember that I did indeed originally try to stick to running everything inside the virtualenv, so I must have ran into some sort of obstacle with uwsgi that made me decide to use it outside.
If you can manage to get a functional changeset to the role to run uwsgi inside the venv, I guess I can consider adopting it, but then I guess consideration also needs to be made for existing NetBox installations (do we uninstall uwsgi? etc).
from ansible-role-netbox.
I'll say this, I've done a local fork of this playbook that uses a virtualenv-installed version of uwsgi
this past week without any issues. It makes the most sense to me, however I could write an update that leaves it up to the user I suppose.
You'd have two options then:
- Use the default behavior
- Use a
uwsgi
binary installed into thevenv
from ansible-role-netbox.
Just a thougth for the uwsgi in venv: if you plan to support RHEL7/CentOS7 and Netbox3, the uwsgi from the distro will not work. I have a running Netbox 3.4.1 on CentOS7 and had to install uwsgi in venv, because otherwise it did not work correctly (python 3.6 vs. python 3.8 in venv).
from ansible-role-netbox.
btw if someone can test the venv uwsgi setup on all technically supported distros and confirm that it works fine, I think I wouldn't mind making it the default for a major release and including update notes to suggest manually removing the non-venv install.
from ansible-role-netbox.
Related Issues (20)
- Support for Deployment of Multiple RQ Workers HOT 1
- uWSGI randomly resets TCP connections HOT 3
- Role needs to be updated to latest NetBox HOT 6
- AnsibleUndefinedVariable: {{ ansible_processor_vcpus }} when running role HOT 2
- Only run invalidate command if commit is NOT present
- markupsafe 2.1.1 cannot import soft_unicode HOT 1
- Recommended SSL settings HOT 3
- Vagrant Install failing with errors HOT 1
- Support 'clearcache' steps during upgrade in v3.2.3+
- Required Updates for "Up to" NetBox v3.4.2 Support HOT 6
- Implement Custom Validators HOT 4
- Fails to deploy on clean Debian 11 HOT 11
- RQworker reload fails randomly HOT 2
- Git-based installation: problematic file ownership
- NetBox dropped "clearcache" management command HOT 2
- Wrong check between Python 3.7 and 3.8 HOT 3
- Outdated Version on Ansible-Galaxy HOT 1
- NetBox 4.0 and higher require Python 3.10 or higher
- Creating NetBox superuser fails on NetBox 4.0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ansible-role-netbox.