-
Notifications
You must be signed in to change notification settings - Fork 248
ci: [1/?] Automated version update pipeline #3667
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
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
pr: none | ||
trigger: none | ||
|
||
variables: | ||
- group: ACN-CNI-Pipeline | ||
|
||
parameters: | ||
- name: versions | ||
displayName: K8s Versions | ||
type: object | ||
default: | ||
- ver: '27' | ||
LTS: true | ||
- ver: '28' | ||
LTS: true | ||
- ver: '29' | ||
LTS: true | ||
- ver: '30' | ||
LTS: false | ||
- ver: '31' | ||
LTS: false | ||
- ver: '32' | ||
LTS: false | ||
# - ver: '33' | ||
# LTS: 'false' | ||
|
||
stages: | ||
- stage: setup | ||
displayName: Variable Group Init | ||
jobs: | ||
- job: env | ||
displayName: Setup | ||
pool: | ||
name: "$(BUILD_POOL_NAME_DEFAULT)" | ||
steps: | ||
- script: | | ||
# To use the variables below, you must make the respective stage's dependsOn have - setup or it will not retain context of this stage | ||
|
||
echo "##vso[task.setvariable variable=commitID;isOutput=true]$(echo $(make revision)-$(date "+%d%H%M"))" | ||
name: "EnvironmentalVariables" | ||
displayName: "Set environmental variables" | ||
condition: always() | ||
- job: vgroup | ||
displayName: View Variable Group | ||
pool: | ||
name: "$(BUILD_POOL_NAME_DEFAULT)" | ||
steps: | ||
- task: AzureCLI@2 | ||
inputs: | ||
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) | ||
scriptLocation: "inlineScript" | ||
scriptType: "bash" | ||
addSpnToEnvironment: true | ||
inlineScript: | | ||
az pipelines variable-group show --id $(CNI_VAR_GROUP) --org $(System.TeamFoundationCollectionUri) --project $(System.TeamProject) --debug | ||
|
||
displayName: "Configure Defaults and List" | ||
condition: always() | ||
env: | ||
AZURE_DEVOPS_EXT_PAT: $(System.AccessToken) | ||
|
||
- bash: | | ||
az pipelines variable-group variable update --id $(CNI_VAR_GROUP) --org $(System.TeamFoundationCollectionUri) --project $(System.TeamProject) --name CILIUM_IMAGE_REGISTRY --value "Changed it was" | ||
displayName: "Change Variable" | ||
env: | ||
AZURE_DEVOPS_EXT_PAT: $(System.AccessToken) | ||
|
||
- bash: | | ||
az pipelines variable-group show --id $(CNI_VAR_GROUP) --org $(System.TeamFoundationCollectionUri) --project $(System.TeamProject) --debug | ||
displayName: "List Variable Group" | ||
env: | ||
AZURE_DEVOPS_EXT_PAT: $(System.AccessToken) | ||
|
||
|
||
- stage: cluster | ||
displayName: "Cluster Create" | ||
dependsOn: | ||
- setup | ||
variables: | ||
commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] | ||
jobs: | ||
- ${{ each version in parameters.versions }}: | ||
- job: cluster${{ version.ver }} | ||
displayName: 1.${{ version.ver }} Cluster Creation | ||
pool: | ||
name: "$(BUILD_POOL_NAME_DEFAULT)" | ||
strategy: | ||
matrix: | ||
cniv1: | ||
clusterType: cniv1-up | ||
clusterName: cniv1 | ||
cilium: | ||
clusterType: overlay-cilium-up | ||
clusterName: cilium | ||
overlay: | ||
clusterType: overlay-up | ||
clusterName: overlay | ||
steps: | ||
- template: ../../templates/create-cluster-steps.yaml | ||
parameters: | ||
clusterType: $(clusterType) | ||
clusterName: $(clusterName)-${{ version.ver }}-$(commitID) | ||
k8sVersion: 1.${{ version.ver }} | ||
vmSize: Standard_B2ms | ||
vmSizeWin: Standard_B2ms | ||
os: windows | ||
region: $(REGION_AKS_CLUSTER_TEST) | ||
LTS: ${{ version.LTS }} | ||
|
||
|
||
- stage: clusterDelete | ||
displayName: "Cluster Delete" | ||
condition: always() | ||
dependsOn: | ||
- setup | ||
- cluster | ||
variables: | ||
commitID: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.commitID'] ] | ||
jobs: | ||
- ${{ each version in parameters.versions }}: | ||
- job: cluster${{ version.ver }} | ||
displayName: 1.${{ version.ver }} Cluster Delete | ||
pool: | ||
name: "$(BUILD_POOL_NAME_DEFAULT)" | ||
strategy: | ||
matrix: | ||
cniv1: | ||
clusterName: cniv1 | ||
cilium: | ||
clusterName: cilium | ||
overlay: | ||
clusterName: overlay | ||
steps: | ||
- template: ../../templates/delete-cluster.yaml | ||
parameters: | ||
name: $(clusterName)-${{ version.ver }}-$(commitID) | ||
clusterName: $(clusterName)-${{ version.ver }}-$(commitID) | ||
region: $(REGION_AKS_CLUSTER_TEST) | ||
sub: $(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS) | ||
svcConn: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
parameters: | ||
name: "" | ||
displayName: "" | ||
clusterType: "" | ||
clusterName: "" # Recommended to pass in unique identifier | ||
vmSize: "" | ||
vmSizeWin: "" | ||
k8sVersion: "" | ||
osSkuWin: "Windows2022" # Currently we only support Windows2022 | ||
dependsOn: "" | ||
region: "" | ||
os: linux | ||
|
||
|
||
steps: | ||
- task: AzureCLI@2 | ||
inputs: | ||
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) | ||
scriptLocation: "inlineScript" | ||
scriptType: "bash" | ||
addSpnToEnvironment: true | ||
inlineScript: | | ||
set -e | ||
echo "Check az version" | ||
az version | ||
if ${{ lower(contains(parameters.clusterType, 'dualstack')) }} | ||
then | ||
echo "Install az cli extension preview" | ||
az extension add --name aks-preview | ||
az extension update --name aks-preview | ||
fi | ||
|
||
if ! [ -z ${{ parameters.k8sVersion }} ]; then | ||
echo "Set K8S_VER with ${{ parameters.k8sVersion }}" | ||
export K8S_VER=${{ parameters.k8sVersion }} | ||
fi | ||
|
||
if ! [ -z ${K8S_VERSION} ]; then | ||
echo "Default k8s version, $(make -C ./hack/aks vars | grep K8S | cut -d'=' -f 2), is manually set to ${K8S_VERSION}" | ||
export K8S_VER=${K8S_VERSION} | ||
fi | ||
|
||
mkdir -p ~/.kube/ | ||
make -C ./hack/aks azcfg AZCLI=az REGION=${{ parameters.region }} | ||
|
||
make -C ./hack/aks ${{ parameters.clusterType }} \ | ||
AZCLI=az REGION=${{ parameters.region }} SUB=$(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS) \ | ||
CLUSTER=${{ parameters.clusterName }} \ | ||
VM_SIZE=${{ parameters.vmSize }} VM_SIZE_WIN=${{ parameters.vmSizeWin }} \ | ||
OS_SKU_WIN=${{ parameters.osSkuWin }} OS=${{ parameters.os }} \ | ||
LTS=${{ lower(parameters.LTS) }} | ||
|
||
echo "Cluster successfully created" | ||
displayName: Cluster - ${{ parameters.clusterType }} | ||
continueOnError: ${{ contains(parameters.clusterType, 'dualstack') }} | ||
jpayne3506 marked this conversation as resolved.
Show resolved
Hide resolved
|
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.