Skip to content

Commit

Permalink
merge with dev
Browse files Browse the repository at this point in the history
  • Loading branch information
r2k1 committed Nov 19, 2024
2 parents a96414f + 84ff546 commit 9b08ee6
Show file tree
Hide file tree
Showing 104 changed files with 4,883 additions and 5,230 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Buf CI
on:
push:
pull_request:
permissions:
contents: read
pull-requests: write
jobs:
buf:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: bufbuild/buf-action@v1
with:
input: aks-node-controller
4 changes: 2 additions & 2 deletions .pipelines/.vsts-vhd-automation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ stages:
echo "PR for Image Bumping, Official Branch Cutting"
/bin/bash vhdbuilder/scripts/automate_version_bump.sh
env:
GITHUB_PAT: $(GITHUB_PAT)
GITHUB_PAT: $(PAT-aks-node-assistant)
IMAGE_VERSION: $(IMAGE_VERSION)
VHD_BUILD_ID: ${{ parameters.VHD_BUILD_ID }}
PR_TARGET_BRANCH: ${{ parameters.PRTargetBranch }}
Expand All @@ -67,7 +67,7 @@ stages:
echo "PR for Release Notes"
/bin/bash vhdbuilder/scripts/automate_release_notes.sh
env:
GITHUB_PAT: $(GITHUB_PAT)
GITHUB_PAT: $(PAT-aks-node-assistant)
IMAGE_VERSION: $(IMAGE_VERSION)
VHD_BUILD_ID: ${{ parameters.VHD_BUILD_ID }}
SKIP_LATEST: $(SKIP_LATEST_RELEASE_NOTES_UPDATE)
Expand Down
53 changes: 4 additions & 49 deletions .pipelines/.vsts-vhd-builder-release.yaml

Large diffs are not rendered by default.

5 changes: 1 addition & 4 deletions .pipelines/.vsts-vhd-builder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pool:
name: $(POOL_NAME)

variables:
- group: aks-vuln-to-kusto
- group: aks-vuln-to-kusto

stages:
- stage: build
Expand All @@ -33,7 +33,6 @@ stages:
timeoutInMinutes: 180
steps:
- bash: |
echo '##vso[task.setvariable variable=DRY_RUN]False'
echo '##vso[task.setvariable variable=OS_SKU]Ubuntu'
echo '##vso[task.setvariable variable=OS_VERSION]22.04'
echo '##vso[task.setvariable variable=IMG_PUBLISHER]Canonical'
Expand All @@ -56,7 +55,6 @@ stages:
timeoutInMinutes: 180
steps:
- bash: |
echo '##vso[task.setvariable variable=DRY_RUN]False'
echo '##vso[task.setvariable variable=OS_SKU]Ubuntu'
echo '##vso[task.setvariable variable=OS_VERSION]18.04'
echo '##vso[task.setvariable variable=IMG_PUBLISHER]Canonical'
Expand All @@ -79,7 +77,6 @@ stages:
timeoutInMinutes: 180
steps:
- bash: |
echo '##vso[task.setvariable variable=DRY_RUN]False'
echo '##vso[task.setvariable variable=OS_SKU]CBLMariner'
echo '##vso[task.setvariable variable=OS_VERSION]V2'
echo '##vso[task.setvariable variable=IMG_PUBLISHER]MicrosoftCBLMariner'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ steps:
else
echo "This is a release build triggered from the release pipeline"
echo "$(Build.SourceBranch)" | grep -E 'windows/v[[:digit:]]{8}'
echo "$(Build.SourceBranch)" | grep -E '^refs/heads/windows/v[[:digit:]]{8}$'
if (( $? != 0 )); then
echo "The branch $(Build.SourceBranch) is not release branch. Please use the release branch. Release branch name format: windows/vYYYYMMDD."
exit 1
Expand Down
35 changes: 12 additions & 23 deletions .pipelines/templates/.builder-release-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ steps:
SYSTEM_TEAMPROJECT: $(System.TeamProject)
BUILD_RUN_NUMBER: $(Build.BuildNumber)
VHD_ARTIFACT_NAME: ${{ parameters.artifactName }}
DRY_RUN: $(DRY_RUN)

- task: PublishPipelineArtifact@0
condition: always()
Expand Down Expand Up @@ -212,15 +213,15 @@ steps:
targetPath: 'image-bom.json'

- task: CopyFiles@2
condition: and(succeeded(), eq(variables.DRY_RUN, 'False'))
condition: succeeded()
displayName: Copy Image Bom
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)'
Contents: 'image-bom.json'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- bash: make -f packer.mk convert-sig-to-classic-storage-account-blob
condition: and(succeeded(), eq(variables.DRY_RUN, 'False'))
condition: and(succeeded(), eq(variables.GENERATE_PUBLISHING_INFO, 'True'))
displayName: Convert Shared Image Gallery To VHD Blob In Classic Storage Account
env:
RESOURCE_GROUP_NAME: $(AZURE_RESOURCE_GROUP_NAME)
Expand All @@ -229,44 +230,32 @@ steps:
condition: always()
displayName: Check Build Performance

- bash: make -f packer.mk generate-sas
displayName: Getting Shared Access Signature URI
condition: and(succeeded(), eq(variables.DRY_RUN, 'False'))
- bash: make -f packer.mk generate-publishing-info
displayName: Generate Publishing Info
condition: and(succeeded(), eq(variables.GENERATE_PUBLISHING_INFO, 'True'))
env:
RESOURCE_GROUP_NAME: $(AZURE_RESOURCE_GROUP_NAME)
STORAGE_ACCT_BLOB_URL: $(CLASSIC_BLOB)
OFFER_NAME: $(OS_SKU)

- task: PublishPipelineArtifact@1
condition: and(succeeded(), eq(variables.DRY_RUN, 'False'))
displayName: Publish VHD Publishing-info
condition: and(succeeded(), eq(variables.GENERATE_PUBLISHING_INFO, 'True'))
displayName: Publish Publishing Info
inputs:
artifactName: 'publishing-info-${{ parameters.artifactName }}'
targetPath: 'vhd-publishing-info.json'

- task: CopyFiles@2
condition: and(succeeded(), eq(variables.DRY_RUN, 'False'))
displayName: Copy VHD Publishing-info
condition: and(succeeded(), eq(variables.GENERATE_PUBLISHING_INFO, 'True'))
displayName: Copy Publishing Info
inputs:
SourceFolder: '$(System.DefaultWorkingDirectory)'
Contents: 'vhd-publishing-info.json'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: UniversalPackages@0
condition: and(succeeded(), eq(variables.DRY_RUN, 'False'))
displayName: Universal Publish
inputs:
command: publish
publishDirectory: 'vhd-publishing-info.json'
vstsFeedPublish: 'CloudNativeCompute/AKS-Linux-VHD-Artifacts'
vstsFeedPackagePublish: 'publishing-info-${{ parameters.artifactName }}'
packagePublishDescription: 'VHD publishing info ${{ parameters.artifactName }}'
versionOption: minor

- task: PublishPipelineArtifact@0
# These "bulk" artifacts are the folders, per SKU, that contain all other artifacts (publishing-info, image-bom, trivy reports, etc.)
condition: and(succeeded(), eq(variables.DRY_RUN, 'False'))
displayName: Publish Bulk Artifacts
condition: succeeded()
displayName: Publish Artifacts
inputs:
artifactName: '${{ parameters.artifactName }}'
targetPath: '$(Build.ArtifactStagingDirectory)'
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,16 @@ validate-image-version:
generate-kubelet-flags:
@./e2e/kubelet/generate-kubelet-flags.sh

.PHONY: lint-proto-files
lint-proto-files:
@(cd aks-node-controller && ../hack/tools/bin/buf lint)
@(cd aks-node-controller && ../hack/tools/bin/buf breaking --against '../.git#branch=dev') # TODO: change to master

.PHONY: compile-proto-files
compile-proto-files:
@./hack/tools/bin/buf generate -o . --path ./pkg/proto/ --template ./pkg/proto/buf.gen.yaml
@(cd aks-node-controller && ../hack/tools/bin/buf format -w)
@(cd aks-node-controller && ../hack/tools/bin/buf generate)
$(MAKE) lint-proto-files

.PHONY: generate-manifest
generate-manifest:
Expand Down
6 changes: 2 additions & 4 deletions aks-node-controller/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"bytes"
"context"
"encoding/json"
"errors"
"flag"
"fmt"
Expand All @@ -14,7 +13,7 @@ import (
"path/filepath"

"github.com/Azure/agentbaker/aks-node-controller/parser"
aksnodeconfigv1 "github.com/Azure/agentbaker/pkg/proto/aksnodeconfig/v1"
"github.com/Azure/agentbaker/aks-node-controller/pkg/nodeconfigutils"
"gopkg.in/fsnotify.v1"
)

Expand Down Expand Up @@ -82,8 +81,7 @@ func (a *App) Provision(ctx context.Context, flags ProvisionFlags) error {
return fmt.Errorf("open provision file %s: %w", flags.ProvisionConfig, err)
}

config := &aksnodeconfigv1.Configuration{}
err = json.Unmarshal(inputJSON, config)
config, err := nodeconfigutils.UnmarshalConfigurationV1(inputJSON)
if err != nil {
return fmt.Errorf("unmarshal provision config: %w", err)
}
Expand Down
11 changes: 11 additions & 0 deletions aks-node-controller/buf.gen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: v2
clean: true
managed:
enabled: true
override:
- file_option: go_package_prefix
value: github.com/azure/agentBaker/aks-node-controller/pkg/gen
plugins:
- remote: buf.build/protocolbuffers/go:v1.35.2
out: pkg/gen
opt: paths=source_relative
9 changes: 9 additions & 0 deletions aks-node-controller/buf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: v2
modules:
- path: proto
lint:
use:
- STANDARD
breaking:
use:
- WIRE_JSON
1 change: 0 additions & 1 deletion aks-node-controller/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ package main
// it will help us to avoid introducing any breaking changes in the future.
const (
logFile = "/var/log/azure/aks-node-controller.log"
bootstrapService = "bootstrap.service"
provisionJSONFilePath = "/var/log/azure/aks/provision.json"
provisionCompleteFilePath = "/opt/azure/containers/provision.complete"
)
25 changes: 9 additions & 16 deletions aks-node-controller/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,20 @@ toolchain go1.23.0

require (
github.com/Azure/agentbaker v0.20240503.0
github.com/Azure/go-autorest/autorest/to v0.4.0
github.com/blang/semver v3.5.1+incompatible
github.com/stretchr/testify v1.9.0
)

require (
github.com/kr/text v0.2.0 // indirect
golang.org/x/sys v0.22.0 // indirect
google.golang.org/protobuf v1.34.2
gopkg.in/fsnotify.v1 v1.4.7
)

require (
github.com/Azure/go-autorest v14.2.0+incompatible // indirect
github.com/Azure/go-autorest/autorest/to v0.4.0 // indirect
github.com/Masterminds/semver/v3 v3.2.1 // indirect
github.com/blang/semver v3.5.1+incompatible // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.33.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/kr/text v0.2.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/fsnotify.v1 v1.4.7
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
golang.org/x/sys v0.23.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)

replace github.com/Azure/agentbaker => ../
)
Loading

0 comments on commit 9b08ee6

Please sign in to comment.