-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.tf
160 lines (145 loc) · 3.36 KB
/
main.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# install
# kubectl, helm
# SDKs: ipfs, cod, terraform
terraform {
required_providers {
shell = {
source = "scottwinkler/shell"
version = "1.7.10"
}
kind = {
source = "tehcyx/kind"
version = "0.2.0"
}
}
}
#variable "KUBE_CONFIG_PATH" {
# type = string
#}
provider "shell" {
sensitive_environment = {
# KUBE_CONFIG_PATH = var.KUBE_CONFIG_PATH
KUBE_CONFIG_PATH = "~/.kube/config"
}
interpreter = ["/bin/sh", "-c"]
enable_parallelism = false
}
# InfraStructure cleanup
resource "shell_script" "delete_cats_k8s" {
lifecycle_commands {
create = <<-EOF
cd ~/Projects/cats-research
kind delete cluster --name cat-action-plane
EOF
delete = ""
}
}
#resource "shell_script" "setup_cod" {
# lifecycle_commands {
# create = <<-EOF
# cd ~/Projects/Research/cats-research/
# if test -f /usr/local/bin/bacalhau;
# then
# curl -sL https://get.bacalhau.org/install.sh | bash
## wget https://github.com/bacalhau-project/bacalhau/releases/download/v1.1.5/bacalhau_v1.1.5_linux_amd64.tar.gz
## tar -xvzf bacalhau_v1.1.5_linux_amd64.tar.gz
## sudo mv ./bacalhau /usr/local/bin/
# fi
# EOF
## delete = "rm bacalhau_v1.1.5_linux_amd64.tar.gz"
# delete = ""
# }
# depends_on = [
# shell_script.delete_cats_k8s
# ]
#}
provider "kind" {
# Configuration options
}
resource "kind_cluster" "default" {
name = "cat-action-plane"
node_image = "kindest/node:v1.23.0"
wait_for_ready = "true"
depends_on = [
shell_script.delete_cats_k8s,
# shell_script.setup_cod
]
}
#resource "shell_script" "setup_helm" {
# lifecycle_commands {
# create = <<-EOF
# cd ~/Projects/cats-research
# if ! command -v helm &> /dev/null;
# then
# sudo curl -sL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
# fi
# EOF
# delete = ""
# }
# depends_on = [
# kind_cluster.default,
# shell_script.delete_cats_k8s
# ]
#}
provider "helm" {
kubernetes {
config_context_cluster = "kind-cat-action-plane"
config_path = "~/.kube/config"
}
}
resource "helm_release" "kuberay-operator" {
name = "kuberay-operator"
repository = "https://ray-project.github.io/kuberay-helm/"
chart = "kuberay-operator"
version = "1.0.0"
wait_for_jobs = "true"
depends_on = [
kind_cluster.default
]
}
resource "helm_release" "ray-cluster" {
name = "raycluster"
repository = "https://ray-project.github.io/kuberay-helm/"
chart = "ray-cluster"
version = "0.6.0"
wait_for_jobs = "true"
# set {
# name = "image.tag"
# value = "nightly-aarch64"
# type = "string"
# }
depends_on = [
kind_cluster.default,
helm_release.kuberay-operator
]
}
#resource "helm_release" "hdfs" {
# name = "hdfs"
# repository = "https://gradiant.github.io/charts"
# chart = "gradiant"
# version = "0.1.10"
# depends_on = [
# kind_cluster.default
# ]
#}
#resource "helm_release" "hdfs" {
# name = "hdfs"
# repository = "https://gchq.github.io/gaffer-docker"
# chart = "hdfs"
# version = "2.0.0"
# set {
# name = "hdfs.namenode.tag"
# value = "3.3.3"
# }
# set {
# name = "hdfs.datanode.tag"
# value = "3.3.3"
# }
# set {
# name = "hdfs.shell.tag"
# value = "3.3.3"
# }
# depends_on = [
# kind_cluster.default
# ]
#}