test(e2e): Add worker health check when setting up infra (#3708)
* test(e2e): Add worker health check when setting up infra * test(e2e): Set limits on postgres container This was done to potentially reduce some load on runners
This commit is contained in:
1 parent
e552b12f22
commit
72efe74f24
6 files changed
+40
No files matched your search
@@ -63,6 +63,8 @@ resource "docker_container" "postgres" {
|
||||
"POSTGRES_USER=${var.user}",
|
||||
"POSTGRES_PASSWORD=${var.password}",
|
||||
]
|
||||
cpu_set = "1-2"
|
||||
memory = 2000
|
||||
volumes {
|
||||
host_path = abspath(path.module)
|
||||
container_path = "/etc/postgresql/"
|
||||
|
||||
@@ -63,6 +63,7 @@ resource "docker_image" "boundary" {
|
||||
|
||||
locals {
|
||||
recording_storage_path = "/recordings"
|
||||
port_ops = var.port + 1
|
||||
}
|
||||
|
||||
resource "docker_container" "worker" {
|
||||
@@ -78,6 +79,10 @@ resource "docker_container" "worker" {
|
||||
internal = var.port
|
||||
external = var.port
|
||||
}
|
||||
ports {
|
||||
internal = local.port_ops
|
||||
external = local.port_ops
|
||||
}
|
||||
capabilities {
|
||||
add = ["IPC_LOCK"]
|
||||
}
|
||||
@@ -96,6 +101,7 @@ resource "docker_container" "worker" {
|
||||
type_tags = jsonencode(var.tags)
|
||||
recording_storage_path = local.recording_storage_path
|
||||
port = var.port
|
||||
port_ops = local.port_ops
|
||||
})
|
||||
file = "/boundary/worker-config.hcl"
|
||||
}
|
||||
@@ -115,6 +121,14 @@ resource "docker_container" "worker" {
|
||||
}
|
||||
}
|
||||
|
||||
resource "enos_local_exec" "check_address" {
|
||||
depends_on = [
|
||||
docker_container.worker
|
||||
]
|
||||
|
||||
inline = ["timeout 10s bash -c 'until echo $(curl -s -i \"http://0.0.0.0:${local.port_ops}/health?worker_info=1\") | grep -i \\\"upstream_connection_state\\\":\\\"READY\\\"; do sleep 2; done'"]
|
||||
}
|
||||
|
||||
output "upstream_address" {
|
||||
value = "${var.container_name}:${var.port}"
|
||||
}
|
||||
@@ -14,6 +14,12 @@ listener "tcp" {
|
||||
tls_disable = true
|
||||
}
|
||||
|
||||
listener "tcp" {
|
||||
address = "0.0.0.0:${port_ops}"
|
||||
purpose = "ops"
|
||||
tls_disable = true
|
||||
}
|
||||
|
||||
worker {
|
||||
name = "${worker_name}"
|
||||
public_addr = "${worker_name}:${port}"
|
||||
|
||||
@@ -14,6 +14,12 @@ listener "tcp" {
|
||||
tls_disable = true
|
||||
}
|
||||
|
||||
listener "tcp" {
|
||||
address = "0.0.0.0:${port_ops}"
|
||||
purpose = "ops"
|
||||
tls_disable = true
|
||||
}
|
||||
|
||||
worker {
|
||||
name = "${worker_name}"
|
||||
public_addr = "${worker_name}:${port}"
|
||||
|
||||
@@ -14,6 +14,12 @@ listener "tcp" {
|
||||
tls_disable = true
|
||||
}
|
||||
|
||||
listener "tcp" {
|
||||
address = "0.0.0.0:${port_ops}"
|
||||
purpose = "ops"
|
||||
tls_disable = true
|
||||
}
|
||||
|
||||
worker {
|
||||
name = "${worker_name}"
|
||||
public_addr = "${worker_name}:${port}"
|
||||
|
||||
@@ -14,6 +14,12 @@ listener "tcp" {
|
||||
tls_disable = true
|
||||
}
|
||||
|
||||
listener "tcp" {
|
||||
address = "0.0.0.0:${port_ops}"
|
||||
purpose = "ops"
|
||||
tls_disable = true
|
||||
}
|
||||
|
||||
worker {
|
||||
name = "${worker_name}"
|
||||
public_addr = "${worker_name}:${port}"
|
||||
|
||||
Reference in new issue
Block a user