Skip to content

Commit

Permalink
ㅤ⚡️ BUMP ⚡️ㅤ ㅤ2 files ↑49 ↓8ㅤ
Browse files Browse the repository at this point in the history
  • Loading branch information
borestad committed Oct 26, 2024
1 parent bcb20f0 commit 8987636
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 8 deletions.
40 changes: 40 additions & 0 deletions .github/scripts/ga-create-ramdisk
Original file line number Diff line number Diff line change
@@ -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
17 changes: 9 additions & 8 deletions .github/workflows/cron.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 8987636

Please sign in to comment.