Commit Graph

28 Commits

Author SHA1 Message Date
jonathanmetzman 370fb73473
[build][infra] Improve build functions. (#6296)
Important functional changes involve mostly improvements to
the command line scripts (this doesn't affect the build infra, only
local use):

1. Make sure scripts use the same builder as builds requested by infra, otherwise builds
will be very slow and will fail for larger projects.
2. Allow users to specify --test-images to use base images with suffix "-testing"
3. Allow script users to specify --parallel for parallel builds.
4. Allow script users to specify --testing so that builds are uploaded to testing buckets.
5. Allow script users to specify --branch so that builds use specified branch instead of master.
6. Clone oss-fuzz with depth 1 for improved speed and space usage.
7. Use logging instead of writing to stderr or print.
8. Allow scripts to accept multiple projects.
9. Allow script to keep executing after failure to get build steps.
10. Change scripts to use python3.
11. Tag more so builds are easier to query.
12. Log the gcb page for each build.

Other changes include major refactoring:

1. Don't construct image names from scratch using format strings each time they are used.
Provide a helper function for this.
2. Provide a helper function,  get_env instead of constructing the env from scratch each time.
3. Move compile step into its own function: get_compile_step.
4. Move upload steps into their own helper function get_upload_steps.
5. Don't misuse the name image_project when we really mean cloud project.
6. Move cleanup step into its own helper function: get_cleanup_step.
7. Exit with returncode of main function from build_project.
8. Add unittests for build_project.
9. Make request_build share run_build code with build_project.
10. Use proper spacing in comments.
11. Test builds other than libfuzzer-ASAN-x86_64. Test other sanitizers, fuzzers and architectures
12. Make build_and_run_coverage share more code with build_project.
13. Move tests for build_and_run_coverage_test.py out of requst_coverage_test.py into their own file.
14. Use single quotes for strings.
15. Store state for a build in Build object instead of passing it everywhere.
16. Don't abuse project_yaml dict for storing project state. Use a Project object instead.
17. Better variable naming.
18. Use more classes instead of passing around arguments.
19. Use more f-strings.
20. Make scripts share main function.
21. Begin comments with uppercase and end with period.
22. Don't import functions or classes as dictated by style guide.
23. Share more test code in test_utils

Related: #6180.
2021-08-25 11:44:52 -07:00
jonathanmetzman e407f54e61
[infra][build] Switch to f-strings. (#6182) 2021-08-10 10:48:16 -07:00
Oliver Chang 3022776970
Revert "Bring back build status page fix until quota issues are resolved. (#5997)" (#6008)
This reverts commit e10f1658fa.
2021-07-08 10:32:36 +10:00
Abhishek Arya e10f1658fa
Bring back build status page fix until quota issues are resolved. (#5997) 2021-07-05 10:15:45 -07:00
DavidKorczynski d6970e868f
infra: Remove unused import from update_build_status (#5981)
In this commit 0370821e39 the use of the `time` import was removed. This causes the CI to complain about `infra/build/functions/update_build_status.py:21:0: W0611: Unused import time (unused-import)` here https://github.com/google/oss-fuzz/pull/5980/checks?check_run_id=2941631092
2021-06-29 12:29:35 +00:00
Abhishek Arya 0370821e39
Revert rate limits in update_build_status. 2021-06-28 21:30:04 -07:00
Abhishek Arya 53eff02879
Update update_build_status.py 2021-06-25 17:43:38 -07:00
Abhishek Arya a5822bb2ff
Update update_build_status.py 2021-06-25 17:09:42 -07:00
Abhishek Arya 00bbfdb5e1
Update update_build_status.py 2021-06-25 16:56:01 -07:00
Abhishek Arya 7d93e152de
Update update_build_status.py 2021-06-25 13:19:33 -07:00
Abhishek Arya ea06882e92
Update update_build_status.py 2021-06-25 13:16:47 -07:00
Abhishek Arya 77211e836c
Update update_build_status.py 2021-06-25 12:46:09 -07:00
Abhishek Arya 3096b90ca2
Update update_build_status.py 2021-06-25 12:04:37 -07:00
Abhishek Arya ba0a288c6e
Update update_build_status.py 2021-06-25 11:40:44 -07:00
Abhishek Arya 7e61f5509e
Update update_build_status.py 2021-06-25 11:06:47 -07:00
Abhishek Arya 3680920a30
Update update_build_status.py 2021-06-25 10:38:19 -07:00
Abhishek Arya 5fcb499c68
Decrease number of build logs to avoid rate limits. (#5973) 2021-06-25 10:18:38 -07:00
Abhishek Arya 867646da2d
Update update_build_status.py 2021-06-25 09:43:11 -07:00
Abhishek Arya 3b19d9fc18
Update update_build_status.py 2021-06-25 09:29:33 -07:00
Abhishek Arya db33cc2c38
Update update_build_status.py 2021-06-25 09:04:31 -07:00
Abhishek Arya 13a076b275
Reduce build status workers to see if quota issue resolve. 2021-06-25 08:42:43 -07:00
Fabian Meumertzheim 6ca344a446
Generate badges for projects without coverage (#5459)
Generate badges also for projects with no coverage builds at all (e.g.
JVM and Python projects). For these projects, the badge only has the two
possible states "build passing" and "build failing".
2021-03-21 18:52:02 -07:00
Oliver Chang 65a83e2125
Split up builds status function. (#4261)
- Split into separate invocations for fuzzing, coverage, and badges.
- Also use threads to speed things up.
2020-08-06 13:59:08 +10:00
Oliver Chang 909db51a15
More build infra cleanup. (#4252)
- Deleted unused code.
- Consolidate some modules.
2020-08-06 09:36:47 +10:00
kabeer27 341b3d836a
Display historical logs ui change (#4197)
* Initial UI Change to display historical logs

* Minor changes

* More formatting changes

* Adding license header

* Changes, take a look Oliver

* Changes for handling empty build history/ no last successful build

* Reverting the logs folder path from /logs/log to /log

* Merged to latest master and other chnages to template

* Changing backend to reflect build history

* Fixing order of query

* Removed last build status

* More changes

* Adding unit tests and fixes found by unit testing

* Fixing lint errors

* Added more unit tests and fixed typos and formatting

* Fixing comment caps

* Minor formatting issue

Co-authored-by: Oliver Chang <oliverchang@users.noreply.github.com>
2020-07-30 16:20:22 +10:00
Oliver Chang ccb5821f51
Fix build status update. (#4224)
Check for valid statuses rather than only excluding the WORKING status.
There are other failure statuses that need to be accounted for (e.g.
EXPIRED).
2020-07-30 15:10:52 +10:00
Oliver Chang 4e2a7c07e5
Many build infra fixes. (#4209)
- Remove base image project argument from deploy.sh. Deploy all
  functions to the main oss-fuzz image.
- Reduce max instances of functions to 1 to avoid rate limiting issues.
- Fix missing ndb context initialization in request_build.py
- Fix incorrect tags in BuildHistory entities. "-" was doubled.
- Fix base build deployment with incorrect schedule variable.
- Add scripts for requesting builds locally.
2020-07-29 12:39:49 +10:00
kabeer27 9d2381a621
Initial integration of builds_status (#4175) 2020-07-23 16:23:31 +10:00