Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Repro-CI Artifacts Reflect Configs Repo Structure #74

Closed
wants to merge 9 commits into from
2 changes: 1 addition & 1 deletion .github/workflows/config-pr-1-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ jobs:
id: tests
uses: EnricoMi/publish-unit-test-result-action/composite@e780361cd1fc1b1a170624547b3ffda64787d365 #v2.12.0
with:
files: ${{ env.TESTING_LOCAL_LOCATION }}/checksum/test_report.xml
files: ${{ env.TESTING_LOCAL_LOCATION }}/testing/checksum/test_report.xml
comment_mode: off
check_run: true
check_name: Repro Test Results
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/config-pr-2-confirm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,14 @@ jobs:
--jq='[.[] | select(.headBranch == "${{ steps.pr.outputs.branch }}" and .status == "completed")] | sort_by(.updatedAt) | last | .databaseId')
gh run download $associated_run -D ${{ env.ARTIFACT_LOCAL_LOCATION }}

- name: Update metadata.yaml and Checksum files
- name: Update metadata.yaml, add checksums and optional files
# Note: This copies over (and therefore commits) files that are
# specified by config-pr-1-ci.ymls inputs.additional-artifact-content-paths
# Also, we have the strange double asterix in the `cp` because
# `gh run download` may download multiple artifacts if they exist.
run: |
yq -i '.version = "${{ needs.bump-version.outputs.after }}"' metadata.yaml
cp --recursive --verbose ${{ env.ARTIFACT_LOCAL_LOCATION }}/*/* testing
cp --recursive --verbose ${{ env.ARTIFACT_LOCAL_LOCATION }}/*/* .

- name: Import Commit-Signing Key
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/config-schedule-2-start.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
id: tests
uses: EnricoMi/publish-unit-test-result-action/composite@e780361cd1fc1b1a170624547b3ffda64787d365 #v2.12.0
with:
files: ${{ env.TESTING_LOCAL_LOCATION }}/checksum/test_report.xml
files: ${{ env.TESTING_LOCAL_LOCATION }}/testing/checksum/test_report.xml
comment_mode: off
check_run: true
compare_to_earlier_commit: false
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/generate-checksums.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ jobs:
id: run
env:
BASE_EXPERIMENT_LOCATION: ${{ env.EXPERIMENT_LOCATION }}/base-experiment
CHECKSUM_LOCATION: ${{ env.EXPERIMENT_LOCATION }}/testing
TEST_VENV_LOCATION: ${{ env.EXPERIMENT_LOCATION }}/test-venv
run: |
ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} -i ${{ steps.ssh.outputs.private-key-path }} /bin/bash<<EOT
Expand Down Expand Up @@ -131,7 +132,7 @@ jobs:
# Run pytests - this also generates checksums files
model-config-tests -s \
-m "checksum" \
--output-path ${{ env.EXPERIMENT_LOCATION }}
--output-path "${{ env.CHECKSUM_LOCATION }}"

# Deactivate and remove the test virtual environment
deactivate
Expand All @@ -143,12 +144,13 @@ jobs:
EOT

echo "experiment-location=${{ env.EXPERIMENT_LOCATION }}" >> $GITHUB_OUTPUT
echo "checksum-location=${{ env.CHECKSUM_LOCATION }}" >> $GITHUB_OUTPUT
echo "::notice::Checksums generated on ${{ vars.DEPLOYMENT_TARGET }} at ${{ env.EXPERIMENT_LOCATION }}"

- name: Copy Back Checksums
run: |
rsync --recursive -e 'ssh -i ${{ steps.ssh.outputs.private-key-path }}' \
'${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST_DATA }}:${{ env.EXPERIMENT_LOCATION }}/checksum' \
'${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST_DATA }}:${{ steps.run.outputs.checksum-location }}' \
${{ env.OUTPUT_LOCAL_LOCATION }}

- name: Generate Output Artifact Name
Expand Down Expand Up @@ -181,10 +183,10 @@ jobs:
name: ${{ needs.generate-checksum.outputs.artifact-name }}
path: ${{ env.OUTPUT_LOCAL_LOCATION }}

- name: Move Checksums to Repo
- name: Move Outputs to Repo
run: |
mkdir -p ${{ inputs.committed-checksum-location }}
mv ${{ env.OUTPUT_LOCAL_LOCATION }}/checksum/* ${{ inputs.committed-checksum-location }}
mv ${{ env.OUTPUT_LOCAL_LOCATION }} .

- name: Update version in metadata.yaml
if: inputs.committed-checksum-tag != ''
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/test-repro.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ jobs:
id: run
env:
BASE_EXPERIMENT_LOCATION: ${{ env.EXPERIMENT_LOCATION }}/base-experiment
CHECKSUM_LOCATION: ${{ env.EXPERIMENT_LOCATION }}/testing
COMPARED_CHECKSUM_LOCATION: ${{ env.EXPERIMENT_LOCATION }}/compared
TEST_VENV_LOCATION: ${{ env.EXPERIMENT_LOCATION }}/test-venv
run: |
Expand Down Expand Up @@ -152,9 +153,9 @@ jobs:
# Run model-config-tests pytests - this also generates checksums files.
# If there is a checksum to compare against, add --checksum-path arg.
model-config-tests -s -m "${{ inputs.test-markers }}" \
--output-path "${{ env.EXPERIMENT_LOCATION }}" \
--output-path "${{ env.CHECKSUM_LOCATION }}" \
${{ inputs.compared-config-ref != '' && '--checksum-path $COMPARED_CHECKSUM_FILE \' || '\' }}
--junitxml="${{ env.EXPERIMENT_LOCATION }}/checksum/test_report.xml"
--junitxml="${{ env.CHECKSUM_LOCATION }}/checksum/test_report.xml"

# Deactivate and remove the test virtual environment
deactivate
Expand All @@ -165,11 +166,12 @@ jobs:
exit 0
EOT
echo "experiment-location=${{ env.EXPERIMENT_LOCATION }}" >> $GITHUB_OUTPUT
echo "checksum-location=${{ env.CHECKSUM_LOCATION }}" >> $GITHUB_OUTPUT

- name: Copy Back Checksums and Test Report
run: |
rsync --recursive --verbose -e 'ssh -i ${{ steps.ssh.outputs.private-key-path }}' \
'${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST_DATA }}:${{ env.EXPERIMENT_LOCATION }}/checksum' \
'${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST_DATA }}:${{ steps.run.outputs.checksum-location }}' \
${{ env.ARTIFACT_LOCAL_LOCATION }}

- name: Copy Back Additional Artifact Content
Expand Down