runs-on/action
RunsOn Action for magic caching, and more. This action is required if you are using the magic caching feature of RunsOn (extras=s3-cache job label).
Usage
jobs:
build:
runs-on: runs-on=${{ github.run_id }}/runner=2cpu-linux-x64/extras=s3-cache
steps:
- uses: runs-on/action@v1
- other steps
Options
show_env
Show all environment variables available to actions (used for debugging purposes).
jobs:
build:
runs-on: runs-on=${{ github.run_id }}/runner=2cpu-linux-x64/extras=s3-cache
steps:
- uses: runs-on/action@v1
with:
show_env: true
show_costs
Displays how much it cost to run that workflow job. Uses https://ec2-pricing.runs-on.com to get accurate data, for both on-demand and spot pricing across all regions and availability zones.
Beta: also compares with similar machine on GitHub.
Example output in the post-step:
| metric | value |
| ---------------------- | --------------- |
| Instance Type | m7i-flex.large |
| Instance Lifecycle | on-demand |
| Region | us-east-1 |
| Duration | 2.06 minutes |
| Cost | $0.0040 |
| GitHub equivalent cost | $0.0240 |
| Savings | $0.0200 (82.8%) |
metrics
Send additional metrics using CloudWatch agent.
Supported metrics:
| Metric Type |
Available Metrics |
cpu |
usage_user, usage_system |
network |
bytes_recv, bytes_sent |
memory |
used_percent |
disk |
used_percent, inodes_used |
io |
io_time, reads, writes |
jobs:
build:
runs-on: runs-on=${{ github.run_id }}/runner=2cpu-linux-x64/extras=s3-cache
steps:
- uses: runs-on/action@v1
with:
metrics: cpu,network,memory,disk,io
The action will display live metrics with sparklines and charts in the post-execution summary.
Example output:
๐ CPU User:
100.0 โค
87.5 โค
75.0 โค
62.5 โค
50.0 โค
37.5 โค
25.0 โค
12.5 โผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
0.0 โค
CPU User (Percent)
Stats: min:7.4 avg:8.3 max:8.8 Percent
๐ CPU System:
100.0 โค
87.5 โค
75.0 โค
62.5 โค
50.0 โค
37.5 โค
25.0 โค โญโโโโโโโโโโโโโโฎ โญโโโโโโโโโโโโโโโ
12.5 โผโโโโโโโโฏ โฐโโโโโโโโโโโโโโโโโโโโโโฏ
0.0 โค
CPU System (Percent)
Stats: min:16.8 avg:18.7 max:20.7 Percent
๐ Network Received:
34314 โผโฎ
31245 โคโฐโฎ
28175 โค โฐโฎ
25106 โค โฐโโฎ โญโโโฎ
22036 โค โฐโฎ โญโโฏ โฐโฎ
18967 โค โฐโฎ โญโโฏ โฐโโฎ โญโโโโฎ
15898 โค โฐโฎ โญโฏ โฐโโฎ โญโโโฏ โฐโโโโฎ
12828 โค โฐโโโฏ โฐโฎ โญโโโฏ โฐโโโโโโโโฎ
9759 โค โฐโโฏ โฐโโโโโโโโโโ
Network Received (Bytes)
Stats: min:9759.0 avg:16461.6 max:34314.0 Bytes
๐ Network Sent:
51281 โผโฎ
46447 โคโฐโฎ
41614 โค โฐโฎ
36780 โค โฐโฎ
31946 โค โฐโโฎ
27113 โค โฐโฎ โญโฎ
22279 โค โฐโฎ โญโโโโโฏโฐโโโฎ โญโโโโโโฎ
17446 โค โฐโโโโฏ โฐโโโฎ โญโโโโฏ โฐโโโโโโโฎ
12612 โค โฐโโโโฏ โฐโโโโโโโโโโโโโโ
Network Sent (Bytes)
Stats: min:12612.0 avg:22532.8 max:51281.0 Bytes
๐ Memory Used:
100.0 โค
87.5 โค
75.0 โค
62.5 โค
50.0 โค
Stats: min:504.0 avg:948.6 max:1281.0 ms
๐ Disk Reads:
25.0 โผโฎ
21.9 โคโฐโฎ
18.8 โค โฐโโฎ
15.6 โค โฐโฎ
12.5 โค โฐโฎ
9.4 โค โฐโฎ โญ
6.3 โค โฐโฎ โญโโโฏ
3.2 โค โฐโโโโโฎ โญโโโโโโโโฎ โญโโโฏ
0.0 โค โฐโโโโโโโโโฏ โฐโโโโโโโโโโโโโโโโโโโโโโโฏ
Disk Reads (Ops/s)
Stats: min:0.0 avg:5.0 max:25.0 Ops/s
๐ Disk Writes:
5973 โค โญโฎ
5500 โค โญโฏโฐโฎ
5028 โผโฎ โญโฏ โฐโฎ โญโโโโฎ โญ
4555 โคโฐโฎ โญโฏ โฐโฎ โญโโโฏ โฐโโฎ โญโโฏ
4083 โค โฐโฎ โญโฏ โฐโโฎ โญโโโฏ โฐโฎ โญโโฏ
3610 โค โฐโโฎ โญโฏ โฐโฎ โญโโโฏ โฐโโฎ โญโโฏ
3138 โค โฐโฎ โญโฏ โฐโฎ โญโโโโฏ โฐโโโโฏ
2665 โค โฐโฎ โญโฏ โฐโโฏ
2193 โค โฐโโโฏ
Disk Writes (Ops/s)
Stats: min:2040.0 avg:4180.9 max:6026.0 Ops/s
sccache
Only available for Linux runners.
Configures sccache so that you can cache the compilation of C/C++ code, Rust, as well as NVIDIA's CUDA.
The only parameter it can take for now is s3, which will auto-configure the S3 cache backend for sccache, using the RunsOn S3 cache bucket that comes for free (with crazy speed and unlimited storage) with your RunsOn installation.
Example:
jobs:
build:
runs-on: runs-on=${{ github.run_id }}/runner=2cpu-linux-x64/extras=s3-cache
steps:
- uses: runs-on/action@v1
with:
sccache: s3
- uses: mozilla-actions/sccache-action@v0.0.9
- run: # your slow rust compilation
What this does under the hood is the equivalent of:
echo "SCCACHE_GHA_ENABLED=false" >> $GITHUB_ENV
echo "SCCACHE_BUCKET=${{ env.RUNS_ON_S3_BUCKET_CACHE}}" >> $GITHUB_ENV
echo "SCCACHE_REGION=${{ env.RUNS_ON_AWS_REGION}}" >> $GITHUB_ENV
echo "SCCACHE_S3_KEY_PREFIX=cache/sccache" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
Development
Make your source code changes in a commit, then push the updated binaries and JS files in a separate commit:
make release
Future work
This action will probably host a few other features such as:
- enabling/disabling SSM agent ?