Skip to content

Commit

Permalink
Install extra requirements for thumbor (#162)
Browse files Browse the repository at this point in the history
* Install extra requirements for thumbor
* see https://github.com/orgs/community/discussions/134407#discussioncomment-10228093

---------

Co-authored-by: Tiger Oakes <contact@tigeroakes.com>
Co-authored-by: Yoav <yoav@gingerlime.com>
  • Loading branch information
3 people authored Sep 3, 2024
1 parent 1111510 commit 630f3a7
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 16 deletions.
4 changes: 2 additions & 2 deletions tests/nginx-proxy-autowebp.bats
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
BASE=tests/setup/basic

teardown () {
docker-compose -f $BASE/docker-compose.yml down
docker compose -f $BASE/docker-compose.yml down
}

load_thumbor () {
docker-compose -f $BASE/docker-compose.yml up -d
docker compose -f $BASE/docker-compose.yml up -d
timeout 2m bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8888/healthcheck)" != "200" ]]; do sleep 5; done' || false
}

Expand Down
10 changes: 5 additions & 5 deletions tests/nginx-proxy-cache.bats
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
BASE=tests/setup/basic

teardown () {
docker-compose -f $BASE/docker-compose.yml down
docker compose -f $BASE/docker-compose.yml down
}

load_thumbor () {
docker-compose -f $BASE/docker-compose.yml up -d
docker compose -f $BASE/docker-compose.yml up -d
timeout 2m bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8888/healthcheck)" != "200" ]]; do sleep 5; done' || false
}

@test "proxy cache memory size=500m, inactive=48h, max_size=10g by default" {
load_thumbor
run bash -c "docker-compose -f $BASE/docker-compose.yml exec -T nginx-proxy bash -c 'cat /etc/nginx/conf.d/default.conf' | grep 'keys_zone=thumbor:500m inactive=48h max_size=10g'"
run bash -c "docker compose -f $BASE/docker-compose.yml exec -T nginx-proxy bash -c 'cat /etc/nginx/conf.d/default.conf' | grep 'keys_zone=thumbor:500m inactive=48h max_size=10g'"
[ $status -eq 0 ]
}

Expand All @@ -22,8 +22,8 @@ load_thumbor () {
export PROXY_CACHE_INACTIVE=24h
export PROXY_CACHE_MEMORY_SIZE=10m
load_thumbor
docker-compose -f $BASE/docker-compose.yml exec -T nginx-proxy bash -c 'cat /etc/nginx/conf.d/default.conf'
run bash -c "docker-compose -f $BASE/docker-compose.yml exec -T nginx-proxy bash -c 'cat /etc/nginx/conf.d/default.conf' | grep 'keys_zone=thumbor:10m inactive=24h max_size=20g'"
docker compose -f $BASE/docker-compose.yml exec -T nginx-proxy bash -c 'cat /etc/nginx/conf.d/default.conf'
run bash -c "docker compose -f $BASE/docker-compose.yml exec -T nginx-proxy bash -c 'cat /etc/nginx/conf.d/default.conf' | grep 'keys_zone=thumbor:10m inactive=24h max_size=20g'"
[ $status -eq 0 ]
}

Expand Down
4 changes: 2 additions & 2 deletions tests/nginx-proxy-cors.bats
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
BASE=tests/setup/basic

teardown () {
docker-compose -f $BASE/docker-compose.yml down
docker compose -f $BASE/docker-compose.yml down
}

load_thumbor () {
docker-compose -f $BASE/docker-compose.yml up -d
docker compose -f $BASE/docker-compose.yml up -d
timeout 2m bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8888/healthcheck)" != "200" ]]; do sleep 5; done' || false
}

Expand Down
4 changes: 2 additions & 2 deletions tests/nginx-proxy.bats
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ BASE=tests/setup/basic
setup () {
if [[ "$BATS_TEST_NUMBER" -eq 1 ]]; then
export AUTO_WEBP=True
docker-compose -f $BASE/docker-compose.yml up -d
docker compose -f $BASE/docker-compose.yml up -d
timeout 2m bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:8888/healthcheck)" != "200" ]]; do sleep 5; done' || false
rm -rf $BASE/data/*
fi
}

teardown () {
if [[ "${#BATS_TEST_NAMES[@]}" -eq "$BATS_TEST_NUMBER" ]]; then
docker-compose -f $BASE/docker-compose.yml down
docker compose -f $BASE/docker-compose.yml down
fi
}

Expand Down
6 changes: 1 addition & 5 deletions thumbor/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@ python-dateutil
dateutils==0.6.12
shortuuid==1.0.8
redis==5.0.1
opencv-python-headless==4.8.1.78
raven==6.10.0
cairosvg==2.7.1
pycurl==7.45.2
tc-aws==7.0.2
tc-core==0.5
thumbor==7.7.4
thumbor[all]==7.7.4
thumbor-wand-engine==0.1.1
pillow-avif-plugin==1.4.2

0 comments on commit 630f3a7

Please sign in to comment.