Skip to content

Commit

Permalink
cURL benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
edigaryev committed Apr 9, 2024
1 parent fb7ccdc commit ee167e6
Showing 1 changed file with 12 additions and 20 deletions.
32 changes: 12 additions & 20 deletions .github/workflows/cache-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ on:
push:

env:
CACHE_BUSTER: 5
NUM_OF_1K_BLOCKS: 2560000
CACHE_BUSTER: 7
NUM_OF_1K_BLOCKS: 1536000

jobs:
actions-cache:
Expand All @@ -16,10 +16,6 @@ jobs:
runs_on:
- name: gh-ubuntu
image: "ubuntu-latest"
- name: cl-ubuntu-amd64
image: "ghcr.io/cirruslabs/ubuntu-runner-amd64:22.04-sm"
- name: cl-macos-arm64
image: "ghcr.io/cirruslabs/macos-sonoma-xcode:latest"

runs-on: ${{ matrix.runs_on.image }}

Expand All @@ -44,13 +40,11 @@ jobs:
run: stat testfile

cirruslabs-cache:
name: "${{ matrix.runs_on.name }} + cirruslabs/cache"
name: "${{ matrix.runs_on.name }} + cURL"

strategy:
matrix:
runs_on:
- name: gh-ubuntu
image: "ubuntu-latest"
- name: cl-ubuntu-amd64
image: "ghcr.io/cirruslabs/ubuntu-runner-amd64:22.04-sm"
- name: cl-macos-arm64
Expand All @@ -64,16 +58,14 @@ jobs:
- name: Print environment
run: env

- name: Cache Binary
id: cache
uses: cirruslabs/cache@v4
with:
path: testfile
key: "cirruslabs-cache-${{ matrix.runs_on.name }}-attempt-${{ env.CACHE_BUSTER }}"
- name: Generate binary
run: dd if=/dev/urandom of=binary.bin bs=1024 count=${{ env.NUM_OF_1K_BLOCKS }}

- name: Generate Binary
if: steps.cache.outputs.cache-hit != 'true'
run: dd if=/dev/urandom of=testfile bs=1024 count=${{ env.NUM_OF_1K_BLOCKS }}
- name: Upload Binary
run: wget --quiet --method POST --body-file binary.bin "http://$CIRRUS_HTTP_CACHE_HOST/binary-${{ matrix.runs_on.name }}-${{ env.CACHE_BUSTER }}"

- name: Stat Binary
run: stat testfile
- name: Remove binary to save space
run: rm binary.bin

- name: Download binary
run: wget --quiet -O downloaded-binary.bin "http://$CIRRUS_HTTP_CACHE_HOST/binary-${{ matrix.runs_on.name }}-${{ env.CACHE_BUSTER }}" || true

0 comments on commit ee167e6

Please sign in to comment.