requirements: Remove Thumbor.

Thumbor and tc-aws have been dragging their feet on Python 3 support
for years, and even the alphas and unofficial forks we’ve been running
don’t seem to be maintained anymore.  Depending on these projects is
no longer viable for us.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-05-06 15:38:24 -07:00
committed by Tim Abbott
parent 779353b44e
commit 405bc8dabf
51 changed files with 26 additions and 2336 deletions

View File

@@ -15,11 +15,7 @@ sys.path.append(ZULIP_PATH)
from typing import TYPE_CHECKING, List
from scripts.lib.node_cache import NODE_MODULES_CACHE_PATH, setup_node_modules
from scripts.lib.setup_venv import (
THUMBOR_VENV_DEPENDENCIES,
YUM_THUMBOR_VENV_DEPENDENCIES,
get_venv_dependencies,
)
from scripts.lib.setup_venv import get_venv_dependencies
from scripts.lib.zulip_tools import (
ENDC,
FAIL,
@@ -159,7 +155,6 @@ UBUNTU_COMMON_APT_DEPENDENCIES = [
"libxss1",
"xvfb",
# Puppeteer dependencies end here.
*THUMBOR_VENV_DEPENDENCIES,
]
COMMON_YUM_DEPENDENCIES = [
@@ -179,7 +174,6 @@ COMMON_YUM_DEPENDENCIES = [
"mesa-libgbm",
"xorg-x11-server-Xvfb",
# Puppeteer dependencies end here.
*YUM_THUMBOR_VENV_DEPENDENCIES,
]
BUILD_PGROONGA_FROM_SOURCE = False

View File

@@ -50,7 +50,7 @@ parser.add_argument(
dest="clear_memcached",
help="Do not clear memcached on startup",
)
parser.add_argument("--streamlined", action="store_true", help="Avoid thumbor, etc.")
parser.add_argument("--streamlined", action="store_true", help="Avoid process_queue, etc.")
parser.add_argument(
"--enable-tornado-logging",
action="store_true",
@@ -98,7 +98,6 @@ proxy_port = base_port
django_port = base_port + 1
tornado_port = base_port + 2
webpack_port = base_port + 3
thumbor_port = base_port + 4
os.chdir(os.path.join(os.path.dirname(__file__), ".."))
@@ -149,7 +148,7 @@ def server_processes() -> List[List[str]]:
if options.streamlined:
# The streamlined operation allows us to do many
# things, but search/thumbor/etc. features won't work.
# things, but search/etc. features won't work.
return main_cmds
other_cmds = [
@@ -161,11 +160,6 @@ def server_processes() -> List[List[str]]:
"--quiet",
],
["./manage.py", "deliver_scheduled_messages"],
[
"/srv/zulip-thumbor-venv/bin/thumbor",
"--conf=./zthumbor/thumbor_settings.py",
f"--port={thumbor_port}",
],
]
# NORMAL (but slower) operation:
@@ -200,8 +194,6 @@ def transform_url(protocol: str, path: str, query: str, target_port: int, target
host = ":".join((target_host, str(target_port)))
# Here we are going to rewrite the path a bit so that it is in parity with
# what we will have for production
if path.startswith("/thumbor"):
path = path[len("/thumbor") :]
newpath = urlunparse((protocol, host, path, "", query, ""))
return newpath
@@ -320,10 +312,6 @@ class TornadoHandler(BaseHandler):
target_port = tornado_port
class ThumborHandler(BaseHandler):
target_port = thumbor_port
class ErrorHandler(BaseHandler):
@web.asynchronous
def prepare(self) -> None:
@@ -333,17 +321,12 @@ class ErrorHandler(BaseHandler):
self.finish()
def using_thumbor() -> bool:
return not options.streamlined
class Application(web.Application):
def __init__(self, enable_logging: bool = False) -> None:
handlers = [
(r"/json/events.*", TornadoHandler),
(r"/api/v1/events.*", TornadoHandler),
(r"/webpack.*", WebPackHandler),
(r"/thumbor.*", ThumborHandler if using_thumbor() else ErrorHandler),
(r"/.*", DjangoHandler),
]
super().__init__(handlers, enable_logging=enable_logging)
@@ -387,9 +370,6 @@ def print_listeners() -> None:
if not options.test:
ports.append((webpack_port, "webpack"))
if using_thumbor():
ports.append((thumbor_port, "Thumbor"))
for port, label in ports:
print(f" {port}: {label}")
print()

View File

@@ -13,11 +13,9 @@ from scripts.lib.zulip_tools import overwrite_symlink
VENV_PATH = "/srv/zulip-py3-venv"
DEV_REQS_FILE = os.path.join(ZULIP_PATH, "requirements", "dev.txt")
THUMBOR_REQS_FILE = os.path.join(ZULIP_PATH, "requirements", "thumbor-dev.txt")
def main() -> None:
setup_virtualenv("/srv/zulip-thumbor-venv", THUMBOR_REQS_FILE, patch_activate_script=True)
cached_venv_path = setup_virtualenv(VENV_PATH, DEV_REQS_FILE, patch_activate_script=True)
overwrite_symlink(cached_venv_path, os.path.join(ZULIP_PATH, "zulip-py3-venv"))

View File

@@ -2,7 +2,7 @@
set -e
# Make sure the Zulip dev virtualenv exists, and operate within it.
if [ ! -d /srv/zulip-py3-venv ] || [ ! -d /srv/zulip-thumbor-venv ]; then
if [ ! -d /srv/zulip-py3-venv ]; then
./tools/setup/setup_venvs.py
fi
@@ -54,7 +54,3 @@ for name in pip prod mypy docs; do
cp "$OUTPUT_BASE_DIR/dev.txt" "$OUTPUT_BASE_DIR/$name.txt"
compile_requirements "requirements/$name.in" "$OUTPUT_BASE_DIR/$name.txt"
done
compile_requirements requirements/thumbor-dev.in "$OUTPUT_BASE_DIR/thumbor-dev.txt"
cp "$OUTPUT_BASE_DIR/thumbor-dev.txt" "$OUTPUT_BASE_DIR/thumbor.txt"
compile_requirements "requirements/thumbor.in" "$OUTPUT_BASE_DIR/thumbor.txt"