Skip to content

Commit

Permalink
Modified compression benchmark to use mongodb.
Browse files Browse the repository at this point in the history
Signed-off-by: L Lakshmanan <lakshmanan.l@research.iiit.ac.in>

Small edit to server.py

Signed-off-by: Lakshman <Lakshman@localhost>
  • Loading branch information
Lakshman authored and dhschall committed Aug 17, 2024
1 parent 07c700e commit 135a667
Show file tree
Hide file tree
Showing 20 changed files with 3,481 additions and 12 deletions.
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,6 +20,28 @@
# 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
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

0 comments on commit 135a667

Please sign in to comment.