Skip to content

Commit 808c1e3

Browse files
authored
chore: Introduce a new http -> pipelines -> blackhole soak (#10142)
* Introduce a new http -> pipelines -> blackhole soak This commit introduces a new soak to investigate our pipelines in an ongoing basis. The pipeline configuration for vector and the sample data was contributed by work was contributed @vladimir-dd. I have expanded the soak to allow mounting a TESTNAME/data to smuggle static data into the minikube, by which we feed http_gen. Unfortunately this does not work as we cannot use the Virtual Box VM for soak testing and kubernetes/minikube#12301 is open. We will have to figure out some other way to smuggle data into the minikube for this soak to function. This commit depends on #10141 which depends on DataDog/lading#119. Signed-off-by: Brian L. Troutwine <[email protected]> * Use configmap hack It turns out that the problem discussed in the last commit is fixed by kubernetes/minikube#13013. This is not present in a minikube release yet, so we can't rely on it. That said, this commit introduces a hack whereby the bootstrap is passed in a configmap. This limits the size of the bootstrap with all the problems that come along with a low-entropy experiment. Signed-off-by: Brian L. Troutwine <[email protected]>
1 parent b73de9f commit 808c1e3

File tree

13 files changed

+3722
-9
lines changed

13 files changed

+3722
-9
lines changed

soaks/bin/run_experiment.sh

+6-4
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,12 @@ SOAK_CAPTURE_DIR="${CAPTURE_DIR}/${SOAK_NAME}"
8282

8383
pushd "${__dir}"
8484
./boot_minikube.sh --cpus "${SOAK_CPUS}" --memory "${SOAK_MEMORY}"
85-
mkdir -p "${SOAK_CAPTURE_DIR}"
85+
mkdir --parents "${SOAK_CAPTURE_DIR}"
86+
minikube image load "${IMAGE}"
87+
# Mount the capture directory. This is where the samples captured from inside
88+
# the minikube will be placed on the host.
8689
minikube mount "${SOAK_CAPTURE_DIR}:/captures" &
87-
minikube cache add "${IMAGE}"
88-
MOUNT_PID=$!
90+
CAPTURE_MOUNT_PID=$!
8991
popd
9092

9193
pushd "${SOAK_ROOT}/tests/${SOAK_NAME}/terraform"
@@ -96,7 +98,7 @@ echo "[${VARIANT}] Sleeping for ${WARMUP_GRACE} seconds to allow warm-up"
9698
sleep "${WARMUP_GRACE}"
9799
echo "[${VARIANT}] Recording captures to ${SOAK_CAPTURE_DIR}"
98100
sleep "${TOTAL_SAMPLES}"
99-
kill "${MOUNT_PID}"
101+
kill "${CAPTURE_MOUNT_PID}"
100102
popd
101103

102104
pushd "${__dir}"

soaks/common/terraform/modules/lading_http_blackhole/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ variable "http-blackhole-yaml" {
1515

1616
variable "lading_image" {
1717
description = "The lading image to run"
18-
type = string
18+
type = string
1919
}

soaks/common/terraform/modules/lading_http_gen/main.tf

+22
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
resource "kubernetes_config_map" "lading_bootstrap" {
2+
metadata {
3+
name = "lading-http-gen-bootstrap"
4+
namespace = var.namespace
5+
}
6+
7+
data = {
8+
"bootstrap.log" = var.http-gen-static-bootstrap
9+
}
10+
}
11+
112
resource "kubernetes_config_map" "lading" {
213
metadata {
314
name = "lading-http-gen"
@@ -70,6 +81,11 @@ resource "kubernetes_deployment" "http-gen" {
7081
name = "http-gen"
7182
command = ["/http_gen"]
7283

84+
volume_mount {
85+
mount_path = "/data"
86+
name = "data"
87+
read_only = true
88+
}
7389
volume_mount {
7490
mount_path = "/etc/lading"
7591
name = "etc-lading"
@@ -106,6 +122,12 @@ resource "kubernetes_deployment" "http-gen" {
106122
name = kubernetes_config_map.lading.metadata[0].name
107123
}
108124
}
125+
volume {
126+
name = "data"
127+
config_map {
128+
name = kubernetes_config_map.lading_bootstrap.metadata[0].name
129+
}
130+
}
109131
}
110132
}
111133
}

soaks/common/terraform/modules/lading_http_gen/variables.tf

+8-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,14 @@ variable "http-gen-yaml" {
1313
type = string
1414
}
1515

16+
variable "http-gen-static-bootstrap" {
17+
description = "Boostrap log to be used for static variant, mounted at /data/boostrap.log"
18+
type = string
19+
default = ""
20+
}
21+
22+
1623
variable "lading_image" {
1724
description = "The lading image to run"
18-
type = string
25+
type = string
1926
}

soaks/common/terraform/modules/lading_splunk_hec_blackhole/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ variable "splunk-hec-blackhole-yaml" {
1515

1616
variable "lading_image" {
1717
description = "The lading image to run"
18-
type = string
18+
type = string
1919
}

soaks/common/terraform/modules/lading_splunk_hec_gen/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ variable "splunk-hec-gen-yaml" {
1515

1616
variable "lading_image" {
1717
description = "The lading image to run"
18-
type = string
18+
type = string
1919
}

soaks/common/terraform/modules/lading_tcp_gen/variables.tf

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ variable "tcp-gen-yaml" {
1515

1616
variable "lading_image" {
1717
description = "The lading image to run"
18-
type = string
18+
type = string
1919
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# HTTP -> Pipelines -> Datadog Logs
2+
3+
This soak tests the http sink feeding through multiple pipeline transforms down
4+
to blackhole sink. It is a complicated topology.
5+
6+
## Method
7+
8+
Lading `http_gen` is used to generate log load into vector. The vector internal
9+
blackhole is sink for this configuration.

soaks/tests/http_pipelines_blackhole/terraform/data/http_gen_bootstrap.log

+179
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
worker_threads: 1
2+
prometheus_addr: "0.0.0.0:9090"
3+
4+
targets:
5+
vector:
6+
headers: {}
7+
target_uri: "http://vector:8282/"
8+
bytes_per_second: "500 Mb"
9+
parallel_connections: 10
10+
method:
11+
post:
12+
maximum_prebuild_cache_size_bytes: "256 Mb"
13+
variant:
14+
static:
15+
static_path: "/data/bootstrap.log"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Set up the providers needed to run this soak and other terraform related
2+
# business. Here we only require 'kubernetes' to interact with the soak
3+
# minikube.
4+
terraform {
5+
required_providers {
6+
kubernetes = {
7+
version = "~> 2.5.0"
8+
source = "hashicorp/kubernetes"
9+
}
10+
}
11+
}
12+
13+
# Rig the kubernetes provider to communicate with minikube. The details of
14+
# adjusting `~/.kube/config` are addressed by the soak control scripts.
15+
provider "kubernetes" {
16+
config_path = "~/.kube/config"
17+
}
18+
19+
# Setup background monitoring details. These are needed by the soak control to
20+
# understand what vector et al's running behavior is.
21+
module "monitoring" {
22+
source = "../../../common/terraform/modules/monitoring"
23+
type = var.type
24+
vector_image = var.vector_image
25+
}
26+
27+
# Setup the soak pieces
28+
#
29+
# This soak config sets up a vector soak with lading/http-gen feeding into vector,
30+
# lading/http-blackhole receiving.
31+
resource "kubernetes_namespace" "soak" {
32+
metadata {
33+
name = "soak"
34+
}
35+
}
36+
37+
module "vector" {
38+
source = "../../../common/terraform/modules/vector"
39+
type = var.type
40+
vector_image = var.vector_image
41+
vector-toml = file("${path.module}/vector.toml")
42+
namespace = kubernetes_namespace.soak.metadata[0].name
43+
vector_cpus = var.vector_cpus
44+
depends_on = [module.monitoring]
45+
}
46+
module "http-gen" {
47+
source = "../../../common/terraform/modules/lading_http_gen"
48+
type = var.type
49+
http-gen-yaml = file("${path.module}/http_gen.yaml")
50+
# This is a hack. Ultimately this creates a configmap in the minikube, where
51+
# we would _prefer_ to simply mount a directory into the kube. This is not
52+
# possible, pending introductoin of
53+
# https://github.com/kubernetes/minikube/issues/12301 into a release. Keep in
54+
# mind that the bootstrap _must_ be below 1MB in size, which severely limits
55+
# the entropy of our experiment.
56+
http-gen-static-bootstrap = file("${path.module}/data/http_gen_bootstrap.log")
57+
namespace = kubernetes_namespace.soak.metadata[0].name
58+
lading_image = var.lading_image
59+
depends_on = [module.monitoring, module.vector]
60+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
variable "type" {
2+
description = "The type of the vector install, whether 'baseline' or 'comparison'"
3+
type = string
4+
}
5+
6+
variable "vector_image" {
7+
description = "The image of vector to use in this investigation"
8+
type = string
9+
}
10+
11+
variable "vector_cpus" {
12+
description = "The total number of CPUs to give to vector"
13+
type = number
14+
}
15+
16+
variable "lading_image" {
17+
description = "The lading image to run"
18+
type = string
19+
}

0 commit comments

Comments
 (0)