Skip to content

Commit

Permalink
Update model_performance.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
leahwicz authored Sep 21, 2022
1 parent 564950b commit 3a94f5e
Showing 1 changed file with 14 additions and 23 deletions.
37 changes: 14 additions & 23 deletions .github/workflows/model_performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,12 @@ on:
# here and in the runner. Even if we use a semver library I suspect it will be rather difficult.
release_id:
description: '(^^ always run from main) dbt version to model (must be non-prerelease in Pypi)'
default: 9.9.9
required: true
open_prs:
description: Open PRs to main and release branch? (branch name inferred from provided version) (yes/no)
default: 'no'
description: Open PRs to main and release branch? (branch name inferred from provided version)
type: boolean
required: true
pull_request: # TODO: remove, just for testing purposes
# pull_request: # TODO: remove, just for testing purposes

env:
RUNNER_CACHE_PATH: performance/runner/target/release/runner
Expand Down Expand Up @@ -86,7 +85,7 @@ jobs:
without_v=1.2.1 # TODO: just for testing
local_release_id=$without_v
echo "::set-output name=release_id::$without_v"
echo "::set-output name=open_prs::yes"
echo "::set-output name=open_prs::true"
fi
# string manipulation to get the branch name. It can't be discovered from the github api
Expand Down Expand Up @@ -194,7 +193,10 @@ jobs:
# TODO CHANGE NUMBER OF RUNS BEFORE MERGING
# TODO this isn't putting the baseline in the right directory. it's putting it one level up.
- name: Run Measurement
run: mkdir ${{ github.workspace }}/performance/tmp/ && mkdir -p performance/baselines/${{ needs.latest-runner.outputs.release_id }}/ && performance/app model -v ${{ needs.latest-runner.outputs.release_id }} -b ${{ github.workspace }}/performance/baselines/ -p ${{ github.workspace }}/performance/projects/ -t ${{ github.workspace }}/performance/tmp/ -n 2
run: |
mkdir ${{ github.workspace }}/performance/tmp/
mkdir -p performance/baselines/${{ needs.latest-runner.outputs.release_id }}/
performance/app model -v ${{ needs.latest-runner.outputs.release_id }} -b ${{ github.workspace }}/performance/baselines/ -p ${{ github.workspace }}/performance/projects/ -t ${{ github.workspace }}/performance/tmp/ -n 2
- name: '[DEBUG] ls baseline directory after run'
run: ls -R performance/baselines/
Expand All @@ -205,11 +207,13 @@ jobs:
path: performance/baselines/${{ needs.latest-runner.outputs.release_id }}/

create-pr:
if: ${{ needs.latest-runner.outputs.open_prs == 'yes' }}
name: Open PR for ${{ matrix.base-branch }}
if: ${{ needs.latest-runner.outputs.open_prs }}

# depends on `model` as a separate job so that the baseline can be committed to more than one branch
# i.e. release branch and main
needs: [latest-runner, model]
name: Open PR for ${{ matrix.base-branch }}

runs-on: ubuntu-latest

strategy:
Expand All @@ -229,22 +233,16 @@ jobs:
echo "open_prs: ${{ needs.latest-runner.outputs.open_prs }}"
echo "release_branch: ${{ needs.latest-runner.outputs.release_branch }}"
# explicitly checkout main
- name: Checkout
uses: actions/checkout@v2
with:
ref: ${{ matrix.base-branch }}

- name: Create PR branch
run: |
git log -1
git checkout -b ${{ matrix.target-branch }}
git push origin ${{ matrix.target-branch }}
git branch --set-upstream-to=origin/${{ matrix.target-branch }} ${{ matrix.target-branch }}
git log -1
- name: '[DEBUG] ls baselines before artifact download'
run: ls -R performance/baselines/
- uses: actions/download-artifact@v3
with:
Expand All @@ -253,10 +251,6 @@ jobs:

- name: '[DEBUG] ls baselines after artifact download'
run: ls -R performance/baselines/

- name: '[DEBUG] git status'
run: |
git status

- name: Commit baseline
uses: EndBug/add-and-commit@v9
Expand All @@ -267,17 +261,14 @@ jobs:
message: 'adding performance baseline for ${{ needs.latest-runner.outputs.release_id }}'
branch: '${{ matrix.target-branch }}'
push: 'origin origin/${{ matrix.target-branch }}'

- name: '[DEBUG] git status'
run: git status

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
author: 'Github Build Bot <[email protected]>'
base: ${{ matrix.base-branch }}
draft: true
title: 'Adding performance modeling for ${{needs.latest-runner.outputs.release_id}} to ${{ matrix.target-branch }}'
title: 'Adding performance modeling for ${{needs.latest-runner.outputs.release_id}} to ${{ matrix.base-branch }}'
branch: '${{ matrix.target-branch }}'
labels: |
Skip Changelog
Performance

0 comments on commit 3a94f5e

Please sign in to comment.