Skip to content

Commit

Permalink
adjustments to artifact location and host key
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobBarthelmeh committed Feb 25, 2025
1 parent 6fb539e commit a158e6a
Showing 1 changed file with 28 additions and 15 deletions.
43 changes: 28 additions & 15 deletions .github/workflows/sftp-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
- name: configure
working-directory: ./wolfssh/
run : |
./configure --enable-all --enable-debug LDFLAGS="-L${{ github.workspace }}/build-dir/lib" CPPFLAGS="-I${{ github.workspace }}/build-dir/include -DWOLFSSH_NO_FPKI -DWOLFSSH_NO_SFTP_TIMEOUT -DWOLFSSH_MAX_SFTP_RW=4000000 -DMAX_PATH_SZ=120 -DEXAMPLE_SFTP_BENCHMARK"
./configure --enable-all LDFLAGS="-L${{ github.workspace }}/build-dir/lib" CPPFLAGS="-I${{ github.workspace }}/build-dir/include -DWOLFSSH_NO_FPKI -DWOLFSSH_NO_SFTP_TIMEOUT -DWOLFSSH_MAX_SFTP_RW=4000000 -DMAX_PATH_SZ=120 -DEXAMPLE_SFTP_BENCHMARK"
- name: make
working-directory: ./wolfssh/
Expand All @@ -79,15 +79,16 @@ jobs:
- name: Get Saved OpenSSH Upload Results
uses: actions/download-artifact@v4
continue-on-error: true
working-directory: ./wolfssh/
with:
path: ./wolfssh/
path: expected_sftp_benchmarks
artifact_id: 'openssh-upload'

- name: Get Saved OpenSSH Download Results
uses: actions/download-artifact@v4
continue-on-error: true
with:
path: ./wolfssh/
path: expected_sftp_benchmarks
artifact_id: 'openssh-download'

- name: Install gnuplot
Expand All @@ -103,14 +104,13 @@ jobs:
echo "AuthorizedKeysFile $PWD/keys/hansel-key-ecc.pub" >> sshd-config-test.txt
echo "PubkeyAuthentication yes" >> sshd-config-test.txt
echo "Subsystem sftp internal-sftp" >> sshd-config-test.txt
echo "MaxAuthTries 15" >> sshd-config-test.txt
sed -i.bak "s/hansel/$USER/" ./keys/hansel-key-ecc.pub
chmod 600 ./keys/hansel-key-*.pem
chmod 600 ./keys/hansel-key-*.pub
chmod 700 ~/.ssh
sudo mkdir -p /run/sshd
sudo chmod 755 /run/sshd
sudo /usr/sbin/sshd -p 22222 -h $PWD/keys/server-key.pem -f sshd-config-test.txt -E $PWD/sshd-log.txt
sudo /usr/sbin/sshd -p 22222 -f sshd-config-test.txt -E $PWD/sshd-log.txt
cat sshd-config-test.txt
ps -e | grep sshd
Expand All @@ -120,45 +120,58 @@ jobs:
run: |
./scripts/get-sftp-benchmark.sh 22222
- name: Rename files to be unique to PR
working-directory: ./wolfssh/
run: |
mv upload-results.png upload-results-pr${{ github.event.pull_request.number }}.png
mv download-results.png download-results-pr${{ github.event.pull_request.number }}.png
- name: Store Upload Speed PNG
uses: actions/upload-artifact@v4
working-directory: ./wolfssh/
with:
name: upload-results-pr${{ github.event.pull_request.number }}.png
path: wolfssh/upload-results.png
path: sftp_upload_results
retention-days: 2

- name: Store Download Speed PNG
uses: actions/upload-artifact@v4
working-directory: ./wolfssh/
with:
name: download-results-pr${{ github.event.pull_request.number }}.png
path: wolfssh/download-results.png
path: sftp_download_results
retention-days: 2

- name: Upload OpenSSH Download Results
if: steps.download-artifact.outputs.found != 'true'
working-directory: ./wolfssh/
uses: actions/upload-artifact@v4
with:
name: openssh-download
path: wolfssh/openssh-average-download.csv
name: openssh-average-upload.csv
path: expected_sftp_benchmarks

- name: Upload OpenSSH Upload Results
if: steps.download-artifact.outputs.found != 'true'
working-directory: ./wolfssh/
uses: actions/upload-artifact@v4
with:
name: openssh-upload
path: wolfssh/openssh-average-upload.csv
name: openssh-average-download.csv
path: expected_sftp_benchmarks

- name: Comment on PR about performance
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ARTIFACT_URL=$(gh api repos/${{ github.repository }}/actions/artifacts \\
--jq '.artifacts[0].archive_download_url')
PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
gh pr comment $PR_NUMBER --body "Attached is the performance results" \
--attach download-results-pr${{ github.event.pull_request.number }}.png \
--attach upload-results-pr${{ github.event.pull_request.number }}.png
gh pr comment $PR_NUMBER --body "Performance results are located here" \
"[benchmark artifacts]($ARTIFACT_URL)"
- name: Print logs if failed
working-directory: ./wolfssh/
if: failure()
run: sudo cat sshd-log.txt
run: |
sudo cat sshd-log.txt
cat log.csv

0 comments on commit a158e6a

Please sign in to comment.