-
Notifications
You must be signed in to change notification settings - Fork 1.5k
CI: Improvement to speed up compilation and reduce download errors. #13301
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
Conversation
4ac123a to
7f78e63
Compare
|
Do GitHub Actions download packages each time they run? If so, can the packages be downloaded once and archived somehow, so they don't have to be re-downloaded every time the Action runs? Is that what this PR is doing? |
|
Thanks @simbit18 . Let me test on our internal CI. |
|
Let's use as an example architectures with expressif SoC. For these jobs Linux (risc-v-01), Linux (xtensa-01), Linux (xtensa-02) and for board name:board configuration with the espressif ESP-HAL-3RDPARTY is cloned and then cleaned up each time even if it doesn't change until the job is finished. So in this case but in general this logic slows down the compilation and can be more prone to network error resulting in workflow failure. This is why I thought of a temporary storage folder in this PR. In the case of compiling on GITHUB at each restart of the workflow for each job it does these steps: 1 create the temporary storage folder the previous workflow does not change (logic of moving to branch-commit). In the case of local build the previous workflow does not change (logic of moving to branch-commit). Rightly as @tmedicci noted, since the espressif/ESP-HAL-3RDPARTY is not in the nuttx tree and we can't be aware of changes in the repository (logic of moving to branch-commit) users who don't update the configuration without the -S option might have an outdated repository locally. Time comparison https://github.com/apache/nuttx/actions/runs/10730602568/usage With this PR |
Yeah, this is an important improvement for our CI! |
Just to make sure, do you agree about the problem of the not-in-sync repository? Are you planning to implement a workaround? |
HI @tmedicci only locally if user does not use ./tools/configure.sh -S esp32-devkitc:<config_name> could happen. When I have time I will see if it is possible to find solution to correct this case. Of course comments and suggestions are welcome !!! :) |
7f78e63 to
65b0085
Compare
|
Updated changed logic -S now creates the nxtmpdir folder for third-party packages. .github/workflows/build.yml: Hi @tmedicci you can run a test on your internal CI. |
Hi @simbit18, thanks for updating it. Particularly, I liked the solution of creating the temp folder only if |
Hi @tmedicci I will also try to check the commit of the HAL but I think to make it generic it needs to be transferred to a shell scripting. The idea of speeding up the NuttX build and using the tmp folder is not only about esp HAL but in general in all parts where git and curl are used. Because surely the archs, boards and configs will increase in the future, and with them the time to finish jobs will also increase. |
I agree! This is a starting point. From my perspective, it's totally acceptable to check the git version of the HAL in the makefile as the starting point ;) |
4c2669d to
fa7efca
Compare
|
HI @tmedicci @xiaoxiang781216 I simplified by adding these macros to config.mk. @tmedicci Now there is also version control. |
That's fine, thanks! I will test it in our internal CI |
| chip/$(ESP_HAL_3RDPARTY_REPO): | ||
| $(Q) echo "Cloning Espressif HAL for 3rd Party Platforms" | ||
| $(Q) git clone --quiet $(ESP_HAL_3RDPARTY_URL) chip/$(ESP_HAL_3RDPARTY_REPO) | ||
| ifeq ($(STORAGETMP),y) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we simply call one function with the enough arguments, which could do all thing internally?
24f9514 to
f9b6f2d
Compare
|
HI @tmedicci @xiaoxiang781216 I updated the commit and also added arch/risc-v/src/esp32c3-legacy/Make.defs |
tmedicci
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
eaee072 to
d3316d2
Compare
jerpelea
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add commit messages
Configuration/Tool: stm32f4discovery/nsh,CONFIG_ARM_TOOLCHAIN_GNU_EABI
|
d3316d2 to
4f1cc9b
Compare
Hi @jerpelea after passing the CI I will squash the commits into a single commit with message. |
The simple improvement is designed to speed up compilation and reduce download errors on github and local. Added a folder nxtmpdir for storing third-party packages nuttxworkspace | |- nuttx |- apps |- nxtmpdir tools/Unix.mk: added export NXTMPDIR := $(WSDIR)/nxtmpdir tools/configure.sh: added option -S creates the nxtmpdir folder for third-party packages. tools/Config.mk: added macro CLONE - Git clone repository. CHECK_COMMITSHA - Check if the branch contains the commit SHA-1. tools/testbuild.sh: added option -S For now I added in the folder this package ESP_HAL_3RDPARTY_URL = https://github.com/espressif/esp-hal-3rdparty.git ARCH arch/xtensa/src/esp32/Make.defs arch/xtensa/src/esp32s2/Make.defs arch/xtensa/src/esp32s3/Make.defs arch/risc-v/src/common/espressif/Make.defs arch/risc-v/src/esp32c3-legacy/Make.defs but you can also add other packages (maybe also of apps)
4f1cc9b to
a152c7a
Compare
|
@jerpelea done |
This PR syncs the CI Build Workflow `build.yml` from `nuttx` repo to `nuttx-apps`. The updated `build.yml` consolidates these changes: - apache/nuttx#13301 - apache/nuttx#13806 - apache/nuttx#13862 `build.yml` from `nuttx` repo was slightly modified for `nuttx-apps`: - All References to `apache/nuttx/.../arch.yml` were changed to `apache/nuttx-apps/.../arch.yml` (we decouple them so they are easier to update) - Removed `pull_request > paths-ignore` and `push > paths-ignore` (following the existing convention)
This PR syncs the CI Build Workflow `build.yml` from `nuttx` repo to `nuttx-apps`. The updated `build.yml` consolidates these changes: - apache/nuttx#13301 - apache/nuttx#13806 - apache/nuttx#13862 `build.yml` from `nuttx` repo was slightly modified for `nuttx-apps`: - All References to `apache/nuttx/.../arch.yml` were changed to `apache/nuttx-apps/.../arch.yml` (we decouple them so they are easier to update) - Removed `pull_request > paths-ignore` and `push > paths-ignore` (following the existing convention)




Summary
The simple improvement is designed to speed up compilation and reduce download errors on github and local.
Added a folder nxtmpdir for storing third-party packages
nuttxworkspace
|
|- nuttx
|- apps
|- nxtmpdir
tools/Unix.mk:
added nxtmpdir folder creation
tools/configure.sh:
added option -S creates the nxtmpdir folder for third-party packages.
For now I added in the folder this package
ESP_HAL_3RDPARTY_URL = https://github.com/espressif/esp-hal-3rdparty.git
ARCH
arch/xtensa/src/esp32/Make.defs
arch/xtensa/src/esp32s2/Make.defs
arch/xtensa/src/esp32s3/Make.defs
arch/risc-v/src/common/espressif/Make.defs
arch/risc-v/src/esp32c3-legacy/Make.defs
but you can also add other packages (maybe also of apps)
@no1wudi @tmedicci
Impact
There should be no impact.
Testing
CI