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

Modified compression benchmark to use mongodb. #1027

Merged
merged 1 commit into from
Aug 17, 2024
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
6 changes: 6 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,9 @@ benchmarks/video-processing/videos/video4.mp4 filter=lfs diff=lfs merge=lfs -tex
benchmarks/video-analytics-standalone/videos/default.mp4 filter=lfs diff=lfs merge=lfs -text
benchmarks/video-analytics-standalone/videos/video1.mp4 filter=lfs diff=lfs merge=lfs -text
benchmarks/video-analytics-standalone/videos/video2.mp4 filter=lfs diff=lfs merge=lfs -text
benchmarks/compression/files/video2.mp4 filter=lfs diff=lfs merge=lfs -text
benchmarks/compression/files/video1.mp4 filter=lfs diff=lfs merge=lfs -text
benchmarks/compression/files/img4.jpg filter=lfs diff=lfs merge=lfs -text
benchmarks/compression/files/img1.jpg filter=lfs diff=lfs merge=lfs -text
benchmarks/compression/files/img2.jpg filter=lfs diff=lfs merge=lfs -text
benchmarks/compression/files/img3.jpg filter=lfs diff=lfs merge=lfs -text
4 changes: 2 additions & 2 deletions .github/workflows/e2e-compression.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ jobs:

- name: start docker-compose benchmark
run: |
docker-compose -f ${{ env.YAML_DIR }}/dc-${{ matrix.service }}.yaml pull
docker-compose -f ${{ env.YAML_DIR }}/dc-${{ matrix.service }}.yaml up &> log_file &
docker compose -f ${{ env.YAML_DIR }}/dc-${{ matrix.service }}.yaml pull
docker compose -f ${{ env.YAML_DIR }}/dc-${{ matrix.service }}.yaml up &> log_file &
sleep 60s
cat log_file

Expand Down
22 changes: 22 additions & 0 deletions benchmarks/compression/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,32 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

#---------- Init-Database -----------#
# First stage (Builder):
FROM vhiveease/golang-builder:latest AS databaseInitBuilder

Check warning on line 25 in benchmarks/compression/Dockerfile

View workflow job for this annotation

GitHub Actions / Build and push all images (compression-python)

Stage names should be lowercase

StageNameCasing: Stage name 'databaseInitBuilder' should be lowercase More info: https://docs.docker.com/go/dockerfile/rule/stage-name-casing/
WORKDIR /app/app/
RUN apt-get install git ca-certificates

COPY ./benchmarks/compression/init/go.mod ./
COPY ./benchmarks/compression/init/go.sum ./
COPY ./benchmarks/compression/init/init-database.go ./

RUN go mod tidy
RUN CGO_ENABLED=0 GOOS=linux go build -v -o ./init-database init-database.go

# Second stage (Runner):
FROM scratch as databaseInit

Check warning on line 37 in benchmarks/compression/Dockerfile

View workflow job for this annotation

GitHub Actions / Build and push all images (compression-python)

Stage names should be lowercase

StageNameCasing: Stage name 'databaseInit' should be lowercase More info: https://docs.docker.com/go/dockerfile/rule/stage-name-casing/

Check warning on line 37 in benchmarks/compression/Dockerfile

View workflow job for this annotation

GitHub Actions / Build and push all images (compression-python)

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
WORKDIR /app/
COPY --from=databaseInitBuilder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=databaseInitBuilder /app/app/init-database .
COPY ./benchmarks/compression/files/ ./files

ENTRYPOINT [ "/app/init-database" ]

#---------- PYTHON -----------#
# First stage (Builder):
# Install gRPC and all other dependencies
FROM vhiveease/python-slim:latest as compressionPythonBuilder

Check warning on line 48 in benchmarks/compression/Dockerfile

View workflow job for this annotation

GitHub Actions / Build and push all images (compression-python)

Stage names should be lowercase

StageNameCasing: Stage name 'compressionPythonBuilder' should be lowercase More info: https://docs.docker.com/go/dockerfile/rule/stage-name-casing/

Check warning on line 48 in benchmarks/compression/Dockerfile

View workflow job for this annotation

GitHub Actions / Build and push all images (compression-python)

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
WORKDIR /py
COPY ./benchmarks/compression/python/requirements.txt ./requirements.txt
RUN pip3 install --user -r requirements.txt
Expand All @@ -34,7 +56,7 @@
ADD https://raw.githubusercontent.com/vhive-serverless/vSwarm-proto/main/proto/compression/compression_pb2.py ./proto/compression/

# Second stage (Runner):
FROM vhiveease/python-slim:latest as compressionPython

Check warning on line 59 in benchmarks/compression/Dockerfile

View workflow job for this annotation

GitHub Actions / Build and push all images (compression-python)

Stage names should be lowercase

StageNameCasing: Stage name 'compressionPython' should be lowercase More info: https://docs.docker.com/go/dockerfile/rule/stage-name-casing/

Check warning on line 59 in benchmarks/compression/Dockerfile

View workflow job for this annotation

GitHub Actions / Build and push all images (compression-python)

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
COPY --from=compressionPythonBuilder /root/.local /root/.local
COPY --from=compressionPythonBuilder /py /app
WORKDIR /app
Expand Down
15 changes: 12 additions & 3 deletions benchmarks/compression/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,31 @@
# SOFTWARE.

ROOT = ../../
FUNCTIONS = compression-python
FUNCTIONS = compression-python init-database
ALL_IMAGES = $(FUNCTIONS)

all-image: $(ALL_IMAGES)

compression-python: docker/Dockerfile python/server.py python/requirements.txt files/metamorphosis.txt
compression-python: Dockerfile python/server.py python/requirements.txt files/metamorphosis.txt
DOCKER_BUILDKIT=1 docker build \
--tag vhiveease/compression-python:latest \
--target compressionPython \
-f docker/Dockerfile \
-f ./Dockerfile \
$(ROOT) --load

init-database: Dockerfile init/init-database.go files/metamorphosis.txt
DOCKER_BUILDKIT=1 docker build \
--tag vhiveease/compression-init-database:latest \
--target databaseInit \
-f ./Dockerfile \
$(ROOT) --load

## Push images
push:
docker push docker.io/vhiveease/compression-python:latest
docker push docker.io/vhiveease/compression-init-database:latest

## Pull images from docker hub
pull:
docker pull docker.io/vhiveease/compression-python:latest
docker pull docker.io/vhiveease/compression-init-database:latest
Loading
Loading