Update Testing Guide

Kevin Morris 2021-09-20 08:18:46 +00:00
parent 832def759f
commit 2a6d6b8eef

@ -73,16 +73,29 @@ At this point, we have two choices:
## Development Servers ## Development Servers
When a user runs `docker-compose up -d nginx`, a few things happen: When a user runs `docker-compose up -d nginx`, a few things happen
<small>(some services are omitted)</small>:
1. The `ca` service starts 1. The [ca](#certificate-authority) service starts
2. The `mariadb` service starts 2. The [mariadb](#mariadb) service starts
3. The `git` service starts 3. The [git](#git) service starts
4. The `fastapi` service starts 4. The [redis](#redis) service starts
5. The `php-fpm` service starts 5. The `memcached` service starts
6. The `nginx` service starts 6. The [fastapi](#fastapi) service starts
7. The [php-fpm](#php-fpm) service starts
8. The [nginx](#nginx) service starts
- This last service depends on various other services. - This last service depends on various other services.
###### Notes
The `fastapi` and `php-fpm` services live update when you change
source files in your tree.
The first step of starting services takes several minutes on Docker
currently; however, if you load up and rely on hot reload, you can
do work and restart specific services if need be without concern
(at least, until you add a dependency).
#### Certificate Authority #### Certificate Authority
The `ca` service will produce a `cache/ca.root.pem` file, which is used to The `ca` service will produce a `cache/ca.root.pem` file, which is used to
@ -92,7 +105,8 @@ sign the `cache/localhost.cert.pem` certificate. Users can import our
#### mariadb #### mariadb
The `mariadb` service will bind to `localhost:13306` on the host machine. This The `mariadb` service will bind to `localhost:13306` on the host machine. This
allows users to inspect the database used by the `fastapi` and `php-fpm` services: allows users to inspect the database used by the `fastapi` and `php-fpm`
services:
$ mysql -h127.0.0.1 -P13306 -uaur -paur aurweb \ $ mysql -h127.0.0.1 -P13306 -uaur -paur aurweb \
-e "SELECT * FROM Packages" -e "SELECT * FROM Packages"
@ -102,6 +116,40 @@ as the mysql client does something other than reach the mariadb server with
`localhost` (assumed some type of confusion with localhost, didn't look much `localhost` (assumed some type of confusion with localhost, didn't look much
further). further).
#### git
The `git` service runs sshd using the aurweb-git-auth backend and
aurweb-git-update hook. It is accessible at `ssh://aur@localhost:2222` on
the host system. Users can use this local sshd just like a production
AUR instance for git management.
Note that in order for you to do anything with the sshd, you'll need
to either login to a dummy user or register an account and setup
your public SSH key like you would on aur.archlinux.org.
#### redis
The `redis` service is used as the Redis backend for the `fastapi` service.
You can converse with the service on `localhost:16379`:
$ redis-cli -p 16379
...
#### fastapi
The `fastapi` service runs the aurweb FastAPI implementation through
an ASGI server. Users can configure this with the `FASTAPI_BACKEND`
environment variable: `uvicorn` or `hypercorn`. It enables hot
reloading of the server for changes in all directories in your tree,
which automatically reflects on the [nginx](#nginx) service.
This service is exposed on `localhost:18000`.
#### php-fpm
This service is exposed on `localhost:19000` and majorly depends on
[./web](https://gitlab.archlinux.org/archlinux/aurweb/-/tree/pu/web).
###### Generating Dummy Data ###### Generating Dummy Data
<small>**NOTE**: This step requires Python dependencies to be accessible from <small>**NOTE**: This step requires Python dependencies to be accessible from