[release/9.0] Fixed AddDockerFile to work with compute customization#6446
Merged
davidfowl merged 1 commit intorelease/9.0from Oct 23, 2024
Merged
[release/9.0] Fixed AddDockerFile to work with compute customization#6446davidfowl merged 1 commit intorelease/9.0from
davidfowl merged 1 commit intorelease/9.0from
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
davidfowl
commented
Oct 23, 2024
| template: { | ||
| containers: [ | ||
| { | ||
| image: pythonapp_containerimage |
Contributor
Author
There was a problem hiding this comment.
This is the key change.
mitchdenny
approved these changes
Oct 23, 2024
eerhardt
reviewed
Oct 23, 2024
Comment on lines
+131
to
+152
| 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}" | ||
| } | ||
| } | ||
| """; |
Member
There was a problem hiding this comment.
Should we be baselining the entire resource's manifest? And not just the deployment section?
Contributor
Author
There was a problem hiding this comment.
We could but it's not really relevant for this test.
Member
There was a problem hiding this comment.
"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.
eerhardt
approved these changes
Oct 23, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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