From 4ba5fe5adf47ac86051ed361d0ad75f8f323f9b6 Mon Sep 17 00:00:00 2001 From: Weston Bell-Geddes Date: Sat, 22 Aug 2026 07:52:40 -0600 Subject: [PATCH 1/2] Update development setup instructions Replace the archived faf-stack workflow with the current gitops-stack Tilt setup. Align local development commands with the stack's faf_lobby database. Keep the existing CI database configuration unchanged. --- DEVELOPMENT.md | 57 ++++++++++++++++++++++++-------------------------- README.md | 26 ++++++++++++----------- dev-config.yml | 1 + 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 4cfe63774..34156da41 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -8,7 +8,9 @@ project to build on Windows using the WSL.* ## System dependencies You will need the following software installed on your system: - [Docker](https://docs.docker.com/engine/) -- [Docker Compose](https://github.com/docker/compose) +- [Kubernetes](https://kubernetes.io/) +- [Tilt](https://docs.tilt.dev/install.html) +- [Helm](https://helm.sh/docs/intro/install/) - [Python 3.13](https://www.python.org/downloads/) - [Pipenv](https://github.com/pypa/pipenv/) @@ -41,28 +43,22 @@ export PIPENV_VENV_IN_PROJECT=1 ``` ## Application Dependencies -The lobby server needs the FAF MySQL database for storing persistent state. -Follow the instructions on the [faf-db repo](https://github.com/FAForever/db) -to setup an instance of the database. - -If the database version defined in -[`.github/workflows/test.yml`](.github/workflows/test.yml) does not match -the one defined in your `docker-compose.yml`, you will need to update the -compose file and then re-run the migrations. - -Find the section in `docker-compose.yml` that looks like this and change the -version number to the required version in -[`.github/workflows/test.yml`](.github/workflows/test.yml). -``` -faf-db-migrations: - container_name: faf-db-migrations - image: faforever/faf-db-migrations: +The lobby server needs the FAF MariaDB database for storing persistent state. +The recommended way to run it locally is with the +[gitops-stack](https://github.com/FAForever/gitops-stack): +```sh +git clone https://github.com/FAForever/gitops-stack.git +cd gitops-stack +tilt up ``` -Then run the migrations with the following command. -``` -$ docker-compose run faf-db-migrations migrate -``` +Tilt starts the database and runs its migrations. You can monitor the stack at +. To load data for manual development, trigger the +`populate-db` resource from the Tilt interface. Keep Tilt running while +developing. + +The Tilt stack names the database `faf_lobby`. The checked-in development +configuration uses this name; pass it explicitly to the test commands below. Install the pinned versions of the dependencies (and dev dependencies) to a virtual environment using pipenv by running: @@ -88,21 +84,22 @@ ConnectionError: [Errno 111] Connect call failed ('127.0.0.1', 5672) WARNING Not connected to RabbitMQ, unable to declare exchange. ``` -**Note:** *The pipenv scripts are NOT meant for production deployment. For -deployment use [faf-stack](https://github.com/FAForever/faf-stack).* +**Note:** *The pipenv scripts are NOT meant for production deployment. +Production deployment is managed through +[gitops-stack](https://github.com/FAForever/gitops-stack).* ## Running the tests The unit tests are written using [pytest](https://docs.pytest.org/en/latest) and can be run through the pipenv shortcut: -``` -$ pipenv run tests +```sh +pipenv run tests --mysql_database=faf_lobby ``` Any arguments passed to the shortcut will be forwarded to pytest, so the usual pytest options can be used for test selection. For instance, to run all unit tests containing the keyword "ladder": -``` -$ pipenv run tests tests/unit_tests -k ladder +```sh +pipenv run tests --mysql_database=faf_lobby tests/unit_tests -k ladder ``` If you are running `pytest` by some other means (e.g. with PyCharm) you may need @@ -158,9 +155,9 @@ to start. ## Building with Docker -The recommended way to deploy the server is with -[faf-stack](https://github.com/FAForever/faf-stack). However, you can also -build the docker image manually. +The recommended way to deploy the server is through +[gitops-stack](https://github.com/FAForever/gitops-stack). However, you can +also build the docker image manually. Follow the steps to get [faf-db](https://github.com/FAForever/db) setup, the following assumes the db container is called `faf-db` and the database is called diff --git a/README.md b/README.md index 4bd71bf2f..2821e27a2 100644 --- a/README.md +++ b/README.md @@ -64,23 +64,25 @@ For detailed instructions see the [development guide](DEVELOPMENT.md). *This section assumes you have the necessary system dependencies installed. For a list of what those are see the [development guide](DEVELOPMENT.md).* -1. Start up an instance of the FAF database. This is required to run the unit tests -and development server. -``` -$ git clone https://github.com/FAForever/faf-stack.git -$ cd faf-stack -$ ./scripts/init-db.sh +1. Start the local FAF infrastructure with Tilt. This provides the database +required by the unit tests and development server. +```sh +git clone https://github.com/FAForever/gitops-stack.git +cd gitops-stack +tilt up ``` +Keep Tilt running while developing. -2. Install the project dependencies with pipenv -``` -$ pipenv sync --dev +2. In a separate terminal, install the project dependencies from the server +repository with pipenv. +```sh +pipenv sync --dev ``` 3. Run the unit tests or development server -``` -$ pipenv run tests -$ pipenv run devserver +```sh +pipenv run tests --mysql_database=faf_lobby +pipenv run devserver ``` # For Client Developers diff --git a/dev-config.yml b/dev-config.yml index b4205ad01..94ca1ea5c 100644 --- a/dev-config.yml +++ b/dev-config.yml @@ -1,4 +1,5 @@ LOG_LEVEL: "TRACE" USE_UVLOOP: false USE_POLICY_SERVER: false +DB_NAME: "faf_lobby" QUEUE_POP_TIME_MAX: 30 From 3ed2f8fa80aaeb60cbfd2643bbb32063cfc3d9b2 Mon Sep 17 00:00:00 2001 From: Weston Bell-Geddes Date: Sat, 22 Aug 2026 10:29:52 -0600 Subject: [PATCH 2/2] Proxy lobby traffic to local server Start gitops-stack with the lobby service marked local in both setup guides. This avoids launching the stack's lobby-server container while keeping the cluster proxy. --- DEVELOPMENT.md | 6 ++++-- README.md | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 34156da41..c9c427e5e 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -49,10 +49,12 @@ The recommended way to run it locally is with the ```sh git clone https://github.com/FAForever/gitops-stack.git cd gitops-stack -tilt up +tilt up -- --local faf-lobby-server ``` -Tilt starts the database and runs its migrations. You can monitor the stack at +Tilt starts the supporting services, including the database and its migrations, +and proxies lobby traffic to the server you run locally instead of starting the +stack's lobby-server container. You can monitor the stack at . To load data for manual development, trigger the `populate-db` resource from the Tilt interface. Keep Tilt running while developing. diff --git a/README.md b/README.md index 2821e27a2..f2b3b1bd8 100644 --- a/README.md +++ b/README.md @@ -69,9 +69,11 @@ required by the unit tests and development server. ```sh git clone https://github.com/FAForever/gitops-stack.git cd gitops-stack -tilt up +tilt up -- --local faf-lobby-server ``` -Keep Tilt running while developing. +The `local` argument proxies lobby traffic to the development server you run +locally instead of starting the stack's lobby-server container. Keep Tilt +running while developing. 2. In a separate terminal, install the project dependencies from the server repository with pipenv.