diff --git a/Makefile b/Makefile index 5a51552474..97328b09a6 100644 --- a/Makefile +++ b/Makefile @@ -29,8 +29,6 @@ DIST_DIR = $(GRAPL_ROOT)/dist COMPOSE_USER=${UID}:${GID} COMPOSE_IGNORE_ORPHANS=1 COMPOSE_PROJECT_NAME ?= grapl -# Get a non-loopback private ip for the host. Order is not guaranteed, but that's ok -CONSUL_DNS_IP = $(shell hostname --all-ip-addresses | awk '{ print $$1 }') export diff --git a/docker-compose.yml b/docker-compose.yml index 235d0c850f..cc4568970c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -59,7 +59,6 @@ services: PULUMI_CONFIG_PASSPHRASE: local-grapl-passphrase DOCKER_USER: "${UID}:${GID}" GRAPL_ROOT: "${GRAPL_ROOT}" - CONSUL_DNS_IP: "${CONSUL_DNS_IP}" WITH_PULUMI_TRACING: "${WITH_PULUMI_TRACING}" # Other environment variables like MG_ALPHAS are passed in via # Pulumi.local-grapl.yaml diff --git a/nomad/grapl-core.nomad b/nomad/grapl-core.nomad index c42b0e7f26..75ce764a43 100644 --- a/nomad/grapl-core.nomad +++ b/nomad/grapl-core.nomad @@ -196,12 +196,6 @@ variable "google_client_id" { description = "Google client ID used for authenticating web users via Sign In With Google" } -variable "dns_server" { - type = string - description = "The network.dns.server value. This should be equivalent to the host's ip in order to communicate with dnsmasq and allow consul dns to be available from within containers. This can be replaced as of Nomad 1.3.0 with variable interpolation per https://github.com/hashicorp/nomad/issues/11851." - default = "" -} - locals { dgraph_zero_grpc_private_port_base = 5080 dgraph_zero_http_private_port_base = 6080 @@ -240,9 +234,7 @@ locals { redis_host = local._redis[0] redis_port = local._redis[1] - # TODO once we upgrade to nomad 1.3.0 replace this with attr.unique.network.ip-address (variable interpolation is - # added for network.dns as of 1.3.0 - dns_servers = [var.dns_server] + dns_servers = [attr.unique.network.ip-address] # Grapl services graphql_endpoint_port = 5000 diff --git a/nomad/grapl-ingress.nomad b/nomad/grapl-ingress.nomad index 635ed17683..07244b5309 100644 --- a/nomad/grapl-ingress.nomad +++ b/nomad/grapl-ingress.nomad @@ -1,14 +1,6 @@ -variable "dns_server" { - type = string - description = "The network.dns.server value. This should be equivalent to the host's ip in order to communicate with dnsmasq and allow consul dns to be available from within containers. This can be replaced as of Nomad 1.3.0 with variable interpolation per https://github.com/hashicorp/nomad/issues/11851." - default = "" -} - locals { web_ui_port = 1234 - # TODO once we upgrade to nomad 1.3.0 replace this with attr.unique.network.ip-address (variable interpolation is - # added for network.dns as of 1.3.0 - dns_servers = [var.dns_server] + dns_servers = [attr.unique.network.ip-address] } job "grapl-ingress" { diff --git a/nomad/rust-integration-tests.nomad b/nomad/rust-integration-tests.nomad index d41ee4d3e0..f33362e107 100644 --- a/nomad/rust-integration-tests.nomad +++ b/nomad/rust-integration-tests.nomad @@ -61,12 +61,6 @@ variable "user_session_table" { description = "The name of the DynamoDB user session table" } -variable "dns_server" { - type = string - description = "The network.dns.server value. This should be equivalent to the host's ip in order to communicate with dnsmasq and allow consul dns to be available from within containers. This can be replaced as of Nomad 1.3.0 with variable interpolation per https://github.com/hashicorp/nomad/issues/11851." - default = "" -} - variable "organization_management_db" { type = object({ hostname = string @@ -88,9 +82,7 @@ variable "plugin_work_queue_db" { } locals { - # TODO once we upgrade to nomad 1.3.0 replace this with attr.unique.network.ip-address (variable interpolation is - # added for network.dns as of 1.3.0 - dns_servers = [var.dns_server] + dns_servers = [attr.unique.network.ip-address] } job "rust-integration-tests" { diff --git a/nomad/template_smple.json b/nomad/template_smple.json new file mode 100644 index 0000000000..ebbdbcc09c --- /dev/null +++ b/nomad/template_smple.json @@ -0,0 +1,12 @@ +{ + "name": "foo", + "count": 1, + "container_image": "bar", + "env": { + "key": "value" + }, + "service_type": "grpc", + "upstreams": { + "service": "port" + } +} \ No newline at end of file diff --git a/pulumi/grapl/__main__.py b/pulumi/grapl/__main__.py index 575993e525..efad55dbcf 100644 --- a/pulumi/grapl/__main__.py +++ b/pulumi/grapl/__main__.py @@ -220,7 +220,6 @@ def main() -> None: aws_env_vars_for_local=aws_env_vars_for_local, aws_region=aws.get_region().name, container_images=_container_images(artifacts), - dns_server=config.CONSUL_DNS_IP, kafka_bootstrap_servers=kafka.bootstrap_servers(), kafka_credentials=kafka_service_credentials, kafka_consumer_groups=kafka_consumer_groups, @@ -288,7 +287,6 @@ def main() -> None: nomad_grapl_ingress = NomadJob( "grapl-ingress", jobspec=path_from_root("nomad/grapl-ingress.nomad").resolve(), - vars={"dns_server": config.CONSUL_DNS_IP}, opts=pulumi.ResourceOptions( provider=nomad_provider, # This dependson ensures we've switched the web-ui protocol to http instead of tcp prior. Otherwise there's diff --git a/pulumi/infra/config.py b/pulumi/infra/config.py index 7a9c62b2ef..7f5853f0dd 100644 --- a/pulumi/infra/config.py +++ b/pulumi/infra/config.py @@ -25,12 +25,6 @@ # note: this ${} is interpolated inside Nomad HOST_IP_IN_NOMAD: Final[str] = "${attr.unique.network.ip-address}" -# This is equivalent to what "${attr.unique.network.ip-address}" resolves to but is used for cases where variable -# interpolation is not available such as network.dns prior to Nomad 1.3.0 -# Hax: If this is not available such as in Buildkite, we'll default to Google DNS for now. -# This should be going away once https://github.com/hashicorp/nomad/pull/12817 is merged -CONSUL_DNS_IP: Final[str] = os.getenv("CONSUL_DNS_IP", "8.8.8.8") - def to_bool(input: str | bool | None) -> bool | None: if isinstance(input, bool): diff --git a/pulumi/rust_integration_tests/__main__.py b/pulumi/rust_integration_tests/__main__.py index 952b6d87d8..8e22d26b6c 100644 --- a/pulumi/rust_integration_tests/__main__.py +++ b/pulumi/rust_integration_tests/__main__.py @@ -69,7 +69,6 @@ def main() -> None: "aws_env_vars_for_local": grapl_stack.aws_env_vars_for_local, "aws_region": aws.get_region().name, "container_images": _rust_integration_container_images(artifacts), - "dns_server": config.CONSUL_DNS_IP, "kafka_bootstrap_servers": kafka.bootstrap_servers(), "kafka_consumer_group": kafka.consumer_group("integration-tests"), "kafka_credentials": kafka_credentials,