Skip to content

Commit

Permalink
Restyle
Browse files Browse the repository at this point in the history
  • Loading branch information
aBozowski committed Jun 2, 2022
1 parent f7b7222 commit 126ff6a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
36 changes: 26 additions & 10 deletions examples/chef/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,21 @@ Run `chef.py -h` to see the available commands

### zzz_generated

To eliminate a dependnecy on ZAP in CI jobs, all chef examples found in `examples/chef/devices` must have their output from the ZAP tool cached in `examples/chef/zzz_generated`.
To eliminate a dependnecy on ZAP in CI jobs, all chef examples found in
`examples/chef/devices` must have their output from the ZAP tool cached in
`examples/chef/zzz_generated`.

To generate the cache, one may execute chef with the option `--generate_zzz`. This will run ZAP for all devices in `examples/chef/devices` and place the output into the appropriate directory structure.
To generate the cache, one may execute chef with the option `--generate_zzz`.
This will run ZAP for all devices in `examples/chef/devices` and place the
output into the appropriate directory structure.

Other than the output from the ZAP tool, the cache directory contains two additional files for each device:
- `INPUTMD5.txt` contains the md5 hex digest of the ZAP file used to generate the directory.
- `ZAPSHA.txt` contains the commit of ZAP in the user's tree when the directory was generated.
Other than the output from the ZAP tool, the cache directory contains two
additional files for each device:

- `INPUTMD5.txt` contains the md5 hex digest of the ZAP file used to generate
the directory.
- `ZAPSHA.txt` contains the commit of ZAP in the user's tree when the
directory was generated.

```
zzz_generated/
Expand All @@ -82,7 +90,9 @@ zzz_generated/
└── ZAPSHA.txt
```

These additional files will be used by the CI jobs to validate whether the cache must be regenerated i.e. regeneration is needed when ZAP or the input ZAP files change.
These additional files will be used by the CI jobs to validate whether the cache
must be regenerated i.e. regeneration is needed when ZAP or the input ZAP files
change.

### Workflow

Expand All @@ -92,14 +102,20 @@ All CI jobs for chef can be found in `.github/workflows/chef.yaml`.

The workflow begins by calling chef with `--validate_zzz`.

`--validate_zzz` will recalculate the current ZAP commit and the md5 of all example ZAP files and compare with what is committed to `zzz_generated`.
`--validate_zzz` will recalculate the current ZAP commit and the md5 of all
example ZAP files and compare with what is committed to `zzz_generated`.

If the validation job fails, it will provide instructions to repair `zzz_generated` and no builds will run.
If the validation job fails, it will provide instructions to repair
`zzz_generated` and no builds will run.

#### Build

Once the validation job is complete, there is a separate job for each platform, which run in parallel.
Once the validation job is complete, there is a separate job for each platform,
which run in parallel.

These jobs use a platform-specific image with base `chip-build`.

The build jobs call chef with the options `--ci -t <PLATFORM>`. The `--ci` option will execute builds for all devices specified in `_CI_ALLOW_LIST` defined in `chef.py` (so long as these devices are also in `/devices`) on the specified platform.
The build jobs call chef with the options `--ci -t <PLATFORM>`. The `--ci`
option will execute builds for all devices specified in `_CI_ALLOW_LIST` defined
in `chef.py` (so long as these devices are also in `/devices`) on the specified
platform.
2 changes: 1 addition & 1 deletion examples/chef/chef.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def check_zap() -> str:
"""
shell.run_cmd(f"cd {_REPO_BASE_PATH}")
branch = shell.run_cmd("git rev-parse --abbrev-ref HEAD",
return_cmd_output=True)
return_cmd_output=True)
branch = branch.replace("\n", "")
command = f"git ls-tree {branch} third_party/zap/repo"
zap_commit = shell.run_cmd(command, return_cmd_output=True)
Expand Down

0 comments on commit 126ff6a

Please sign in to comment.