Skip to content

Commit

Permalink
run on github
Browse files Browse the repository at this point in the history
  • Loading branch information
Angelyr committed Mar 18, 2024
1 parent d066c81 commit 209cdea
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/globusTests.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# 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. Replace the endpoint in script to us your new endpoint

from globus_compute_sdk import Executor
import os

endpoint = '7688fa75-1d82-4e10-95c1-27dcb3724e6a'
endpoint = '2e3dc4ed-3c37-4fe1-84c6-edc51c9f08f5'
gce = Executor(endpoint_id = endpoint)
# print("Executor : ", gce)

def run_test():
import os
Expand All @@ -11,11 +20,9 @@ def run_test():
summary = os.popen("cat omega_h-test-result/TestSummary.log").read()
return (summary, result)

# print(run_test()[0])
future = gce.submit(run_test)
os.popen("mkdir -p omega_h-test-result").read()
with open("omega_h-test-result/LastTest.log", "w") as text_file:
text_file.write("%s" % future.result()[0])
with open("omega_h-test-result/TestSummary.log", "w") as text_file:
text_file.write("%s" % future.result()[1])
# print("Submit returned: ", future.result()[0])
18 changes: 17 additions & 1 deletion .github/workflows/perlmutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:

jobs:
build:
runs-on: self-hosted
runs-on: ubuntu-latest

steps:

Expand All @@ -13,11 +13,27 @@ jobs:
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 credentials
env:
GLOBUS_ID: ${{ secrets.GLOBUS_COMPUTE_ID }}
GLOBUS_SECRET: ${{ secrets.GLOBUS_COMPUTE_SECRET }}
run: |
export FUNCX_SDK_CLIENT_ID="$GLOBUS_ID"
export FUNCX_SDK_CLIENT_ID="$GLOBUS_SECRET"
- name: run tests
working-directory: omega_h/.github/workflows
run: python globusTests.py
Expand Down

0 comments on commit 209cdea

Please sign in to comment.