Skip to content

Commit

Permalink
feat: pict-rs v0.5.4 & Lemmy 0.19.3 (#213)
Browse files Browse the repository at this point in the history
* feat: pict-rs v0.5.0

* feat: pictrs 0.5.4 & lemmy 0.19.3

* fix: linting

* fix: spellilng

* chore: add optional reference to prepare_upgrade
  • Loading branch information
ticoombs authored Jan 31, 2024
1 parent 76beae5 commit a9f2507
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 8 deletions.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,19 @@ 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.4.0 (Lemmy 0.19.3 & Pict-rs 0.5.4)

This is a semi-major release which upgrades pict-rs to 0.5 which has support for postgres as a backend. This configuration is **not supported** by lemmy-ansible for the moment.

#### Steps

- `git pull && git checkout 1.4.0`
- Read [Pictrs' Configuration Changes](https://git.asonix.dog/asonix/pict-rs/#configuration-updates)
- Amend your `vars.yml` file to respect the new changes
- Optional: Add: `PICTRS__UPGRADE__CONCURRENCY` with a value between 32 and 512 depending on how much RAM/CPU you want to dedicate to the upgrade process. A value of 32 used about 2.5GB of RAM for the migration.
- Optional: Curl `/internal/prepare_upgrade` to minimise downtime while upgrading. See [the instructions below](https://github.com/LemmyNet/lemmy-ansible#update-your-pict-rs-sled-database-optional) or the official documentation [here](https://git.asonix.dog/asonix/pict-rs/releases#user-content-upgrade-preparation-endpoint)
- Run your regular deployment. Example: `ansible-playbook -i inventory/hosts lemmy.yml --become`

### Upgrading to 1.3.1 (Lemmy 0.19.1)

This is a very minor release but fixes issues relating to federation as part of the Lemmy update.
Expand All @@ -101,7 +114,7 @@ This is a very minor release but fixes issues relating to federation as part of
- `git pull && git checkout 1.3.1`
- Run your regular deployment. Example: `ansible-playbook -i inventory/hosts lemmy.yml --become`

### Upgrading to 1.3.0 (Lemmy 0.19.0 & pictrs-0.4.7)
### Upgrading to 1.3.0 (Lemmy 0.19.0 & Pict-rs 0.4.7)

This is a major change and has required reading! tl;dr

Expand Down
18 changes: 12 additions & 6 deletions examples/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,27 @@ pictrs_safety_secret: "{{ lookup('password', 'inventory/host_vars/{{ domain }}/p
# https://git.asonix.dog/asonix/pict-rs
pictrs_env_vars:
- PICTRS__SERVER__API_KEY: "{{ postgres_password }}"
- PICTRS__MEDIA__VIDEO_CODEC: vp9
- PICTRS__MEDIA__GIF__MAX_WIDTH: 256
- PICTRS__MEDIA__GIF__MAX_HEIGHT: 256
- PICTRS__MEDIA__GIF__MAX_AREA: 65536
- PICTRS__MEDIA__GIF__MAX_FRAME_COUNT: 400
- PICTRS__MEDIA__ANIMATION__MAX_WIDTH: 256
- PICTRS__MEDIA__ANIMATION__MAX_HEIGHT: 256
- PICTRS__MEDIA__ANIMATION__MAX_AREA: 65536
- PICTRS__MEDIA__ANIMATION__MAX_FRAME_COUNT: 400
- PICTRS__MEDIA__VIDEO__ENABLE: "True"
- PICTRS__MEDIA__VIDEO__MAX_FILE_SIZE: 20
- PICTRS_OPENTELEMETRY_URL: http://otel:4137
- RUST_LOG: debug
- RUST_LOG: info
- RUST_BACKTRACE: full
# Edit these for Object Storage
# - PICTRS__STORE__TYPE: object_storage
# - PICTRS__STORE__ENDPOINT: '<S3 endpoint>'
# - PICTRS__STORE__BUCKET_NAME: '<bucket name>'
# - PICTRS__STORE__REGION: '<region>'
# - PICTRS__STORE__USE_PATH_STYLE: false
# - PICTRS__STORE__ACCESS_KEY: '<access key>'
# - PICTRS__STORE__SECRET_KEY: '<secret key>'
# Edit these if you use postgres for your pictrs backend
# - PICTRS__OLD_REPO__PATH=/mnt/sled-repo
# - PICTRS__REPO__TYPE=postgres
# - PICTRS__REPO__URL=postgres://user:password@host:5432/db

postgres_env_vars:
- POSTGRES_USER: lemmy
Expand Down
2 changes: 1 addition & 1 deletion templates/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ services:
logging: *default-logging

pictrs:
image: docker.io/asonix/pictrs:0.4.7
image: docker.io/asonix/pictrs:0.5.4
# 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
Expand Down

0 comments on commit a9f2507

Please sign in to comment.