iterative / terraform-provider-iterative

☁️ Terraform plugin for machine learning workloads: spot instance recovery & auto-termination | AWS, GCP, Azure, Kubernetes
https://registry.terraform.io/providers/iterative/iterative/latest/docs
Apache License 2.0
290 stars 27 forks source link

`task` machine relationship #354

Open dacbd opened 2 years ago

dacbd commented 2 years ago

I was snooping at: https://github.com/iterative/terraform-provider-iterative/pull/340

and I wonder if there are any plans to have the task's "machine" definition accept an iterative_machine definition/resource?

DavidGOrtega commented 2 years ago

@dacbd I would like to have built it on top but they are based on different concepts... in any case task like runner has its own hardware definition

dacbd commented 2 years ago

I might be wrong but looks like right now the only "hardware" definition consists of the instance type, disk, and base image.

I foresee something like this as a future possibility:


terraform {
    required_providers {
        iterative = {
            source = "iterative/iterative"
        }
    }
}

provider "iterative" {}

resource "iterative_machine" "instance_test" {
    cloud = "aws"
    region = "us-west-2"
    aws_subnet_id = "subnet-qwert2345"
    aws_security_group = "test"
    instance_type = "t1.micro"
    instance_permission_set = "some_S3_role"
    ssh_private = ***
}

resource "iterative_task" "task" {
    name = "test"
    machine = iterative_machine.instance_test.id
    script = file("script.sh")
    workdir {
        input = "."
        output = "./output"
        object_storage = "arn:::mys3/bucket"
    }
}
DavidGOrtega commented 2 years ago

Oh yeah! we have already discussed that. Indeed the idea was to be able to use resources within resources. I pretended that also with network and storage resources

https://github.com/iterative/terraform-provider-iterative/issues/89

casperdcl commented 2 years ago

related: #461