From 42e2cabdf8ca3edde0ef6f59dc5c7726f59273e4 Mon Sep 17 00:00:00 2001 From: Emily Lim Date: Tue, 10 Oct 2023 18:36:24 -0700 Subject: [PATCH 1/3] Update .gitignore to exclude sensitive Terraform files --- .gitignore | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.gitignore b/.gitignore index d32231d1abc..2af15e6a08c 100644 --- a/.gitignore +++ b/.gitignore @@ -168,3 +168,18 @@ pyembed_includes .cache/ build_cinderx_venv/ CinderX/build/ + +# Ignore Terraform state files, directories, and logs +*.tfstate +*.tfstate.* +*.terraform +*.terraform.* +.terraform/ +terraform.log + +# Ignore sensitive or auto-generated files +*.pem +*.key +*.tfvars +*.tfvars.* + From 09f2cc94307af6625fabbd0e752ced90cd4e07d5 Mon Sep 17 00:00:00 2001 From: Emily Lim Date: Wed, 11 Oct 2023 12:02:26 -0700 Subject: [PATCH 2/3] Add workflow and configuration files for Actions Add requirements.txt to create the new files. Update .gitignore to ignore venv files. --- .github/workflows/_generate.yml | 45 +++++++++++++++++++++++++++++ .github/workflows/_publish.yml | 50 +++++++++++++++++++++++++++++++++ .gitignore | 3 ++ requirements.txt | 1 + 4 files changed, 99 insertions(+) create mode 100644 .github/workflows/_generate.yml create mode 100644 .github/workflows/_publish.yml create mode 100644 requirements.txt diff --git a/.github/workflows/_generate.yml b/.github/workflows/_generate.yml new file mode 100644 index 00000000000..e9aeec6b3a7 --- /dev/null +++ b/.github/workflows/_generate.yml @@ -0,0 +1,45 @@ +--- +name: _generate + +"on": + workflow_call: + inputs: + force: + type: boolean + default: false + dry_run: + type: boolean + default: false + + workflow_dispatch: + inputs: + force: + description: "Regenerate all of the derived data, even if it already exists" + type: boolean + default: false + dry_run: + description: "Dry run: Do not commit to the repo" + type: boolean + default: false + +jobs: + generate-results: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + cache: pip + - name: install dependencies + run: + python -m pip install -r requirements.txt + - name: regenerate + run: + python -m bench_runner.scripts.generate_results ${{ inputs.force == true && '--force' || '' }} + - name: Add to repo + uses: EndBug/add-and-commit@v9 + if: ${{ !inputs.dry_run }} + with: + add: "['results', 'README.md', 'RESULTS.md', 'longitudinal.png', 'profiling/profiling.png', 'profiling/profiling.md']" + message: Benchmarking results for @${{ github.actor }} diff --git a/.github/workflows/_publish.yml b/.github/workflows/_publish.yml new file mode 100644 index 00000000000..d46d1f5b8ca --- /dev/null +++ b/.github/workflows/_publish.yml @@ -0,0 +1,50 @@ +--- +name: _publish + +"on": + workflow_call: + inputs: + force: + type: boolean + default: false + dry_run: + type: boolean + default: false + + workflow_dispatch: + inputs: + force: + description: "Regenerate all of the derived data, even if it already exists" + type: boolean + default: false + dry_run: + description: "Dry run: Do not commit to the repo" + type: boolean + default: false + +jobs: + mirror: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + path: private + ref: main + fetch-depth: 0 + - uses: actions/checkout@v3 + with: + path: public + ref: main + repository: faster-cpython/benchmarking-public + token: ${{ secrets.BENCHMARK_MIRROR }} + - name: Mirror + run: | + cd public + git remote add upstream $PWD/../private + git fetch upstream + git reset --hard upstream/main + - name: Push + if: ${{ !inputs.dry_run }} + run: | + cd public + git push origin main diff --git a/.gitignore b/.gitignore index 2af15e6a08c..0aa50c34f8d 100644 --- a/.gitignore +++ b/.gitignore @@ -183,3 +183,6 @@ terraform.log *.tfvars *.tfvars.* +# Ignore venv directory +venv/ + diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 00000000000..fadb5fcc0f9 --- /dev/null +++ b/requirements.txt @@ -0,0 +1 @@ +git+https://github.com/faster-cpython/bench_runner@v0.2.2#egg=bench_runner From 7d9d788972504648b3705090c45b9c87cc121d24 Mon Sep 17 00:00:00 2001 From: Emily Lim Date: Tue, 17 Oct 2023 13:21:24 -0700 Subject: [PATCH 3/3] Add workflow file with AWS configuration Workflow file to be updated with steps to deploy benchrunner --- .github/workflows/benchrunner-aws.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/benchrunner-aws.yml diff --git a/.github/workflows/benchrunner-aws.yml b/.github/workflows/benchrunner-aws.yml new file mode 100644 index 00000000000..19cade70cde --- /dev/null +++ b/.github/workflows/benchrunner-aws.yml @@ -0,0 +1,19 @@ +name: Deploy benchrunner to AWS + +on: + workflow_dispatch: {} + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Check out the repository to the runner + uses: actions/checkout@v4 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + aws-region: us-west-2