From 7138be5b61c07fa2db6ae4cc0a334cf398e3c7bb Mon Sep 17 00:00:00 2001 From: Gordon Byers Date: Mon, 6 Feb 2023 16:50:56 +0000 Subject: [PATCH 1/2] ace version bump --- .github/workflows/ByoVnetCI.yml | 7 +++---- .github/workflows/ByoVnetPrivateCI.yml | 4 +--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ByoVnetCI.yml b/.github/workflows/ByoVnetCI.yml index bd9baa351..07e1cbc3f 100644 --- a/.github/workflows/ByoVnetCI.yml +++ b/.github/workflows/ByoVnetCI.yml @@ -22,7 +22,7 @@ on: - reopened - synchronize - ready_for_review - + #Running on a schedule helps trap issues like Kubernetes versions not being available in the region, or Well Architected recommendations changing schedule: # At 11:00pm, every Wednesday week @@ -117,8 +117,7 @@ jobs: CostEstimate: needs: [ReusableWF, Validation] if: github.event_name != 'pull_request' || contains( github.event.pull_request.labels.*.name, 'test-deploy-byoconfig') - uses: TheCloudTheory/arm-estimator/.github/workflows/estimateFromUrl.yml@main - #uses: Gordonby/arm-estimator/.github/workflows/estimateFromUrl.yml@gb-workflowpolish + uses: TheCloudTheory/arm-estimator/.github/workflows/estimateFromUrl.yml@1.1 with: rg: ${{ needs.ReusableWF.outputs.RG }} environment: ${{needs.ReusableWF.outputs.Environment}} @@ -155,7 +154,7 @@ jobs: echo "EventTrigger name is ${{github.event_name}}" echo "PR contains bug : ${{contains(github.event.pull_request.labels.*.name, 'bug')}}" echo "PR labels : ${{github.event.pull_request.labels.*.name}}" - echo "PR draft : ${{github.event.pull_request.draft}}" + echo "PR draft : ${{github.event.pull_request.draft}}" echo "AZCLIVERSION is ${{ env.AZCLIVERSION }}" echo "doDebugSteps is ${{ github.event.inputs.doDebugSteps }}" echo "doVerifySteps is ${{ github.event.inputs.doVerifySteps }}" diff --git a/.github/workflows/ByoVnetPrivateCI.yml b/.github/workflows/ByoVnetPrivateCI.yml index 1c57253b5..06a0ad5b7 100644 --- a/.github/workflows/ByoVnetPrivateCI.yml +++ b/.github/workflows/ByoVnetPrivateCI.yml @@ -127,14 +127,12 @@ jobs: CostEstimate: needs: [ReusableWF] if: github.event_name != 'pull_request' || contains( github.event.pull_request.labels.*.name, 'test-deploy-privateconfig') - uses: TheCloudTheory/arm-estimator/.github/workflows/estimateFromUrl.yml@main - #uses: Gordonby/arm-estimator/.github/workflows/estimateFromUrl.yml@gb-workflowpolish + uses: TheCloudTheory/arm-estimator/.github/workflows/estimateFromUrl.yml@1.1 with: rg: ${{ needs.ReusableWF.outputs.RG }} #Automation-Actions-AksDeployCI #'${{ env.RG }}' There seems to be an issue passing Env variables in reusable workflows environment: ${{needs.ReusableWF.outputs.Environment}} aceVersion: 1.1-beta2 templateFileURL: https://github.com/Azure/AKS-Construction/releases/download/${{ needs.ReusableWF.outputs.LatestAkscVersionTag }}/main.json - #templateParamFileURL: ${{ needs.ReusableWF.outputs.ParamFilePath }} templateParamFileURL: https://raw.githubusercontent.com/Azure/AKS-Construction/${{ github.event_name == 'pull_request' && github.head_ref || github.ref_name }}/${{ needs.ReusableWF.outputs.ParamFilePath }} secrets: From 2b233f2b6de95cbf68c3929c4dd2f68bcdbbaf8c Mon Sep 17 00:00:00 2001 From: Gordon Byers Date: Mon, 6 Feb 2023 16:51:04 +0000 Subject: [PATCH 2/2] workflow docs --- samples/workflows/README.md | 30 +++++++++++++++++++++++++ samples/workflows/azureCostEstimator.md | 12 ++++++++++ 2 files changed, 42 insertions(+) create mode 100644 samples/workflows/README.md create mode 100644 samples/workflows/azureCostEstimator.md diff --git a/samples/workflows/README.md b/samples/workflows/README.md new file mode 100644 index 000000000..4391f8066 --- /dev/null +++ b/samples/workflows/README.md @@ -0,0 +1,30 @@ +# Workflow docs + +The AKS Construction repository uses GitHub action workflows extensively, in particular we use reusable workflows to expose common reusable workflows that can be leveraged from your own workflows. + +In this section of the samples, various features and workflow jobs will be explained. + +## Infrastructure Workflows + +### InfraCI - Starter cluster + +This workflow is one of the simplest for showing the fundamental steps of a IaC workflow. + +1. Validation +1. Infra Deployment +1. App Deployment (smoke test) +1. Infra Cleanup/Destruction + +## Reusable Workflows + +Workflow | Purpose | Sample +-------- | ------- | ------ +Deploy | Deploys AKSC infrastructure with minimal inputs | +Troubleshooting | | +CleanUp | Iterates over a resource group and removes all resources + +## Job Showcase + +Job | Purpose | Sample +--- | ------- | ------ +Azure Cost Estimate | Estimates the monthly cost of an Azure Deployment | [sample](azureCostEstimator.md) diff --git a/samples/workflows/azureCostEstimator.md b/samples/workflows/azureCostEstimator.md new file mode 100644 index 000000000..c40bcb5fc --- /dev/null +++ b/samples/workflows/azureCostEstimator.md @@ -0,0 +1,12 @@ +# ACE (Azure Cost Estimator) + +[ACE](https://github.com/TheCloudTheory/arm-estimator) is a project created by Microsoft MVP [Kamil Mrzygłód](https://github.com/kamil-mrzyglod). It provides a mechanism to take a bicep/arm file with parameters and provide an estimated monthly cost of the deployment. + +AKS Construction leverages ACE in two of the deployment workflows to showcase more advanced Infrastructure as Code practices that can be incorporated into workflows. + +## The output + +In addition to the job output, we persist a json file as an artifact. We could choose to query the costs and fail the workflow if the cost was too high. + +## Adding the workflow +