Giter Site home page Giter Site logo

openwisp / docker-openwisp Goto Github PK

View Code? Open in Web Editor NEW
147.0 16.0 73.0 1.42 MB

OpenWISP in docker (in-alpha). For production checkout ansible-openwisp2.

License: BSD 3-Clause "New" or "Revised" License

Shell 20.79% Python 64.90% Dockerfile 11.22% Makefile 3.09%
docker kubernetes openwisp docker-openwisp

docker-openwisp's Introduction

Docker-OpenWISP

Automation Tests GitLab Container Registery Gitter Support GitHub license

This repository contains official docker images of OpenWISP. Designed with horizontal scaling, easily replicable deployments and user customization in mind.

kubernetes The sample files for deployment on kubernetes are available in the deploy/examples/kubernetes/ directory.

Table of contents

Images Available

Version Corresponding Ansible Version
0.1.0a2 0.9.0
0.1.0a3 0.12.0
0.1.0a4 0.12.0+
0.1.0a5 0.13.1
0.1.0a6 0.13.2+

* Roughly the same features would be available but it's not an exact one-to-one mapping.

The images are hosted on Docker Hub and GitLab Container Registry.

Image Tags

All images are tagged using the following convention:

Tag Software Version
latest Images built on the latest git tag
edge Images built on the current master branch

Architecture

A typical OpenWISP installation is made of multiple components (e.g. application servers, background workers, web servers, database, messaging queue, VPN server, etc. ) that have different scaling requirements.

The aim of Docker OpenWISP is to allow deploying OpenWISP in cloud based environments which allow potentially infinite horizontal scaling. That is the reason for which there are different docker images shipped in this repository.

Architecture

  • openwisp-dashboard: Your OpenWISP device administration dashboard.
  • openwisp-api: HTTP API from various openwisp modules which can be scaled simply by having multiple API containers as per requirement.
  • openwisp-websocket: Dedicated container for handling websocket requests, eg. for updating location of mobile network devices.
  • openwisp-celery: Runs all the background tasks for OpenWISP, eg. updating configurations of your device.
  • openwisp-celery-monitoring: Runs background tasks that perform active monitoring checks, eg. ping checks and configuration checks. It also executes task for writing monitoring data to the timeseries DB.
  • openwisp-celerybeat: Runs periodic background tasks. eg. revoking all the expired certificates.
  • openwisp-nginx: Internet facing container that facilitates all the HTTP and Websocket communication between the outside world and the service containers.
  • openwisp-freeradius: Freeradius container for OpenWISP.
  • openwisp-openvpn: OpenVPN container for out-of-the-box management VPN.
  • openwisp-postfix: Mail server for sending mails to MTA.
  • openwisp-nfs: NFS server that allows shared storage between different machines. It does not run in single server machines but provided for K8s setup.
  • openwisp-base: It is the base image which does not run on your server, but openwisp-api & openwisp-dashboard use it as a base.
  • Redis: data caching service (required for actions like login).
  • PostgreSQL: SQL database container for OpenWISP.

Deployment

Quick Setup

The auto-install.sh script can be used to quickly install a simple instance of openwisp on your server.

Quick Install

If you have created a .env file to configure your instance, then you can use it with the script otherwise.

It asks 5 questions for application configuration, 3 of them are domain names. The dashboard, api & openvpn can be setup on different domain, please ensure the domains you enter point to your server. The remaining 2 questions are email id for site manager email (used by django to send application emails) and letsencrypt (used by certbot to issue https certs on this address.)

To get started, run the following command:

   curl https://raw.githubusercontent.com/openwisp/docker-openwisp/master/deploy/auto-install.sh -o setup.sh
   sudo bash setup.sh
   # If you are upgrading from an older version setup by this script use
   # sudo bash setup.sh --upgrade
   # For more information
   # sudo bash setup.sh --help

To get a real-time streaming output of autoinstall logs, run the following command:

tail -n 50 -f /opt/openwisp/autoinstall.log

Notes:

  • If you're having any installation issues with the latest version, you can try auto-installation with the edge version, which has images built on the current master branch.

  • Still facing errors while installation? Please read the FAQ.

Compose

Setup on docker compose is suitable for single-server setup requirements. It is quicker and requires less prior knowledge about openwisp & networking.

Kubernetes

Setup on kubernetes is complex and requires prior knowledge about linux systems, kubernetes, docker & openwisp. However, it provides scalability for very large networks.

Useful commands for startup and readiness probes which are provided by the images:

  • startup probe example: test $(ps aux | grep -c uwsgi) -ge 2
  • readiness probe example: python services.py uwsgi_status "127.0.0.1:8001"

Customization

The following commands will create the directory structure required for adding customizations. Execute these commands in the same location as the docker-compose.yml file.

mkdir -p customization/configuration/django
touch customization/configuration/django/__init__.py
touch customization/configuration/django/custom_django_settings.py
mkdir -p customization/theme

You can also refer to the directory structure of this repository for an example.

Custom Django Settings

The customization/configuration/django directory created in the above section is mounted at /opt/openwisp/openwisp/configuration in the dashboard, api, celery, celery_monitoring and celerybeat containers.

You can specify additional Django settings (e.g. SMTP configuration) in the customization/configuration/django/custom_django_settings.py file. Django will use these settings at the project startup.

You can also put additional files in customization/configuration/django that needs to be mounted at /opt/openwisp/openwisp/configuration in the containers.

Custom Styles and JavaScript

If you want to use your custom styles, add custom JavaScript you can follow the following guide.

  1. Read about the option OPENWISP_ADMIN_THEME_LINKS. Please make ensure the value you have enter is a valid JSON and add the desired JSON in .env file. example:
OPENWISP_ADMIN_THEME_LINKS=[{"type": "text/css", "href": "/static/custom/css/custom-theme.css", "rel": "stylesheet", "media": "all"},{"type": "image/x-icon", "href": "/static/custom/bootload.png", "rel": "icon"},{"type": "image/svg+xml", "href": "/static/ui/openwisp/images/openwisp-logo-small.svg", "rel": "icons"}]
  1. Create your custom CSS / Javascript file in customization/theme directory created in the above section. E.g. customization/theme/static/custom/css/custom-theme.css.
  2. Start the nginx containers.

Notes:

  1. You can edit the styles / JavaScript files now without restarting the container, as long as file is in the correct place, it will be picked.
  2. You can create a maintenance.html file inside the customize directory to have a custom maintenance page for scheduled downtime.

Customizing uWSGI configuration

By default, you can only configure processes, threads and listen settings of uWSGI using environment variables. If you want to configure more uWSGI settings, you can supply your uWSGI configuration by following these steps:

  1. Create the uWSGI configuration file in the customization/configuration directory. For the sake of this example, let's assume the filename is custom_uwsgi.ini.
  2. In dashboard and api services of docker-compose.yml, add volumes as following
  services:
    dashboard:
      ... # other configuration
      volumes:
        ... # other volumes
        - ${PWD}/customization/configuration/custom_uwsgi.ini:/opt/openwisp/uwsgi.ini:ro
    api:
      ... # other configuration
      volumes:
        ... # other volumes
        - ${PWD}/customization/configuration/custom_uwsgi.ini:/opt/openwisp/uwsgi.ini:ro

Changing Python Packages

You can build with your own python package by creating a file named .build.env in the root of the repository, then set the variables inside .build.env file in <variable>=<value> format. Multiple variable should be separated in newline. These are the variables that can be changed:

  • OPENWISP_MONITORING_SOURCE
  • OPENWISP_FIRMWARE_SOURCE
  • OPENWISP_CONTROLLER_SOURCE
  • OPENWISP_NOTIFICATION_SOURCE
  • OPENWISP_TOPOLOGY_SOURCE
  • OPENWISP_RADIUS_SOURCE
  • OPENWISP_IPAM_SOURCE
  • OPENWISP_USERS_SOURCE
  • OPENWISP_UTILS_SOURCE
  • DJANGO_X509_SOURCE
  • DJANGO_SOURCE

For example, if you want to supply your own django and openwisp-controller source, your .build.env should be written like this:

DJANGO_SOURCE=django==3.2
OPENWISP_CONTROLLER_SOURCE=https://github.com/<username>/openwisp-controller/tarball/master

Disabling Services

Right now, this is only tentative guide. Errata may exist. Please report errors on the gitter channel.

  • openwisp-dashboard: You cannot disable the openwisp-dashboard. It is the heart of OpenWISP and performs core functionalities.
  • openwisp-api: You cannot disable the openwisp-api. It is required for interacting with your devices.
  • openwisp-websocket: Removing this container will cause the system to not able to update real-time location for mobile devices.

If you want to disable a service, you can simply remove the container for that service, however, there are additional steps for some images:

  • openwisp-network-topology: Set the USE_OPENWISP_TOPOLOGY variable to False.
  • openwisp-firmware-upgrader : Set the USE_OPENWISP_FIRMWARE variable to False.
  • openwisp-monitoring : Set the USE_OPENWISP_MONITORING variable to False.
  • openwisp-radius : Set the USE_OPENWISP_RADIUS variable to False.
  • openwisp-postgres: If you are using a seperate database instance,
    • Ensure your database instance is reachable by the following OpenWISP containers: openvpn, freeradius, celerybeat, celery, celery_monitoring, websocket, api, dashboard.
    • Ensure your database server supports GeoDjango. (Install PostGIS for PostgreSQL)
    • Change the database configuration variables to point to your instances, if you are using SSL, remember to set DB_SSLMODE, DB_SSLKEY, DB_SSLCERT, DB_SSLROOTCERT.
    • If you are using SSL, remember to mount volume containing the certificates and key in all the containers which contact the database server and make sure that the private key permission is 600 and owned by root:root.
    • In your database, create database with name <DB_NAME>.
  • openwisp-postfix:

Development

Workbench setup

  1. Install Docker & Docker Compose v2.
  2. In the root of the repository, run make develop, when the containers are ready, you can test them out by going to the domain name of the modules.

Notes:

  • Default username & password are admin.
  • Default domains are: dashboard.openwisp.org and api.openwisp.org.
  • To reach the dashboard you may need to add the openwisp domains set in your .env to your hosts file, example: bash -c 'echo "127.0.0.1 dashboard.openwisp.org api.openwisp.org" >> /etc/hosts'
  • Now you'll need to do steps (2) everytime you make a changes and want to build the images again.
  • If you want to perform actions like cleaning everything produced by docker-openwisp, please use the makefile options.

Runtests

You can run tests either with geckodriver (firefox) or chromedriver (chromium). Chromium is preferred as it checks for console log errors as well.

  1. Setup driver for selenium:

    • Setup chromedriver

      1. Install chromium:
      # On debian
      sudo apt --yes install chromium
      # On ubuntu
      sudo apt --yes install chromium-browser
      1. Check version: chromium --version
      2. Install Driver for your version: https://chromedriver.chromium.org/downloads
      3. Extract chromedriver to one of directories from your $PATH. (example: /usr/bin/)
    • Setup geckodriver

      1. Install: sudo apt --yes install firefox
      2. Check version: firefox --version
      3. Install Driver for your version: https://github.com/mozilla/geckodriver/releases
      4. Extract geckodriver to one of directories from your $PATH. (example: /usr/bin/)
  2. Install selenium: python3 -m pip install selenium

  3. (Optional) Configure: open tests/config.json and configure variables as per your requirement, options are:

    driver: Name of driver to use for tests, "chromium" or "firefox"
    logs: print container's logs if an error occurs.
    logs_file: Location of the log file for saving logs generated for tests.
    headless: Run selenium chrome driver in headless mode
    load_init_data: Flag for running tests/data.py, only needs to be done once after database creation
    app_url: URL to reach the admin dashboard
    username: username for logging in admin dashboard
    password: password for logging in admin dashboard
    services_max_retries: Maximum number of retries to check if services are running
    services_delay_retries: Delay time (in seconds) to each retries for checking if services are running
  4. Run tests: make runtests

Note: To run a single test use the following command

python3 tests/runtests.py <TestSuite>.<TestCase>
# python3 tests/runtests.py TestServices.test_celery

Run Quality Assurance Checks

We use shfmt to format shell scripts and hadolint to lint Dockerfile

To format all files, Run:

./qa-format

To run quality assurance checks you can use the run-qa-checks script:

# install test requirements first
pip install requirements-test.txt

# run QA checks before committing code
./run-qa-checks

Usage

Makefile Options

Most commonly used:

  • start<USER=docker-username> <TAG=image-tag>: Start OpenWISP containers on your server.
  • pull<USER=docker-username> <TAG=image-tag>: Pull Images from registry.
  • stop: Stop make containers on your server.
  • develop: Bundles all the commands required to build the images and run containers.
  • runtests: Run testcases to ensure all the services are working.
  • clean: Aggressively purge all the containers, images, volumes & networks related to docker-openwisp.

Other options:

  • publish <USER=docker-username> <TAG=image-tag>: Build, test and publish images.
  • python-build: Generate a random django secret and set it in the .env file.
  • nfs-build: Build openwisp-nfs server image.
  • base-build: Build openwisp-base image. The base image is used in other OpenWISP images.
  • compose-build: (default) Build OpenWISP images for development.
  • develop-runtests: Similar to runtests, it runs the testcases except doesn't stop the containers after running the tests which maybe desired for debugging & analyzing failing container's logs.

docker-openwisp's People

Contributors

2stacks avatar aryamanz29 avatar atb00ker avatar bixilon avatar codesankalp avatar daffytheduck avatar hispanico avatar marfgold1 avatar nemesifier avatar nikitaermishin avatar pandafy avatar praptisharma28 avatar purhan avatar saurabhchakrabarti avatar scott-grimes avatar strang1ato avatar tkaefer avatar yashikajotwani12 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-openwisp's Issues

[nginx] configuration

Set correct headers for openwisp configurations by replicating the configurations of the ansible-openwisp2.

Ensure following are enabled by default but can be turned off if needed:

  • Gzip
  • HTTP/2
  • IPv6

Blocks: #7 , #2

[release] automating releases

The make publish command helps me to put the docker images on docker hub, but that's not enough, we want use Makefile to be able:

  1. Tag the new release with a version number, example openwisp/openwisp-base:0.1.0 (Images with latest tag should also be uploaded.)
  2. User to easily upload images in their own docker hub account, example atb00ker/openwisp-base:0.1.0
  3. Release edge image directly from the master branch as openwisp/openwisp-base:edge

Edit:

  • 3rd point taken care by docker hub autobuilds! ๐Ÿ˜„

run openwisp-network-topology periodic tasks

Some tasks need to run perodically for openwisp-network-topology which are currently not in a cronjob.
A celery-beat instance or a kubernetes's cronjob object needs to be implemented for this!

[bug] Settings timezone on all containers

Some of the containers don't take the timezone from the variable in the .env file.
For this task,

  1. Change the timezone to some timezone other than UTC or IST in the .env
  2. Run the containers
  3. Check the timezone of each of the container.
  4. If a container doesn't follow the timezone, fix it and submit the PR.

[improvement] Make openwisp_base configurable

The openwisp base image installs python packages hard-coded into the Dockerfile.
We want to make this process a little more configurable so that the user can supply their own python package links to create the image.

[test] Test with different environment variables

Make 3 stages:

  1. Build: should build the docker images and upload on dockerhub as mentioned here with format: openwisp/openwisp-<image>:travis-<build-number>.

  2. Test: should test the images. Multiple test builds should test images with different environment variables.

  3. Destroy: should delete the openwisp/openwisp-<image>:travis-<build-number>.

Test following:

  • With HTTPS
  • Mounting files (raddb/, nginx.conf )

[tasklist] documentation

Include installation, upgrade and usage information as well as an explaination of configuration settings in the README.

source: http://openwisp.org/gsoc/ideas-2019.html

  • Documentation for image requirements:

  • Geo-django: gdal geos proj4

  • Pillow: zlib-dev jpeg-dev

  • service_identity: openssl (openssl-dev: for installation) libffi-dev

  • gettext: envsubst

  • Document Makefile

[testing] Travis-ci builds take too long

The builds for travis take a lot of time due to docker-compose build command.
It'll be great if we can come up with something to cache the intermediate layers or some other way to reduce build time.

[bug] user created even when SMTP errors are received

While adding a new user, even if an SMTP error is received, user is still added to the database. Expected response should be Error code: 5XX.

Example errors:

To reproduce:

  • Intensionally misconfigure postfix so that it either can't relay(incase relay host is used).
    or
  • Send response to non-existing users in "mydestinations".
    or
  • Turn off the postfix service (postfix stop)

Blocked: Mentor review needed

[tasklist] postgresql image

Provide a PostgreSQL instance in a dedicated container, ensure all the other services point to this postgres instance, ensure the data is stored on persistent storage, allow using a PostgreSQL hosted elsewhere as an alternative (some users may want to use managed PostgreSQL services)

source: http://openwisp.org/gsoc/ideas-2019.html

[Bug] Freeradius container printing errors

freeradius_1  | Thu Feb 20 00:12:38 2020 : Error: rlm_sql_postgresql: 42883: UNDEFINED FUNCTION
freeradius_1  | Thu Feb 20 00:12:38 2020 : ERROR: (1) dailycounter: ERROR: rlm_sql_postgresql: ERROR:  function greater(integer, integer) does not exist
freeradius_1  | Thu Feb 20 00:12:38 2020 : ERROR: (1) dailycounter: ERROR: rlm_sql_postgresql: LINE 1: SELECT SUM(AcctSessionTime - GREATER((1582137000 - AcctStart...
freeradius_1  | Thu Feb 20 00:12:38 2020 : ERROR: (1) dailycounter: ERROR: rlm_sql_postgresql:                                      ^
freeradius_1  | Thu Feb 20 00:12:38 2020 : ERROR: (1) dailycounter: ERROR: rlm_sql_postgresql: HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
freeradius_1  | Thu Feb 20 00:12:38 2020 : ERROR: (1) dailycounter: ERROR: SQL query failed: server error
freeradius_1  | Thu Feb 20 00:12:38 2020 : Error: rlm_sql_postgresql: 42883: UNDEFINED FUNCTION
freeradius_1  | Thu Feb 20 00:12:38 2020 : ERROR: (1) dailybandwidthcounter: ERROR: rlm_sql_postgresql: ERROR:  function unix_timestamp(timestamp with time zone) does not exist
freeradius_1  | Thu Feb 20 00:12:38 2020 : ERROR: (1) dailybandwidthcounter: ERROR: rlm_sql_postgresql: LINE 1: ...           WHERE UserName='admin'             AND UNIX_TIMES...
freeradius_1  | Thu Feb 20 00:12:38 2020 : ERROR: (1) dailybandwidthcounter: ERROR: rlm_sql_postgresql:                                                              ^
freeradius_1  | Thu Feb 20 00:12:38 2020 : ERROR: (1) dailybandwidthcounter: ERROR: rlm_sql_postgresql: HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
freeradius_1  | Thu Feb 20 00:12:38 2020 : ERROR: (1) dailybandwidthcounter: ERROR: SQL query failed: server error
freeradius_1  | Thu Feb 20 00:12:38 2020 : Auth: (1) Login OK: [admin/admin] (from client radius_clients port 0)

Improve README documentation

  • Information regarding reaching the dashboard needs to be improved. (Making the hosts part clear)
  • Currently it also says /etc/hosts/ when it should be /etc/hosts (Its a file not a directory

[enchancement] Avoid repeating kubernetes configuration

Currently, the configurations in the kubernetes/ need to be repeated for every file that requires a specific value,
Example, the domain and IP addresses need to changed in 4 files, Config.yml, ExtServices.yml, Services.yml & Ingress.yml, this is not ideal and may cause different settings in different files.

[GSoC] Final Submission

Done:

  1. Fixed: #43 : Fixed in #44

Updates on issues:

  1. #32 : #to-do#
  2. #2 : #to-do#

Review:

  1. #44
  2. #30
  3. #28
  4. Pull requests related to #26:
    4.1. openwisp/django-netjsonconfig#127
    4.2. openwisp/django-x509#62
    4.3. openwisp/openwisp-controller#117 & openwisp/openwisp-controller#116
  5. Need review : #58

Blocked:

  1. Blocked by #44 :
    1.1. #51 & #50 (#11)
    1.2. #48 (#8)
  2. Pulls related to #26 : #52
  3. Need review : #28
  4. Need review : #30
  5. #2

Post-GSoC:

  1. #53 : Improvement for future.
  2. #47 : Testing to-be done after all services are ready.
  3. #54 : Finding the reason for this issue.

[bug] freeradius doesn't work with https

Error:

(1) rest: EXPAND {"username": "%{User-Name}", "password": "%{User-Password}"}
(1) rest: --> {"username": "admin", "password": "admin"}
(1) rest: Processing response header
(1) rest: ERROR: Malformed HTTP header: Status line too short
(1) rest: ERROR: Received 13 bytes of response data: HTTP/2 200
(1) rest: ERROR: Request failed: 23 - Failed writing received data to disk/application
(1) rest: ERROR: Server returned no data

The following were first thought of as the cause of the issue but testing proved these theories wrong:

  1. HTTP/2 related bug in upstream:
    Tested using HTTP/1.1 instead of HTTP/2

  2. Certificate issue, tested with:

tls = {
   tls_check_cert = no
   tls_check_cert_cn = no
}

run openwisp-radius periodic tasks

Some tasks need to run perodically for openwisp-radius which are currently not in a cronjob.
A celery-beat instance or a kubernetes's cronjob object needs to be implemented for this!

[enchancement] moving admin urls to admin namespace

  1. Find all the urls that are required by admin.
  • django_netjsonconfig.urls (django-netjsonconfig schemas)
  • openwisp_controller.pki (CRL view)
  • openwisp_controller.config (get_default_templates)
  1. Rewrite them to be used as admin urls.

[bug] Datetime issue while migrating

Datetime issue while migrating:

For this issue, look at the logs of dashboard container logs while migrating (first time the volume is created), you should see:

/usr/local/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1421: RuntimeWarning: DateTimeField Ca.validity_start received a naive datetime (2019-10-04 00:00:00) while time zone support is active.
  RuntimeWarning)
/usr/local/lib/python3.7/site-packages/django/db/models/fields/__init__.py:1421: RuntimeWarning: DateTimeField Cert.validity_start received a naive datetime (2019-10-04 00:00:00) while time zone support is active.
  RuntimeWarning)

[tasklist] OpenVPN image

Provide a default management VPN based on OpenVPN in a dedicated container. The VPN shall be also pre-configured in OpenWISP, both as a VPN Server and a related VPN client template (ask questions to your mentors to know more about this), the OpenVPN configuration used in the container shall be kept in sync with the definition available in the VPN Server of OpenWISP. The Certificate Revocation List of the VPN shall be downloaded periodically from openwisp on the filesystem (a script run in a crontab) of the VPN server and the configuration of the VPN server

source: http://openwisp.org/gsoc/ideas-2019.html

[enchancement] Removing psql shell commands

Remove psql statements from containers for a more pythonic approach that give proper error codes (like using psycopg2).
The psql statements are used in the shell script: common/utils.sh.

Blocked: Read comments on the issue

[tasklist] travis-ci

Implement automated testing with basic checks for each service, eg: for the admin interface, send and HTTP request expecting to see the login page (at least one similar checks should be implemented for each service); the tests shall be executed in a travis-ci build

source: http://openwisp.org/gsoc/ideas-2019.html

Note:

  • Add Test for checking postfix working on a fresh install by checking the creation of a new user.

Connections branch not working in application

Connection issue: When trying to setup the openwisp_controller.connection, I am facing an issue that when I go to change any of the devices configuration and apply, I get a timeout because request takes too long.

Note 1:

  • I put the openwisp-controller in a container and tested it. (Working)
  • I put the common/ files in a seperate folder beside the openwisp-controller in the container and tested. (Not Working)
  • I copied the settings.py and urls.py to the common/ folder from the openwisp-controller/tests/ and tested. (Not Working)

Now,
Since the first bullet worked, I think that dependencies are not causing it.
Since, the third bullet fails, I think that misconfiguration in settings.py or urls.py is not causing it.

Note 2:
The file /usr/local/lib/python3.7/site-packages/channels/worker has line consumer_finished.send(sender=self.__class__) which "hangs" the execution.

Note 3:
It's not that channels / django / connection branch or dependencies have any issue with alpine packages or postgresql backend or dockerization of worker and runserver into different containers. It's all working in an image here: openwisp/openwisp-controller#111

Note 4:
Since the openwisp/openwisp-controller#111 was working, I decided to use it as a base image and build the images from there and that lead the testing in Note 1. Just incase that might be useful for debugging here is the commit for that: atb00ker@ec427d4

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.