Skip to content
Open
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: 2 additions & 0 deletions kcl/example_pipeline/pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ jobs:
sleep 30
done
displayName: Wait for cluster to succeed
timeoutInMinutes: 60
- task: AzureCLI@2
inputs:
azureSubscription: Azure-for-Telescope-internal
Expand Down Expand Up @@ -183,6 +184,7 @@ jobs:
sleep 30
done
displayName: Wait for node pool cl2pool to succeed
timeoutInMinutes: 30
- task: AzureCLI@2
inputs:
azureSubscription: Azure-for-Telescope-internal
Expand Down
3 changes: 2 additions & 1 deletion kcl/lib/steps/azure/az_cli.k
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import azure_pipelines.ap.steps

AzCli = lambda serviceConnection: str, name: str, script: str, condition: str = Undefined -> steps.Step {
AzCli = lambda serviceConnection: str, name: str, script: str, condition: str = Undefined, timeoutInMinutes: int = Undefined -> steps.Step {
steps.Task {
task = "AzureCLI@2"
inputs = {
Expand All @@ -11,5 +11,6 @@ AzCli = lambda serviceConnection: str, name: str, script: str, condition: str =
}
displayName = name
condition = condition
timeoutInMinutes = timeoutInMinutes
}
}
4 changes: 2 additions & 2 deletions kcl/lib/steps/azure/wait_for_cluster_succeeded.k
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import azure_pipelines.ap.steps

WaitForClusterSucceeded = lambda serviceConnection: str, cluster: str, resourceGroup: str, subscription: str -> steps.Step {
WaitForClusterSucceeded = lambda serviceConnection: str, cluster: str, resourceGroup: str, subscription: str, timeoutInMinutes: int = 60 -> steps.Step {
script = """
while true; do
STATE=$(az aks show \\
Expand All @@ -22,5 +22,5 @@ while true; do
sleep 30
done
"""
AzCli(serviceConnection, "Wait for cluster to succeed", script)
AzCli(serviceConnection, "Wait for cluster to succeed", script, timeoutInMinutes=timeoutInMinutes)
}
4 changes: 2 additions & 2 deletions kcl/lib/steps/azure/wait_for_node_pool_succeeded.k
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import azure_pipelines.ap.steps

WaitForNodePoolSucceeded = lambda serviceConnection: str, cluster: str, resourceGroup: str, subscription: str, poolName: str -> steps.Step {
WaitForNodePoolSucceeded = lambda serviceConnection: str, cluster: str, resourceGroup: str, subscription: str, poolName: str, timeoutInMinutes: int = 30 -> steps.Step {
script = """
while true; do
STATE=$(az aks nodepool show \\
Expand All @@ -23,5 +23,5 @@ while true; do
sleep 30
done
"""
AzCli(serviceConnection, "Wait for node pool ${poolName} to succeed", script)
AzCli(serviceConnection, "Wait for node pool ${poolName} to succeed", script, timeoutInMinutes=timeoutInMinutes)
}
Loading