Code Monkey home page Code Monkey logo

docker-bpo's Introduction

About

This repository allows you to create a Docker image able to run a development instance of the Roundup tracker living at http://bugs.python.org

Usage

  1. Pull python/docker-bpo image from docker hub:
docker pull docker.io/python/docker-bpo
  1. Clone roundup and switch to the bugs.python.org branch:
git clone [email protected]:psf/bpo-roundup roundup
cd roundup
git checkout bugs.python.org
cd ..
  1. Clone the python-dev instance alongside with roundup:
git clone [email protected]:psf/bpo-tracker-cpython python-dev
  1. Setup configuration:
cd python-dev
mkdir db
cp config.ini.template config.ini
cp detectors/config.ini.template detectors/config.ini
cd ..
  1. To run the b.p.o container, cd in the dir where you cloned both roundup and python-dev and run:
docker run --rm -it -p 9999:9999 -v `pwd`:/opt/tracker docker.io/python/docker-bpo

This will launch the container in interactive mode, and mount the dir with the clones to the container's /opt/tracker.

  1. Every time the container is run, the tracker is initialized and 3 users are created. You can then run the tracker with:
rd-start
  1. Your local instance of bugs.python.org should be available at http://localhost:9999 On top of the two default users (admin and anonymous), 3 additional users are also available:
  • user: a regular user
  • developer: a developer (triager) that signed the cla
  • coordinator: a coordinator and committer that signed the cla

You can login as any of these 3 users using pass as password.

Notes

  • Every time you stop the container, all the users and issues you created will be deleted.
  • Every time you start the container, the tracker is initialized and the 3 users are created.
  • Once the container is running, you can start and stop the tracker with rd-start and ctrl+c.
  • When you register a new user, look in python-dev/debugmail.txt: you will find a confirmation URL. Copy it in your broswer and replace all the escaped =3D with =.
  • You can edit the code in roundup and python-dev from outside the container, since those dir are shared.
  • If you edit the code, you'll need to restart the tracker. Changes to the templates (the html dir) do not require a restart.
  • See https://wiki.python.org/moin/TrackerDevelopment for more info.

Troubleshooting

If you cannot access the b.p.o instance through your browser, chances are you may be running the docker on a VM, such a boot2docker. Please modify your NAT settings in that case.

If you have problems with empty /opt/tracker directory it means that SELinux is causing the problem, append :Z which will apply appropriate SELinux context:

docker run --rm -it -p 9999:9999 -v `pwd`:/opt/tracker:Z docker.io/python/docker-bpo

On some systems (Fedora, Red Hat, Centos) due to security constraints docker requires sudo to be run, make sure to update above commands appropriately in that case.

ACKS

Thanks to @introom for the initial version of this repo.

docker-bpo's People

Contributors

anishshah avatar dependabot[bot] avatar ezio-melotti avatar introom avatar rajpratik71 avatar soltysh avatar zware avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-bpo's Issues

Syntax error in init.sh on Ubuntu 16.10

I tried to rebuild the image with Ubuntu 16.10, and when I run docker start I got the error:
/init.sh: 7: /init.sh: Syntax error: "(" unexpected (expecting "fi")

I removed the functions from init.sh (i.e. stop_all() {...}) and I was able to rebuild and start the container, however I noticed that those were added in ed0498a for Fedora.

If this doesn't work on Fedora without the function, is there a way to make it work or should we just remove fedora support (why do we even have it?)? FWIW I also tried the syntax function stop_all {...} (without ()) but it doesn't work. Replacing the shebang with /bin/bash might fix the problem for both, but I haven't tried.

Add a script to populate the db

Currently after starting the container and running rd-admin init, the db is empty.
There should be a script to easily populate the db, able to quickly:

  1. create a few users with different permissions (a Coordinator, a Developer, and a regular user)
  2. create a few issues with a few messages each
  3. create a specific number of users/issues/messages/etc with specific parameters
  4. perhaps import an issue from bpo

This script might also be exploited by the tests.

Add a script to send GH payloads

In order to test GH integration, there should be a script able to send requests like the ones sent by GH when a PR is created or modified or when a PR/commit message mentions bpo-NNNNN.

The script should be able to:

  1. read and send payloads from a file
  2. generate payloads of the given type, with the values provided or with default values.

This script might also be exploited by the tests.

No module named sets_ when running rd-start

@ezio-melotti I didn't notice this until now that I'm building the openshift version of bpo, when I run rd-start on a clean fresh repo clone I'm getting this. I didn't catch it earlier beacuse I had sets_.pyc in place, when I removed it I'm getting the exact same error. Looks like we need an update, any ideas?

tracker@ac87f66780bb:/$ rd-start
Traceback (most recent call last):
  File "/home/tracker/bin/roundup-server", line 11, in <module>
    run()
  File "/opt/tracker/roundup/roundup/scripts/roundup_server.py", line 978, in run
    httpd = config.get_server()
  File "/opt/tracker/roundup/roundup/scripts/roundup_server.py", line 633, in get_server
    for (name, home) in tracker_homes])
  File "/opt/tracker/roundup/roundup/instance.py", line 327, in open
    return Tracker(tracker_home, optimize=optimize)
  File "/opt/tracker/roundup/roundup/instance.py", line 102, in __init__
    self.detectors = self.get_extensions('detectors')
  File "/opt/tracker/roundup/roundup/instance.py", line 207, in get_extensions
    self._execfile(os.path.join(dirname, name), env)
  File "/opt/tracker/roundup/roundup/instance.py", line 239, in _execfile
    self._exec(self._compile(fname), env)
  File "/opt/tracker/roundup/roundup/instance.py", line 233, in _exec
    exec(obj, env)
  File "/opt/tracker/python-dev/detectors/autonosy.py", line 8, in <module>
    from roundup.anypy.sets_ import set
ImportError: No module named sets_

Update backend_name location

Roundup moved the setting for the database backend from the db/backend_name file to a setting in the config.ini.
I'm in the process of updating Roundup and the python-dev instance, and once I deploy the update this issue should be taken care of. I already added the backend to config.ini.template, so it should be enough to remove the echo postgres > db/backend_name from some of the scripts and the readme.

These are the notes from doc/upgrading.txt:

Database back end specified in config.ini (REQUIRED)

The db/backend_name file is no longer used to configure the database
backend being used for a tracker. The backend is now configured in the
config.ini file using the backend option located in the [rdbms]
section. For example if db/backend_name file contains sqlite, a new
entry in the tracker's config.ini will need to be created::

  [rdbms]
  ...

  # Database backend.
  # Default:
  backend = sqlite

Once the config.ini file has been updated with the new backend option,
you can safely delete the db/backend_name file.

Note: the backend_name file may be located in a directory other than
db/ if you have configured the database option in the [main]
section of the config.ini file to be something other than db.

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.