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

Collect cloud info in telescope metadata #459

Merged
merged 4 commits into from
Dec 30, 2024
Merged
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
22 changes: 15 additions & 7 deletions steps/collect-telescope-metadata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@ parameters:
type: object
steps:
- script: |
set -e

if [ -z "$CLOUD_INFO" ]; then
CLOUD_INFO=$(jq -n -c \
--arg cloud "$CLOUD" \
--arg region "$(echo "$REGIONS" | jq -r '.[]')" \
'{
cloud: $cloud,
region: $region
}')
fi

telescope_metadata=$(jq -n \
--arg run_id $RUN_ID \
--arg run_url $RUN_URL \
Expand All @@ -27,13 +39,12 @@ steps:
--arg engine "$ENGINE" \
--arg topology "$TOPOLOGY" \
--arg engine_input "$(echo $ENGINE_INPUT | jq -r '.')" \
--arg cloud "$CLOUD" \
--arg region "$(echo "$REGIONS" | jq -r '.[]')" \
--arg cloud_info "$CLOUD_INFO" \
--arg pipeline_id "$(System.DefinitionId)" \
--arg pipeline_name "$(Build.DefinitionName)" \
--arg cron_schedule_display_name "$BUILD_CRONSCHEDULE_DISPLAYNAME" \
--arg project_name "$(System.TeamProject)" \
--arg byo_resources "$(SKIP_RESOURCE_MANAGEMENT)" \
--arg byo_resources "$SKIP_RESOURCE_MANAGEMENT" \
'{
run_id: $run_id,
pipeline_info: {
Expand All @@ -57,10 +68,7 @@ steps:
engine_input: $engine_input,
byo_resources: $byo_resources
},
cloud_info: {
cloud: $cloud,
region: $region
}
cloud_info: $cloud_info
}' | jq 'with_entries(select(.value != null and .value != ""))' | jq -c .)
echo -n "Telescope Metadata: " && echo "$telescope_metadata" | jq .
echo "$telescope_metadata" > $TEST_RESULTS_DIR/telescope_metadata.json
Expand Down
Loading