Skip to content

Update actions for kurobako benchmarks #20

Update actions for kurobako benchmarks

Update actions for kurobako benchmarks #20

name: Run HPOBench Naval
on:
pull_request:
paths:
- '.github/workflows/benchmark-hpobench-naval.yml'
- '_benchmarks/runner.sh'
- 'cmaes/**.go'
- 'tpe/**.go'
jobs:
benchmarks-hpobench-naval:
name: Run kurobako benchmark
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
cache: true
id: go
- uses: actions/setup-python@v4
with:
python-version: '3.9'
architecture: 'x64'
- run: python -V
- run: pip install -U pip
- run: pip install kurobako optuna cma
- name: Cache kurobako CLI
id: cache-kurobako
uses: actions/cache@v3
with:
path: ./kurobako
key: kurobako-0-2-10
- name: Download kurobako CLI
if: steps.cache-kurobako.outputs.cache-hit != 'true'
run: |
curl -L https://github.com/sile/kurobako/releases/download/0.2.10/kurobako-0.2.10.linux-amd64 -o kurobako
chmod +x kurobako
./kurobako -h
- name: Cache hpobench dataset
id: cache-hpobench-dataset
uses: actions/cache@v3
with:
path: ./tmp/fcnet_tabular_benchmarks
key: hpobench-dataset
- name: Download hpobench dataset
if: steps.cache-hpobench-dataset.outputs.cache-hit != 'true'
run: |
mkdir -p ./tmp
wget -O ./tmp/fcnet_tabular_benchmarks.tar.gz http://ml4aad.org/wp-content/uploads/2019/01/fcnet_tabular_benchmarks.tar.gz
tar xf ./tmp/fcnet_tabular_benchmarks.tar.gz -C ./tmp
- run: go get github.com/sile/kurobako-go
- name: Run HPOBench-Naval Benchmark
env:
KUROBAKO: ./kurobako
REPEATS: 5
BUDGET: 100
SOLVERS: pruner
run: ./_benchmarks/runner.sh hpobench-naval ./kurobako-report.json
- name: Plot kurobako result
uses: c-bata/github-actions-kurobako/plot@v3
id: kurobako-plot
with:
report-json-path: './kurobako-report.json'
- name: Generate kurobako markdown report
run: cat ./kurobako-report.json | ./kurobako report > ./kurobako-report.md
- name: Set HAS_SECRET flag
env:
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }}
GCP_SA_KEY: ${{ secrets.GCP_SA_KEY }}
run: |
if [ ! -z $GCP_PROJECT_ID ] && [ ! -z $GCP_SA_KEY ]; then
echo "HAS_SECRET=1" >> $GITHUB_ENV
else
echo "HAS_SECRET=0" >> $GITHUB_ENV
fi
- uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
if: ${{ env.HAS_SECRET == 1 }}
with:
version: '275.0.0'
service_account_key: ${{ secrets.GCP_SA_KEY }}
- run: gcloud info
if: ${{ env.HAS_SECRET == 1 }}
- run: gcloud config set project ${{ secrets.GCP_PROJECT_ID }}
if: ${{ env.HAS_SECRET == 1 }}
- name: Upload an image to google cloud storage
if: ${{ env.HAS_SECRET == 1 }}
run: gsutil cp ${{ steps.kurobako-plot.outputs.image-path }} gs://kurobako-reports/${{ github.repository }}/hpobench-naval-${{ github.sha }}.png
- name: Comment to Pull Request
if: ${{ env.HAS_SECRET == 1 }}
uses: c-bata/github-actions-kurobako@v2
with:
report-md-path: './kurobako-report.md'
public-image-url: https://storage.googleapis.com/kurobako-reports/${{ github.repository }}/hpobench-naval-${{ github.sha }}.png
title: 'Benchmark result of HPOBench-Naval problem'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: mv ./kurobako-report.json ./kurobako-report-hpobench-naval.json
- uses: actions/upload-artifact@v2
with:
name: kurobako-report
path: kurobako-report-hpobench-naval.json
- run: mv ${{ steps.kurobako-plot.outputs.image-path }} hpobench-naval.png
if: ${{ env.HAS_SECRET == 0 }}
- run: mv ./kurobako-report.md ./kurobako-report-hpobench-naval.md
if: ${{ env.HAS_SECRET == 0 }}
- uses: actions/upload-artifact@v2
if: ${{ env.HAS_SECRET == 0 }}
with:
name: kurobako-report
path: hpobench-naval.png
- uses: actions/upload-artifact@v2
if: ${{ env.HAS_SECRET == 0 }}
with:
name: kurobako-report
path: kurobako-report-hpobench-naval.md