-
Notifications
You must be signed in to change notification settings - Fork 701
[release/9.0] Fixed AddDockerFile to work with compute customization #6446
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
Conversation
- We were not detecting containers with the build annotation and reading the image name from a parameter. Instead, it was using the runtime image name which is incorrect. - Expose DockerfileBuildAnnotation to make this possible. - Added test and updated the playground with a docker file sample
template: { | ||
containers: [ | ||
{ | ||
image: pythonapp_containerimage |
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 the key change.
var resource = target?.DeploymentTarget as AzureProvisioningResource; | ||
|
||
Assert.NotNull(resource); | ||
|
||
var (manifest, bicep) = await ManifestUtils.GetManifestWithBicep(resource); | ||
|
||
var m = manifest.ToString(); | ||
|
||
var expectedManifest = | ||
""" | ||
{ | ||
"type": "azure.bicep.v0", | ||
"path": "api.module.bicep", | ||
"params": { | ||
"outputs_azure_container_registry_managed_identity_id": "{.outputs.AZURE_CONTAINER_REGISTRY_MANAGED_IDENTITY_ID}", | ||
"outputs_managed_identity_client_id": "{.outputs.MANAGED_IDENTITY_CLIENT_ID}", | ||
"outputs_azure_container_apps_environment_id": "{.outputs.AZURE_CONTAINER_APPS_ENVIRONMENT_ID}", | ||
"outputs_azure_container_registry_endpoint": "{.outputs.AZURE_CONTAINER_REGISTRY_ENDPOINT}", | ||
"api_containerimage": "{api.containerImage}" | ||
} | ||
} | ||
"""; |
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 we be baselining the entire resource's manifest? And not just the deployment
section?
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 could but it's not really relevant for this test.
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.
"pythonapp": {
"type": "container.v1",
"build": {
"context": "AppWithDocker",
"dockerfile": "AppWithDocker/Dockerfile"
},
I don't understand how that part isn't relevant. Seems pretty important for the scenario to work.
Backport of #6442 to release/9.0
Customer Impact
Using docker files with container app customization does not work currently.
Testing
Unit tests, and manual testing with azd.
Risk
Low.
Regression?
No
Microsoft Reviewers: Open in CodeFlow