Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the caps are all wrong and hostIp being null has very specific meaning compared to not being present and you probably don't mean that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

share a good example file.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,40 @@
"id": "test-subnet-resource-id"
},
"applicationSharingPolicy": "Personal",
"customServices": [
{
"docker": {
"privileged": true
},
"environmentVariables": {
"test_variable": {
"type": "local",
"value": "test_value"
}
},
"volumes": [
{
"type": "bind",
"read_only": false,
"source": "/home/azureuser/cloudfiles",
"target": "/home/azureuser/cloudfiles"
}
],
"endpoints": [
{
"name": "connect",
"target": 8787,
"published": 8787,
"protocol": "http"
}
],
"image": {
"type": "docker",
"reference": "ghcr.io/azure/rocker-rstudio-ml-verse:latest"
},
"name": "rstudio"
}
],
"sshSettings": {
"sshPublicAccess": "Disabled"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,45 @@
"adminUserName": "azureuser",
"sshPort": 22
},
"osImageMetadata": {
"currentImageVersion": "22.06.14",
"latestImageVersion": "22.07.22",
"isLatestOsImageVersion": false
},
"customServices": [
{
"docker": {
"privileged": true
},
"environmentVariables": {
"test_var": {
"type": "local",
"value": "test_val"
}
},
"volumes": [
{
"type": "bind",
"read_only": false,
"source": "/home/azureuser/cloudfiles",
"target": "/home/azureuser/cloudfiles"
}
],
"endpoints": [
{
"name": "connect",
"target": 8787,
"published": 8787,
"protocol": "http"
}
],
"image": {
"type": "docker",
"reference": "ghcr.io/azure/rocker-rstudio-ml-verse:latest"
},
"name": "rstudio"
}
],
"computeInstanceAuthorizationType": "personal",
"personalComputeInstanceSettings": {
"assignedUser": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3597,6 +3597,22 @@
"$ref": "#/definitions/ComputeInstanceSshSettings",
"x-nullable": true
},
"customServices": {
"type": "array",
"description": "List of Custom Services added to the compute.",
"x-nullable": true,
"items": {
"$ref": "#/definitions/CustomService"
},
"x-ms-identifiers": [
"name"
]
},
"osImageMetadata": {
"readOnly": true,
"description": "Returns metadata about the operating system image for this compute instance.",
"$ref": "#/definitions/ImageMetadata"
},
"connectivityEndpoints": {
"readOnly": true,
"description": "Describes all connectivity endpoints available for this ComputeInstance.",
Expand Down Expand Up @@ -4701,6 +4717,268 @@
}
}
},
"ImageMetadata": {
"type": "object",
"description": "Returns metadata about the operating system image for this compute instance.",
"properties": {
"currentImageVersion": {
"type": "string",
"description": "Specifies the current operating system image version this compute instance is running on."
},
"latestImageVersion": {
"type": "string",
"description": "Specifies the latest available operating system image version."
},
"isLatestOsImageVersion": {
"type": "boolean",
"description": "Specifies whether this compute instance is running on the latest operating system image."
}
}
},
"CustomService": {
"type": "object",
"description": "Specifies the custom service configuration",
"properties": {
"name": {
"type": "string",
"description": "Name of the Custom Service"
},
"image": {
"$ref": "#/definitions/Image",
"description": "Describes the Image Specifications"
},
"environmentVariables": {
"type": "object",
"description": "Environment Variable for the container",
"additionalProperties": {
"$ref": "#/definitions/EnvironmentVariable"
}
},
"docker": {
"description": "Describes the docker settings for the image",
"$ref": "#/definitions/Docker",
"x-nullable": true
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these 3 properties being used and how?

environmentVariables
docker
volumes

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

those are docker specific values. docker gets merged into docker config. advanced stuff for advanced users.

valumes is how you mount volumes (a docker thing)

environmentVariables set environment variables

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a valid example to explain these.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

"endpoints": {
"type": "array",
"description": "Configuring the endpoints for the container",
"items": {
"$ref": "#/definitions/Endpoint"
},
"x-ms-identifiers": [
"name"
]
},
"volumes": {
"type": "array",
"description": "Configuring the volumes for the container",
"items": {
"$ref": "#/definitions/VolumeDefinition"
},
"x-ms-identifiers": [
"source",
"target"
]
}
},
"additionalProperties": true
},
"Image": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Image": {

Please add Title or Description to this definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added, Thanks for bringing it up.

"type": "object",
"description": "Describes the Image Specifications",
"properties": {
"type": {
"default": "docker",
"enum": [
"docker",
"azureml"
],
"type": "string",
"title": "Type of the image",
"description": "Type of the image. Possible values are: docker - For docker images. azureml - For AzureML images",
"x-ms-enum": {
"name": "ImageType",
"modelAsString": true
}
},
"reference": {
"type": "string",
"description": "Image reference"
}
},
"additionalProperties": true
},
"EnvironmentVariable": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"EnvironmentVariable": {

Please add Title or Description to this definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added, Thanks for bringing it up.

"type": "object",
"description": "Environment Variables for the container",
"properties": {
"type": {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is actually a and opaq object with string

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't get you

"enum": [
"local"
],
"default": "local",
"title": "Type of Environment Variable",
"description": "Type of the Environment Variable. Possible values are: local - For local variable",
"type": "string",
"x-ms-enum": {
"name": "EnvironmentVariableType",
"modelAsString": true
}
},
"value": {
"type": "string",
"description": "Value of the Environment variable"
}
},
"additionalProperties": true
},
"Docker": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Docker": {

Please add Title or Description to this definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added, Thanks for bringing it up.

"type": "object",
"description": "Docker container configuration",
"properties": {
"privileged": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

privileged

It is always recommended to use enum instead of boolean, like here:

"mode" as enum with values: "privileged", "unprivileged".

That makes it extensible in future without causing ay breaking changes. Unless you are absolutely sure, it will always be just these values, needing it as boolean.

"type": "boolean",
"description": "Indicate whether container shall run in privileged or non-privileged mode.",
"x-nullable": true
}
},
"additionalProperties": true
},
"Endpoint": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Endpoint": {

Please add Title or Description to this definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added, Thanks for bringing it up.

"type": "object",
"description": "Describes the endpoint configuration for the container",
"properties": {
"protocol": {
"enum": [
"tcp",
"udp",
"http"
],
"default": "tcp",
"title": "Endpoint Communication Protocol",
"description": "Protocol over which communication will happen over this endpoint",
"x-ms-enum": {
"name": "protocol",
"modelAsString": true
},
"type": "string"
},
"name": {
"type": "string",
"description": "Name of the Endpoint"
},
"target": {
"format": "int32",
"type": "integer",
"description": "Application port inside the container."
},
"published": {
"format": "int32",
"type": "integer",
"description": "Port over which the application is exposed from container.",
"x-nullable": true
},
"hostIp": {
"description": "Host IP over which the application is exposed from the container",
"type": "string",
"x-nullable": true
}
}
},
"VolumeDefinition": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"VolumeDefinition": {

Please add Title or Description to this definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added, Thanks for bringing it up.

"type": "object",
"description": "Describes the volume configuration for the container",
"properties": {
"type": {
"enum": [
"bind",
"volume",
"tmpfs",
"npipe"
],
"default": "bind",
"title": "Type of Volume Definition",
"description": "Type of Volume Definition. Possible Values: bind,volume,tmpfs,npipe",
"x-ms-enum": {
"name": "VolumeDefinitionType",
"modelAsString": true
},
"type": "string"
},
"readOnly": {
"type": "boolean",
"description": "Indicate whether to mount volume as readOnly. Default value for this is false.",
"x-nullable": true
},
"source": {
"type": "string",
"description": "Source of the mount. For bind mounts this is the host path."
},
"target": {
"type": "string",
"description": "Target of the mount. For bind mounts this is the path in the container."
},
"consistency": {
"type": "string",
"description": "Consistency of the volume"
},
"bind": {
"$ref": "#/definitions/BindOptions",
"description": "Bind Options of the mount"
},
"volume": {
"$ref": "#/definitions/VolumeOptions",
"description": "Volume Options of the mount"
},
"tmpfs": {
"$ref": "#/definitions/TmpfsOptions",
"description": "tmpfs option of the mount"
}
}
},
"VolumeOptions": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"VolumeOptions": {

Please add Title or Description to this definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added, Thanks for bringing it up.

"type": "object",
"description": "Describes the volume options for the container",
"properties": {
"nocopy": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nocopy

It is always recommended to use enum instead of boolean, like here:

"mode" as enum with values: "nocopy", "normal" etc.

That makes it extensible in future without causing ay breaking changes. Unless you are absolutely sure, it will always be just these values, needing it as boolean.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entire configuration is a docker compose spec that we have ported and extended to our usecase. Most of these properties are standard docker configuration and sticking by the data type they define, they are supposed to be "boolean". We don't intent to diverge from this in future, hence we are fine keeping it as it is.

"type": "boolean",
"description": "Indicate whether volume is nocopy",
"x-nullable": true
}
}
},
"BindOptions": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"BindOptions": {

Please add Title or Description to this definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added, Thanks for bringing it up.

"type": "object",
"description": "Describes the bind options for the container",
"properties": {
"propagation": {
"type": "string",
"description": "Type of Bind Option",
"x-nullable": true
},
"createHostPath": {
"type": "boolean",
"description": "Indicate whether to create host path.",
"x-nullable": true
},
"selinux": {
"type": "string",
"description": "Mention the selinux options.",
"x-nullable": true
}
}
},
"TmpfsOptions": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"TmpfsOptions": {

Please add Title or Description to this definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added, Thanks for bringing it up.

"description": "Describes the tmpfs options for the container",
"type": "object",
"properties": {
"size": {
"format": "int32",
"type": "integer",
"description": "Mention the Tmpfs size"
}
}
},
"ComputeInstanceSshSettings": {
"type": "object",
"description": "Specifies policy and settings for SSH access.",
Expand Down