-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Azure web app - support multicontainer #9943
Conversation
@@ -95,12 +95,20 @@ | |||
}, | |||
{ | |||
"name": "imageName", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please syncup with @azooinmyluggage or @RoopeshNair for updating the help strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@azooinmyluggage , Can you please provide help strings for this too? The help text should convey to provide the image name for single container and "replaceable images" for multi-containers.
Should we add an alias as "images" for multi-container?
"label": "Image name", | ||
"defaultValue": "", | ||
"required": true, | ||
"helpMarkDown": "A globally unique top-level domain name for your specific registry or namespace.<br/> Note: Fully qualified image name will be of the format: '<b>`<registry or namespace`></b>/`<repository`>:`<tag`>'. For example, '<b>myregistry.azurecr.io</b>/nginx:latest'." | ||
}, | ||
{ | ||
"name": "configFilePath", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confirm the name with PMs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename it to multicontainerConfigFile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multicontainerConfigFile is inline with the az cli parameter
az webapp config container set –resource-group [resource group] –name [app name] –multicontainer-config-type “compose” –multicontainer-config-file
@@ -36,6 +39,18 @@ export class TaskParametersUtility { | |||
var endpointTelemetry = '{"endpointId":"' + taskParameters.connectedServiceName + '"}'; | |||
console.log("##vso[telemetry.publish area=TaskEndpointId;feature=AzureRmWebAppDeployment]" + endpointTelemetry); | |||
|
|||
taskParameters.isMultiContainer = false; | |||
taskParameters.isMultiContainer = taskParameters.ImageName && taskParameters.ImageName.indexOf("\n") !=-1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if there is a valid file provided in config file, then also it is multicontainer app
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something we should discuss with PMs. Because then imageName input can be optional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be optional. In KubernetesManifest task as well, the containers input is optional. One needs to provide a value for this input only if they want to perform tag/sha256 substitutions for the images specified in the docker compose file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We had in mandatory in our task since for single container scenarios it is required. Making it optional will allow the user to execute the task with invalid inputs though we will catch it at run time.
Tasks/Common/AzureRmDeploy-common/operations/ContainerBasedDeploymentUtility.ts
Outdated
Show resolved
Hide resolved
return newFilePath; | ||
} | ||
|
||
private getTempDirectory(): string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this function to azure-pipelines-tasks/Tasks/Common/AzureRmDeploy-common/webdeployment-common/utility.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is done.
return tl.getVariable('agent.tempDirectory') || os.tmpdir(); | ||
} | ||
|
||
private tokenizeImages(currentString: string, imageName: string, imageNameWithNewTag: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change current string to content
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is done.
tl.debug("Updating the webapp configuration."); | ||
await this._updateConfigurationDetails(properties["ConfigurationSettings"], properties["StartupCommand"], imageName, isLinuxApp); | ||
await this._updateConfigurationDetails(properties["ConfigurationSettings"], properties["StartupCommand"], imageName, isLinuxApp, isMultiContainer, configFilePath); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should you be using updatedFilePath here? I couldnt find where you updated original file content.
It seems this will deploy provided config file content without transformation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is done.
@@ -50,6 +50,10 @@ export function mockTaskArgument(): ma.TaskLibAnswers{ | |||
}, | |||
"webAppPkg": { | |||
"isDirectory": true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have changes in this file? Does this PR contain L0s as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, it was made to fix some L0,
Existing L0 is sufficient here.
@@ -17,6 +17,8 @@ | |||
"loc.input.help.slotName": "Enter or Select an existing Slot other than the Production slot.", | |||
"loc.input.label.imageName": "Image name", | |||
"loc.input.help.imageName": "A globally unique top-level domain name for your specific registry or namespace.<br/> Note: Fully qualified image name will be of the format: '<b>`<registry or namespace`></b>/`<repository`>:`<tag`>'. For example, '<b>myregistry.azurecr.io</b>/nginx:latest'.", | |||
"loc.input.label.configFilePath": "Configuration File", | |||
"loc.input.help.configFilePath": "Path of the configuration. Should be fully qualified path or relative to the default working directory.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Path of the Docker-Compose file. Should be a fully qualified path or relative to the default working directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is done.
@@ -175,5 +177,10 @@ | |||
"loc.messages.RestartedAppService": "App Service '%s' restarted successfully.", | |||
"loc.messages.RestartedAppServiceSlot": "App Service '%s-%s' restarted successfully.", | |||
"loc.messages.FailedToRestartAppService": "Failed to restart App Service '%s'. Error: %s", | |||
"loc.messages.FailedToRestartAppServiceSlot": "Failed to restart App Service '%s-%s'. Error: %s" | |||
"loc.messages.FailedToRestartAppServiceSlot": "Failed to restart App Service '%s-%s'. Error: %s", | |||
"loc.messages.FailedToGetConfigurationFile": "Failed to get configuration file for multi containers. Please enter the valid configuration file path.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failed to locate the Docker-Compose file which is required for deploying multi-container apps. Please enter a valid Docker-Compose file path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is done.
"label": "Image name", | ||
"defaultValue": "", | ||
"required": true, | ||
"helpMarkDown": "A globally unique top-level domain name for your specific registry or namespace.<br/> Note: Fully qualified image name will be of the format: '<b>`<registry or namespace`></b>/`<repository`>:`<tag`>'. For example, '<b>myregistry.azurecr.io</b>/nginx:latest'." | ||
}, | ||
{ | ||
"name": "configFilePath", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename it to multicontainerConfigFile
"label": "Image name", | ||
"defaultValue": "", | ||
"required": true, | ||
"helpMarkDown": "A globally unique top-level domain name for your specific registry or namespace.<br/> Note: Fully qualified image name will be of the format: '<b>`<registry or namespace`></b>/`<repository`>:`<tag`>'. For example, '<b>myregistry.azurecr.io</b>/nginx:latest'." | ||
}, | ||
{ | ||
"name": "configFilePath", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
multicontainerConfigFile is inline with the az cli parameter
az webapp config container set –resource-group [resource group] –name [app name] –multicontainer-config-type “compose” –multicontainer-config-file
"label": "Configuration File", | ||
"defaultValue": "", | ||
"required": false, | ||
"helpMarkDown": "Path of the configuration. Should be fully qualified path or relative to the default working directory." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Path of the Docker-Compose file. Should be a fully qualified path or relative to the default working directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is done.
"loc.messages.FailedToRestartAppServiceSlot": "Failed to restart App Service '%s-%s'. Error: %s" | ||
"loc.messages.FailedToRestartAppServiceSlot": "Failed to restart App Service '%s-%s'. Error: %s", | ||
"loc.messages.FailedToGetConfigurationFile": "Failed to get configuration file for multi containers. Please enter the valid configuration file path.", | ||
"loc.messages.FailedToDeployToWebApp": "No deployment can happen to the webapp '%s'. For single-container, provide a valid image name and for multi-container, config file is mandatory and image names can also be provided if you want tags to be substituted.", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deployment to the webapp '%s' failed. For single-container, just specify a valid image name. For multi-container specifying a Docker-Compose file is mandatory and specifying image names is optional. Provided images names if the tags in Docker-Compose file need to be substituted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is done.
"loc.messages.FailedToRestartAppServiceSlot": "Failed to restart App Service '%s-%s'. Error: %s", | ||
"loc.messages.FailedToGetConfigurationFile": "Failed to get configuration file for multi containers. Please enter the valid configuration file path.", | ||
"loc.messages.FailedToDeployToWebApp": "No deployment can happen to the webapp '%s'. For single-container, provide a valid image name and for multi-container, config file is mandatory and image names can also be provided if you want tags to be substituted.", | ||
"loc.messages.SingleContainerDeployment": "Single Container Deployment to the webapp '%s' because only image name is given", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single-container Deployment to the webapp '%s' as only the image detail was sepcified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is done.
"loc.messages.FailedToGetConfigurationFile": "Failed to get configuration file for multi containers. Please enter the valid configuration file path.", | ||
"loc.messages.FailedToDeployToWebApp": "No deployment can happen to the webapp '%s'. For single-container, provide a valid image name and for multi-container, config file is mandatory and image names can also be provided if you want tags to be substituted.", | ||
"loc.messages.SingleContainerDeployment": "Single Container Deployment to the webapp '%s' because only image name is given", | ||
"loc.messages.MultiContainerDeploymentWithTransformation": "Multi Container Deployment to the webapp '%s' with transformation of configuration file because both image name and configuration file are given", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Multi-container deployment to the webapp '%s' with the transformation of Docker-Compose file as both image name and Docker-Compose file was specified"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is done.
"loc.messages.FailedToDeployToWebApp": "No deployment can happen to the webapp '%s'. For single-container, provide a valid image name and for multi-container, config file is mandatory and image names can also be provided if you want tags to be substituted.", | ||
"loc.messages.SingleContainerDeployment": "Single Container Deployment to the webapp '%s' because only image name is given", | ||
"loc.messages.MultiContainerDeploymentWithTransformation": "Multi Container Deployment to the webapp '%s' with transformation of configuration file because both image name and configuration file are given", | ||
"loc.messages.MultiContainerDeploymentWithoutTransformation": "Multi Container Deployment to the webapp '%s' without transformation of configuration file because only configuration file is given" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Multi-container deployment to the webapp '%s' without transformation of Docker-Compose file because only Docker-Compose file was specified."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is done.
let updatedConfigFilePath: string = configFilePath; | ||
|
||
if(imageName) { | ||
tl.debug("Deploying image " + imageName + " to the webapp " + this._appService.getName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This statment is correct for single container deployment but for multi-container mention config file name instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix one comment I recently provided before merging
No description provided.