Git Product home page Git Product logo

docker's Introduction

Peering Manager

Peering Manager is a BGP session management tool. Initially conceived as a way to document Internet Exchanges points and peering sessions, its goal is now to provide a source of truth and configuration management for external BGP sessions of all kind (transit, customers, peering, …).

The complete documentation for Peering Manager can be found at Read the Docs. A public demo instance is available at https://demo.peering-manager.net/.

Discussion

  • GitHub Discussions - Discussion forum hosted by GitHub; ideal for Q&A and other structured discussions
  • Slack - Real-time chat hosted by the NetDev Community in channel #peering-manager; best for unstructured discussion or just hanging out

Requirements

Peering Manager is written with the Django with a PostgreSQL database, Redis for caching/task processing and requires Python 3 with some dependencies to run. For a complete list of requirements, see requirements.txt.

Tested Python versions are 3.10, 3.11 and 3.12.

The best way to start setting up this tool is to use pip within a virtualenv.

Build Status Coverage Status Documentation Status

Helping

You can help this project in many ways. Of course you can ask for features, give some ideas for future development, open issues if you found any and contribute to the code with pull requests and patches. You can also support the development of this project by donating some coins.

docker's People

Contributors

dependabot[bot] avatar gmazoyer avatar jamesditrapani avatar jbemmel avatar mngan avatar rlanyi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

docker's Issues

Can't configure LOGGING in docker image

Currently there is no way to specify the logging parameters when using the docker image.

The LOGGING configuration should get broken out to a separate logging.py file, so you can bind an external file into the container. Then either reference the logging.py file from the docker version of configuration.py or make the core settings.py try to import peering_manager.logging if it exists. Netbox uses the latter approach, similar to the import of ldap_config.py.

Unable to get DEBUG output

I am trying to increase the DEBUG loglevel for troubleshooting, but I am unable to get debug output in the console

I tried:

  • editing env/peering-manager.env to set DEBUG=True and LOGLEVEL=DEBUG
  • editing configuration/logging.py to uncomment the custom settings (hardcoding LOGLEVEL='DEBUG')
  • manually changing log statements from log.debug to log.info

The console output after docker-compose up remains at the same level.
Any suggestions?

enum.utils.Color renamed to enum.utils.Colour

In PM1.7 it looks like the name of enum.utils.Color was changed to enum.utils.Colour. So the startup script in the docker image needs to be similarly updated to match

peering-manager_1         | Traceback (most recent call last):
peering-manager_1         |   File "/opt/peering-manager/./manage.py", line 11, in <module>
peering-manager_1         |     execute_from_command_line(sys.argv)
peering-manager_1         |   File "/opt/peering-manager/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
peering-manager_1         |     utility.execute()
peering-manager_1         |   File "/opt/peering-manager/venv/lib/python3.9/site-packages/django/core/management/__init__.py", line 440, in execute
peering-manager_1         |     self.fetch_command(subcommand).run_from_argv(self.argv)
peering-manager_1         |   File "/opt/peering-manager/venv/lib/python3.9/site-packages/django/core/management/base.py", line 414, in run_from_argv
peering-manager_1         |     self.execute(*args, **cmd_options)
peering-manager_1         |   File "/opt/peering-manager/venv/lib/python3.9/site-packages/django/core/management/base.py", line 460, in execute
peering-manager_1         |     output = self.handle(*args, **options)
peering-manager_1         |   File "/opt/peering-manager/venv/lib/python3.9/site-packages/django/core/management/commands/shell.py", line 127, in handle
peering-manager_1         |     exec(sys.stdin.read(), globals())
peering-manager_1         |   File "<string>", line 1, in <module>
peering-manager_1         |   File "/usr/lib/python3.9/runpy.py", line 285, in run_path
peering-manager_1         |     return _run_code(code, mod_globals, init_globals,
peering-manager_1         |   File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
peering-manager_1         |     exec(code, run_globals)
peering-manager_1         |   File "/opt/peering-manager/startup_scripts/__main__.py", line 21, in <module>
peering-manager_1         |     runpy.run_path(f.path)
peering-manager_1         |   File "/usr/lib/python3.9/runpy.py", line 268, in run_path
peering-manager_1         |     return _run_module_code(code, init_globals, run_name,
peering-manager_1         |   File "/usr/lib/python3.9/runpy.py", line 97, in _run_module_code
peering-manager_1         |     _run_code(code, mod_globals, init_globals,
peering-manager_1         |   File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
peering-manager_1         |     exec(code, run_globals)
peering-manager_1         |   File "/opt/peering-manager/startup_scripts/020_tags.py", line 3, in <module>
peering-manager_1         |     from utils.enums import Color
peering-manager_1         | ImportError: cannot import name 'Color' from 'utils.enums' (/opt/peering-manager/utils/enums.py)
peering-manager-docker_peering-manager_1 exited with code 1

Please do not specify ports in docker-compose.yml

Please can you move this from docker-compose.yml to docker-compose.override.yml.example and add a note to the README that this file should be copied and configured.

services:
  peering-manager:
    ports:
      - 8080

Although I am specifying my own required ports 127.0.0.1:8001:8080 in docker-compose.override.yml, it seems that this is merged rather than overriding docker-compose.yml, resulting in a duplicate set of port mappings - the one from your file being wide open to the Internet if the sysadmin does not notice.

Pulling peering-manager-worker - Not found?

When using the included docker-compsoe.yml I am getting the following,

Pulling peering-manager-worker (peering-manager:latest)...
ERROR: The image for the service you're trying to recreate has been removed. If you continue, volume data could be lost. Consider backing up your data before continuing.

Any idea why it is saying that the image has been removed?

LDAP Configuration doesn't pick up AUTH_LDAP_USER_SEARCH correctly.

I am trying to debug LDAP configuration for allowing users to sign in with single sign on. My LDAP server is OpenLDAP with base schemas available for posixAccount and InetOrgPerson, which should be sufficient. SSO from netbox to ldap works, so I know it is possible to get django-auth-ldap to be happy with this setup at the least.

I added the following lines to my environment file to configure ldap, and changed the tag on the pulled image to be the ldap one:

AUTH_LDAP_ATTR_FIRSTNAME: "cn"
AUTH_LDAP_GROUP_SEARCH_BASEDN: "dc=example,dc=com"
AUTH_LDAP_GROUP_SEARCH_CLASS: "groupOfNames"
AUTH_LDAP_GROUP_TYPE: "GroupOfNamesType"
AUTH_LDAP_IS_ADMIN_DN: "cn=netbox_admin,ou=group,dc=example,dc=com"
AUTH_LDAP_IS_SUPERUSER_DN: "cn=netbox_admin,ou=group,dc=example,dc=com"
AUTH_LDAP_MIRROR_GROUPS: "true"
AUTH_LDAP_REQUIRE_GROUP_DN: "cn=netbox_ro,ou=group,dc=example,dc=com"
AUTH_LDAP_SERVER_URI: "ldaps://ldap.example.com"
AUTH_LDAP_START_TLS: "false"
AUTH_LDAP_USER_SEARCH_BASEDN: "ou=people,dc=example,dc=com"
AUTH_LDAP_USER_SEARCH_ATTR: "uid"
AUTH_LDAP_USER_DN_TEMPLATE: "uid=%(user)s,ou=people,dc=example,dc=com"
AUTH_LDAP_BIND_AS_AUTHENTICATING_USER: "true"

I reliably get the error message that AUTH_LDAP_USER_SEARCH is not an instance of LDAPSearch:

image

However when I check the type of that config attribute via a manage.py shell, the type is clearly LDAPSearch:

>>> type(_loaded_configurations[1].AUTH_LDAP_USER_SEARCH)
<class 'django_auth_ldap.config.LDAPSearch'>

I'm at my whit's end here for what could still be preventing this from working, is there something I've just missed?

Templates not found

I have just brought up compose after cloning the repo, and the application seems to be working - I logged into the web UI at :8080 and added an ASN, but clicking on "Import from PeeringDB" under internet exchanges results in a redirect to :8080/internet-exchanges/peeringdb-import/ and the following error:

<class 'peering.models.AutonomousSystem.DoesNotExist'>
AutonomousSystem matching query does not exist.
Python version: 3.9.1
Peering Manager version: v1.3.0

Similarly, clicking on "Add a Peering Session" under an AS's Direct Peering Sessions tab results in a redirect to :8080/direct-peering-sessions/add/?autonomous_system=&return_url= and error

<class 'django.template.exceptions.TemplateDoesNotExist'>
peering/session/direct/add_edit.html
Python version: 3.9.1
Peering Manager version: v1.3.0

Any help would be greatly appreciated!

Cannot import url from django.conf.urls

For some reason the docker images are being built with Django 4.0 instead of 3.x. I tried both the "latest" image and the "snapshot" image and got the same problem:

peering-manager_1         | /opt/peering-manager/peering_manager/settings.py:51: UserWarning: MY_ASN is no longer supported and will be removed in 2.0.
peering-manager_1         |   warnings.warn("MY_ASN is no longer supported and will be removed in 2.0.")
peering-manager_1         | /opt/peering-manager/peering_manager/settings.py:265: UserWarning: DEFAULT_TIMEOUT is no longer supported under REDIS configuration. Set RQ_DEFAULT_TIMEOUT instead.
peering-manager_1         |   warnings.warn(
 peering-manager_1         | Traceback (most recent call last):
peering-manager_1         |   File "/opt/peering-manager/./manage.py", line 11, in <module>
peering-manager_1         |     execute_from_command_line(sys.argv)
peering-manager_1         |   File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 425, in execute_from_command_line
peering-manager_1         |     utility.execute()
peering-manager_1         |   File "/usr/local/lib/python3.10/site-packages/django/core/management/__init__.py", line 419, in execute
peering-manager_1         |     self.fetch_command(subcommand).run_from_argv(self.argv)
peering-manager_1         |   File "/usr/local/lib/python3.10/site-packages/django/core/management/base.py", line 373, in run_from_argv
peering-manager_1         |     self.execute(*args, **cmd_options)
peering-manager_1         |   File "/usr/local/lib/python3.10/site-packages/django/core/management/base.py", line 417, in execute
peering-manager_1         |     output = self.handle(*args, **options)
peering-manager_1         |   File "/usr/local/lib/python3.10/site-packages/django/core/management/base.py", line 90, in wrapped
peering-manager_1         |     res = handle_func(*args, **kwargs)
peering-manager_1         |   File "/usr/local/lib/python3.10/site-packages/django/core/management/commands/migrate.py", line 75, in handle
peering-manager_1         |     self.check(databases=[database])
peering-manager_1         |   File "/usr/local/lib/python3.10/site-packages/django/core/management/base.py", line 438, in check
peering-manager_1         |     all_issues = checks.run_checks(
peering-manager_1         |   File "/usr/local/lib/python3.10/site-packages/django/core/checks/registry.py", line 77, in run_checks
peering-manager_1         |     new_errors = check(app_configs=app_configs, databases=databases)
peering-manager_1         |   File "/usr/local/lib/python3.10/site-packages/django/core/checks/urls.py", line 13, in check_url_config
peering-manager_1         |     return check_resolver(resolver)
peering-manager_1         |   File "/usr/local/lib/python3.10/site-packages/django/core/checks/urls.py", line 23, in check_resolver
peering-manager_1         |     return check_method()
peering-manager_1         |   File "/usr/local/lib/python3.10/site-packages/django/urls/resolvers.py", line 446, in check
peering-manager_1         |     for pattern in self.url_patterns:
peering-manager_1         |   File "/usr/local/lib/python3.10/site-packages/django/utils/functional.py", line 48, in __get__
peering-manager_1         |     res = instance.__dict__[self.name] = self.func(instance)
peering-manager_1         |   File "/usr/local/lib/python3.10/site-packages/django/urls/resolvers.py", line 632, in url_patterns
peering-manager_1         |     patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
peering-manager_1         |   File "/usr/local/lib/python3.10/site-packages/django/utils/functional.py", line 48, in __get__
peering-manager_1         |     res = instance.__dict__[self.name] = self.func(instance)
peering-manager_1         |   File "/usr/local/lib/python3.10/site-packages/django/urls/resolvers.py", line 625, in urlconf_module
peering-manager_1         |     return import_module(self.urlconf_name)
peering-manager_1         |   File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
peering-manager_1         |     return _bootstrap._gcd_import(name[level:], package, level)
peering-manager_1         |   File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
peering-manager_1         |   File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
peering-manager_1         |   File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
peering-manager_1         |   File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
peering-manager_1         |   File "<frozen importlib._bootstrap_external>", line 883, in exec_module
peering-manager_1         |   File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
peering-manager_1         |   File "/opt/peering-manager/peering_manager/urls.py", line 2, in <module>
peering-manager_1         |     from django.conf.urls import include, url
peering-manager_1         | ImportError: cannot import name 'url' from 'django.conf.urls' (/usr/local/lib/python3.10/site-packages/django/conf/urls/__init__.py)
peering-manager_1         | ⏳ Waiting on DB... (24s / 30s)

Running "pip list" inside the container shows it's using Django 4.0 despite the requirements file saying >=3.2,<3.3.

cron in docker image

The PM docker image doesn’t seem to have cron installed. Is it intended to do the scheduled tasks some other way?

nginx missing from docker built on repo

Hello,
I pull docker image built from the repo, I got 404 for all the REQ toward /static/* , I had to log into the container ,apt install nginx and copy /etc/peering-manager/nginx/nginx.conf to /etc/nginx/nginx.conf. Not sure I'm doing it the right way. Anyway it seems that sth was missing

LDAP libs not properly installed

LDAP libs are not properly installed in the latest Docker image:

root@12e4fd9ca22d:/opt/peering-manager# dpkg --list | grep libldap
root@12e4fd9ca22d:/opt/peering-manager# 
root@12e4fd9ca22d:/var/log# cat apt/history.log | grep libldap2-dev
root@12e4fd9ca22d:/var/log#

Fixed by manually running the apt-get install lines from the dockerfile within the container:

root@12e4fd9ca22d:/opt/peering-manager# apt-get update -y \
>     && apt-get install -y \
>        build-essential \
>        python3-dev \
>        libldap2-dev \
>        libsasl2-dev \
>        libssl-dev \
>        libxml2-dev \
>        libxslt1-dev \
>        zlib1g-dev

Can't seem to locate anywhere in the Docker hub image where we attempt to install libldap2-dev https://hub.docker.com/layers/peeringmanager/peering-manager/latest/images/sha256-1d[…]a32a7e0e04db6d1e284e52c4f527a6831fcdb6f5e9ced?context=explore

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.