Skip to content

Commit

Permalink
Add Docker compose files and benchmark to POSIX storage
Browse files Browse the repository at this point in the history
  • Loading branch information
roger2hk committed Aug 29, 2024
1 parent 145f866 commit ccb4043
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 21 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Benchmark

on: [push, pull_request]

permissions:
contents: read

jobs:
benchmark-mysql:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Start Tessera
run: docker compose -f ./cmd/example-mysql/docker/compose.yaml up --build --detach
- name: Run benchmark
run: go run ./hammer --log_public_key=Test-Betty+df84580a+AQQASqPUZoIHcJAF5mBOryctwFdTV1E0GRY4kEAtTzwB --log_url=http://localhost:2024 --max_read_ops=0 --num_writers=512 --max_write_ops=512 --max_runtime=1m --leaf_write_goal=2500 --show_ui=false
- name: Stop Tessera
if: ${{ always() }}
run: docker compose -f ./cmd/example-mysql/docker/compose.yaml down

benchmark-posix:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Start Tessera
run: docker compose -f ./cmd/example-posix/docker/compose.yaml up --build --detach
- name: Run benchmark
run: go run ./hammer --log_public_key=example.com/log/testdata+33d7b496+AeHTu4Q3hEIMHNqc6fASMsq3rKNx280NI+oO5xCFkkSx --log_url=http://localhost:2024 --write_log_url=http://localhost:2025 --max_read_ops=0 --num_writers=512 --max_write_ops=512 --max_runtime=1m --leaf_write_goal=2500 --show_ui=false
- name: Stop Tessera
if: ${{ always() }}
run: docker compose -f ./cmd/example-posix/docker/compose.yaml down
21 changes: 0 additions & 21 deletions .github/workflows/benchmark_mysql.yml

This file was deleted.

16 changes: 16 additions & 0 deletions cmd/example-posix/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM golang:1.23.0-alpine3.19@sha256:fe8f9c7d418d3ac91787f11c31071c4814b6da5f9aae55bc581a7aacc264c395 AS build

WORKDIR /build

# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
COPY go.mod go.sum ./
RUN go mod download && go mod verify

COPY . .
RUN CGO_ENABLED=0 go build -v ./cmd/example-posix

FROM alpine:3.20@sha256:0a4eaa0eecf5f8c050e5bba433f58c052be7587ee8af3e8b3910ef9ab5fbe9f5

COPY --from=build /build/example-posix /

ENTRYPOINT ["/example-posix"]
44 changes: 44 additions & 0 deletions cmd/example-posix/docker/compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
services:

tessera-example-posix-read-proxy:
container_name: tessera-example-posix-read-proxy
image: "busybox:stable"
ports:
- "2024:2024"
command: [
"/bin/busybox",
"httpd",
"-f",
"-p",
"2024",
"-h",
"/tmp/tessera-posix-log"
]
volumes:
- tiles:/tmp/tessera-posix-log
restart: always

tessera-example-posix:
container_name: tessera-example-posix
build:
context: ../../../
dockerfile: ./cmd/example-posix/docker/Dockerfile
ports:
- "2025:2025"
environment:
LOG_PRIVATE_KEY: "PRIVATE+KEY+example.com/log/testdata+33d7b496+AeymY/SZAX0jZcJ8enZ5FY1Dz+wTML2yWSkK+9DSF3eg"
LOG_PUBLIC_KEY: "example.com/log/testdata+33d7b496+AeHTu4Q3hEIMHNqc6fASMsq3rKNx280NI+oO5xCFkkSx"
command: [
"--storage_dir=/tmp/tessera-posix-log",
"--initialise",
"--listen=:2025",
"--alsologtostderr",
"--v=2",
]
volumes:
- tiles:/tmp/tessera-posix-log
restart: always

volumes:
tiles:
name: "tiles"

0 comments on commit ccb4043

Please sign in to comment.