tests(tdxtest): ramp up the testing

Signed-off-by: Harald Hoyer <harald@matterlabs.dev>
This commit is contained in:
Harald Hoyer 2025-02-13 15:40:20 +01:00
parent a41460b7f0
commit fbbb37ca5a
Signed by: harald
GPG key ID: F519A1143B3FBE32
6 changed files with 52 additions and 120 deletions

View file

@ -7,13 +7,33 @@
./../../../packages/tdx_google/configuration.nix ./../../../packages/tdx_google/configuration.nix
]; ];
networking.hosts = {
"127.0.0.100" = [ "metadata.google.internal" ];
# might want to run kafka on the testing host
"10.0.2.2" = [ "kafka" ];
};
# emulate metadata.google.internal
services.static-web-server = {
enable = true;
listen = "127.0.0.100:80";
root = ./web-root;
};
# systemd.services.vector = {
# environment = {
# KAFKA_URLS = "10.0.2.2:9092";
# KAFKA_TOPIC = "tdx-google-test";
# };
# };
systemd.services.docker_start_container = { systemd.services.docker_start_container = {
environment = { # environment = {
CONTAINER_IMAGE = "amd64/hello-world@sha256:e2fc4e5012d16e7fe466f5291c476431beaa1f9b90a5c2125b493ed28e2aba57"; # CONTAINER_IMAGE = "matterlabsrobot/tdx-test:pnj1ryxxb8gbzk9wh18s9bcqrzr1z9ff";
CONTAINER_HUB = "docker.io"; # CONTAINER_HUB = "docker.io";
CONTAINER_USER = ""; # CONTAINER_TOKEN = "";
CONTAINER_TOKEN = ""; # CONTAINER_USER = "";
}; # };
postStop = '' postStop = ''
: :
@ -37,6 +57,7 @@
environment.systemPackages = with pkgs; [ environment.systemPackages = with pkgs; [
strace strace
tcpdump tcpdump
static-web-server
]; ];
@ -60,118 +81,4 @@
cores = 4; cores = 4;
}; };
}; };
/*
services.loki = {
enable = true;
configuration = {
server.http_listen_port = 3030;
auth_enabled = false;
analytics.reporting_enabled = false;
ingester = {
lifecycler = {
address = "127.0.0.1";
ring = {
kvstore = {
store = "inmemory";
};
replication_factor = 1;
};
};
chunk_idle_period = "1h";
max_chunk_age = "1h";
chunk_target_size = 999999;
chunk_retain_period = "30s";
};
schema_config = {
configs = [
{
from = "2024-04-25";
store = "tsdb";
object_store = "filesystem";
schema = "v13";
index = {
prefix = "index_";
period = "24h";
};
}
];
};
storage_config = {
tsdb_shipper = {
active_index_directory = "/var/lib/loki/tsdb-shipper-active";
cache_location = "/var/lib/loki/tsdb-shipper-cache";
cache_ttl = "24h";
};
filesystem = {
directory = "/var/lib/loki/chunks";
};
};
limits_config = {
reject_old_samples = true;
reject_old_samples_max_age = "168h";
volume_enabled = true;
};
table_manager = {
retention_deletes_enabled = false;
retention_period = "0s";
};
compactor = {
working_directory = "/var/lib/loki";
compactor_ring = {
kvstore = {
store = "inmemory";
};
};
};
};
};
services.promtail = {
enable = true;
configuration = {
server = {
http_listen_port = 3031;
grpc_listen_port = 0;
};
clients = [
{
url = "http://127.0.0.1:${toString config.services.loki.configuration.server.http_listen_port}/loki/api/v1/push";
}
];
scrape_configs = [{
job_name = "journal";
journal = {
max_age = "12h";
labels = {
job = "systemd-journal";
};
};
relabel_configs = [
{
source_labels = [ "__journal__systemd_unit" ];
target_label = "systemd_unit";
}
{
source_labels = [ "__journal__hostname" ];
target_label = "nodename";
}
{
source_labels = [ "__journal_container_id" ];
target_label = "container_id";
}
];
}];
};
# extraFlags
};
*/
} }

View file

@ -0,0 +1,21 @@
{
"server": {
"port": 8080,
"timeout_seconds": 30
},
"metrics": {
"port": 9000
},
"telemetry": {
"otlp": {
"enable": true,
"endpoint": "http://127.0.0.1:4317",
"protocol": "grpc"
},
"logging": {
"level": "trace",
"console": true,
"json": false
}
}
}

View file

@ -0,0 +1 @@
matterlabsrobot/tdx-test:81hgl91s5hj0sb83c7ij9acf2s5qjvb5