this post was submitted on 16 Jun 2024
17 points (94.7% liked)

Lemmy Support

4645 readers
1 users here now

Support / questions about Lemmy.

Matrix Space: #lemmy-space

founded 5 years ago
MODERATORS
 

Anyone care to share their docker compose file for the upgrade? Or at least the pictrs portion? I've upgraded and migrated postgres to 16, but am having issues with the pictrs part.

top 7 comments
sorted by: hot top controversial new old
[โ€“] [email protected] 5 points 5 months ago* (last edited 5 months ago) (2 children)

Set image tag in pictrs section to 0.5 and change to the new ENV format described in the docs of pictrs. At last start only the pictrs container docker compose up -d pictrs

Here is my example in the new formaz. Be aware it is just an example โ˜๐Ÿป


pictrs:
    image: asonix/pictrs:0.5
    container_name: lemmy-pictrs
    # 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
    # entrypoint: /sbin/tini -- /usr/local/bin/pict-rs -p /mnt -m 4 --image-format webp
    environment:
      - PICTRS_OPENTELEMETRY_URL=http://otel:4137
      - PICTRS__SERVER__API_KEY=redacted
      - RUST_LOG=info
      - RUST_BACKTRACE=full
      - PICTRS__MEDIA__VIDEO__VIDEO_CODEC=vp9
      - 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
    user: 991:991
    volumes:
      - ./volumes/pictrs:/mnt:Z
    restart: always
    logging: *default-logging
    deploy:
      resources:
        limits:
          memory: 690m

[โ€“] [email protected] 4 points 5 months ago (2 children)

Mind you that PICTRS__API_KEY is the wrong variable, and should be PICTRS__SERVER__API_KEY. I've noticed it when Lemmy Thumbnail Cleaner complained about the api key being incorrect. Follow the repo page and check if your variables are correct.

[โ€“] [email protected] 2 points 5 months ago

Thanks, I edited the compose file. I overlooked this one. The docker-compose example for Lemmy on Github still has the old ENV. Maybe this one should be edited too

[โ€“] [email protected] 2 points 5 months ago* (last edited 5 months ago)

This one isn't mentioned here https://git.asonix.dog/asonix/pict-rs#0-4-to-0-5-migration-guide

PICTRS__SERVER__API_KEY

Good catch.

[โ€“] [email protected] 2 points 5 months ago (2 children)

This is the part of the new compose file that I don't understand:

PICTRS__OLD_REPO__PATH=/mnt/sled-repo PICTRS__REPO__TYPE=postgres PICTRS__REPO__URL=postgres://user:password@host:5432/db

When I try to add it, pictrs complains about not being able to connect to postgres, even though the credentials are correct and I've already run the postgres migration script. Did you not do this part when you upgraded?

[โ€“] [email protected] 1 points 5 months ago

No I just replaced the image tag. Pictrs will do the upgrade itself.

[โ€“] [email protected] 1 points 5 months ago

This is for making the pictrs backend on postgres and to migrate it to postgres. Though not documented with Lemmy it works and I am running it that way on my instance. It allows you to load balance and have high availability of pictrs service.