From 82fefeef9cf1cc907bd82b3a94e592e7d61de7f0 Mon Sep 17 00:00:00 2001 From: Tim Coombs Date: Mon, 18 Dec 2023 11:15:12 +1100 Subject: [PATCH] Version 1.3.0 (#206) * feat: 0.19.x * chore: upgrade pictrs to 0.4.6 * chore: upgrade pictrs to 0.4.7 * chore: readme upgrade instructions * Update README.md 1.3.1 stuff * fix: remove 1.3.1 - wrong branch * fix: remove placeholder about downtime * fix: prettier thinks this is better... * fix: add back downtime nonsense! * fix: fix command runner * fix: complete docs with estimated downtimes and ways to upgrade pictrs --- README.md | 42 ++++++++++++++++++++++++++++++++++++ templates/docker-compose.yml | 2 +- 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a873e3b..c23c3bb 100644 --- a/README.md +++ b/README.md @@ -92,6 +92,48 @@ If you wish to see another distribution on the list, please test on the latest c Since version `1.1.0` we no longer default to using `main` but use tags to make sure deployments are versioned. With every new release all migration steps shall be written below so make sure you check out the [Lemmy Releases Changelog](https://github.com/LemmyNet/lemmy/blob/main/RELEASES.md) to see if there are any config changes with the releases since your last read. +### Upgrading to 1.3.0 (Lemmy 0.19.0 & pictrs-0.4.7) + +This is a major change and has required reading! tl;dr + +- Lemmy has been upgraded to 0.19.0 +- pict-rs has been upgraded to 0.4.7 + - pict-rs has not been integrated with postgres yet +- "Optional Modules" are now available to be added to your lemmy install as provided by the community. + - The first being pictrs-safety + +#### Steps + +- Prepare to have downtime as the database needs to perform migrations! +- Run `git pull && git checkout 1.3.0` +- Run your regular deployment. Example: `ansible-playbook -i inventory/hosts lemmy.yml --become` +- Lemmy will now be down! In testing this takes from 20 to 60 minutes. + - If you are bored you can ssh into your server, and check the logs on postgres for updates + - `docker compose logs -f postgres` while ssh'd and in your Lemmy directory + +#### Update your pict-rs sled-database (Optional) + +If you are happy for pict-rs to be down _for a while_ go straight to our `1.3.1` git tag which updates pictrs to 0.5.0. Otherwise keep reading. +Starting with 0.5.0 your database will automatically upgrade to the latest version, which will cause downtime for your users. +As such there is an intermediary step where you can upgrade your database in the background to prepare for 0.5 (Reference documentation)[https://git.asonix.dog/asonix/pict-rs/releases#user-content-upgrade-preparation-endpoint]. This ensure no-one is caught out by unforseen downtime of multiple services. + +Once you have deployed lemmy-ansible `1.3.0` tag, please continue (if you want): + +- Take note of what your pict-rs API Key is under `vars.yml` +- Take note of what your docker network name is. (It's normally the domain without any extra characters) + - You should be able to find it via: `docker network ls | grep _default` if in doubt. +- Run the following command replacing `api-key` with the pict-rs api key, & `youdomain` with the network name. +- `docker run --network yourdomain_default --rm curlimages/curl:8.5.0 --silent -XPOST -H'X-Api-Token: api-key' 'http://pictrs:8080/internal/prepare_upgrade'` +- This will start the background process updating your database from 0.4 to 0.5 compatible. + +This is only Optional, and takes a shorter amount of time than the Lemmy database upgrade, but on huge installations it may take a lot longer. + +#### Optional Module(s) + +Our first optional module is [pictrs-safety](https://github.com/db0/pictrs-safety). See the repo linked for more information, especially for integration with pictrs (which is what it is for) Thanks to @db0 for their contribution. +See the `pictrs_safety_env_vars` under `examples/vars.yml` for relevant options (and the two password variables) +To enable this module to be used you must ADD `pictrs_safety: true` to your `vars.yml`. + ### Upgrading to 1.2.1 (Lemmy 0.18.5) This is a minor change which fixes the issue with the Postgres container not using the `customPostgres.conf` file. diff --git a/templates/docker-compose.yml b/templates/docker-compose.yml index 6e879f2..85d0ab5 100644 --- a/templates/docker-compose.yml +++ b/templates/docker-compose.yml @@ -60,7 +60,7 @@ services: logging: *default-logging pictrs: - image: docker.io/asonix/pictrs:0.4.3 + image: docker.io/asonix/pictrs:0.4.7 # this needs to match the pictrs url in lemmy.hjson hostname: pictrs # we can set options to pictrs like this, here we set max. image size and forced format for conversion