Skip to content
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

Add link checking for stress CI #3826

Merged
merged 2 commits into from
Aug 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/common/pipelines/templates/steps/verify-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ steps:
-branchReplacementName ${{ parameters.BranchReplacementName }}
-devOpsLogging: $true
-checkLinkGuidance: ${{ parameters.CheckLinkGuidance }}
-inputCacheFile "https://azuresdkartifacts.blob.core.windows.net/verify-links-cache/verify-links-cache.txt"
-inputCacheFile "https://azuresdkartifacts.blob.core.windows.net/verify-links-cache/verify-links-cache.txt"
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ function CheckDependencies()
},
@{
Command = "az";
Help = "Azure CLI must be installed: https://docs.microsoft.com/en-us/cli/azure/install-azure-cli";
Help = "Azure CLI must be installed: https://docs.microsoft.com/cli/azure/install-azure-cli";
}
)

Expand Down
12 changes: 6 additions & 6 deletions tools/stress-cluster/chaos/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The chaos environment is an AKS cluster (Azure Kubernetes Service) with several

Technologies used:

1. [Azure AKS](https://docs.microsoft.com/en-us/azure/aks/)
1. [Azure AKS](https://docs.microsoft.com/azure/aks/)
1. [Kubernetes](https://kubernetes.io/)
1. [Chaos Mesh](https://chaos-mesh.org/)

Expand All @@ -41,8 +41,8 @@ You will need the following tools to create and run tests:
1. [Docker](https://docs.docker.com/get-docker/)
1. [Kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)
1. [Helm](https://helm.sh/docs/intro/install/)
1. [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
1. [Powershell Core](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7.1#ubuntu-2004) (if using Linux)
1. [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli)
1. [Powershell Core](https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7.1#ubuntu-2004) (if using Linux)

## Access

Expand Down Expand Up @@ -422,7 +422,7 @@ spec:

For more detailed examples, see:

- [Chaos Experiments](https://chaos-mesh.org/docs/chaos_experiments/networkchaos_experiment) docs for all possible types
- [Chaos Experiments](https://chaos-mesh.org/docs/simulate-network-chaos-on-kubernetes/) docs for all possible types
- `./examples/network_stress_example/templates/network_loss.yaml` for an example network loss manifest within a helm chart
- The [Faults via Dashboard section](#faults-via-dashboard) for generating the configs from the UI

Expand Down Expand Up @@ -507,7 +507,7 @@ script](https://github.com/Azure/azure-sdk-tools/blob/main/eng/common/scripts/st
This script handles: cluster and container registry access, building the stress test helm package, installing helm
package dependencies, and building and pushing docker images. The script must be run via powershell or powershell core.

If using bash or another linux terminal, a [powershell core](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7.1#ubuntu-2004) shell can be invoked via `pwsh`.
If using bash or another linux terminal, a [powershell core](https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7.1#ubuntu-2004) shell can be invoked via `pwsh`.

The first invocation of the script must be run with the `-Login` flag to set up cluster and container registry access.

Expand Down Expand Up @@ -575,7 +575,7 @@ kubectl logs -n <stress test namespace> <stress test pod name>

## Configuring faults

Faults can be configured via kubernetes manifests or via the UI (which is a helper for building the manifests under the hood). For docs on the manifest schema, see [here](https://chaos-mesh.org/docs/user_guides/run_chaos_experiment).
Faults can be configured via kubernetes manifests or via the UI (which is a helper for building the manifests under the hood). For docs on the manifest schema, see [here](https://chaos-mesh.org/docs/define-chaos-experiment-scope/).

### Faults via Dashboard

Expand Down
13 changes: 13 additions & 0 deletions tools/stress-cluster/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,19 @@ pr:
- tools/stress-cluster

jobs:
- job: Analyze
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth a separate job?

Copy link
Member Author

@benbp benbp Aug 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The alternative is putting it into either the release or provision template, which are both used directly in other pipelines. I don't want to have to wait or be blocked by bad links in order to release stress tests or provision the cluster via those dedicated pipelines.

We could put it in the release template, and just add a parameter like Analyze: true as an alternative, though that may be overloading the release job in a sense (and it would make CI take twice as long).

pool:
name: 'azsdk-pool-mms-ubuntu-2004-general'
vmImage: 'MMSUbuntu20.04'
steps:
- template: /eng/common/pipelines/templates/steps/verify-links.yml
parameters:
Directory: tools/stress-cluster
- template: /eng/common/pipelines/templates/steps/verify-links.yml
parameters:
Directory: eng/common/scripts/stress-testing


- template: /eng/pipelines/templates/jobs/stress-test-release.yml
parameters:
Environment: pg
Expand Down
8 changes: 4 additions & 4 deletions tools/stress-cluster/cluster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ Table of Contents
This directory contains all configuration used for stress test cluster buildout (azure and kubernetes buildout), as well
as a set of common stress test config boilerplate (helm library).

The `./azure` directory contains [Azure Bicep](https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/overview)
files for deploying Azure resources (mainly [AKS clusters](https://azure.microsoft.com/en-us/services/kubernetes-service/)
The `./azure` directory contains [Azure Bicep](https://docs.microsoft.com/azure/azure-resource-manager/bicep/overview)
files for deploying Azure resources (mainly [AKS clusters](https://azure.microsoft.com/services/kubernetes-service/)
to support stress testing (for dev/playground and/or production).

Azure Bicep comes pre-installed with the Azure CLI, and is a DSL for generating ARM templates.
Expand All @@ -34,8 +34,8 @@ easier to make and roll out config changes to tests across repos by using helm c

# Dependencies

- [Powershell Core](https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7.1#ubuntu-2004)
- [Azure CLI](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli)
- [Powershell Core](https://docs.microsoft.com/powershell/scripting/install/installing-powershell-core-on-linux?view=powershell-7.1#ubuntu-2004)
- [Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli)
- [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)
- [helm](https://helm.sh)
- [kind](https://github.com/kubernetes-sigs/kind/releases) (if testing locally)
Expand Down
2 changes: 1 addition & 1 deletion tools/stress-cluster/cluster/azure/cluster/cluster.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ resource cluster 'Microsoft.ContainerService/managedClusters@2020-09-01' = {

// Add Monitoring Metrics Publisher role to omsagent identity. Required to publish metrics data to
// cluster resource container insights.
// https://docs.microsoft.com/en-us/azure/azure-monitor/containers/container-insights-update-metrics
// https://docs.microsoft.com/azure/azure-monitor/containers/container-insights-update-metrics
resource metricsPublisher 'Microsoft.Authorization/roleAssignments@2020-04-01-preview' = {
name: '${guid('monitoringMetricsPublisherRole', resourceGroup().id)}'
scope: cluster
Expand Down
6 changes: 3 additions & 3 deletions tools/stress-cluster/cluster/azure/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ resource group 'Microsoft.Resources/resourceGroups@2020-10-01' = {
}

// Add unique suffix to monitoring resource names to simplify cross-resource queries.
// https://docs.microsoft.com/en-us/azure/azure-monitor/logs/cross-workspace-query#identifying-an-application
// https://docs.microsoft.com/azure/azure-monitor/logs/cross-workspace-query#identifying-an-application
var resourceSuffix = uniqueString(group.id)

module logWorkspace 'monitoring/log-analytics-workspace.bicep' = {
Expand Down Expand Up @@ -106,8 +106,8 @@ var appInsightsConnectionStringSecretName = 'appInsightsConnectionString-${resou
var appInsightsConnectionStringSecretValue = 'APPLICATIONINSIGHTS_CONNECTION_STRING="${appInsights.outputs.connectionString}"\n'

// Storage account information used for kubernetes fileshare volume mounting via the azure files csi driver
// See https://docs.microsoft.com/en-us/azure/aks/azure-files-volume#create-a-kubernetes-secret
// See https://docs.microsoft.com/en-us/azure/aks/azure-files-csi
// See https://docs.microsoft.com/azure/aks/azure-files-volume#create-a-kubernetes-secret
// See https://docs.microsoft.com/azure/aks/azure-files-csi
var debugStorageKeySecretName = 'debugStorageKey-${resourceSuffix}'
var debugStorageKeySecretValue = '${storage.outputs.key}'
var debugStorageAccountSecretName = 'debugStorageAccount-${resourceSuffix}'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class JobWithAzureResourceDeployment : BaseJob

private string BicepContents = @"
// Add Bicep file contents here.
// [Overview] https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/overview
// [Overview] https://docs.microsoft.com/azure/azure-resource-manager/bicep/overview
// [Examples] https://github.com/Azure/bicep/tree/main/docs/examples
";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ spec:
provider: azure
secretObjects:
# Storage account information used for kubernetes fileshare volume mounting via the azure files csi driver
# See https://docs.microsoft.com/en-us/azure/aks/azure-files-volume#create-a-kubernetes-secret
# See https://docs.microsoft.com/en-us/azure/aks/azure-files-csi
# See https://docs.microsoft.com/azure/aks/azure-files-volume#create-a-kubernetes-secret
# See https://docs.microsoft.com/azure/aks/azure-files-csi
- secretName: debugstorageaccountconfig
type: Opaque
data:
Expand Down