From 43a1bc23bd1a7d2799d6f60773f315657841b4b4 Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Tue, 8 Mar 2022 22:59:22 +0900 Subject: [PATCH] Added CI discussion Signed-off-by: Cristian Le --- docs/CI.md | 75 ++++++++++++++++++++++++++++++++++++++++++ docs/CI_TeamCity.md | 47 ++++++++++++++++++++++++++ docs/Yocto(BitBake).md | 6 ++++ 3 files changed, 128 insertions(+) create mode 100644 docs/CI.md create mode 100644 docs/CI_TeamCity.md create mode 100644 docs/Yocto(BitBake).md diff --git a/docs/CI.md b/docs/CI.md new file mode 100644 index 0000000..4aa3e9f --- /dev/null +++ b/docs/CI.md @@ -0,0 +1,75 @@ +# Continuous Integration (CI) for AsteroidOS + +In the various repositories managed by AsteroidOS, we provide a few portable CI configurations that you can use to setup +your own CI server. We offer two CI configurations: + +- Monolith (this repository): Contains all CI subprojects +- Individual (project's repository): Links to/Contains the minimum parent CI projects to build the project + +AsteroidOS relies on CI to: + +- Build and deploy the images for each smartwatch at https://asteroidos.org/install/ +- (TBD) Update the apps managed by AsteroidOS and deploy them to AsteroidOS Updater (TBD) +- Manage and provide a public bitbake cache server to speed up the compilation time, both for our developers and anyone + who wishes to contribute + +Due to the complex interconnection of the AsteroidOS project, for a bare minimum CI setup, we require that: + +| Requirements | TeamCity | +|---------------------------------|:--------:| +| Trigger on third-party commits | V | +| Bootstrap configurations [1] | V | +| Trigger on changes of subfolder | V | +| Trigger on commit message | V | + +[1] You can setup/manage your own CI server by simply pointing to your own forks of the project. + +| | TeamCity | +|-------------------------|---------------------------------------------------------------------------------------------------| +| Maintainers | [LecrisUT](https://github.com/LecrisUT) | +| Open Source | Closed Source | +| Main Advantage | - Can be setup on local development setup
- Can interconnect with external TeamCity servers | +| Limitations | - 3 Free Build agents
- 100 Build Configurations | +| Docker integration | - Can be run without Docker | +| Integration with Github | - Minimal
- Lacks PullRequest build approval
- Lacks a proper Github app | +| Other noteworthy points | - Integrates with some Cloud agents | + +-------------- + +## Available CI workflows + +### Build device + +Builds a specific device's image and deploys it to https://asteroidos.org/install/. Triggerred by: + +- Changes in files at `meta-smartwatch/meta-$DEVICE` if the commit comment does not start with `[NoBuild]:` +- Commits starting with a comma separated list formatted like `$DEVICE1,$DEVICE2:`, where the relevant device is in the + list + +### Rebuild device (from scratch) + +Builds a specific device's image without using any `sstate-cache`. Triggerred by: + +- Commits starting with `[Rebuild:$DEVICE]:` on either `meta-smarwatch` or `meta-asteroid` +- Trigger by `Rebuild all devices` + +### Build package + +Builds a specific app's package and deploys it to the package repository connected to AsteroidOS Updated (TBD). +Triggerred by: + +- Changes in files at `meta-asteroid-apps/$PACKAGE` if the commit comment does not start with `[NoBuild]:` +- Changes to the repository managing the specific package + +### Build all devices + +Triggers a `Build device` for all smartwatches. Triggerred by: + +- Daily check if any of the `Build package` was triggerred +- Weekly schedule if that week there were no local contributions + +### Rebuild all devices + +Triggers a `Rebuild device (from scratch)` for all smarwatches. Triggerred by: + +- Monthly schedule \ No newline at end of file diff --git a/docs/CI_TeamCity.md b/docs/CI_TeamCity.md new file mode 100644 index 0000000..575fc0a --- /dev/null +++ b/docs/CI_TeamCity.md @@ -0,0 +1,47 @@ +# TeamCity CI setup + +This setup was constructed so that it can be easily ported by anyone who want to contribute and develop on their own +forks. Just follow these steps to get your CI server up and running (order of opperations is important): + +1. Install a local TeamCity server +2. Create a new project named `Asteroid` pointing to this repository and the specific branch you wish to track and/or + push these settings to +3. Configure the Context Parameters +4. Resolve the red errors related to the missing authenthication by providing a Github access token with at least read + permission to public repositories. +5. (optional) Change the settings repository to point to the project one. + +Feel free to change, archive, delete any of the sub-projects to fit your needs and write access. + +### Context Parameters + +For a full list check `.teamcity/$Project/Settings.kt`. + +- `Fork`: [AsteroidOS]
+The fork that should be attached to the current CI project. +- `Devices`: [sturgeon,catfish]
+A comma-separated list of devices you wish to manage. +- `Packages`: [asteroid-launcher]
+A comma-separated list of Asteroid packages you wish to manage. +- (optional) `Upstream`: [AsteroidOS]
+The upstream repository of all the other parent/child projects. +- (optional) `DeploySstate`: [false]
+Enables uploading to the `sstate-cache` server. +- (optional) `PullRequests`: [false]
+Enables tracking pull requests on `fork`. +- (optional) `CommitStatus`: [false]
+Enables pushing commit status to the `fork`. +- (optional) `CommitUser`: [`Fork`]
+The commit user pushing commit status. +*Required if `CommitStatus == true`*. + +### Other configurations + +- (optional) `$Project/SSH Keys/Sstate Server Key`
+The SSH key used to upload to your own `sstate-cache` server. +*Required if `DeploySstate == true`*. +- (optional) `$Project/Versioned Settings/Tokens/credentialsJSON:0b803d82-f0a8-42ee-b8f9-0fca109a14ab`
+Github OAuth token for `CommitUser` or your account. +*Required if `PullRequests || CommitStatus == true`*. + +### Other Notes \ No newline at end of file diff --git a/docs/Yocto(BitBake).md b/docs/Yocto(BitBake).md new file mode 100644 index 0000000..f5994c3 --- /dev/null +++ b/docs/Yocto(BitBake).md @@ -0,0 +1,6 @@ +# Setting up Yocto (Bitbake) development environment + +## Sstate-cache server + +AsteroidOS provides a public [`sstate-cache` server](https://sstate.asteroid.org) that you can use to speed up your +first time compilation (2 hours -> 10 min). \ No newline at end of file