|
1 |
| -## Startup Script of Compute Engine |
2 |
| - |
3 |
| -A startup script is a file that contains commands that run when a virtual |
4 |
| -machine instance boots. Compute Engine provides support for running startup |
5 |
| -scripts on Linux and Windows virtual machines. |
6 |
| - |
7 |
| -### Create a virtual machine instance using startup script |
8 |
| - |
9 |
| -The `startup-script.sh` could be used as the startup script of a virtual machine |
10 |
| -instance which run Matter coverage report and publish the result via an App |
11 |
| -Engine service. |
12 |
| - |
13 |
| -You can create a virtual machine instance by using the gcloud compute instances |
14 |
| -create command with the `--metadata-from-file` flag. |
15 |
| - |
16 |
| -``` |
17 |
| -gcloud compute instances create VM_NAME \ |
18 |
| - --image-project=PROJECT_NAME \ |
19 |
| - --image-family=ubuntu-22.04 \ |
20 |
| - --metadata-from-file=startup-script=FILE_PATH |
21 |
| -``` |
22 |
| - |
23 |
| -Replace the following: |
24 |
| - |
25 |
| -`PROJECT_NAME`: the name of the project host the virtual machine instance |
26 |
| - |
27 |
| -`VM_NAME`: the name of the virtual machine instance |
28 |
| - |
29 |
| -`FILE_PATH`: the relative path to the startup script file |
| 1 | +## Google Cloud Compute Engine |
| 2 | + |
| 3 | +We have setup a Virtual Machine on |
| 4 | +[Google Cloud](https://cloud.google.com/products/compute) to generate both the |
| 5 | +[Matter SDK coverage report](https://matter-build-automation.ue.r.appspot.com) |
| 6 | +and the |
| 7 | +[Matter SDK Conformance report](https://matter-build-automation.ue.r.appspot.com/conformance_report.html). |
| 8 | + |
| 9 | +### The Matter SDK Virtual Machine and the "startup-script.sh" |
| 10 | + |
| 11 | +We created a VM named `matter-build-coverage`. The machine configuration is |
| 12 | +located |
| 13 | +[here](https://pantheon.corp.google.com/compute/instancesDetail/zones/us-central1-a/instances/matter-build-coverage?inv=1&invt=AbnAfg&project=matter-build-automation). |
| 14 | +Reach out to Google team members if you need to make changes to this VM. |
| 15 | + |
| 16 | +This virtual machine is scheduled to run daily, starting at 11:45PM and stopping |
| 17 | +at 2am. During boot, the machine runs the `startup-script.sh`. |
| 18 | + |
| 19 | +The `startup-script.sh` script contains commands to checkout the SDK repository |
| 20 | +and create both the SDK coverage report and conformance report. The startup |
| 21 | +script uses `scripts/build_coverage.sh` to generate the coverage report and |
| 22 | +`scripts/examples/conformance_report.py` to generate the conformance report. The |
| 23 | +resulting HTML files are published via an App Engine service and available here |
| 24 | +([coverage report](https://matter-build-automation.ue.r.appspot.com/), |
| 25 | +[conformance report](https://matter-build-automation.ue.r.appspot.com/conformance_report.html)). |
| 26 | + |
| 27 | +### Making Changes to "startup-script.sh" |
| 28 | + |
| 29 | +If you make changes to `startup-script.sh`, make sure you go to the |
| 30 | +[VM configuration](https://pantheon.corp.google.com/compute/instancesDetail/zones/us-central1-a/instances/matter-build-coverage?inv=1&invt=AbnAfg&project=matter-build-automation), |
| 31 | +click `edit` and update the startup script in the `Automation` text box, to |
| 32 | +reflect your changes. The script in the Matter SDK repo is just a copy of the |
| 33 | +configuration in the VM. |
0 commit comments