Skip to content

Commit

Permalink
Retry requests to artifacts API from CI jobs (elastic#10675)
Browse files Browse the repository at this point in the history
Retry forever if the artifacts API is not available, and assume it will
come back at some point. If it doesn't come back, the job would fail in
any case by timeout.
  • Loading branch information
jsoriano authored Aug 1, 2024
1 parent af59973 commit 0b84690
Showing 2 changed files with 17 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .buildkite/scripts/find_oldest_supported_version.py
Original file line number Diff line number Diff line change
@@ -2,14 +2,27 @@
import argparse
import requests
import sys
import yaml
import unittest
import yaml

VERSION_URL = "https://artifacts-api.elastic.co/v1/versions?x-elastic-no-kpi=true"
from requests.adapters import HTTPAdapter, Retry

ARTIFACTS_URL = "https://artifacts-api.elastic.co"
VERSION_URL = ARTIFACTS_URL + "/v1/versions?x-elastic-no-kpi=true"


def fetch_version():
return requests.get(VERSION_URL).json()
# Retry forever on connection or 500 errors, assume the artifacts API
# will come back. If it doesn't come back we cannot continue executing
# jobs in any case.
retries = Retry(
total=None,
backoff_factor=0.5,
status_forcelist=[500, 502, 503, 504],
)
session = requests.Session()
session.mount(ARTIFACTS_URL, HTTPAdapter(max_retries=retries))
return session.get(VERSION_URL).json()


def find_oldest_supported_version(kibana_version_condition: str) -> str:
1 change: 1 addition & 0 deletions .buildkite/scripts/trigger_integrations_in_parallel.sh
Original file line number Diff line number Diff line change
@@ -50,6 +50,7 @@ for package in ${PACKAGE_LIST}; do
- label: "Check integrations ${package}"
key: "test-integrations-${package}"
command: ".buildkite/scripts/test_one_package.sh ${package} ${from} ${to}"
timeout_in_minutes: 240
agents:
provider: gcp
image: ${IMAGE_UBUNTU_X86_64}

0 comments on commit 0b84690

Please sign in to comment.