From 5fccab2edb01623afeb402efea08ad8f9619c540 Mon Sep 17 00:00:00 2001 From: Josh Terrill Date: Tue, 16 Dec 2025 23:55:25 -0800 Subject: [PATCH] fix issue with instances not being destroyed --- numerai/cli/destroy_all.py | 2 +- numerai/cli/node/destroy.py | 2 +- numerai/cli/uninstall.py | 2 +- numerai/cli/upgrade.py | 2 +- numerai/cli/util/terraform.py | 8 ++++---- numerai/terraform/aws/-inputs.tf | 2 +- numerai/terraform/aws/aws/cluster.tf | 2 +- numerai/terraform/azure/input.tf | 2 +- numerai/terraform/gcp/-inputs.tf | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/numerai/cli/destroy_all.py b/numerai/cli/destroy_all.py index 8834dbc..74747d8 100644 --- a/numerai/cli/destroy_all.py +++ b/numerai/cli/destroy_all.py @@ -62,7 +62,7 @@ def destroy_all(ctx, verbose, preserve_node_config): verbose, provider, env_vars=provider_keys, - inputs={"node_config_file": "nodes.json"}, + inputs={"node_config_file": "../nodes.json"}, ) except Exception as e: diff --git a/numerai/cli/node/destroy.py b/numerai/cli/node/destroy.py index a09a480..fb92036 100644 --- a/numerai/cli/node/destroy.py +++ b/numerai/cli/node/destroy.py @@ -62,7 +62,7 @@ def destroy(ctx, preserve_node_config, verbose): verbose, provider, env_vars=provider_keys, - inputs={"node_config_file": "nodes.json"}, + inputs={"node_config_file": "../nodes.json"}, ) except Exception as e: diff --git a/numerai/cli/uninstall.py b/numerai/cli/uninstall.py index 862f9f8..36b6451 100644 --- a/numerai/cli/uninstall.py +++ b/numerai/cli/uninstall.py @@ -55,7 +55,7 @@ def uninstall(): provider=provider, verbose=True, env_vars=provider_keys, - inputs={"node_config_file": "nodes.json"}, + inputs={"node_config_file": "../nodes.json"}, ) click.secho("cleaning up docker images...") diff --git a/numerai/cli/upgrade.py b/numerai/cli/upgrade.py index 9cc2759..e27cb94 100644 --- a/numerai/cli/upgrade.py +++ b/numerai/cli/upgrade.py @@ -210,7 +210,7 @@ def upgrade(verbose): verbose, provider="aws", env_vars=load_or_init_keys("aws"), - inputs={"node_config_file": "nodes.json"}, + inputs={"node_config_file": "../nodes.json"}, ) click.secho("Upgrade complete!", fg="green") diff --git a/numerai/cli/util/terraform.py b/numerai/cli/util/terraform.py index 0f23b4d..20989d5 100644 --- a/numerai/cli/util/terraform.py +++ b/numerai/cli/util/terraform.py @@ -19,7 +19,7 @@ def apply_terraform(nodes_config, affected_providers, provider, verbose): verbose, affected_provider, env_vars=load_or_init_keys(affected_provider), - inputs={"node_config_file": "nodes.json"}, + inputs={"node_config_file": "../nodes.json"}, ) else: click.secho(f"provider {affected_provider} not supported", fg="red") @@ -51,7 +51,7 @@ def create_azure_registry(provider, provider_keys, verbose): verbose, "azure", env_vars=provider_keys, - inputs={"node_config_file": "nodes.json"}, + inputs={"node_config_file": "../nodes.json"}, ) res = terraform("output -json acr_repo_details", True, provider).decode("utf-8") return json.loads(res) @@ -64,13 +64,13 @@ def create_gcp_registry(provider, verbose): 'apply -target="google_project_service.cloud_resource_manager" -auto-approve ', verbose, "gcp", - inputs={"node_config_file": "nodes.json"}, + inputs={"node_config_file": "../nodes.json"}, ) terraform( 'apply -target="google_artifact_registry_repository.registry[0]" -auto-approve ', verbose, "gcp", - inputs={"node_config_file": "nodes.json"}, + inputs={"node_config_file": "../nodes.json"}, ) res = terraform("output -json artifact_registry_details", True, provider).decode( "utf-8" diff --git a/numerai/terraform/aws/-inputs.tf b/numerai/terraform/aws/-inputs.tf index 52c4624..e6892e0 100644 --- a/numerai/terraform/aws/-inputs.tf +++ b/numerai/terraform/aws/-inputs.tf @@ -13,7 +13,7 @@ variable "az_count" { variable "node_config_file" { description = "Path to the json file used to configure nodes" type = string - default = "nodes.json" + default = "../nodes.json" } variable "node_container_port" { diff --git a/numerai/terraform/aws/aws/cluster.tf b/numerai/terraform/aws/aws/cluster.tf index 088513b..d21d0c9 100644 --- a/numerai/terraform/aws/aws/cluster.tf +++ b/numerai/terraform/aws/aws/cluster.tf @@ -110,7 +110,7 @@ resource "aws_launch_template" "node" { } resource "aws_batch_compute_environment" "node" { - compute_environment_name_prefix = "${local.node_prefix}-" + compute_environment_name = "${local.node_prefix}-compute" compute_resources { instance_role = aws_iam_instance_profile.batch_ecs_instance_role.arn diff --git a/numerai/terraform/azure/input.tf b/numerai/terraform/azure/input.tf index 0a78367..27df80d 100644 --- a/numerai/terraform/azure/input.tf +++ b/numerai/terraform/azure/input.tf @@ -9,7 +9,7 @@ variable "az_resource_group_location" { variable "node_config_file" { description = "Path to the json file used to configure nodes" type = string - default = "nodes.json" + default = "../nodes.json" } variable "node_container_port" { diff --git a/numerai/terraform/gcp/-inputs.tf b/numerai/terraform/gcp/-inputs.tf index e6eb26e..821759e 100644 --- a/numerai/terraform/gcp/-inputs.tf +++ b/numerai/terraform/gcp/-inputs.tf @@ -7,5 +7,5 @@ variable "region" { variable "node_config_file" { description = "Path to the json file used to configure nodes" type = string - default = "nodes.json" + default = "../nodes.json" }