Create a provider to use Azure Batch (#133)
* Started work on provider * WIP Adding batch provider * Working basic call into pool client. Need to parameterize the baseurl * Fixed job creation by manipulating the content-type * WIP Kicking off containers. Dirty * [wip] More meat around scheduling simple containers. * Working on basic task wrapper to co-schedule pods * WIP on task wrapper * WIP * Working pod minimal wrapper for batch * Integrate pod template code into provider * Cleaning up * Move to docker without gpu * WIP batch integration * partially working * Working logs * Tidy code * WIP: Testing and readme * Added readme and terraform deployment for GPU Azure Batch pool. * Update to enable low priority nodes for gpu * Fix log formatting bug. Return node logs when container not yet started * Moved to golang v1.10 * Fix cri test * Fix up minor docs Issue. Add provider to readme. Add var for vk image.
This commit is contained in:
committed by
Robbie Zhang
parent
1ad6fb434e
commit
d6e8b3daf7
59
providers/azurebatch/deployment/aks/main.tf
Normal file
59
providers/azurebatch/deployment/aks/main.tf
Normal file
@@ -0,0 +1,59 @@
|
||||
resource "random_id" "workspace" {
|
||||
keepers = {
|
||||
# Generate a new id each time we switch to a new resource group
|
||||
group_name = "${var.resource_group_name}"
|
||||
}
|
||||
|
||||
byte_length = 8
|
||||
}
|
||||
|
||||
#an attempt to keep the AKS name (and dns label) somewhat unique
|
||||
resource "random_integer" "random_int" {
|
||||
min = 100
|
||||
max = 999
|
||||
}
|
||||
|
||||
resource "azurerm_kubernetes_cluster" "aks" {
|
||||
name = "aks-${random_integer.random_int.result}"
|
||||
location = "${var.resource_group_location}"
|
||||
dns_prefix = "aks-${random_integer.random_int.result}"
|
||||
|
||||
resource_group_name = "${var.resource_group_name}"
|
||||
kubernetes_version = "1.9.2"
|
||||
|
||||
linux_profile {
|
||||
admin_username = "${var.linux_admin_username}"
|
||||
|
||||
ssh_key {
|
||||
key_data = "${var.linux_admin_ssh_publickey}"
|
||||
}
|
||||
}
|
||||
|
||||
agent_pool_profile {
|
||||
name = "agentpool"
|
||||
count = "2"
|
||||
vm_size = "Standard_DS2_v2"
|
||||
os_type = "Linux"
|
||||
}
|
||||
|
||||
service_principal {
|
||||
client_id = "${var.client_id}"
|
||||
client_secret = "${var.client_secret}"
|
||||
}
|
||||
}
|
||||
|
||||
output "cluster_client_certificate" {
|
||||
value = "${base64decode(azurerm_kubernetes_cluster.aks.kube_config.0.client_certificate)}"
|
||||
}
|
||||
|
||||
output "cluster_client_key" {
|
||||
value = "${base64decode(azurerm_kubernetes_cluster.aks.kube_config.0.client_key)}"
|
||||
}
|
||||
|
||||
output "cluster_ca" {
|
||||
value = "${base64decode(azurerm_kubernetes_cluster.aks.kube_config.0.cluster_ca_certificate)}"
|
||||
}
|
||||
|
||||
output "host" {
|
||||
value = "${azurerm_kubernetes_cluster.aks.kube_config.0.host}"
|
||||
}
|
||||
Reference in New Issue
Block a user