-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Summary
- Formalize the
databasekey inconfig.tomlfiles to specify a published database image and tag - Excise the Docker library portions of the Toolset to its own library repository
- Move configuration of a database into the Docker container start-up
- Formalize
start_upinterface for all database types - Formalize
build_upinterface for all database types - Formalize
is_readyinterface for all database types - Formalize communication of the running
container_idback to the Toolset
Motivation
Currently (and also in the legacy implementation), the database field of the configuration file specified one of a list of supported databases that were curated by the TechEmpower Framework Benchmarks team and community contributors. This implementation necessitates being able to build a database's Docker image dynamically, or the image being published by an external process and pulled at runtime.
This database key could technically be changed to allow specifying the published base image from which the database image will be built. For instance, a configuration could specify database = "mysql:5.7", and the Toolset et al could support pulling that published image from Dockerhub, configuring it, starting the container, connecting with a client, and issuing the build-up scripts for establishing the ready state of that database (creating the user/password, schema, tables, inserting data, etc).
Detailed Design
The proposed change would cause a verification of any test to become the following:
- Start via
tfb_toolset.exe -m verify --test gemini --type db - Parse
frameworks/Java/gemini/config.tomland retrieve the database value ofmysql:5.7 - Toolset starts the verifier container in a "create database" mode, passing
mysql:5.7as an environment variable, and blocks until it terminates - Verifier runs in "create database" mode, splits the database into
image_nameandimage_tag
4a. Validates thatimage_nameis a known database with a verifier implementation
4b. Issues a Docker create image from "[image_name]:[image_tag]" - Verifier starts the database, optionally mounting configuration files
- Verifier, via database interface, checks
is_readyfor a period of time - Verifier communicates
container_idonce database is ready back to Toolset which asynchronously stores the id - Verifier, via database interface, executes the
build_upstage of the database - Verifier terminates
- Toolset verifies
Benefits
- Use of officially published database images as opposed to our best-attempt images
- Individual tests must specify the exact database type and version allowing testing different databases over time in a controlled and visible way
build_upis moved from creation scripts on the image to client scripts on the Verifier- One source of truth for a given database type - the
mysqlfolder under the Verifier is where all database about themysqldatabase type exists (read: no external repository; if themysqlfolder is deleted, it is no longer supported; if acouchdbfolder is added and the interfaces implemented, it is supported)
Drawbacks
- Database configuration files must live in an otherwise Rust repository
- Additional test time required to connect the client to the database instance and
build_upon every invocation - While database type and version are specified by the implementer, the configuration file is static to the Verifier
Alternatives
- Maintain an additional repository with folders for each database type (similar to how it is done in Legacy) and a single
Dockerfilefor each, publishing to Dockerhub under the TechEmpower repository for consumption by the Toolset.
Unresolved Questions
- Do all database types support configurations mounted as a volume? See Using a custom MySQL configuration file.
- Is there a way to have "versioned" configuration files other than having X files in the Verifier?