Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
cmd/kola: add Azure
Browse files Browse the repository at this point in the history
Adds support for the Azure platform to kola. The following parameters
are supported: azure-disk-uri, azure-location, azure-size.
  • Loading branch information
arithx committed Nov 29, 2017
1 parent 5ba0c74 commit 4ce382b
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
11 changes: 11 additions & 0 deletions cmd/kola/kola.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,11 @@ func writeProps() error {
AMI string `json:"ami"`
InstanceType string `json:"type"`
}
type Azure struct {
DiskURI string `json:"diskUri"`
Location string `json:"location"`
Size string `json:"size"`
}
type DO struct {
Region string `json:"region"`
Size string `json:"size"`
Expand Down Expand Up @@ -167,6 +172,7 @@ func writeProps() error {
Platform string `json:"platform"`
Board string `json:"board"`
AWS AWS `json:"aws"`
Azure Azure `json:"azure"`
DO DO `json:"do"`
ESX ESX `json:"esx"`
GCE GCE `json:"gce"`
Expand All @@ -182,6 +188,11 @@ func writeProps() error {
AMI: kola.AWSOptions.AMI,
InstanceType: kola.AWSOptions.InstanceType,
},
Azure: Azure{
DiskURI: kola.AzureOptions.DiskURI,
Location: kola.AzureOptions.Location,
Size: kola.AzureOptions.Size,
},
DO: DO{
Region: kola.DOOptions.Region,
Size: kola.DOOptions.Size,
Expand Down
7 changes: 6 additions & 1 deletion cmd/kola/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var (
outputDir string
kolaPlatform string
defaultTargetBoard = sdk.DefaultBoard()
kolaPlatforms = []string{"aws", "do", "esx", "gce", "oci", "packet", "qemu"}
kolaPlatforms = []string{"aws", "azure", "do", "esx", "gce", "oci", "packet", "qemu"}
kolaDefaultImages = map[string]string{
"amd64-usr": sdk.BuildRoot() + "/images/amd64-usr/latest/coreos_production_image.bin",
"arm64-usr": sdk.BuildRoot() + "/images/arm64-usr/latest/coreos_production_image.bin",
Expand Down Expand Up @@ -65,6 +65,11 @@ func init() {
sv(&kola.AWSOptions.SecurityGroup, "aws-sg", "kola", "AWS security group name")
sv(&kola.AWSOptions.IAMInstanceProfile, "aws-iam-profile", "kola", "AWS IAM instance profile name")

// azure-specific options
sv(&kola.AzureOptions.DiskURI, "azure-disk-uri", "", "Azure disk uri")
sv(&kola.AzureOptions.Location, "azure-location", "westus", "Azure location (default \"westus\"")
sv(&kola.AzureOptions.Size, "azure-size", "Standard_A1", "Azure machine size (default \"Standard_A1\")")

// do-specific options
sv(&kola.DOOptions.ConfigPath, "do-config-file", "", "DigitalOcean config file (default \"~/"+auth.DOConfigPath+"\")")
sv(&kola.DOOptions.Profile, "do-profile", "", "DigitalOcean profile (default \"default\")")
Expand Down
5 changes: 5 additions & 0 deletions kola/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ import (
"github.com/coreos/mantle/kola/torcx"
"github.com/coreos/mantle/platform"
awsapi "github.com/coreos/mantle/platform/api/aws"
azureapi "github.com/coreos/mantle/platform/api/azure"
doapi "github.com/coreos/mantle/platform/api/do"
esxapi "github.com/coreos/mantle/platform/api/esx"
gcloudapi "github.com/coreos/mantle/platform/api/gcloud"
ociapi "github.com/coreos/mantle/platform/api/oci"
packetapi "github.com/coreos/mantle/platform/api/packet"
"github.com/coreos/mantle/platform/machine/aws"
"github.com/coreos/mantle/platform/machine/azure"
"github.com/coreos/mantle/platform/machine/do"
"github.com/coreos/mantle/platform/machine/esx"
"github.com/coreos/mantle/platform/machine/gcloud"
Expand All @@ -55,6 +57,7 @@ var (

Options = platform.Options{}
AWSOptions = awsapi.Options{Options: &Options} // glue to set platform options from main
AzureOptions = azureapi.Options{Options: &Options} // glue to set platform options from main
DOOptions = doapi.Options{Options: &Options} // glue to set platform options from main
ESXOptions = esxapi.Options{Options: &Options} // glue to set platform options from main
GCEOptions = gcloudapi.Options{Options: &Options} // glue to set platform options from main
Expand Down Expand Up @@ -126,6 +129,8 @@ func NewCluster(pltfrm string, rconf *platform.RuntimeConfig) (cluster platform.
switch pltfrm {
case "aws":
cluster, err = aws.NewCluster(&AWSOptions, rconf)
case "azure":
cluster, err = azure.NewCluster(&AzureOptions, rconf)
case "do":
cluster, err = do.NewCluster(&DOOptions, rconf)
case "esx":
Expand Down

0 comments on commit 4ce382b

Please sign in to comment.