This changes the stdout/stderr buffering behavior of Python. Without it,
indexing scripts don't stream updates and use really big buffers.
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
By default it never restarts. It is a good idea to avoid leaks across
weeks of a Python process running.
Also remove useless comment about processes value (16 is probably higher
than CPU count and will be fine).
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Apparently we might need this for some C code extensions:
> Forcing a WSGI application to run within the first interpreter can be
> necessary when a third party C extension module for Python has used
> the simplified threading API for manipulation of the Python GIL and
> thus will not run correctly within any additional sub interpreters
> created by Python.
https://www.modwsgi.org/en/latest/configuration-directives/WSGIApplicationGroup.html
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Before, we copied all source files at the start of the Dockerfile; that
meant we always rebuilt most steps. Only copy requirements.txt first,
then copy the rest after many steps.
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
Set env variable $ELIXIR_ROOT inside the Dockerfile. That is used by
utils/index-all-repositories to know where to put repo/data directories.
With that adjustment the docker setup is working as indicated in the
README.
Fix the following error:
$ docker exec -it -e PYTHONUNBUFFERED=1 elixir-container /bin/bash -c \
'export "PATH=/usr/local/elixir/venv/bin:$PATH" ; /usr/local/elixir/utils/index-all-repositories'
Error: ELIXIR_ROOT environment variable not set
It's where Elixir data are stored
Following official documentation, move away from bsddb3 to berkeleydb.
https://www.jcea.es/programacion/pybsddb.htm
Main change: key and values are now bytes and not strings.
The code diff is really simple because all operations on keys/values is
done from elixir/data.py and that works fine with both bytes and
strings (it does explicit casting).
* Remove repository indexing from Dockerfile
* Copy Elixir code from the context instead of cloning it from Github
* Move Dockerfile from docker/debian/Dockerfile to docker/Dockerfile
* Add docs for the new Dockerfile
* Add an utility script that allows easier repository configuration
* Add .dockerignore
* Use relative paths in Docker section in README
Two things get fixed here:
- README says downloading Dockerfile is enough. It is not; Debian
Dockerfile requires docker/debian/000-default.conf file.
- docker/debian/Dockerfile links to 000-default.conf file using:
COPY ./docker/debian/000-default.conf /etc/apache2/sites-available/000-default.conf
This means following command in README cannot work:
docker build [...] .
Either you set cwd to root Git repo and Dockerfile is not found, or
you set cwd to docker/debian/ and 000-default.conf is not found.
Correct command would be:
docker build -f docker/debian/Dockerfile [...] .
We fix Dockerfile by expecting 000-default.conf to be in cwd. We fix
README by rewording the paragraph and updating commands to work based
on Git repo root directory.
Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com>
* Pin base version to debian:bookworm
* Install falcon with apt
* Use pipx to install Pygments, since global package installation with
pip is not supported anymore
* Add elixir-data to git safe directories so that git ran from script.sh
stops complaining
* Update repo permissions so that git ran from the cgi script stops
complaining
* Move apache configuration to an external file for better readability