Ops
Search…
Azure
OPS can run on Microsoft Azure assuming your environment is setup.

Pre-requisites

    1.
    Create a new resource group.
    2.
    Create a storage account - that is your bucket.
    3.
    Create a quickstart auth:
    1
    az ad sp create-for-rbac --sdk-auth > quickstart.auth
    Copied!
    Most of the environment variables you need will be found in this json file.

Image Operations

Create Image

If you have already created an Ops project, you can update your existing config.json. You need to add CloudConfig which mentions specific details like ProjectID, BucketName.
1
{
2
"CloudConfig" :{
3
"Zone": "us-west2-a",
4
"BucketName":"nanostest"
5
}
6
}
Copied!
Once, you have updated config.json you can create an image in Azure with the following command.
1
#!/bin/sh
2
3
# used for uploading blob
4
export AZURE_STORAGE_ACCOUNT="nanostest"
5
export AZURE_STORAGE_ACCESS_KEY=""
6
7
# used for create
8
export AZURE_SUBSCRIPTION_ID=""
9
export AZURE_LOCATION_DEFAULT=""
10
export AZURE_TENANT_ID=""
11
export AZURE_CLIENT_ID=""
12
export AZURE_CLIENT_SECRET=""
13
14
# used for everything?
15
export AZURE_BASE_GROUP_NAME="bob"
16
17
GOOS=linux go build -o gtest2
18
19
ops image create <elf_file|program> -c config.json -t azure -a gtest2
Copied!

List Images

You can list existing images on Azure with ops image list.
1
export AZURE_SUBSCRIPTION_ID=""
2
export AZURE_LOCATION_DEFAULT=""
3
export AZURE_TENANT_ID=""
4
export AZURE_CLIENT_ID=""
5
export AZURE_CLIENT_SECRET=""
6
ops image list -t azure
Copied!

Delete Image

1
export AZURE_SUBSCRIPTION_ID=""
2
export AZURE_LOCATION_DEFAULT=""
3
export AZURE_TENANT_ID=""
4
export AZURE_CLIENT_ID=""
5
export AZURE_CLIENT_SECRET=""
6
7
ops image delete -t azure bob2
Copied!

Instance Operations

Create Instance

1
export AZURE_STORAGE_ACCOUNT=""
2
3
export AZURE_SUBSCRIPTION_ID=""
4
export AZURE_LOCATION_DEFAULT=""
5
export AZURE_TENANT_ID=""
6
export AZURE_CLIENT_ID=""
7
export AZURE_CLIENT_SECRET=""
8
9
export AZURE_BASE_GROUP_NAME=""
10
11
ops instance create bob -z westus2 -t azure
Copied!

VPC, Subnet and Security Group

By default, ops creates a VPC, a subnet and a security group per instance.
You can select a different VPC, subnet or security group using the configuration file. The keys to set are RunConfig.VPC, RunConfig.Subnet and RunConfig.SecurityGroup.
1
{
2
"RunConfig":{
3
"VPC": "vpc-name",
4
"Subnet": "subnet-name",
5
"SecurityGroup": "sg-name"
6
}
7
}
Copied!

List Instances

1
export AZURE_SUBSCRIPTION_ID=""
2
export AZURE_LOCATION_DEFAULT=""
3
export AZURE_TENANT_ID=""
4
export AZURE_CLIENT_ID=""
5
export AZURE_CLIENT_SECRET=""
6
7
export AZURE_BASE_GROUP_NAME=""
8
9
ops instance list -t azure -z us-west-2
Copied!

Get Logs for Instance

You can get logs from serial console of a particular instance using ops instance logs command. The logs are stored in your cloud storage bucket.
1
export AZURE_STORAGE_ACCOUNT=""
2
export AZURE_STORAGE_ACCESS_KEY=""
3
4
export AZURE_SUBSCRIPTION_ID=""
5
export AZURE_LOCATION_DEFAULT=""
6
export AZURE_TENANT_ID=""
7
export AZURE_CLIENT_ID=""
8
export AZURE_CLIENT_SECRET=""
9
10
export AZURE_BASE_GROUP_NAME=""
11
12
ops instance logs -t azure gtest2-image -z us-west-2
Copied!

Delete Instance

Last modified 6mo ago