Skip to content
Snippets Groups Projects
Commit 7ea45f8d authored by Corné Lukken's avatar Corné Lukken
Browse files

L2SS-2032: Fix integration tests after jumppad consul removal

parent e7525f8f
No related branches found
No related tags found
1 merge request!999L2SS-2032: Fix integration tests after jumppad consul removal
...@@ -151,6 +151,7 @@ Next change the version in the following places: ...@@ -151,6 +151,7 @@ Next change the version in the following places:
# Release Notes # Release Notes
* 0.43.2 Fix jumppad integration test using custom nomad image that includes consul
* 0.43.1 Fix rounding for the coarse delay and loss compensations. * 0.43.1 Fix rounding for the coarse delay and loss compensations.
* 0.43.0 Use PyTango 10.0.0 * 0.43.0 Use PyTango 10.0.0
* 0.42.12 Calibration device now fetches the station's name from the StationManager * 0.42.12 Calibration device now fetches the station's name from the StationManager
......
...@@ -77,7 +77,9 @@ telemetry { ...@@ -77,7 +77,9 @@ telemetry {
} }
consul { consul {
address = "localhost:8500" # address = "192.168.76.2:8500"
# checks_use_advertise = true # Otherwise will fallback to bind_addr
addres = "127.0.0.1:8500"
server_service_name = "nomad" server_service_name = "nomad"
client_service_name = "nomad-client" client_service_name = "nomad-client"
auto_advertise = true auto_advertise = true
...@@ -86,7 +88,6 @@ consul { ...@@ -86,7 +88,6 @@ consul {
} }
advertise { advertise {
http = "{{ GetInterfaceIP \"eth0\" }}" http = "{{ GetInterfaceIP \"eth0\" }}"
rpc = "{{ GetInterfaceIP \"eth0\" }}" rpc = "{{ GetInterfaceIP \"eth0\" }}"
serf = "{{ GetInterfaceIP \"eth0\" }}" serf = "{{ GetInterfaceIP \"eth0\" }}"
......
resource "network" "station" { resource "network" "station" {
subnet = "192.168.72.0/21" subnet = "192.168.72.0/21"
} }
resource "template" "consul_config" { resource "template" "consul_config" {
source = <<-EOF source = <<-EOF
...@@ -39,9 +40,10 @@ resource "template" "consul_config" { ...@@ -39,9 +40,10 @@ resource "template" "consul_config" {
destination = "./tmp/consul.hcl" destination = "./tmp/consul.hcl"
} }
resource "container" "consul" { resource "container" "consul" {
depends_on = ["resource.template.consul_config"] depends_on = [
"resource.template.consul_config", "resource.network.station"
]
network { network {
id = resource.network.station.meta.id id = resource.network.station.meta.id
ip_address = "192.168.76.1" ip_address = "192.168.76.1"
...@@ -54,6 +56,7 @@ resource "container" "consul" { ...@@ -54,6 +56,7 @@ resource "container" "consul" {
command = [ command = [
"consul", "consul",
"agent", "agent",
"-dev",
"-config-file=/consul/config/config.hcl" "-config-file=/consul/config/config.hcl"
] ]
...@@ -82,17 +85,22 @@ resource "container" "consul" { ...@@ -82,17 +85,22 @@ resource "container" "consul" {
privileged = false privileged = false
} }
resource "nomad_cluster" "station" { resource "nomad_cluster" "station" {
depends_on = ["resource.container.consul"] depends_on = [
"resource.container.consul",
]
client_nodes = 1 client_nodes = 1
client_config = "./config/nomad/client.hcl" client_config = "./config/nomad/client.hcl"
consul_config = "./config/nomad/consul.hcl" consul_config = "./config/nomad/consul.hcl"
datacenter = "stat" datacenter = "stat"
image {
name = "git.astron.nl:5000/lofar2.0/jumppad-docker-files/nomad:latest"
}
network { network {
id = resource.network.station.meta.id id = resource.network.station.meta.id
#ip_address = "192.168.76.250" # ip_address = "192.168.76.3"
} }
environment = { environment = {
NO_PROXY = "astron.nl,control.lofar,10.0.0.0/8" NO_PROXY = "astron.nl,control.lofar,10.0.0.0/8"
......
...@@ -104,11 +104,16 @@ job "tango" { ...@@ -104,11 +104,16 @@ job "tango" {
} }
template { template {
wait {
min = "30s"
max = "300s"
}
error_on_missing_key = true
data = <<EOH data = <<EOH
{{ range service "tangodb" }} {{- range service "tangodb" }}
MYSQL_HOST = "{{ .Address }}" MYSQL_HOST = "{{ .Address }}"
MYSQL_PORT = "{{ .Port }}" MYSQL_PORT = "{{ .Port }}"
{{ end }} {{- end }}
EOH EOH
destination = "local/env.txt" destination = "local/env.txt"
env = true env = true
......
...@@ -43,7 +43,7 @@ if dig @127.0.0.1 -p 8600 tango.service.consul +short > /dev/null; then ...@@ -43,7 +43,7 @@ if dig @127.0.0.1 -p 8600 tango.service.consul +short > /dev/null; then
TANGO_HOST=$(dig @127.0.0.1 -p 8600 tango.service.consul +short) TANGO_HOST=$(dig @127.0.0.1 -p 8600 tango.service.consul +short)
export TANGO_HOST="$TANGO_HOST:$TANGO_PORT" export TANGO_HOST="$TANGO_HOST:$TANGO_PORT"
else else
export TANGO_HOST=$(hostname):10000 export TANGO_HOST="$(hostname):10000"
fi fi
echo "Using tango host $TANGO_HOST" echo "Using tango host $TANGO_HOST"
......
0.43.1 0.43.2
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment