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

ART-11093 add ignore_non_x86_nightlies arg for gen-assembly #1104

Merged
merged 6 commits into from
Dec 19, 2024
Merged
Changes from 3 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
17 changes: 11 additions & 6 deletions pyartcd/pyartcd/pipelines/gen_assembly.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ def __init__(self, runtime: Runtime, group: str, assembly: str, data_path: str,
nightlies: Tuple[str, ...], allow_pending: bool, allow_rejected: bool, allow_inconsistency: bool,
custom: bool, arches: Tuple[str, ...], in_flight: Optional[str], previous_list: Tuple[str, ...],
auto_previous: bool, auto_trigger_build_sync: bool, pre_ga_mode: str, skip_get_nightlies: bool,
logger: Optional[logging.Logger] = None):
ignore_non_x86_nightlies: Optional[bool] = False, logger: Optional[logging.Logger] = None):
self.runtime = runtime
self.group = group
self.assembly = assembly
self.data_path = data_path
self.nightlies = nightlies
self.ignore_non_x86_nightlies = ignore_non_x86_nightlies
self.allow_pending = allow_pending
self.allow_rejected = allow_rejected
self.allow_inconsistency = allow_inconsistency
Expand Down Expand Up @@ -97,11 +98,13 @@ async def run(self):
if self.custom and (self.auto_previous or self.previous_list or self.in_flight):
raise ValueError("Specifying previous list for a custom release is not allowed.")

if not self.skip_get_nightlies:
if self.skip_get_nightlies:
candidate_nightlies = self.nightlies
elif self.ignore_non_x86_nightlies:
candidate_nightlies = await self._get_latest_accepted_nightly()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like setting this option will cause the pipeline completely ignore the --nightly parameter. Is there a way to fix that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the design, when ignore_non_x86_nightlies set only use latest accepted x86 nightly.
nightly parameter is used with skip_get_nightlies, if skip_get_nightlies is true the input value of nighties set will be used.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you're setting what's supposed to be a var of list of nightlies to a single nightly.. how does that work?
Is this code tested?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is what we want, if ignore_non_x86_nightlies is true we only use x86_64 nightly and build the assembly as we did with all arch nightly, we use x86_64 nightly get brew event and get full arch of rhcos from the rhcos version in x86_64 nightly

else:
candidate_nightlies, latest_nightly = await asyncio.gather(
*[self._get_nightlies(), self._get_latest_accepted_nightly()])
else:
candidate_nightlies = self.nightlies

self._logger.info("Generating assembly definition...")
assembly_definition = await self._gen_assembly_from_releases(candidate_nightlies)
Expand Down Expand Up @@ -304,16 +307,18 @@ async def _create_or_update_pull_request(self, assembly_definition: OrderedDict)
@click.option('--previous', 'previous_list', metavar='EDGES', default=[], multiple=True, help='A list of releases that can upgrade to this release')
@click.option('--auto-previous', 'auto_previous', is_flag=True, help='If specified, previous list is calculated from Cincinnati graph')
@click.option('--skip-get-nightlies', 'skip_get_nightlies', is_flag=True, default=False, help='Skip get_nightlies_function (Use only for special cases)')
@click.option('--ignore-non-x86-nightlies', 'ignore_non_x86_nightlies', is_flag=True, default=False, help='Ignore non-x86 nightlies, only use x86 nightly')
@pass_runtime
@click_coroutine
async def gen_assembly(runtime: Runtime, data_path: str, group: str, assembly: str, nightlies: Tuple[str, ...],
allow_pending: bool, allow_rejected: bool, allow_inconsistency: bool, custom: bool, pre_ga_mode: str,
auto_trigger_build_sync: bool, arches: Tuple[str, ...], in_flight: Optional[str],
previous_list: Tuple[str, ...], auto_previous: bool, skip_get_nightlies: bool):
previous_list: Tuple[str, ...], auto_previous: bool, skip_get_nightlies: bool, ignore_non_x86_nightlies: bool):
pipeline = GenAssemblyPipeline(runtime=runtime, group=group, assembly=assembly, data_path=data_path,
nightlies=nightlies, allow_pending=allow_pending, allow_rejected=allow_rejected,
allow_inconsistency=allow_inconsistency, arches=arches, custom=custom,
auto_trigger_build_sync=auto_trigger_build_sync,
in_flight=in_flight, previous_list=previous_list, auto_previous=auto_previous,
pre_ga_mode=pre_ga_mode, skip_get_nightlies=skip_get_nightlies)
pre_ga_mode=pre_ga_mode, skip_get_nightlies=skip_get_nightlies,
ignore_non_x86_nightlies=ignore_non_x86_nightlies)
await pipeline.run()