diff --git a/.github/scripts/ga-create-ramdisk b/.github/scripts/ga-create-ramdisk new file mode 100755 index 0000000..8438dad --- /dev/null +++ b/.github/scripts/ga-create-ramdisk @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +## +# +# Creates a ram disk for ~ 40-80.000% (!!) faster I/O operations on slow Github CI runners +# +## + +WORKSPACE=/home/runner/work +SIZE=8G + +test -d $WORKSPACE.bak && \ + { echo 'Ramdrive script has already been run'; exit 0; } + +# Move origin workspace to .bak +sudo mv $WORKSPACE $WORKSPACE.bak +mkdir -p $WORKSPACE + +# Create the actual ramdrive partition +sudo mount -o size=$SIZE -t tmpfs none $WORKSPACE + +# Copy over all files, preserve attributes & permissions +sudo rsync -a $WORKSPACE.bak/ $WORKSPACE + +# Recreate folders that benefits from high I/O +mkdir -p $WORKSPACE/{.rush,.local,.cache,.npm} + +# Move /var/cache/apt +sudo rsync -a /var/cache/apt $WORKSPACE/.var-cache-apt +rm -rf /var/cache/apt; ln -sfv /var/cache/apt $WORKSPACE/.var-cache-apt + +# Symlink folders back to the home folder +rm -rf /home/runner/.rush; ln -sfv $WORKSPACE/.rush /home/runner/.rush +rm -rf /home/runner/.local; ln -sfv $WORKSPACE/.local /home/runner/.local +rm -rf /home/runner/.cache; ln -sfv $WORKSPACE/.cache /home/runner/.cache +rm -rf /home/runner/.npm; ln -sfv $WORKSPACE/.cache /home/runner/.npm + +echo +df -Th +echo diff --git a/.github/workflows/cron.yml b/.github/workflows/cron.yml index da8c62b..3513e24 100644 --- a/.github/workflows/cron.yml +++ b/.github/workflows/cron.yml @@ -28,13 +28,13 @@ jobs: name: job ❯ build & run runs-on: ubuntu-24.04 steps: - - name: Create Ramdrive - run: | - sudo mv /home/runner/work /home/runner/_work - mkdir -p /home/runner/work - sudo mount -o size=6G -t tmpfs none /home/runner/work - sudo rsync -a /home/runner/_work/ /home/runner/work - find . /home/runner/work + # - name: Create Ramdrive + # run: | + # sudo mv /home/runner/work /home/runner/_work + # mkdir -p /home/runner/work + # sudo mount -o size=6G -t tmpfs none /home/runner/work + # sudo rsync -a /home/runner/_work/ /home/runner/work + # find . /home/runner/work - name: Benchmark1 run: | @@ -48,6 +48,7 @@ jobs: echo -e '#!/bin/sh\nexec eatmydata /usr/bin/dpkg $@' | sudo tee /usr/local/bin/dpkg && sudo chmod +x /usr/local/bin/dpkg echo -e '#!/bin/sh\nexec eatmydata /usr/bin/apt $@' | sudo tee /usr/local/bin/apt && sudo chmod +x /usr/local/bin/apt echo -e '#!/bin/sh\nexec eatmydata /usr/bin/apt-get $@' | sudo tee /usr/local/bin/apt-get && sudo chmod +x /usr/local/bin/apt-get + sudo cp -p /bin/true /usr/bin/mandb 2> /dev/null || true # ───────────────────────────────────────────────────── - name: Bootstrap ❯❯ actions/checkout@v4 @@ -124,7 +125,7 @@ jobs: - name: "✨ Docker ❯❯ Job1" # if: github.event.schedule != '*/5 * * * *' run: | - docker run hello-world + pstats docker run hello-world # ───────────────────────────────────────────────────── - name: "✨ Cron ❯❯ Job1"