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.

The checkout script will clone component repositories defined in the compile YAML to build the model.

Note, a bare-metal build defaults to a parallel checkout. A container build defaults to a non-parallel checkout.

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

This function baremetal_checkout_write is called by checkout_create in order to

  • Extract compilation specifications from the parsed YAML configuration

  • Generate a checkout script to the source directory. The source directory is defined within the ‘modelRoot’ variable in the “platforms” section of the combined YAML

Parameters:
  • model_yaml (yamlfre.freyaml) – “freyaml” class object containing a parsed and validated yaml dictionary containing the “compile” specification

  • src_dir (str) – Absolute directory path to git clone the source code

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

  • parallel_cmd (str) – Set to “ &” for parallel checkouts and “” for non-parallel checkouts

  • execute (bool) – If True, run the generated checkout.sh

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

Calls baremetal_checkout_write or container_checkout_write to create checkout.sh for baremetal or container builds, respectively.

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

  • platform (tuple) – FRE platform(s) that are defined in the platforms.yaml

  • target (tuple) – Predefined FRE target(s)

  • no_parallel_checkout (bool) – Option to disable parallel checkouts

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

  • execute (bool) – If True, run checkout.sh

  • force_checkout (bool) – If True, for bare-metal build: add timestamp to source directory and create a new checkout script If True, for container build: overwrite locally existing checkout script before COPY-ing to the container image filesystem

Raises:
  • ValueError

    • If ‘njobs’ is not an integer

    • If ‘platform’ does not exist in the platforms.yaml configuration

  • OSError – If executing checkout.sh returns an error

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

This function container_checkout_write is called by checkout_create in order to

  • Extract compilation specifications from the parsed YAML configuration

  • Generate a checkout script in a local ./tmp directory, where it will later be copied to the directory of the container image filesystem for execution

Parameters:
  • model_yaml (yamlfre.freyaml) – “freyaml” class object containing a parsed and validated yaml dictionary containing the “compile” specification

  • src_dir (str) – Internal path for source code in the running container. The source directory is defined within the ‘modelRoot’ variable in the “platforms” section of the combined YAML

  • tmp_dir (str) – Temporary directory (outside of container) that hosts the created checkout script

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

  • parallel_cmd (str) – Since container builds are not parallelized, set to “”