Globus-CLI

From Research Computing Center Wiki
Revision as of 14:39, 7 October 2021 by Shtsai (talk | contribs) (Created page with "The Globus Command Line Interface (CLI) provides an interface to Globus services from the shell, and is suited to both interactive and simple scripting use cases. The CLI can...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The Globus Command Line Interface (CLI) provides an interface to Globus services from the shell, and is suited to both interactive and simple scripting use cases. The CLI can be used to integrate Globus actions into your scripts to automate your data flows.

To use it on Sapelo2, you need to load the module first, and authenticate a session. This can be done on an interactive node, before you use Globus CLI commands in your scripts.

Example steps to use:

1. Start an interactive session with the command

interact

2. On the interactive node, load the Globus-CLI module with

ml Globus-CLI/2.1.0-GCCcore-8.3.0

3. Authenticate with Globus using the command globus login. This command will present you a URL, which you should copy and paste into a browser on your local machine. Once you visit the link in the browser, you will be prompted to login. Please choose University of Georgia in the "Use your existing organizational login" box. Choose continue and you will be forwarded to a UGA Single Sign-On (SSO) login page. You will also need to authenticate with Duo (two-factor authentication). Once the authentication is complete, your browser will display an Authorization Code, which you need to enter into your Sapelo2 session and press the return key.

[shtsai@ss-sub3 ~]$ interact

srun --pty  --cpus-per-task=1 --job-name=interact --ntasks=1 --nodes=1 --partition=inter_p --time=12:00:00 --mem=2GB /bin/bash -l

[shtsai@ra3-22 ~]$ ml Globus-CLI/2.1.0-GCCcore-8.3.0 
[shtsai@ra3-22 ~]$ globus login
Please authenticate with Globus here:
------------------------------------
https://auth.globus.org/v2/oauth2/authorize?client_id=c39024f239054858-d791-4e0c-bf78-b193sdf94506af640f&redirect_uri=https%3A%2F%2Fauth.globus.org%2Fv2%2Fweb%2Fauth-code&scope=openid+profile+email+urn%3Aglobus%3Aauth%3Ascope%3Aauth.globus.org%3Aview_identity_set+urn%3Aglobus%3Aauth%3Ascope%3Atransfer.api.globus.org%3Aall&state=_default&response_type=code&access_type=offline&prompt=login
------------------------------------

Enter the resulting Authorization Code here: EpaIO2Xdt94kgfkash6pzftQUM

You have successfully logged in to the Globus CLI!

You can check your primary identity with
  globus whoami

For information on which of your identities are in session use
  globus session show

Logout of the Globus CLI with
  globus logout

[shtsai@ra3-22 ~]$