Commit graph

14 commits

Author SHA1 Message Date
Kevin Morris
b98159d5b9
change(docker): use step-ca for CA + cert generation
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-27 16:43:29 -08:00
Kevin Morris
a025118344
change(docker): get python-poetry from arch instead of poetry
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-17 01:36:18 -08:00
Kevin Morris
4b8963b7ba
feat(docker): add cron service (aurblup + mkpkglists)
Normally, these scripts are used to update official providers
in the aurweb database along with archives that can be retrieved.

Run both of these scripts in a 5 minute cron job, to both reflect
the live instance database and production load.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-11-09 00:29:19 -08:00
Kevin Morris
c4163547f6
fix(docker): swap package cgit -> cgit-aurweb
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-21 11:10:55 -07:00
Kevin Morris
7bfc2bf9b4
fix(FastAPI): Improve sqlite testing speed
This commit adds a new Arch dependency: `libeatmydata`, which
provides the `eatmydata` executable that stubs out fsync() operations.
We use `eatmydata` to run our sharness and pytests in Docker now.

With `autocommit=True`, required by SQLAlchemy to keep the
session up to date with external DB modifications, many fsync
calls are used in the SQLite backend; especially because we're wiping
and creating records in every DB-bound test.

**Before:**

- mysql: 1m42s (elapsed during pytest run)
- sqlite: 3m06s (elapsed during pytest run)

**After:**

- mysql: 1m40s (elapsed during pytest run)
- sqlite: 1m50s (elapsed during pytest run)

Shout out to @klausenbusk, who suggested this as a possible fix,
and it was. Thanks, Kristian!

Closes #120

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-10-03 15:59:52 -07:00
Kevin Morris
2f9994807b
use Poetry to deal with deps and package install
As the new-age Python package manager, Poetry brings a lot
of good additions to the table. It allows us to more easily
deal with virtualenvs for the project and resolve dependencies.

As of this commit, `requirements.txt` is replaced by Poetry,
configured at `pyproject.toml`.

In Docker and GitLab, we currently use Poetry in a root fashion.
We should work toward purely using virtualenvs in Docker, but,
for now we'd like to move forward with other things. The project
can still be installed to a virtualenv and used on a user's system
through Poetry; it is just not yet doing so in Docker.

Modifications:

* docker/scripts/install-deps.sh
    * Remove python dependencies.
* conf/config.defaults
    * Script paths have been updated to use '/usr/bin'.
* docker/git-entrypoint.sh
    * Use '/usr/bin/aurweb-git-auth' instead of
      '/usr/local/bin/aurweb-git-auth'.

Additions:

* docker/scripts/install-python-deps.sh
    * A script used purely to install Python dependencies with Poetry.
      This has to be used within the aurweb project directory and
      requires system-wide dependencies are installed beforehand.
    * Also upgrades system-wide pip.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-09-04 15:46:40 -07:00
Hunter Wittenborn
eff7d478ab Updated CI tests for pip dependencies; Changed styling in install-deps.sh 2021-08-28 20:12:35 -05:00
Hunter Wittenborn
85b1a05d01 Removed pip dependencies from docker/scripts/install-deps.sh 2021-08-28 19:51:05 -05:00
Kevin Morris
968ed736c1
add python-orjson dependency
python-orjson speeds up a lot of JSON serialization steps,
so we choose to use it over the standard library json module.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-08-17 19:58:29 -07:00
Kevin Morris
91e769f603
FastAPI: add redis integration
This includes the addition of the python-fakeredis package,
used for stubbing python-redis when a user does not have a
configured cache.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-08-17 19:58:28 -07:00
Kevin Morris
96d1af9363
docker-compose: add redis service
Now, the fastapi docker-compose service uses the new redis
service for a cache option.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-08-17 19:58:26 -07:00
Kevin Morris
35851d5533
Docker: add service 'memcached'
Additionally, setup memcached for php-fpm.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-08-16 22:09:09 -07:00
Kevin Morris
8d6e782ba1 add python-feedgen dependency
Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-07-01 11:09:09 -07:00
Kevin Morris
f4406ccf5c Docker: Centralize repo dependencies
Now, we have `docker/scripts/install-deps.sh`, a script used
by both Docker and .gitlab-ci.yml. We can now focus on changing
deps in this script along as well as documentation going forward.

Signed-off-by: Kevin Morris <kevr@0cost.org>
2021-06-29 21:53:18 -07:00