conformance/

directory
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2024 License: Apache-2.0

README

Conformance Personalities

This directory contains personalities that serve a dual purpose:

  • To provide a simple example of a personality that can be deployed with each backend
  • To function as conformance and performance harnesses for Tessera (using the hammer)

Each subdirectory contains an implementation of the same personality built on top of Tessera. Implementations are provided that use:

Each of these personalities exposes an endpoint that accepts POST requests at a /add URL. The contents of any request body will be appended to the log, and the decimal index assigned to this newly sequenced entry will be returned.

Codelab

This codelab will help you add a few entries to a log, and inspect its contents. First, you need to bring up personality (a server built with Tessera which manages the log) on the infrastructure of your choice:

Choose one of the implementations above and deploy it. In the shell you are going to run this codelab in, define the following environment variables (check the logging output from the implementation you deployed, as these may have been output):

  • The write URL: ${WRITE_URL}
  • The read URL: ${READ_URL}
  • The log public key: ${LOG_PUBLIC_KEY}

The commands below add entries to the log, and then show a few approaches to inspect the contents of the log.

# Add 3 entries in parallel, and wait for all requests to complete
curl -d 'one!' -H "Content-Type: application/data" -X POST ${WRITE_URL}add &
curl -d 'two!' -H "Content-Type: application/data" -X POST ${WRITE_URL}add &
curl -d 'three!' -H "Content-Type: application/data" -X POST ${WRITE_URL}add &
wait

# Check that the checkpoint is of the correct size (i.e. 3).
# If the checkpoint size is zero, this is expected. It may take a second to integrate the entries and publish the checkpoint.
curl -s ${READ_URL}checkpoint

# Look at the leaves after confirming the checkpoint size. Piping into xxd to reveal the leaf sizes.
curl -s ${READ_URL}tile/entries/000.p/3 | xxd

The tiles format is plain-text, but it's better to inspect the log via tooling made for this purpose:

go run github.com/mhutchinson/woodpecker@main \
  --custom_log_type=tiles \
  --custom_log_url=${READ_URL} \
  --custom_log_vkey=${LOG_PUBLIC_KEY}

Use arrow keys left and right to go backwards and forwards through the entries in the log. Use q to quit.

Here's a demo of the codelab being followed:

Codelab demo

Directories

Path Synopsis
aws is a simple personality allowing to run conformance/compliance/performance tests and showing how to use the Tessera AWS storage implmentation.
aws is a simple personality allowing to run conformance/compliance/performance tests and showing how to use the Tessera AWS storage implmentation.
gcp is a simple personality allowing to run conformance/compliance/performance tests and showing how to use the Tessera GCP storage implmentation.
gcp is a simple personality allowing to run conformance/compliance/performance tests and showing how to use the Tessera GCP storage implmentation.
mysql is a simple personality allowing to run conformance/compliance/performance tests and showing how to use the Tessera MySQL storage implmentation.
mysql is a simple personality allowing to run conformance/compliance/performance tests and showing how to use the Tessera MySQL storage implmentation.
posix runs a web server that allows new entries to be POSTed to a tlog-tiles log stored on a posix filesystem.
posix runs a web server that allows new entries to be POSTed to a tlog-tiles log stored on a posix filesystem.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL