Before you do anything else
- Make sure you have a container registry and credentials — or contact us to request them.
-
Antithesis runs your software using Linux container images, much as Docker and Kubernetes do. So it’s helpful to have some understanding of:
- Docker
- Your software’s dependencies
- Antithesis runs your system in a hermetic simulation environment — meaning no internet access at all. Anything your system needs must either be packaged into the environment or mocked appropriately.
Need help?
Need help?
If you run into trouble, or simply want to make sure your testing is as thorough as possible, our solutions engineering team would be happy to help — email us at: support@antithesis.com or join our Discord.
tl;dr
-
Containerize your software and its dependencies
- Build a container image for your software, for x86-64 CPUs.
- Provide images for everything that runs inside the system — we run without internet access.
- For external dependencies that don’t have a public image, use (or write) a mock.
-
Package your system
- Orchestrate your system with a
docker-compose.yamlfile.- Ensure all services have correct image names with tags/digests. If no tag/digest is provided, Antithesis will get the image tagged
latestby default. - Use a
.envfile to declare all environment variables.
- Ensure all services have correct image names with tags/digests. If no tag/digest is provided, Antithesis will get the image tagged
- Build a
configimage (e.g.FROM scratch; COPY . .).
- Orchestrate your system with a
-
Test locally
- Simulate isolation (no internet connectivity).
- Run
docker-compose upto bring up your system.
-
Add a test template
- Place an executable test in
/opt/antithesis/test/v1/quickstart/inside a container that runs indefinitely. - Run the test locally with
docker compose exec.
- Place an executable test in
-
Add a ready signal
- Emit a
setup_completesignal for Antithesis to start testing.
- Emit a
-
Push your images
- Tag and push all container images, including the
configimage, to the Antithesis registry.
- Tag and push all container images, including the
-
Run your first test!
- Trigger a test with the provided webhook endpoint.
- Review the triage report you’ll receive by email.
Containerize your software
You’ll package your software and its dependencies and upload them to the Antithesis registry. If you’re already deploying with containers, read this note, then jump to the next step. If this is your first time containerizing software, here’s a basic example to get you started: Create a Dockerfile in the root directory of your project to containerize it. Your structure might look like this:<image-name> and <tag-name> appropriately.
If you don’t specify the tag name when building the Docker container image, Docker will automatically tag the most recent build of the image as
latest.Containerize your dependencies
Since there’s no internet access inside the Antithesis environment, all of your software’s dependencies need to be deployed alongside it. There are two ways to do this.- Deploy the actual service, just as you would in production.
- Upload a mock of the service.
Deploy the actual service
If the dependency is something you control, e.g. a local database node, follow the previous step to build a container image. You’ll upload it to the Antithesis registry along with your software. For third-party services, many open-source tools (like Redis, Kafka, MongoDB, MySQL, etc.) are already hosted on public registries such as Docker Hub or Quay. If so, you can simply specify the registry and image when setting up orchestration.Upload a mock
If a third-party dependency doesn’t offer a public container image, you’ll need a mock of the service. Many companies provide mocks in containerized form (e.g. Stripe provides Stripe-mock), and third-party providers, e.g. Localstack, provide sophisticated pre-built mocks of common dependencies like AWS. Treat these like any other open-source, containerized dependency and specify the registry and image when setting up orchestration. Handling external dependencies offers more details, and a list of commonly used mocks.Set up container orchestration
We expect you to deliver a container image that contains a specific directory structure of what to run. We call this theconfig image.
In this image, include:
- Any configuration files expected by the containers: license files, settings, environment variables file, or other resources.
- A container orchestration file,
docker-compose.yaml.
docker-compose.yaml file in this directory lists each of the services you want to have running, the container image that the service should be started from, any external volumes that should be mounted into that container, and other options.
Here’s an example docker-compose.yaml which uses a .env file to declare environment variables. Docker compose offers multiple ways to set environment variables within your containers.
- The database service has requested an external volume mount. Data stored in these directories will be mapped out of the container filesystem and will outlive the container’s own lifetime. The volume declarations refer to empty directories created in the configuration directory. Since we’re going to use the configuration directory as our working directory, these relative paths will resolve correctly.
- The services in the above example can reach each other by hostname. We automatically generate suitable DNS entries from the names of each of the services and inject them into the environment of every other service.
- Official Docker Compose documentation
- Our Docker best practices guide
- Or you can email us at support@antithesis.com
config directory:
Test your setup locally
To test your container orchestration locally, from inside your config directory, run:config image.
To build a config image, copy all configuration files and add them to a scratch image.
Provide a basic test template
To test your system and find bugs, Antithesis needs to exercise your software. We do this using a test template — code that makes your software do something. There’s a lot you can do with test templates (see Test composition or our tutorial on this for more), but to test your setup, you can use one of your existing integration tests. To do this, use the following naming conventions to enable Antithesis to detect and run your test. These conventions should be followed exactly.-
Create a directory called
/opt/antithesis/test/v1/quickstartin any of your containers. -
Paste an existing integration test into an executable named
singleton_driver_<your_test_name>.<extension>in the directory you just created. Make sure your executable has an appropriate shebang in the first line, e.g.#!/usr/bin/env bash
docker compose exec on your test command and see if it runs.
Add a ready signal for fuzzing
Before running any tests, Antithesis initializes your software and its dependencies. Once your system is up and running, it should emit asetup_complete message to initiate testing.
ImportantDuring the initialization process, none of your containers should exit with a non-zero exit code before the ready signal is emitted.
$ANTITHESIS_OUTPUT_DIR/sdk.jsonl — in our environment, we’ll ensure that this variable and the directory it points to always exist.
details must not terminate with a newline, because the entire message must be JSONL. More details on this syntax here.Push your images
When you become a customer, we configure a container registry for you and send you a credential file$TENANT_NAME.key.json.
To authenticate to your container registry, run the following command:
us-central1-docker.pkg.dev/molten-verve-216720/$TENANT_NAME-repository/.
For example, if your local image is named my_app, you’d tag it as it’s referenced in your docker-compose.yaml and push it as follows:
docker.io/library/postgres:17.2) can be referenced directly in your config files, you do not need to copy them into the Antithesis registry.
Run your first test
You can use this webhook endpoint to kick off a test run using the username and password we sent you when you became a customer.- All container images mentioned in
docker-compose.yamlwill be automatically pulled into the testing environment. - Images needed for setup but not mentioned in
docker-compose.yamlshould be passed in theantithesis.imagesparameter with an image name and tags/digests. If it’s public image, include a full path to the image (eg."antithesis.images":"docker.io/library/postgres:17.2"). - Do not pass the config image in
antithesis.images; it should only be passed toantithesis.config_image. - Consult the endpoint reference for more details.
Review the triage report
Within an hour, you’ll receive an email with a link to a triage report. We suggest you read about the triage report and test properties while you wait! Congratulations — you’re now set up with Antithesis! From here, we suggest:- Reading the Properties and Assertions section to understand some of the core concepts behind Antithesis testing.
- Trying the Test Composer tutorial for a ground-up guide to iterating on your testing.
- Reading the SDK docs to integrate the relevant SDK with your code.