From 7c3637971571c1b5757d634aa627a91ff96999da Mon Sep 17 00:00:00 2001 From: Colin Woodbury Date: Mon, 21 Feb 2022 14:18:26 -0800 Subject: [PATCH 1/3] docs(docker): basic usage instructions --- docker/README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 docker/README.md diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 00000000..dceee74f --- /dev/null +++ b/docker/README.md @@ -0,0 +1,39 @@ +# Aurweb and Docker + +The `INSTALL` document details a manual Aurweb setup, but Docker images are also +provided here to avoid the complications of database configuration (and so +forth). + +### Setup + +Naturally, both `docker` and `docker-compose` must be installed, and your Docker +service must be started: + +```sh +systemctl start docker.service +``` + +The main image - `aurweb` - must be built manually: + +```sh +docker compose build aurweb-image +``` + +### Starting and Stopping the Services + +With the above steps complete, you can bring up an initial cluster: + +```sh +docker compose up +``` + +Subsequent runs will be done with `start` instead of `up`. The cluster can be +stopped with `docker compose stop`. + +### Testing + +With a running cluster, execute the following in a new terminal: + +```sh +docker compose run test +``` From 27f30212e83609fafe2081f3366d376f5ecf69df Mon Sep 17 00:00:00 2001 From: Colin Woodbury Date: Mon, 21 Feb 2022 14:40:18 -0800 Subject: [PATCH 2/3] docs(docker): note ports and `curl` usage --- docker/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docker/README.md b/docker/README.md index dceee74f..6fa2f142 100644 --- a/docker/README.md +++ b/docker/README.md @@ -37,3 +37,14 @@ With a running cluster, execute the following in a new terminal: ```sh docker compose run test ``` + +### Querying the RPC + +The Fast (Python) API runs on Port 8444, while the legacy PHP version runs +on 8443. You can query one like so: + +```sh +curl -k "https://localhost:8444/rpc/?v=5&type=search&arg=python" +``` + +`-k` bypasses local certificate issues that `curl` will otherwise complain about. From d92f1838404b426c6e3baad103f4dccac1a40e03 Mon Sep 17 00:00:00 2001 From: Colin Woodbury Date: Wed, 23 Feb 2022 18:12:00 -0800 Subject: [PATCH 3/3] docs(docker): explain how to generate dummy data --- docker/README.md | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/docker/README.md b/docker/README.md index 6fa2f142..89dbb739 100644 --- a/docker/README.md +++ b/docker/README.md @@ -16,7 +16,7 @@ systemctl start docker.service The main image - `aurweb` - must be built manually: ```sh -docker compose build aurweb-image +docker compose build ``` ### Starting and Stopping the Services @@ -38,6 +38,21 @@ With a running cluster, execute the following in a new terminal: docker compose run test ``` +### Generating Dummy Data + +Before you can make meaningful queries to the cluster, it needs some data. +Luckily such data can be generated. First, `docker ps` to discover the ID of the +container running the FastAPI. Then: + +```sh +docker exec -it /bin/bash +./scheme/gendummydata.py dummy.sql +mysql aurweb < dummy.sql +``` + +The generation script may prompt you to install other Arch packages before it +can proceed. + ### Querying the RPC The Fast (Python) API runs on Port 8444, while the legacy PHP version runs