1596 Commits

Author SHA1 Message Date
Alex Vandiver
2dc5c6c50e upgrade-postgresql: Only touch pgroonga_setup.sql.applied if required.
Since c8ec3dfcf6, the file must contain the version that was
configured, or we run `ALTER EXTENSION pgroonga UPDATE`; if the file
is missing, and pgroonga was previously installed, it run `CREATE
EXTENSION pgroonga` which will be an error.  If the file is present
but pgroonga was not configured, a later attempt to enable pgroonga
will incorrectly run `ALTER EXTENSION pgroonga UPDATE` instead of
`CREATE EXTENSION pgroonga`.

If the file existed on the previous version, touch it in the new
PostgreSQL version.  This will ensure that puppet will *always* run
the pgroonga update, which may be necessary in case the pgroonga
version also changed.  At worst, if the pgroonga version has not
changed, this will be a safe no-op.
2025-05-16 11:33:20 -07:00
Anders Kaseorg
8e9de0b053 configure-rabbitmq: Restore startup retry loop.
‘rabbitmqctl await_startup’ does not retry to wait for the Erlang
runtime to start, only to wait for the RabbitMQ application to start
once Erlang is running.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-05-15 16:59:27 -07:00
Anders Kaseorg
2354653f33 install-node: Upgrade Node.js from 22.14.0 to 22.15.0.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-05-05 14:15:44 -07:00
Anders Kaseorg
fe96666782 install-uv: Upgrade uv from 0.6.13 to 0.7.2.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-05-05 09:10:19 -07:00
Anders Kaseorg
e4a2695f54 install-uv: Upgrade uv from 0.6.6 to 0.6.13.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-04-08 10:17:49 -07:00
Anders Kaseorg
80b607c8cb install: Remove PostgreSQL 13 support.
PostgreSQL 13 reaches end of life on November 13, 2025, and Django 5.2
does not support it.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-04-07 17:41:55 -07:00
Anders Kaseorg
818742c62b install: Support PostgreSQL 17.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-04-07 16:42:19 -07:00
Alex Vandiver
342d278c8a upgrade: Remove handling of "googleblob" emoji rename.
This code was originally added in 608173657d in Zulip Server 2.0;
since we can only directly upgrade from 5.0 or later, this code is
guaranteed to have run already. Remove it.
2025-04-03 10:46:12 -07:00
Alex Vandiver
e93d43e8d1 upgrade: Remove puppet_classes renaming code.
This code was originally added in 5f3765b872 in Zulip Server 4.0;
since we can only directly upgrade from 5.0 or later, this code is
guaranteed to have run already. Remove it.
2025-04-03 10:46:12 -07:00
Alex Vandiver
f48a3a772f upgrade: Remove ancient symlink of settings.py.
This code was originally added in 2b146012e1 in Zulip Server 1.7.0;
since we can only directly upgrade from 5.0 or later, this code is
guaranteed to have run already. Remove it.
2025-04-03 10:46:12 -07:00
Alex Vandiver
e404a9b71c upgrade: Remove explicit python3-yaml install step.
The python3-yaml dependency was added at install time in 3314fefaec
in Zulip Server 4.0, and this workaround was added in de41a10d38,
also in 4.0.  Since we can only directly upgrade from 5.0 or later,
the dependency is guaranteed to be installed already, by one or the
other of those ways. Remove this workaround.
2025-04-03 10:46:12 -07:00
Alex Vandiver
39cc830ae5 upgrade: Remove tsearch_extras cleanup code.
This code was originally added in 382261dc72 in Zulip Server 3.0;
since we can only directly upgrade from 5.0 or later, this code is
guaranteed to have run already. Remove it.
2025-04-03 10:46:12 -07:00
Alex Vandiver
53bf48a873 upgrade: Remove RabbitMQ cookie randomization code.
This code was originally added in e705883857 in Zulip Server 5.0;
since we can only directly upgrade from 5.0 or later, this code is
guaranteed to have run already. Remove it.
2025-04-03 10:46:12 -07:00
Alex Vandiver
ba9569a6fe sha256-tarball-to: Support zipfiles. 2025-03-27 21:56:54 -07:00
Anders Kaseorg
7702f53d90 clean-venv-cache: Remove.
The current stable branch is on uv, so we no longer need to preserve
the old-style zulip-venv-cache directories from the last 14 days.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-03-26 15:51:48 -07:00
Anders Kaseorg
c517e95e6b install: Move ourself to deployments path before creating venv.
This prevents the venv from ending up with references to /root.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-03-25 10:17:17 -07:00
Anders Kaseorg
ce81d8498d provision: Ignore Python warnings while building requirements.
Build warnings are unfortunately very common in third-party packages.
They’re difficult to reliably detect since packages don’t always build
from source, and they can’t be whitelisted on a per-package basis
since they’re all attributed to setuptools or an anonymous code
string.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-03-19 17:15:09 -07:00
Anders Kaseorg
838ae38b43 install-uv: Upgrade uv from 0.6.3 to 0.6.6.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-03-14 17:31:50 -07:00
Alex Vandiver
29a0d287fc puppet: Allow for arbitrary queues to have more than one worker.
This generalizes from thumbnail_workers, to include any other queue.
We only additionally choose to document `email_senders_workers`,
however, since other queues are not guaranteed to work correctly with
multiple consumers.
2025-03-14 14:07:09 -07:00
Alex Vandiver
232de4b98f check_rabbitmq_queue: Increase deferred_email_senders paging thresholds.
c5200e8b05 switched `digest_emails` from sending emails by inserting
into the ScheduledEmail table, and being processed later by
`deliver_scheduled_emails`, to inserting into the
`deferred_email_senders` RabbitMQ queue.  This moved it from being in
an unmonitored table, to a monitored queue.

This slightly improved throughput -- but began paging, since the
backlog was now in a monitored form.  Increase the paging thresholds
to not page for expected behaviour.
2025-03-11 12:34:11 -07:00
Alex Vandiver
a9337e7641 nagios: Change the cron jobs to exit 0 for all ok/warning/critical.
The cron jobs are potentially wrapped by Sentry, which logs "cron
failures" and sends emails.  We would like those failures to only be
when the cron job itself failed to run successfully -- not when the
underlying metric is outside of its normal range.  We would like to
differentiate a failure of the monitoring infrastructure from a
failure of what it is monitoring.

Swap to return 0 on everything except "unknown" results.
2025-03-05 09:49:36 -08:00
Alex Vandiver
c5200e8b05 deliver_scheduled_emails: Use a queue, instead of infinite retries.
`deliver_scheduled_emails` tries to deliver the email synchronously,
and if it fails, it retries after 10 seconds.  Since it does not track
retries, and always tries the earliest-scheduled-but-due message
first, the worker will not make forward progress if there is a
persistent failure with that message, and will retry indefinitely.
This can result in excessive network or email delivery charges from
the remote SMTP server.

Switch to delivering emails via a new queue worker.  The
`deliver_scheduled_emails` job now serves only to pull deferred jobs
out of the table once they are due, insert them into RabbitMQ, and
then delete them.  This limits the potential for head-of-queue
failures to failures inserting into RabbitMQ, which is more reasonable
than failures speaking to a complex external system we do not control.
Retries and any connections to the SMTP server are left to the
RabbitMQ consumer.

We build a new RabbitMQ queue, rather than use the existing
`email_senders` queue, because that queue is expected to be reasonably
low-latency, for things like missed message notifications.  The
`send_future_email` codepath which inserts into ScheduledEmails is
also (ab)used to digest emails, which are extremely bursty in their
frequency -- and a large burst could significantly delay emails behind
it in the queue.

The new queue is explicitly only for messages which were not initiated
by user actions (e.g., invitation reminders, digests, new account
follow-ups) which are thus not latency-sensitive.

Fixes: #32463.
2025-03-04 16:09:25 -08:00
Alex Vandiver
47e622f5a5 run_hooks: Pass down, and respect, --from-git argument.
The refactoring in 4e28e1d3ff incorrectly switched a check for
`if args.from_git` into `if NEW_ZULIP_MERGE_BASE`, which is
incorrect -- the merge-base is always defined, it may just match the
version.  This led to errors when installing from tarball, without a
git repo.

Since the run_hooks command was already set up to take a `--from-git`
argument, but was ignoring it, pass down that flag from
upgrade-zulip-stage-3 when necessary, and swap the run_hooks logic
back to basing the version-resolution logic on that flag.
2025-03-04 13:18:50 -08:00
Anders Kaseorg
3af4900891 install-node: Upgrade Node.js from 22.12.0 to 22.14.0.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-02-26 16:20:47 -08:00
Anders Kaseorg
d7556b4060 requirements: Migrate to uv.
https://docs.astral.sh/uv/

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-02-24 22:29:24 -08:00
Anders Kaseorg
72f5df2e09 install: Remove --cacert and CUSTOM_CA_CERTIFICATES.
This has been broken for many years and nobody’s complained.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-02-24 22:29:24 -08:00
Alex Vandiver
6ac9e3328e cache: Flush caches from all known key prefixes.
When flushing caches, we want to ensure that even processes which may
have a wrong cache-key-prefix know to fetch the latest data from the
database.  This is complicated by the cache-key-prefixes being stored
on disk, and thus checking that every cache delete is not sufficiently
performant.

We store the list of cache-key-prefixes in the cache, itself, with no
prefix.  This cache is updated when a new cache-key is written, and is
also allowed to lapse after 24 hours.  Updating this global cache
entry on new prefix creation ensures that even a
not-yet-restarted-into deployment will have its caches appropriately
purged if changes are made to the underlying data.

However, this both adds a cache-get, as well as multiplies the size of
all cache clears; for large bulk clears (e.g. for stream renames,
which clear the cache for all message-ids in them) this may prove
untenable.
2025-02-21 14:11:08 -08:00
Alex Vandiver
e2df4f52ef kandra: Update Teleport version. 2025-02-21 10:16:33 -08:00
Anders Kaseorg
3823697e6c clean_node_cache: Remove.
The old /srv/zulip-npm-cache system has been unused for two
years (Zulip Server ≥ 7.0).  We can just delete this directory.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-02-19 16:44:02 -08:00
Alex Vandiver
72f667fb31 upgrade-zulip: Prevent restarting only Django into inconsistent caching. 2025-02-14 12:03:13 -08:00
Mateusz Mandera
367d193639 register_server: Rename flag to --agree-to-terms-of-service.
That's a better style than the underscores.
2025-02-13 11:03:44 -08:00
Mateusz Mandera
0a45a289f2 install: Add --agree-to-terms-of-service flag. 2025-02-13 09:49:28 -08:00
Mateusz Mandera
ac0af8d5ff install: Replace RTD links with our new permalinks. 2025-02-12 09:50:52 -08:00
Mateusz Mandera
0de58860dc install: Configure services during installation. 2025-02-05 17:47:28 -08:00
Alex Vandiver
59dde93a47 run_hooks: Diff to "last" instead of "current" during post-deploy. 2025-02-04 10:44:17 -08:00
Anders Kaseorg
7c2212caa3 node_cache: Work around corepack breakage due to npm key rotation.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-02-03 11:29:39 -08:00
PieterCK
68b3ce482a check-database-compatibility: Refactor a STALE_MIGRATIONS.
This consolidates the list of stale migration to
`lib/migration_status.py` as `STALE_MIGRATIONS`.

This is a prep work to make the migration status tool at
`migration_status.py` be able to clean its output of these migrations
too.
2025-01-24 17:08:37 -08:00
Anders Kaseorg
653b0b0436 ruff: Partially reformat Python with Ruff 0.9 (2025 style).
These are the changes that are backwards compatible with the 2024
style.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-01-14 09:42:16 -08:00
Alex Vandiver
dfb4ef892c upgrade-zulip: Pass --only-django through to restart-server. 2025-01-03 15:15:28 -08:00
Anders Kaseorg
30b68abf55 install-node: Upgrade Node.js from 22.11.0 to 22.12.0.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2025-01-02 17:30:40 -08:00
Alex Vandiver
3eb501fa18 requirements: Require some swap space if installed on < 5GB RAM. 2024-12-22 06:52:06 -08:00
Anders Kaseorg
19b8cde27f ruff: Fix PLC0206 Extracting value from dictionary without calling .items().
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-12-21 21:06:53 -08:00
Alex Vandiver
d8ed381789 puppet: Increase email_senders page threshold.
Email senders having a few minutes of backlog does not justify paging.

In the future, this worker will be async or sharded and not backlog.
2024-11-22 14:31:30 -08:00
Anders Kaseorg
532aee926c requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-19 11:09:34 -08:00
Anders Kaseorg
0bd9f4f674 install-node: Upgrade Node.js from 20.18.0 to 22.11.0.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-05 17:01:09 -08:00
Anders Kaseorg
2bb87aebec install: Remove PostgreSQL 12 support.
PostgreSQL 12 reaches end of life on November 14, 2024.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-01 15:33:31 -07:00
Anders Kaseorg
8dd0d7f48d reindex-textual-data: Remove PostgreSQL ≥ 11 check.
We removed PostgreSQL 10 support long ago in 6.0-beta1~88.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-01 15:33:31 -07:00
Anders Kaseorg
3ec58fd3d5 requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-20 18:16:27 -07:00
Anders Kaseorg
71ca928ec9 ruff: Fix SIM115 Use a context manager for opening files.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-20 18:16:27 -07:00
Anders Kaseorg
f812fee7ac install-node: Upgrade Node.js from 20.17.0 to 20.18.0.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-10-15 10:36:01 -07:00