diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 9ebe8fd..717a487 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -44,8 +44,8 @@ jobs: uses: docker/metadata-action@v5 with: images: | - ${{ vars.DOCKERHUB_IMAGE }} - ${{ vars.GHCR_IMAGE }} + name=${{ vars.GHCR_IMAGE }} + name=${{ vars.DOCKERHUB_IMAGE }},enable=${{ github.event_name != 'pull_request' }} labels: | org.opencontainers.image.title=docker-diskmark org.opencontainers.image.description=A disk benchmarking tool for Docker @@ -55,7 +55,7 @@ jobs: type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} type=edge,branch=$repo.default_branch - type=sha,prefix=,suffix=,format=short + type=ref,event=pr - name: Build and push Docker image uses: docker/build-push-action@v5 with: @@ -72,8 +72,8 @@ jobs: uses: docker/scout-action@v1 with: command: cves,recommendations,compare - image: ${{ vars.DOCKERHUB_IMAGE }}:${{ env.SHA }} - to: ${{ vars.DOCKERHUB_IMAGE }}:latest + image: ${{ steps.meta.outputs.tags }} + to: ${{ vars.GHCR_IMAGE }}:latest ignore-base: true ignore-unchanged: true only-fixed: true @@ -81,7 +81,7 @@ jobs: write-comment: true github-token: ${{ secrets.GITHUB_TOKEN }} - name: Update repo description - if: github.ref == 'refs/heads/main' + if: ${{ github.ref == 'refs/heads/main' }} uses: peter-evans/dockerhub-description@v4 with: username: ${{ secrets.DOCKERHUB_USERNAME }} diff --git a/README.md b/README.md index ce23465..e691945 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# docker-diskmark +# docker-diskmark [![docker-image](https://github.com/e7d/docker-diskmark/actions/workflows/docker-image.yml/badge.svg)](https://github.com/e7d/docker-diskmark/actions/workflows/docker-image.yml) A [fio](https://github.com/axboe/fio)-based disk benchmark [docker container](https://hub.docker.com/r/e7db/diskmark), similar to what [CrystalDiskMark](https://crystalmark.info/en/software/crystaldiskmark/) does. Inspired by the [crystal-disk-mark-fio-bench.sh](https://gist.github.com/0x0I/35a3aa0f810acfddeddb7ff59c37f484) GitHub Gist by [0x0I](https://gist.github.com/0x0I). @@ -41,20 +41,20 @@ Find below a table listing all the different parameters you can use with the con | `LOOPS` | Environment | | The number of test loops performed on the test file.
This parameter overrides the `RUNTIME` parameter. | | `/disk` | Volume | | The target path to benchmark. | -By default, a 1 GB test file is used, using 5 loops for each test, reading and writing random bytes on the disk where Docker is installed. +By default, a 1 GB test file is used, with a 5 seconds duration for each test, reading and writing random bytes on the disk where Docker is installed. ### With parameters -For example, you could go and use a 4 GB file looping each test twice, and writting only zeros instead of random data. +For example, you can use a 4 GB file, looping each test twice, but after a warmup phase, and writting only zeros instead of random data. You can achieve this using the following command: ``` -docker run -it --rm -e SIZE=4G -e LOOPS=2 -e DATA=0x00 e7db/diskmark +docker run -it --rm -e SIZE=4G -e WARMUP=1 -e LOOPS=2 -e DATA=0x00 e7db/diskmark ``` ### Force profile -A detection of your disk is made, so the benchmark uses the appropriate profile, `default` or `nvme`. -In the event that the detection returns a wrong value, you can force the use of either of the profiles: +A detection of your disk is tried, so the benchmark uses the appropriate profile, `default` or `nvme`. +In the event that the detection fails, yielding "Unknown", or returns the wrong profile, you can force the use of either of the profiles: ``` docker run -it --rm -e PROFILE=nvme e7db/diskmark ``` @@ -69,9 +69,9 @@ It is composed of 4 parts: - `Qyy`, where `yy` is the queue depth - `Tzz`, where `zz` is the number of threads -In the previous example `RND4KQ32T16`, the job uses random accesses, with a block size of 4K, a queue depth of 32, and 16 threads. +In the previous example `RND4KQ32T16`, the job uses **random accesses**, with a **block size of 4K**, a **queue depth of 32**, and **16 threads**. -Construct you custom chain, then run the benchmark using the following command: +Construct your custom chain, then run the benchmark using the following command: ``` docker run -it --rm -e JOB=RND4KQ32T16 e7db/diskmark ```