Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/mozilla/neqo into auto-tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
mxinden committed May 7, 2024
2 parents 1bfd2f5 + bb88aab commit 167d93f
Show file tree
Hide file tree
Showing 53 changed files with 981 additions and 468 deletions.
206 changes: 206 additions & 0 deletions .github/actions/maximize-build-space/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
# https://github.com/easimon/maximize-build-space/blob/fadc013e293a3453768b4ddb9db8c85104752807/action.yml

name: 'Maximize build disk space'
description: 'Maximize the available disk space for your build job'
branding:
icon: 'crop'
color: 'orange'
inputs:
root-reserve-mb:
description: 'Space to be left free on the root filesystem, in Megabytes.'
required: false
default: '1024'
temp-reserve-mb:
description: 'Space to be left free on the temp filesystem (/mnt), in Megabytes.'
required: false
default: '100'
swap-size-mb:
description: 'Swap space to create, in Megabytes.'
required: false
default: '4096'
overprovision-lvm:
description: |
Create the LVM disk images as sparse files, making the space required for the LVM image files *appear* unused on the
hosting volumes until actually allocated. Use with care, this can lead to surprising out-of-disk-space situations.
You should prefer adjusting root-reserve-mb/temp-reserve-mb over using this option.
required: false
default: 'false'
build-mount-path:
description: 'Absolute path to the mount point where the build space will be available, defaults to $GITHUB_WORKSPACE if unset.'
required: false
build-mount-path-ownership:
description: 'Ownership of the mount point path, defaults to standard "runner" user and group.'
required: false
default: 'runner:runner'
pv-loop-path:
description: 'Absolute file path for the LVM image created on the root filesystem, the default is usually fine.'
required: false
default: '/pv.img'
tmp-pv-loop-path:
description: 'Absolute file path for the LVM image created on the temp filesystem, the default is usually fine. Must reside on /mnt'
required: false
default: '/mnt/tmp-pv.img'
remove-dotnet:
description: 'Removes .NET runtime and libraries. (frees ~17 GB)'
required: false
default: 'false'
remove-android:
description: 'Removes Android SDKs and Tools. (frees ~11 GB)'
required: false
default: 'false'
remove-haskell:
description: 'Removes GHC (Haskell) artifacts. (frees ~2.7 GB)'
required: false
default: 'false'
remove-codeql:
description: 'Removes CodeQL Action Bundles. (frees ~5.4 GB)'
required: false
default: 'false'
remove-docker-images:
description: 'Removes cached Docker images. (frees ~3 GB)'
required: false
default: 'false'
runs:
using: "composite"
steps:
- name: Disk space report before modification
shell: bash
run: |
echo "Memory and swap:"
sudo free
echo
sudo swapon --show
echo
echo "Available storage:"
sudo df -h
echo
- name: Maximize build disk space
shell: bash
run: |
set -euo pipefail
BUILD_MOUNT_PATH="${{ inputs.build-mount-path }}"
if [[ -z "${BUILD_MOUNT_PATH}" ]]; then
BUILD_MOUNT_PATH="${GITHUB_WORKSPACE}"
fi
echo "Arguments:"
echo
echo " Root reserve: ${{ inputs.root-reserve-mb }} MiB"
echo " Temp reserve: ${{ inputs.temp-reserve-mb }} MiB"
echo " Swap space: ${{ inputs.swap-size-mb }} MiB"
echo " Overprovision LVM: ${{ inputs.overprovision-lvm }}"
echo " Mount path: ${BUILD_MOUNT_PATH}"
echo " Root PV loop path: ${{ inputs.pv-loop-path }}"
echo " Temp PV loop path: ${{ inputs.tmp-pv-loop-path }}"
echo -n " Removing: "
if [[ ${{ inputs.remove-dotnet }} == 'true' ]]; then
echo -n "dotnet "
fi
if [[ ${{ inputs.remove-android }} == 'true' ]]; then
echo -n "android "
fi
if [[ ${{ inputs.remove-haskell }} == 'true' ]]; then
echo -n "haskell "
fi
if [[ ${{ inputs.remove-codeql }} == 'true' ]]; then
echo -n "codeql "
fi
if [[ ${{ inputs.remove-docker-images }} == 'true' ]]; then
echo -n "docker "
fi
echo
# store owner of $GITHUB_WORKSPACE in case the action deletes it
WORKSPACE_OWNER="$(stat -c '%U:%G' "${GITHUB_WORKSPACE}")"
# ensure mount path exists before the action
sudo mkdir -p "${BUILD_MOUNT_PATH}"
sudo find "${BUILD_MOUNT_PATH}" -maxdepth 0 ! -empty -exec echo 'WARNING: directory [{}] is not empty, data loss might occur. Content:' \; -exec ls -al "{}" \;
echo "Removing unwanted software... "
if [[ ${{ inputs.remove-dotnet }} == 'true' ]]; then
sudo rm -rf /usr/share/dotnet
fi
if [[ ${{ inputs.remove-android }} == 'true' ]]; then
sudo rm -rf /usr/local/lib/android
fi
if [[ ${{ inputs.remove-haskell }} == 'true' ]]; then
sudo rm -rf /opt/ghc
fi
if [[ ${{ inputs.remove-codeql }} == 'true' ]]; then
sudo rm -rf /opt/hostedtoolcache/CodeQL
fi
if [[ ${{ inputs.remove-docker-images }} == 'true' ]]; then
sudo docker image prune --all --force
fi
echo "... done"
VG_NAME=buildvg
# github runners have an active swap file in /mnt/swapfile
# we want to reuse the temp disk, so first unmount swap and clean the temp disk
echo "Unmounting and removing swap file."
sudo swapoff -a
sudo rm -f /mnt/swapfile
echo "Creating LVM Volume."
echo " Creating LVM PV on root fs."
# create loop pv image on root fs
ROOT_RESERVE_KB=$(expr ${{ inputs.root-reserve-mb }} \* 1024)
ROOT_FREE_KB=$(df --block-size=1024 --output=avail / | tail -1)
ROOT_LVM_SIZE_KB=$(expr $ROOT_FREE_KB - $ROOT_RESERVE_KB)
ROOT_LVM_SIZE_BYTES=$(expr $ROOT_LVM_SIZE_KB \* 1024)
sudo touch "${{ inputs.pv-loop-path }}" && sudo fallocate -z -l "${ROOT_LVM_SIZE_BYTES}" "${{ inputs.pv-loop-path }}"
export ROOT_LOOP_DEV=$(sudo losetup --find --show "${{ inputs.pv-loop-path }}")
sudo pvcreate -f "${ROOT_LOOP_DEV}"
# create pv on temp disk
echo " Creating LVM PV on temp fs."
TMP_RESERVE_KB=$(expr ${{ inputs.temp-reserve-mb }} \* 1024)
TMP_FREE_KB=$(df --block-size=1024 --output=avail /mnt | tail -1)
TMP_LVM_SIZE_KB=$(expr $TMP_FREE_KB - $TMP_RESERVE_KB)
TMP_LVM_SIZE_BYTES=$(expr $TMP_LVM_SIZE_KB \* 1024)
sudo touch "${{ inputs.tmp-pv-loop-path }}" && sudo fallocate -z -l "${TMP_LVM_SIZE_BYTES}" "${{ inputs.tmp-pv-loop-path }}"
export TMP_LOOP_DEV=$(sudo losetup --find --show "${{ inputs.tmp-pv-loop-path }}")
sudo pvcreate -f "${TMP_LOOP_DEV}"
# create volume group from these pvs
sudo vgcreate "${VG_NAME}" "${TMP_LOOP_DEV}" "${ROOT_LOOP_DEV}"
echo "Recreating swap"
# create and activate swap
sudo lvcreate -L "${{ inputs.swap-size-mb }}M" -n swap "${VG_NAME}"
sudo mkswap "/dev/mapper/${VG_NAME}-swap"
sudo swapon "/dev/mapper/${VG_NAME}-swap"
echo "Creating build volume"
# create and mount build volume
sudo lvcreate -l 100%FREE -n buildlv "${VG_NAME}"
if [[ ${{ inputs.overprovision-lvm }} == 'true' ]]; then
sudo mkfs.ext4 -m0 "/dev/mapper/${VG_NAME}-buildlv"
else
sudo mkfs.ext4 -Enodiscard -m0 "/dev/mapper/${VG_NAME}-buildlv"
fi
sudo mount "/dev/mapper/${VG_NAME}-buildlv" "${BUILD_MOUNT_PATH}"
sudo chown -R "${{ inputs.build-mount-path-ownership }}" "${BUILD_MOUNT_PATH}"
# if build mount path is a parent of $GITHUB_WORKSPACE, and has been deleted, recreate it
if [[ ! -d "${GITHUB_WORKSPACE}" ]]; then
sudo mkdir -p "${GITHUB_WORKSPACE}"
sudo chown -R "${WORKSPACE_OWNER}" "${GITHUB_WORKSPACE}"
fi
- name: Disk space report after modification
shell: bash
run: |
echo "Memory and swap:"
sudo free
echo
sudo swapon --show
echo
echo "Available storage:"
sudo df -h
4 changes: 2 additions & 2 deletions .github/actions/nss/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ runs:
#
# - name: Checkout NSPR
# if: env.BUILD_NSS == '1'
# uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
# uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
# with:
# repository: "nss-dev/nspr"
# path: ${{ github.workspace }}/nspr

# - name: Checkout NSS
# if: env.BUILD_NSS == '1'
# uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
# uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
# with:
# repository: "nss-dev/nss"
# path: ${{ github.workspace }}/nss
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/pr-comment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ inputs:
runs:
using: composite
steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
run-id: ${{ github.event.workflow_run.id }}
name: ${{ inputs.name }}
Expand All @@ -32,7 +32,7 @@ runs:
echo "[:arrow_down: Download logs]($(cat log-url))" >> contents
fi
- uses: thollander/actions-comment-pull-request@v2
- uses: thollander/actions-comment-pull-request@fabd468d3a1a0b97feee5f6b9e499eab0dd903f6 # v2.5.0
with:
filePath: contents
mode: ${{ inputs.mode }}
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/quic-interop-runner/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ runs:
using: "composite"
steps:
- name: Checkout quic-interop/quic-interop-runner repository
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
repository: 'quic-interop/quic-interop-runner'
path: 'quic-interop-runner'
Expand All @@ -40,7 +40,7 @@ runs:
sudo apt-get install -y --no-install-recommends tshark
shell: bash

- uses: actions/setup-python@v5
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: 3.8
cache: 'pip'
Expand Down Expand Up @@ -88,7 +88,7 @@ runs:
mv result.json.tmp result.json
shell: bash

- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: '${{ inputs.client }} vs. ${{ inputs.server }} results'
path: |
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/rust/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
using: composite
steps:
- name: Install Rust
uses: dtolnay/rust-toolchain@master
uses: dtolnay/rust-toolchain@bb45937a053e097f8591208d8e74c90db1873d07 # master
with:
toolchain: ${{ inputs.version }}
components: ${{ inputs.components }}
Expand All @@ -35,7 +35,7 @@ runs:
# sccache slows CI down, so we leave it disabled.
# Leaving the steps below commented out, so we can re-evaluate enabling it later.
# - name: Use sccache
# uses: mozilla-actions/[email protected]
# uses: mozilla-actions/sccache-action@2e7f9ec7921547d4b46598398ca573513895d0bd # v0.0.4

# - name: Enable sscache
# shell: bash
Expand All @@ -53,6 +53,6 @@ runs:

# Ditto for rust-cache.
# - name: Use Rust cache
# uses: Swatinem/rust-cache@v2
# uses: Swatinem/rust-cache@23bce251a8cd2ffc3c1075eaa2367cf899916d84 # v2.7.3
# with:
# cache-all-crates: "true"
2 changes: 1 addition & 1 deletion .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
run:
shell: bash
steps:
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Download actionlint
id: get_actionlint
run: bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/main/scripts/download-actionlint.bash)
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/bench.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:

steps:
- name: Checkout neqo
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- name: Checkout msquic
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
repository: microsoft/msquic
ref: main
Expand Down Expand Up @@ -244,6 +244,6 @@ jobs:
- name: Export PR comment data
uses: ./.github/actions/pr-comment-data-export
with:
name: bench
name: ${{ github.workflow }}
contents: results.md
log-url: ${{ steps.export.outputs.artifact-url }}
9 changes: 5 additions & 4 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ jobs:
matrix:
os: [ubuntu-latest, macos-14, windows-latest]
# Don't increase beyond what Firefox is currently using:
# https://firefox-source-docs.mozilla.org/writing-rust-code/update-policy.html#schedule
rust-toolchain: [1.74.0, stable, nightly]
# https://searchfox.org/mozilla-central/search?q=MINIMUM_RUST_VERSION&path=python/mozboot/mozboot/util.py
# Keep in sync with Cargo.toml
rust-toolchain: [1.76.0, stable, nightly]
type: [debug]
include:
- os: ubuntu-latest
Expand All @@ -41,7 +42,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- name: Install dependencies (Linux)
if: runner.os == 'Linux'
Expand Down Expand Up @@ -151,7 +152,7 @@ jobs:
if: success() || failure()

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@84508663e988701840491b86de86b666e8a86bed # v4.3.0
uses: codecov/codecov-action@5ecb98a3c6b747ed38dc09f787459979aebb39be # v4.3.1
with:
file: lcov.info
fail_ci_if_error: false
Expand Down
Loading

0 comments on commit 167d93f

Please sign in to comment.