pipeline: add hard 17*30 limit to number of total matrix jobs

- show size of each GHA output in logs
This commit is contained in:
Ricardo Pardini
2023-10-13 20:05:48 +02:00
committed by Igor
parent fed7bf63f5
commit ed39cb04fb
2 changed files with 7 additions and 1 deletions

View File

@@ -17,7 +17,7 @@ def set_gha_output(name, value):
with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: with open(os.environ['GITHUB_OUTPUT'], 'a') as fh:
print(f'{name}={value}', file=fh) print(f'{name}={value}', file=fh)
log.info(f"Set GHA output '{name}' to '{value}'") log.info(f"Set GHA output '{name}' to ({len(value)} bytes) '{value}'")
def set_multiline_gha_output(name, value): def set_multiline_gha_output(name, value):

View File

@@ -161,6 +161,12 @@ else:
num_chunks = int(len(matrix) / ideal_chunk_size) + 1 num_chunks = int(len(matrix) / ideal_chunk_size) + 1
log.warning(f"Number of chunks: {num_chunks}") log.warning(f"Number of chunks: {num_chunks}")
matrix_hard_limit = 17 * 30 # @TODO: maybe 17*50 later
# if over the limit, just slice to the limit, add warning about lost jobs
if len(matrix) > matrix_hard_limit:
log.warning(f"Matrix size is over the hard limit of {matrix_hard_limit}, slicing to that limit. Matrix is incomplete.")
matrix = matrix[:matrix_hard_limit]
# distribute the matrix items equally along the chunks. try to keep every chunk the same size. # distribute the matrix items equally along the chunks. try to keep every chunk the same size.
chunks = [] chunks = []
for i in range(num_chunks): for i in range(num_chunks):