forked from sandialabs/omega_h
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from SCOREC/ac/perlmutter-actions
GPU Systems Testing
- Loading branch information
Showing
2 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Systems | ||
on: | ||
schedule: | ||
# Sunday 1:30 AM | ||
- cron: '30 1 * * 0' | ||
|
||
concurrency: | ||
group: systems-omega_h | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
strategy: | ||
matrix: | ||
machine: ["Perlmutter", "Frontier"] | ||
|
||
steps: | ||
|
||
- name: checkout omega_h | ||
uses: actions/checkout@v4 | ||
with: | ||
path: omega_h | ||
|
||
- name: setup python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: install packing | ||
run: sudo apt install python3-packaging | ||
|
||
- name: install globus | ||
run: | | ||
python -m ensurepip --upgrade --user | ||
python -m pip install globus-compute-endpoint | ||
- name: use globus | ||
working-directory: omega_h/.github/workflows | ||
env: | ||
GLOBUS_ID: ${{ secrets.GLOBUS_COMPUTE_ID }} | ||
GLOBUS_SECRET: ${{ secrets.GLOBUS_COMPUTE_SECRET }} | ||
run: | | ||
export GLOBUS_COMPUTE_CLIENT_ID="$GLOBUS_ID" | ||
export GLOBUS_COMPUTE_CLIENT_SECRET="$GLOBUS_SECRET" | ||
if [ ${{matrix.machine}} == Perlmutter ]; then TARGET_ENDPOINT=0dd4499a-8d76-4977-bae9-841e4bb2f616; fi | ||
if [ ${{matrix.machine}} == Frontier ]; then TARGET_ENDPOINT=d625c6cf-de7a-4228-ac44-56247a642fe0; fi | ||
python test_on_system.py ${{ github.sha }} $TARGET_ENDPOINT | ||
- name: print build log | ||
working-directory: omega_h/.github/workflows | ||
run: cat omega_h-test-result/Build.log | ||
|
||
- name: print test summary | ||
working-directory: omega_h/.github/workflows | ||
run: cat omega_h-test-result/TestSummary.log | ||
|
||
- name: print test log | ||
working-directory: omega_h/.github/workflows | ||
run: cat omega_h-test-result/LastTest.log | ||
|
||
- name: check failed test | ||
working-directory: omega_h/.github/workflows | ||
run: if grep "Failed" omega_h-test-result/TestSummary.log; then return 1; fi | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# How to use | ||
# 1. Login to https://app.globus.org/settings/developers and copy a project app id and secret | ||
# 2. Use the id and secret to create and endpoint https://funcx.readthedocs.io/en/latest/sdk.html#client-credentials-with-clients | ||
# $ export FUNCX_SDK_CLIENT_ID="b0500dab-ebd4-430f-b962-0c85bd43bdbb" | ||
# $ export FUNCX_SDK_CLIENT_SECRET="ABCDEFGHIJKLMNOP0123456789=" | ||
# 3. Set up an endpoint on the computer that will run the tests, using these instructions: https://funcx.readthedocs.io/en/latest/endpoints.html | ||
# 4. Create install-test.sh and run-test.sh on target computer | ||
|
||
from globus_compute_sdk import Executor | ||
import sys | ||
import os | ||
|
||
name = "omega_h-test" | ||
build = "build-omega_h" | ||
branch = sys.argv[1] | ||
endpoint = sys.argv[2] | ||
|
||
def run_on_endpoint(name, build, branch): | ||
import subprocess | ||
|
||
install = subprocess.run(["./install-test.sh "+name+" "+branch], shell=True, encoding="utf_8", stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | ||
if install.returncode == 1: | ||
return (install, None, None) | ||
|
||
summary = subprocess.run(["./run-test.sh "+name+" "+build], shell=True, encoding="utf_8", stdout=subprocess.PIPE, stderr=subprocess.STDOUT) | ||
if summary.returncode == 1: | ||
return (install, summary, None) | ||
|
||
with open(name+"-result/LastTest.log","r") as f: | ||
result = f.read() | ||
|
||
return (install, summary, result) | ||
|
||
gce = Executor(endpoint_id = endpoint) | ||
future = gce.submit(run_on_endpoint, name, build, branch) | ||
result = future.result() | ||
|
||
os.popen("mkdir -p "+name+"-result").read() | ||
with open(name+"-result/Build.log", "w") as text_file: | ||
text_file.write("%s" % result[0].stdout) | ||
text_file.close() | ||
if result[0].returncode == 0: | ||
with open(name+"-result/TestSummary.log", "w") as text_file: | ||
text_file.write("%s" % result[1].stdout) | ||
text_file.close() | ||
with open(name+"-result/LastTest.log", "w") as text_file: | ||
text_file.write("%s" % result[2]) | ||
text_file.close() |