Repository: E3SM-Project/zstash

Issue:
Add Compy endpoint to Globus file
Add Compy endpoint to Globus file.

In https://github.com/E3SM-Project/zstash/blob/main/zstash/globus.py, add Compy's Globus endpoint.

Discussion:

Patch:
diff --git a/conda/dev.yml b/conda/dev.yml
index 52453d7..e4b5995 100644
--- a/conda/dev.yml
+++ b/conda/dev.yml
@@ -9,7 +9,7 @@ dependencies:
   - python=3.9.13
   - six=1.16.0
   - globus-sdk=3.2.1
-  - fair-research-login=0.2.0
+  - fair-research-login=0.2.6
   # Developer Tools
   # =================
   # If versions are updated, also update 'rev' in `.pre-commit.config.yaml`
diff --git a/conda/meta.yaml b/conda/meta.yaml
index a4050ea..b4c8cbc 100644
--- a/conda/meta.yaml
+++ b/conda/meta.yaml
@@ -1,5 +1,5 @@
 {% set name = "zstash" %}
-{% set version = "1.4.0rc1" %}
+{% set version = "1.4.0rc2" %}
 
 package:
   name: {{ name|lower }}
diff --git a/setup.py b/setup.py
index b7a575d..325cf65 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ from setuptools import find_packages, setup
 
 setup(
     name="zstash",
-    version="1.4.0rc1",
+    version="1.4.0rc2",
     author="Ryan Forsyth, Chris Golaz, Zeshawn Shaheen",
     author_email="forsyth2@llnl.gov, golaz1@llnl.gov, shaheen2@llnl.gov",
     description="Long term HPSS archiving software for E3SM",
diff --git a/tbump.toml b/tbump.toml
index 76b862f..1ad7e1e 100644
--- a/tbump.toml
+++ b/tbump.toml
@@ -2,7 +2,7 @@
 github_url = "https://github.com/E3SM-Project/zstash.git"
 
 [version]
-current = "1.4.0rc1"
+current = "1.4.0rc2"
 
 # Example of a semver regexp with support for PEP 440
 # release candidates.Make sure this matches current_version
diff --git a/zstash/__init__.py b/zstash/__init__.py
index 9a34250..bde275d 100644
--- a/zstash/__init__.py
+++ b/zstash/__init__.py
@@ -1,1 +1,1 @@
-__version__ = "v1.4.0rc1"
+__version__ = "v1.4.0rc2"
diff --git a/zstash/globus.py b/zstash/globus.py
index 0b1e1c9..11495b6 100644
--- a/zstash/globus.py
+++ b/zstash/globus.py
@@ -1,6 +1,7 @@
 from __future__ import absolute_import, print_function
 
 import configparser
+import os
 import os.path
 import re
 import socket
@@ -22,9 +23,11 @@ hpss_endpoint_map = {
 regex_endpoint_map = {
     r"theta.*\.alcf\.anl\.gov": "08925f04-569f-11e7-bef8-22000b9a448b",
     r"blueslogin.*\.lcrc\.anl\.gov": "61f9954c-a4fa-11ea-8f07-0a21f750d19b",
+    r"chrlogin.*\.lcrc\.anl\.gov": "61f9954c-a4fa-11ea-8f07-0a21f750d19b",
     r"b\d+\.lcrc\.anl\.gov": "61f9954c-a4fa-11ea-8f07-0a21f750d19b",
     r"chr.*\.lcrc\.anl\.gov": "61f9954c-a4fa-11ea-8f07-0a21f750d19b",
     r"cori.*\.nersc\.gov": "9d6d99eb-6d04-11e5-ba46-22000b92c6ec",
+    r"compy.*\.pnl\.gov": "68fbd2fa-83d7-11e9-8e63-029d279f7e24",
     r"perlmutter.*\.nersc\.gov": "6bdc7956-fc0f-4ad2-989c-7aa5ee643a79",  # If this doesn't work, use cori
 }
 
@@ -66,6 +69,10 @@ def globus_activate(hpss: str):
             sys.exit(1)
     if not local_endpoint:
         fqdn = socket.getfqdn()
+        if re.fullmatch(r"n.*\.local", fqdn) and os.getenv("HOSTNAME", "NA").startswith(
+            "compy"
+        ):
+            fqdn = "compy.pnl.gov"
         for pattern in regex_endpoint_map.keys():
             if re.fullmatch(pattern, fqdn):
                 local_endpoint = regex_endpoint_map.get(pattern)
diff --git a/zstash/main.py b/zstash/main.py
index 027d1ef..7683c89 100755
--- a/zstash/main.py
+++ b/zstash/main.py
@@ -54,6 +54,10 @@ For help with a specific command
     # exclude the rest of the args too, or validation will fail
     args: argparse.Namespace = parser.parse_args(sys.argv[1:2])
 
+    print(
+        "For help, please see https://e3sm-project.github.io/zstash. Ask questions at https://github.com/E3SM-Project/zstash/discussions/categories/q-a."
+    )
+
     if args.command == "version":
         print(__version__)
     elif args.command == "create":


Test patch:
diff --git a/tests/base.py b/tests/base.py
index e43387a..f9c3fb5 100644
--- a/tests/base.py
+++ b/tests/base.py
@@ -6,6 +6,9 @@ To run an individual test, run something like `python -m unittest tests.test_ext
 If running on Cori, it is preferable to run from $CSCRATCH rather than
 /global/homes. Running from the latter may result in a
 'Resource temporarily unavailable' error.
+
+If running on Compy, it is necessary to run test_globus.py from a
+sub-directory of /compyfs rather than /qfs.
 """
 
 import os
@@ -144,12 +147,14 @@ class TestZstash(unittest.TestCase):
         """
         Assert that the code is being run from the correct directory.
         """
-        actual = os.getcwd()
-        expected = "zstash"
-        if not actual.endswith(expected):
-            self.stop(
-                "Current_directory={} does not end in {}".format(actual, expected)
-            )
+        # To run the tests, we should be at the top of the repository.
+        ls_results = os.listdir()
+        if ("zstash" in ls_results) and (os.path.isdir("zstash")):
+            if ("tests" in ls_results) and (os.path.isdir("tests")):
+                return
+        self.stop(
+            f"Current directory={os.getcwd()} does not contain zstash and tests directories"
+        )
 
     def assertEqualOrStop(self, actual, expected):
         """
diff --git a/tests/test_check.py b/tests/test_check.py
index ae2c4a2..8683323 100644
--- a/tests/test_check.py
+++ b/tests/test_check.py
@@ -189,7 +189,7 @@ class TestCheck(TestZstash):
         )
         self.assertEqualOrStop(
             output + err,
-            'INFO: zstash/000000.tar exists. Checking expected size matches actual size.\nINFO: Opening tar archive {}/000000.tar\nINFO: Checking file1.txt\nINFO: Checking file2.txt\nINFO: No failures detected when checking the files. If you have a log file, run "grep -i Exception <log-file>" to double check.\n'.format(
+            'For help, please see https://e3sm-project.github.io/zstash. Ask questions at https://github.com/E3SM-Project/zstash/discussions/categories/q-a.\nINFO: zstash/000000.tar exists. Checking expected size matches actual size.\nINFO: Opening tar archive {}/000000.tar\nINFO: Checking file1.txt\nINFO: Checking file2.txt\nINFO: No failures detected when checking the files. If you have a log file, run "grep -i Exception <log-file>" to double check.\n'.format(
                 self.cache
             ),
         )