E3SM-Project / E3SM-Project/zstash
[Feature]: Activate Globus immediately on `zstash update`
- Dominant language
- Python
- Stars
- 11
- Forks
- 10
- Avg merge
- 14h 18m
- Merged PRs (30d)
- 1
Description
### How will this affect the next version number?
New feature (increment MINOR version)
### Is your feature request related to a problem?
Related to #409, @wlin7 noted that `zstash update`
> can take significant time to check/gather file list before checking on auth token. Maybe we should switch the order: immediately checking on token and consent if zstash sets to use globus.
### Describe the solution you'd like
It looks like #414 (the main fix to #409) is going to be more focused on `stat` optimization. Nevertheless, this is still a good idea for a performance improvement and could be implemented separately. #412 (which is closed) added this block, which should work:
```python
# Check Globus authentication early to fail fast before file scanning
if config.hpss is not None and config.hpss != "none":
url = urlparse(config.hpss)
if url.scheme == "globus":
logger.info("Checking Globus authentication before file scanning...")
globus_activate(config.hpss)
# Existing code here:
# Start doing actual work
logger.debug("Running zstash update")
logger.debug("Local path : {}".format(config.path))
logger.debug("HPSS path : {}".format(config.hpss))
logger.debug("Max size : {}".format(maxsize))
logger.debug("Keep local tar files : {}".format(keep))
```
### Describe alternatives you've considered
_No response_
### Additional context
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.