est-social / mastodon

Tweaks to Mastodon code for est.social
https://joinmastodon.org
GNU Affero General Public License v3.0
2 stars 0 forks source link

Update to v4.3.0 #20

Closed SlyEcho closed 1 month ago

SlyEcho commented 1 month ago

Pitch

Upstream release v4.3.0 came out.

Motivation

It is needed.

Steps

SlyEcho commented 1 month ago

Ruby update to 3.3.5

git -C .rbenv pull
git -C .rbenv/plugins/ruby-build pull
RUBY_CONFIGURE_OPTS="--with-jemalloc" rbenv install 3.3.5
SlyEcho commented 1 month ago

Install nvm:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
exec bash

Install Node 20:

nvm install 20
SlyEcho commented 1 month ago

Add build libs from the Dockerfile scripts:

sudo apt-get install -y --no-install-recommends \
    autoconf \
    automake \
    build-essential \
    cmake \
    git \
    libgdbm-dev \
    libglib2.0-dev \
    libgmp-dev \
    libicu-dev \
    libidn-dev \
    libpq-dev \
    libssl-dev \
    libtool \
    meson \
    nasm \
    pkg-config \
    shared-mime-info \
    xz-utils \
    libcgif-dev \
    libexif-dev \
    libexpat1-dev \
    libgirepository1.0-dev \
    libheif-dev \
    libimagequant-dev \
    libjpeg-turbo8-dev \
    liblcms2-dev \
    liborc-dev \
    libtiff-dev \
    libwebp-dev \
    libdav1d-dev \
    liblzma-dev \
    libmp3lame-dev \
    libopus-dev \
    libsnappy-dev \
    libvorbis-dev \
    libvpx-dev \
    libx264-dev \
    libx265-dev \
  ;

Missing from the list in the Dockerfile:

SlyEcho commented 1 month ago

Install cgif:

curl -L https://github.com/dloebl/cgif/archive/refs/tags/v0.4.1.tar.gz | tar -xz
cd cgif-0.4.1
meson setup builddir -Dbuildtype=release -Dexamples=false -Dtests=false
ninja -C builddir
sudo ninja -C builddir install
SlyEcho commented 1 month ago

Install dav1d:

curl -L http://downloads.videolan.org/videolan/dav1d/1.4.3/dav1d-1.4.3.tar.xz | tar -xJ
cd dav1d-1.4.3
meson setup builddir -Dbuildtype=release -Denable_tests=false -Denable_tools=false
ninja -C builddir
sudo ninja -C builddir install
SlyEcho commented 1 month ago

FFMPEG 7.0.2:

curl https://ffmpeg.org/releases/ffmpeg-7.0.2.tar.xz | tar -xJ
cd ffmpeg-7.0.2
./configure \
    --toolchain=hardened \
    --disable-debug \
    --disable-devices \
    --disable-doc \
    --disable-ffplay \
    --disable-network \
    --disable-static \
    --enable-ffmpeg \
    --enable-ffprobe \
    --enable-gpl \
    --enable-libdav1d \
    --enable-libmp3lame \
    --enable-libopus \
    --enable-libsnappy \
    --enable-libvorbis \
    --enable-libvpx \
    --enable-libwebp \
    --enable-libx264 \
    --enable-libx265 \
    --enable-shared \
    --enable-version3 \
  ;

Dependency errors:

ERROR: libmp3lame >= 3.98.3 not found
SlyEcho commented 1 month ago

Install LAME 3.100

curl -L https://sourceforge.net/projects/lame/files/lame/3.100/lame-3.100.tar.gz/download | tar -xz
cd lame-3.100/
./configure 
make -j8
sudo make install
SlyEcho commented 1 month ago

Continue ffmpeg build:

./configure ...
nice make -j8
sudo make install
SlyEcho commented 1 month ago

Install spng:

curl -L https://github.com/randy408/libspng/archive/v0.7.4.tar.gz | tar -xz
cd libspng-0.7.4
meson setup builddir -Dbuildtype=release
ninja -C builddir
sudo ninja -C builddir install
SlyEcho commented 1 month ago

Install libvips:

curl -L https://github.com/libvips/libvips/releases/download/v8.15.3/vips-8.15.3.tar.xz | tar -xJ
cd vips-8.15.3
meson setup builddir -Dbuildtype=release -Ddeprecated=false -Dintrospection=disabled -Dmodules=disabled -Dexamples=false
nice ninja -C builddir
sudo ninja -C builddir install
SlyEcho commented 1 month ago

Start updating:

# fix backup server SSH config to not validate host key
# do backup first:
~/bin/backup.sh

cd live
git fetch
git reset --hard origin/main

# From release docs:
corepack enable
corepack prepare
bundle install
yarn install --immutable
bundle exec rails assets:precompile

# Generate new encryption keys and add to `.env.production`:
bin/rails db:encryption:init
SlyEcho commented 1 month ago

Checked systemd files: no changes Checked nginx files: only change was to increase file upload limit to 99 MB

SlyEcho commented 1 month ago

Continuing upgrade:

SKIP_POST_DEPLOYMENT_MIGRATIONS=true bundle exec rails db:migrate

Restart mastodon processes:

sudo systemctl stop mastodon-*.service
sudo systemctl start mastodon-web mastodon-streaming mastodon-sidekiq

Post migrations:

bundle exec rails db:migrate
SlyEcho commented 1 month ago

Elasticsearch update:

bin/tootctl search deploy --only=accounts
SlyEcho commented 1 month ago

Update config:

MASTODON_USE_LIBVIPS=true
MALLOC_CONF="narenas:2,background_thread:true,thp:never,dirty_decay_ms:1000,muzzy_decay_ms:0"
SOURCE_TAG=v4.3.0-est
SlyEcho commented 1 month ago

Done.