Skip to content

Commit

Permalink
build cli: add argument fake_build
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexandreMary committed Dec 10, 2024
1 parent 4ee4d77 commit 760a4af
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions src/davai_env/cli/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def main():
this_xp.build(
skip_fetching_sources=args.skip_fetching_sources,
drymode=args.drymode,
fake_build=args.fake_build,
# gmkpack arguments
preexisting_pack=args.preexisting_pack,
cleanpack=args.cleanpack,
Expand All @@ -28,6 +29,10 @@ def get_args():
parser.add_argument('-e', '--preexisting_pack',
action='store_true',
help="Gmkpack: assume the pack already preexists, and repopulate it with sources changes.")
parser.add_argument('-f', '--fake_build',
action='store_true',
help=" ".join(["Fake build: assume binaries already present (in pack),"
"copy them in vortex workflow. Better know what you're doing..."]))
parser.add_argument('-c', '--cleanpack',
action='store_true',
help="Gmkpack: clean pack before git2pack+pack2bin.")
Expand Down
10 changes: 7 additions & 3 deletions src/davai_env/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,9 @@ def ciboulai_init(self):

def build(self,
drymode=False,
# gmkpack arguments
skip_fetching_sources=False,
fake_build=False,
# gmkpack arguments
preexisting_pack=False,
cleanpack=False):
"""Generic, main davai build of executables."""
Expand All @@ -357,7 +358,8 @@ def build(self,
cleanpack=cleanpack)
# launch build in batch/scheduler
self._gmkpack_launch_build(drymode=drymode,
cleanpack=cleanpack)
cleanpack=cleanpack,
fake_build=fake_build)
else:
raise NotImplementedError("compiling_system == {}".format(compiling_system))

Expand All @@ -384,14 +386,16 @@ def _gmkpack_fetch_sources(self,

def _gmkpack_launch_build(self,
drymode=False,
cleanpack=False):
cleanpack=False,
fake_build=False):
"""Launch build job."""
os.environ['DAVAI_START_BUILD'] = str(time.time())
# run build in batch/scheduler
build_job = 'build.gmkpack.pack2bin'
self._launch(build_job, 'build',
drymode=drymode,
cleanpack=cleanpack,
fake_build=fake_build,
**self.sources_to_test)
# run build monitoring (interactively)
if guess_host() != 'atos_bologna': # FIXME: dirty
Expand Down

0 comments on commit 760a4af

Please sign in to comment.