feat: Publish Local Build Container to Azure Container Registry - [dev to main]#487
Conversation
…edge-Mining-Solution-Accelerator into psl-pk-US18489-localacr
…edge-Mining-Solution-Accelerator into psl-pk-US18489-localacr
…edge-Mining-Solution-Accelerator into psl-pk-US18489-localacr
feat: Publish Locally Built Container Image to Azure Container Registry
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for local Docker builds via a new useLocalBuild flag, centralizes ACR creation, removes unused infra resources, enhances E2E test reporting, and updates the devcontainer for Docker-in-Docker.
- Introduce
useLocalBuildparam in Bicep modules to switch ACR references and role assignments - Extract ACR resource into
deploy_container_registry.bicepand update build scripts (docker-build.sh/ps1) - Enhance pytest HTML reporting in
conftest.pyand enable Docker DIND in.devcontainer
Reviewed Changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/e2e-test/tests/conftest.py | Capture per-test logs, rename Duration column, and customize node IDs |
| tests/e2e-test/testdata/prompts.json | Added a new prompt entry |
| tests/e2e-test/sample_dotenv_file.txt | Fixed mismatched quotes |
| tests/e2e-test/requirements.txt | Added beautifulsoup4 dependency |
| tests/e2e-test/pytest.ini | Enabled short tracebacks |
| tests/e2e-test/pages/HomePage.py | Extended page object with citation link methods |
| infra/scripts/docker-build.sh/.ps1 | Added local-build toggle, ACR deploy/login, build & push logic |
| infra/*.bicep & infra/main.json | Added useLocalBuild, dynamic acrName, removed unused resources |
| infra/deploy_container_registry.bicep | New module for ACR creation |
| azure.yaml | Added preprovision hooks to run Docker build scripts |
| .devcontainer/devcontainer.json | Enabled Docker-in-Docker feature |
| @pytest.hookimpl(tryfirst=True) | ||
| def pytest_html_report_title(report): | ||
| report.title = "Automation_KM_Generic" | ||
| def pytest_runtest_setup(item): |
There was a problem hiding this comment.
[nitpick] Attaching a handler to the root logger may capture unrelated logs. Consider using a dedicated logger instance scoped to this fixture to avoid noise from other modules.
| else: | ||
| report.description = "" | ||
|
|
||
| def pytest_collection_modifyitems(items): |
There was a problem hiding this comment.
[nitpick] Modifying the private attribute item._nodeid can be brittle across Pytest versions. Consider using the public item.name or a reporting hook to adjust the display name.
| def rename_duration_column(): | ||
| report_path = os.path.abspath("report.html") # or your report filename |
There was a problem hiding this comment.
[nitpick] Hardcoding the report filename may break if the --html option changes; consider retrieving the path from Pytest config or an environment variable.
| def rename_duration_column(): | |
| report_path = os.path.abspath("report.html") # or your report filename | |
| report_filename = None # Global variable to store the report filename | |
| def pytest_configure(config): | |
| global report_filename | |
| report_filename = config.getoption("--html") # Retrieve the --html option value | |
| def rename_duration_column(): | |
| if not report_filename: | |
| print("Report filename not set, skipping column rename.") | |
| return | |
| report_path = os.path.abspath(report_filename) |
|
🎉 This PR is included in version 3.6.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Purpose
This pull request introduces several changes across multiple files to support local builds with Docker, streamline infrastructure deployment, and enhance configuration flexibility. The most significant updates include adding support for a "use local build" flag, refactoring container registry management, and removing unused resources from the infrastructure definition.
Support for Local Builds
useLocalBuildparameter to multiple Bicep files (infra/main.bicep,infra/deploy_app_service.bicep,infra/deploy_backend_docker.bicep,infra/deploy_frontend_docker.bicep) to conditionally configure deployments for local Docker builds. This includes setting up role assignments for pulling images from a local Azure Container Registry (ACR). [1] [2] [3]Container Registry Management
deploy_container_registry.bicepfile to define the ACR resource. This replaces inline definitions in other files and centralizes ACR creation logic.useLocalBuildflag. [1] [2]Removal of Unused Resources
infra/deploy_ai_foundry.bicep. This simplifies the infrastructure and eliminates unnecessary components. [1] [2] [3]Preprovision Hooks
azure.yamlto handle Docker build scripts for both Windows (docker-build.ps1) and POSIX (docker-build.sh) environments. These scripts are executed during deployment to prepare the environment.Devcontainer Updates
.devcontainer/devcontainer.jsonfile to include thedocker-in-dockerfeature, enabling Docker builds within the development container.These changes enhance the flexibility and maintainability of the deployment pipeline while improving support for local development workflows.
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify docker image pointing to your local image when use_Local_Build environment variable is set to true
