Skip to content

Commit

Permalink
Transfer plugin information by artifact for scoring runs (#592)
Browse files Browse the repository at this point in the history
* upload and download json artifact between jobs

* fix testing changes
  • Loading branch information
samwinebrake authored Mar 5, 2024
1 parent 4135d7c commit 75a496b
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .github/workflows/score_new_plugins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
outputs:
PLUGIN_INFO: ${{ steps.set_plugin_output.outputs.PLUGIN_INFO }}
RUN_SCORING: ${{ steps.scoringneeded.outputs.RUN_SCORING }}
steps:
- name: Check out repository code
Expand Down Expand Up @@ -90,10 +89,15 @@ jobs:
echo "::add-mask::$USER_EMAIL" # Mask the USER_EMAIL
echo "PLUGIN_INFO=$(<<<${{ steps.getpluginfo.outputs.PLUGIN_INFO }} tr -d "'" | jq -c ". + {user_id: \"$BS_UID\", public: \"$BS_PUBLIC\", email: \"$USER_EMAIL\"}")" >> $GITHUB_ENV
- name: Set job-level output for PLUGIN_INFO
id: set_plugin_output
- name: Write PLUGIN_INFO to a json file
run: |
echo "PLUGIN_INFO=$PLUGIN_INFO" >> $GITHUB_OUTPUT
echo "$PLUGIN_INFO" > plugin-info.json
- name: Upload PLUGIN_INFO as an artifact
uses: actions/upload-artifact@v2
with:
name: plugin-info
path: plugin-info.json


run_scoring:
Expand All @@ -102,11 +106,24 @@ jobs:
needs: [process_submission]
if: needs.process_submission.outputs.RUN_SCORING == 'True'
env:
PLUGIN_INFO: ${{ needs.process_submission.outputs.PLUGIN_INFO }}
JENKINS_USER: ${{ secrets.JENKINS_USER }}
JENKINS_TOKEN: ${{ secrets.JENKINS_TOKEN }}
JENKINS_TRIGGER: ${{ secrets.JENKINS_TRIGGER }}
steps:

- name: Download PLUGIN_INFO artifact
uses: actions/download-artifact@v2
with:
name: plugin-info
path: artifact-directory

- name: Set PLUGIN_INFO as an environment variable
run: |
PLUGIN_INFO=$(cat artifact-directory/plugin-info.json)
USER_EMAIL=$(echo "$PLUGIN_INFO" | jq -r '.email')
echo "::add-mask::$USER_EMAIL" # add a mask when bringing email back from artifact
echo "PLUGIN_INFO=${PLUGIN_INFO}" >> $GITHUB_ENV
- name: Add domain, public, competition, and model_type to PLUGIN_INFO
run: |
echo "PLUGIN_INFO=$(<<<$PLUGIN_INFO tr -d "'" | jq -c '. + {domain: "vision", competition: "None", model_type: "Brain_Model"}')" >> $GITHUB_ENV
Expand Down

0 comments on commit 75a496b

Please sign in to comment.