Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add libjemalloc2 and libtcmalloc-minimal4 to Dockerfile #222

Merged
merged 2 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/integration-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Integration Tests
on:
pull_request:
branches:
- master
paths-ignore:
- '**.md'
- 'Makefile'
- 'config.json'

jobs:
glib_malloc:
name: Glib malloc RAM usage test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Build image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
push: false
tags: ghcr.io/webp-sh/webp_server_go

- name: Start the container
run: |
cp tests/glib_malloc/docker-compose.yml ./
docker-compose up -d

- name: Send Requests to Server
run: |
cd pics
find * -type f -print | xargs -I {} curl -H "User-Agent: Mozilla/5.0 Gecko/20100101 Firefox/98.0" http://localhost:3333/{}

- name: Get container RAM stats
run: |
docker stats --no-stream

jemalloc:
name: jemalloc RAM usage test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Build image
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
push: false
tags: ghcr.io/webp-sh/webp_server_go

- name: Start the container
run: |
cp tests/jemalloc/docker-compose.yml ./
docker-compose up -d

- name: Send Requests to Server
run: |
cd pics
find * -type f -print | xargs -I {} curl -H "User-Agent: Mozilla/5.0 Gecko/20100101 Firefox/98.0" http://localhost:3333/{}

- name: Get container RAM stats
run: |
docker stats --no-stream
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ RUN cd /build && sed -i "s|.\/pics|${IMG_PATH}|g" config.json \

FROM debian:bullseye-slim

RUN apt update && apt install --no-install-recommends libvips ca-certificates -y && rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/apt/archives/*
RUN apt update && apt install --no-install-recommends libvips ca-certificates libjemalloc2 libtcmalloc-minimal4 -y && rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/apt/archives/*

COPY --from=builder /build/webp-server /usr/bin/webp-server
COPY --from=builder /build/config.json /etc/config.json
Expand Down
13 changes: 13 additions & 0 deletions tests/glib_malloc/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3'

services:
webp:
image: webpsh/webp-server-go
restart: always
environment:
- MALLOC_ARENA_MAX=1
volumes:
- ./pics:/opt/pics
- ./exhaust:/opt/exhaust
ports:
- 127.0.0.1:3333:3333
14 changes: 14 additions & 0 deletions tests/jemalloc/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3'

services:
webp:
image: webpsh/webp-server-go
restart: always
environment:
- MALLOC_ARENA_MAX=1
- LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2
volumes:
- ./pics:/opt/pics
- ./exhaust:/opt/exhaust
ports:
- 127.0.0.1:3333:3333