Skip to content

Move batchtime from task definitions to task refs #1768

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

Merged
merged 1 commit into from
Oct 15, 2024
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
38 changes: 27 additions & 11 deletions .evergreen/config_generator/components/cse/openssl.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from shrub.v3.evg_build_variant import BuildVariant
from shrub.v3.evg_task import EvgTaskRef

from config_generator.etc.compile import generate_compile_tasks
from config_generator.etc.function import merge_defns
from config_generator.etc.utils import TaskRef

from config_generator.etc.cse.compile import CompileCommon
from config_generator.etc.cse.test import generate_test_tasks
Expand Down Expand Up @@ -64,23 +64,25 @@ def functions():
)


def tasks():
res = []
SASL_TO_FUNC = {
'cyrus': SaslCyrusOpenSSLCompile,
}

SASL_TO_FUNC = {
'cyrus': SaslCyrusOpenSSLCompile,
}
MORE_TAGS = ['cse']

MORE_TAGS = ['cse']
TASKS = [
*generate_compile_tasks(SSL, TAG, SASL_TO_FUNC, COMPILE_MATRIX, MORE_TAGS),
*generate_test_tasks(SSL, TAG, TEST_MATRIX),
]

res += generate_compile_tasks(SSL, TAG, SASL_TO_FUNC, COMPILE_MATRIX, MORE_TAGS)
res += generate_test_tasks(SSL, TAG, TEST_MATRIX)

def tasks():
res = TASKS.copy()

# PowerPC and zSeries are limited resources.
for task in res:
if any(pattern in task.run_on for pattern in ["power8", "zseries"]):
task.patchable = False
task.batchtime = 1440 # 1 day

return res

Expand All @@ -90,11 +92,25 @@ def variants():
'CLIENT_SIDE_ENCRYPTION': 'on',
}

tasks = []

# PowerPC and zSeries are limited resources.
for task in TASKS:
if any(pattern in task.run_on for pattern in ["power8", "zseries"]):
tasks.append(
TaskRef(
name=task.name,
batchtime=1440, # 1 day
)
)
else:
tasks.append(task.get_task_ref())

return [
BuildVariant(
name=TAG,
display_name=TAG,
tasks=[EvgTaskRef(name=f'.{TAG}')],
tasks=tasks,
expansions=expansions,
),
]
38 changes: 28 additions & 10 deletions .evergreen/config_generator/components/sasl/openssl.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from typing import List

from shrub.v3.evg_build_variant import BuildVariant
from shrub.v3.evg_task import EvgTaskRef

from config_generator.etc.utils import TaskRef
from config_generator.etc.function import merge_defns
from config_generator.etc.compile import generate_compile_tasks

Expand Down Expand Up @@ -67,33 +69,49 @@ def functions():
)


def tasks():
res = []
SASL_TO_FUNC = {
'cyrus': SaslCyrusOpenSSLCompile,
}

SASL_TO_FUNC = {
'cyrus': SaslCyrusOpenSSLCompile,
}
TASKS = [
*generate_compile_tasks(SSL, TAG, SASL_TO_FUNC, COMPILE_MATRIX),
*generate_test_tasks(SSL, TAG, TEST_MATRIX),
]

res += generate_compile_tasks(SSL, TAG, SASL_TO_FUNC, COMPILE_MATRIX)
res += generate_test_tasks(SSL, TAG, TEST_MATRIX)

def tasks():
res = TASKS.copy()

# PowerPC and zSeries are limited resources.
for task in res:
if any(pattern in task.run_on for pattern in ["power8", "zseries"]):
task.patchable = False
task.batchtime = 1440 # 1 day

return res


def variants():
expansions = {}

tasks = []

# PowerPC and zSeries are limited resources.
for task in TASKS:
if any(pattern in task.run_on for pattern in ["power8", "zseries"]):
tasks.append(
TaskRef(
name=task.name,
batchtime=1440, # 1 day
)
)
else:
tasks.append(task.get_task_ref())

return [
BuildVariant(
name=TAG,
display_name=TAG,
tasks=[EvgTaskRef(name=f'.{TAG}')],
tasks=tasks,
expansions=expansions,
),
]
12 changes: 12 additions & 0 deletions .evergreen/config_generator/etc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,23 @@
from shrub.v3.evg_command import EvgCommandType, subprocess_exec
from shrub.v3.evg_project import EvgProject
from shrub.v3.shrub_service import ConfigDumper
from shrub.v3.evg_task import EvgTaskRef
from typing_extensions import get_args, get_origin, get_type_hints

T = TypeVar('T')


# Equivalent to EvgTaskRef but defines additional properties.
class TaskRef(EvgTaskRef):
"""
An evergreen task reference model that also includes additional properties.

(The shrub.py model is missing some properties)
"""

batchtime: int | None = None


# Automatically formats the provided script and invokes it in Bash.
def bash_exec(
script,
Expand Down
22 changes: 0 additions & 22 deletions .evergreen/generated_configs/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1605,7 +1605,6 @@ tasks:
- name: cse-sasl-cyrus-openssl-rhel83-zseries-gcc-compile
run_on: rhel83-zseries-large
tags: [cse-matrix-openssl, compile, rhel83-zseries, gcc, cse, sasl-cyrus]
batchtime: 1440
patchable: false
commands:
- func: find-cmake-latest
Expand All @@ -1617,7 +1616,6 @@ tasks:
run_on: rhel83-zseries-small
tags: [cse-matrix-openssl, test, rhel83-zseries, gcc, sasl-cyrus, cse, auth, server, "5.0", openssl]
depends_on: [{ name: cse-sasl-cyrus-openssl-rhel83-zseries-gcc-compile }]
batchtime: 1440
patchable: false
commands:
- func: fetch-build
Expand All @@ -1639,7 +1637,6 @@ tasks:
run_on: rhel83-zseries-small
tags: [cse-matrix-openssl, test, rhel83-zseries, gcc, sasl-cyrus, cse, auth, replica, "7.0", openssl]
depends_on: [{ name: cse-sasl-cyrus-openssl-rhel83-zseries-gcc-compile }]
batchtime: 1440
patchable: false
commands:
- func: fetch-build
Expand All @@ -1661,7 +1658,6 @@ tasks:
run_on: rhel83-zseries-small
tags: [cse-matrix-openssl, test, rhel83-zseries, gcc, sasl-cyrus, cse, auth, server, "7.0", openssl]
depends_on: [{ name: cse-sasl-cyrus-openssl-rhel83-zseries-gcc-compile }]
batchtime: 1440
patchable: false
commands:
- func: fetch-build
Expand All @@ -1683,7 +1679,6 @@ tasks:
run_on: rhel83-zseries-small
tags: [cse-matrix-openssl, test, rhel83-zseries, gcc, sasl-cyrus, cse, auth, replica, "8.0", openssl]
depends_on: [{ name: cse-sasl-cyrus-openssl-rhel83-zseries-gcc-compile }]
batchtime: 1440
patchable: false
commands:
- func: fetch-build
Expand All @@ -1705,7 +1700,6 @@ tasks:
run_on: rhel83-zseries-small
tags: [cse-matrix-openssl, test, rhel83-zseries, gcc, sasl-cyrus, cse, auth, server, "8.0", openssl]
depends_on: [{ name: cse-sasl-cyrus-openssl-rhel83-zseries-gcc-compile }]
batchtime: 1440
patchable: false
commands:
- func: fetch-build
Expand All @@ -1727,7 +1721,6 @@ tasks:
run_on: rhel83-zseries-small
tags: [cse-matrix-openssl, test, rhel83-zseries, gcc, sasl-cyrus, cse, auth, replica, latest, openssl]
depends_on: [{ name: cse-sasl-cyrus-openssl-rhel83-zseries-gcc-compile }]
batchtime: 1440
patchable: false
commands:
- func: fetch-build
Expand All @@ -1749,7 +1742,6 @@ tasks:
run_on: rhel83-zseries-small
tags: [cse-matrix-openssl, test, rhel83-zseries, gcc, sasl-cyrus, cse, auth, server, latest, openssl]
depends_on: [{ name: cse-sasl-cyrus-openssl-rhel83-zseries-gcc-compile }]
batchtime: 1440
patchable: false
commands:
- func: fetch-build
Expand Down Expand Up @@ -3217,7 +3209,6 @@ tasks:
- name: sasl-cyrus-openssl-rhel81-power8-gcc-compile
run_on: rhel81-power8-large
tags: [sasl-matrix-openssl, compile, rhel81-power8, gcc, sasl-cyrus]
batchtime: 1440
patchable: false
commands:
- func: find-cmake-latest
Expand All @@ -3229,7 +3220,6 @@ tasks:
run_on: rhel81-power8-small
tags: [sasl-matrix-openssl, test, rhel81-power8, gcc, sasl-cyrus, auth, server, "4.2", openssl]
depends_on: [{ name: sasl-cyrus-openssl-rhel81-power8-gcc-compile }]
batchtime: 1440
patchable: false
commands:
- func: fetch-build
Expand All @@ -3251,7 +3241,6 @@ tasks:
run_on: rhel81-power8-small
tags: [sasl-matrix-openssl, test, rhel81-power8, gcc, sasl-cyrus, auth, server, "4.4", openssl]
depends_on: [{ name: sasl-cyrus-openssl-rhel81-power8-gcc-compile }]
batchtime: 1440
patchable: false
commands:
- func: fetch-build
Expand All @@ -3273,7 +3262,6 @@ tasks:
run_on: rhel81-power8-small
tags: [sasl-matrix-openssl, test, rhel81-power8, gcc, sasl-cyrus, auth, server, "5.0", openssl]
depends_on: [{ name: sasl-cyrus-openssl-rhel81-power8-gcc-compile }]
batchtime: 1440
patchable: false
commands:
- func: fetch-build
Expand All @@ -3295,7 +3283,6 @@ tasks:
run_on: rhel81-power8-small
tags: [sasl-matrix-openssl, test, rhel81-power8, gcc, sasl-cyrus, auth, server, "6.0", openssl]
depends_on: [{ name: sasl-cyrus-openssl-rhel81-power8-gcc-compile }]
batchtime: 1440
patchable: false
commands:
- func: fetch-build
Expand All @@ -3317,7 +3304,6 @@ tasks:
run_on: rhel81-power8-small
tags: [sasl-matrix-openssl, test, rhel81-power8, gcc, sasl-cyrus, auth, server, "7.0", openssl]
depends_on: [{ name: sasl-cyrus-openssl-rhel81-power8-gcc-compile }]
batchtime: 1440
patchable: false
commands:
- func: fetch-build
Expand All @@ -3339,7 +3325,6 @@ tasks:
run_on: rhel81-power8-small
tags: [sasl-matrix-openssl, test, rhel81-power8, gcc, sasl-cyrus, auth, server, "8.0", openssl]
depends_on: [{ name: sasl-cyrus-openssl-rhel81-power8-gcc-compile }]
batchtime: 1440
patchable: false
commands:
- func: fetch-build
Expand All @@ -3361,7 +3346,6 @@ tasks:
run_on: rhel81-power8-small
tags: [sasl-matrix-openssl, test, rhel81-power8, gcc, sasl-cyrus, auth, server, latest, openssl]
depends_on: [{ name: sasl-cyrus-openssl-rhel81-power8-gcc-compile }]
batchtime: 1440
patchable: false
commands:
- func: fetch-build
Expand All @@ -3382,7 +3366,6 @@ tasks:
- name: sasl-cyrus-openssl-rhel83-zseries-gcc-compile
run_on: rhel83-zseries-large
tags: [sasl-matrix-openssl, compile, rhel83-zseries, gcc, sasl-cyrus]
batchtime: 1440
patchable: false
commands:
- func: find-cmake-latest
Expand All @@ -3394,7 +3377,6 @@ tasks:
run_on: rhel83-zseries-small
tags: [sasl-matrix-openssl, test, rhel83-zseries, gcc, sasl-cyrus, auth, server, "5.0", openssl]
depends_on: [{ name: sasl-cyrus-openssl-rhel83-zseries-gcc-compile }]
batchtime: 1440
patchable: false
commands:
- func: fetch-build
Expand All @@ -3416,7 +3398,6 @@ tasks:
run_on: rhel83-zseries-small
tags: [sasl-matrix-openssl, test, rhel83-zseries, gcc, sasl-cyrus, auth, server, "6.0", openssl]
depends_on: [{ name: sasl-cyrus-openssl-rhel83-zseries-gcc-compile }]
batchtime: 1440
patchable: false
commands:
- func: fetch-build
Expand All @@ -3438,7 +3419,6 @@ tasks:
run_on: rhel83-zseries-small
tags: [sasl-matrix-openssl, test, rhel83-zseries, gcc, sasl-cyrus, auth, server, "7.0", openssl]
depends_on: [{ name: sasl-cyrus-openssl-rhel83-zseries-gcc-compile }]
batchtime: 1440
patchable: false
commands:
- func: fetch-build
Expand All @@ -3460,7 +3440,6 @@ tasks:
run_on: rhel83-zseries-small
tags: [sasl-matrix-openssl, test, rhel83-zseries, gcc, sasl-cyrus, auth, server, "8.0", openssl]
depends_on: [{ name: sasl-cyrus-openssl-rhel83-zseries-gcc-compile }]
batchtime: 1440
patchable: false
commands:
- func: fetch-build
Expand All @@ -3482,7 +3461,6 @@ tasks:
run_on: rhel83-zseries-small
tags: [sasl-matrix-openssl, test, rhel83-zseries, gcc, sasl-cyrus, auth, server, latest, openssl]
depends_on: [{ name: sasl-cyrus-openssl-rhel83-zseries-gcc-compile }]
batchtime: 1440
patchable: false
commands:
- func: fetch-build
Expand Down
Loading