fre.make.create_checkout_script module

FRE Checkout Script Generator

Retrieves information from the resolved yaml configuration to generate a checkout.sh script that git clones the model source code.

Key Features: - YAML Integration: Consolidates model, platform, and compilation YAML configurations. - Multi-Environment Support: Generates tailored checkout logic for both bare-metal and containerized build environments. - Parallelization Control: Manages git submodule cloning concurrency and shell-level parallel backgrounding.

fre.make.create_checkout_script.baremetal_checkout_write(model_yaml: freyaml, src_dir: str, jobs: str, parallel_cmd: str, execute: bool)

This function extracts information from resolved/loaded yaml configuration and generates a checkout script to the source directory for the bare-metal build.

Parameters:
  • model_yaml (yamlfre.freyaml) – FRE YAML class object containing parsed and validated yaml dictionary compilation information

  • src_dir (str) – Path to the directory where source code will be checked out

  • jobs (str) – Number of git submodules to clone simultaneously

  • parallel_cmd (str) – “ &” is added for parallel checkouts and “” for non-parallel checkouts

  • execute (bool) – If True, runs the generated script after creation

fre.make.create_checkout_script.checkout_create(yamlfile: str, platform: str | list, target: str | list, no_parallel_checkout: bool | None = None, njobs: int = 4, execute: bool | None = False, force_checkout: bool | None = False)

Creates the checkout script for bare-metal or container builds.

The checkout script will clone component repositories, defined in the compile yaml, needed to build the model.

Parameters:
  • yamlfile (str) – Model compile YAML file path

  • platform (str or list) – FRE platform(s); defined in the platforms yaml. Can be a single string or a list of platforms. If on gaea c5, a FRE platform may look like ncrc5.intel23-classic

  • target (str or list) – Predefined FRE target(s); options include [prod/debug/repro]-openmp

  • no_parallel_checkout (bool) – Option to turn off background parallel checkouts

  • njobs (int) – Used in the recursive clone; number of submodules to fetch simultaneously (default 4)

  • execute (bool) – If True, runs the created checkout script to check out source code

  • force_checkout (bool) – If True, overwrites locally existing checkout script and source code with new versions

Raises:
  • ValueError

    • If ‘njobs’ is not an integer/compatible with execution flags

    • If a specified platform does not exist in the platforms yaml configuration

  • OSError – If checkout script execution fails

Note

For a bare-metal build, a parallel checkout is the default For a container build, a non-parallel checkout is the default

fre.make.create_checkout_script.container_checkout_write(model_yaml: freyaml, src_dir: str, tmp_dir: str, jobs: str, parallel_cmd: str)

This function extracts information from resolved/loaded yaml configuration and generates a checkout script in the ./tmp directory for a containerized build. The script is then copied to and run in the container during the image build.

Parameters:
  • model_yaml (yamlfre.freyaml) – FRE YAML class object containing parsed and validated yaml dictionary compilation information

  • src_dir (str) – Internal container path for source code, corresponding to the ‘modelRoot’ key defined in the platform yaml

  • tmp_dir (str) – Temporary directory that hosts the created checkout script, before being copied to the cointainer

  • jobs (str) – Number of git submodules to clone simultaneously

  • parallel_cmd (str) – Container builds are not parallelized; use “” for non-parallel checkouts