GoCommands#

This section shows how to download files and directories from the UNLOCK FDP using GoCommands. GoCommands is an alternative to iCommands, it is much easier to install and is focused on ease of user experience, although it still requires some command line familiarity.

Documentation:
https://learning.cyverse.org/ds/gocommands/

GitHub repository:
cyverse/gocommands

Installation#

  1. Press the `Windows’ button, type PowerShell and run it as administrator.

  2. Use the following command in PowerShell:

New-Item -ItemType Directory -Path "$env:USERPROFILE\gocmd-irods" | Out-Null ; New-Item -ItemType Directory -Path "$env:USERPROFILE\.irods" | Out-Null ; cd "$env:USERPROFILE\gocmd-irods"
  1. You might have gotten warnings if you had already created a .irods folder under your home directory, this is safe to ignore. Run the next command, the terminal will exit after completion:

curl -o gocmdv.txt https://raw.githubusercontent.com/cyverse/gocommands/main/VERSION.txt ; $env:GOCMD_VER = (Get-Content gocmdv.txt) ; curl -o gocmd.zip https://github.com/cyverse/gocommands/releases/download/$env:GOCMD_VER/gocmd-$env:GOCMD_VER-windows-amd64.zip ; tar zxvf gocmd.zip ; del gocmd.zip ; del gocmdv.txt ; [Environment]::SetEnvironmentVariable("Path", "$env:Path;$env:USERPROFILE\gocmd-irods", "User") ; exit
  1. Verify your installation in a new shell session:

gocmd --help

You can either download a pre-built binary (use with ./gocmd), or install GoCommands through conda.

  • Binary file Download the latest binary file from: cyverse/gocommands, or run the command for Darwin-amd64 (Mac OS Intel):

GOCMD_VER=$(curl -L -s https://raw.githubusercontent.com/cyverse/gocommands/main/VERSION.txt); \
curl -L -s https://github.com/cyverse/gocommands/releases/download/${GOCMD_VER}/gocmd-${GOCMD_VER}-darwin-amd64.tar.gz | tar zxvf -

Or Darwin-arm64 (Mac OS M1/M2):

GOCMD_VER=$(curl -L -s https://raw.githubusercontent.com/cyverse/gocommands/main/VERSION.txt); \
curl -L -s https://github.com/cyverse/gocommands/releases/download/${GOCMD_VER}/gocmd-${GOCMD_VER}-darwin-arm64.tar.gz | tar zxvf -
  • Conda Add the conda-forge channel to conda:

conda config --add channels conda-forge
conda config --set channel_priority strict

Install GoCommands:

conda install gocommands

You can either download a pre-built binary (use with ./gocmd), or install GoCommands through conda.

  • Binary file Download the latest binary file from: cyverse/gocommands, or run the command for Linux-amd64:

GOCMD_VER=$(curl -L -s https://raw.githubusercontent.com/cyverse/gocommands/main/VERSION.txt); \
curl -L -s https://github.com/cyverse/gocommands/releases/download/${GOCMD_VER}/gocmd-${GOCMD_VER}-linux-amd64.tar.gz | tar zxvf -

Or Linux-arm64:

GOCMD_VER=$(curl -L -s https://raw.githubusercontent.com/cyverse/gocommands/main/VERSION.txt); \
curl -L -s https://github.com/cyverse/gocommands/releases/download/${GOCMD_VER}/gocmd-${GOCMD_VER}-linux-arm64.tar.gz | tar zxvf -
  • Conda Add the conda-forge channel to conda:

conda config --add channels conda-forge
conda config --set channel_priority strict

Install GoCommands:

conda install gocommands

Authentication#

GoCommands (like all iRODS clients) requires a configuration file, which ensures that your connection is encrypted and that you do not need to provide all access information each time you connect to the UNLOCK FDP. This file is typically stored in your home directory under a folder called .irods:

OS

Path to .irods folder

Windows

C:\Users\<your-username>\.irods

macOS

/Users/<your-username>/.irods

Linux

/home/<your-username>/.irods

Create a file named irods_environment.json in this folder. Make sure that the extension is correct, enter the following information in the file:

{
    "irods_user_name": "<USERNAME>",
    "irods_host": "data.m-unlock.nl",
    "irods_port": 1247,
    "irods_zone_name": "unlock",
    "irods_home": "/",
    "irods_authentication_scheme": "pam_password",
    "irods_encryption_algorithm": "AES-256-CBC",
    "irods_encryption_key_size": 32,
    "irods_encryption_num_hash_rounds": 16,
    "irods_encryption_salt_size": 8,
    "irods_client_server_policy": "CS_NEG_REQUIRE",
    "irods_client_server_negotiation": "request_server_negotiation"
 }

Make sure to fill in your USERNAME in the first field.

To verify your configuration file, use the following command:

gocmd env

You can alternatively set up your configuration file with the following command:

gocmd init

The first time you run GoCommands, it will prompt you for your SRAM token. After which the GoCommands are ready to use.

Usage#

Use gocmd help for an overview of all GoCommands. You will find many familiar UNIX commands that work on the remote filesystem such as cd, pwd, ls, mkdir, cp, mv, rm, cat, etc.

Within the UNLOCK FDP the data structure is very similar to the metadata registration structure. Read access is granted to people that are associated to the project and/or the investigation. The root folder is the landing directory of the UNLOCK FDP, also called a zone. Within this zone, the project folders that are accessible to you can be seen with the following command:

gocmd ls unlock/home

Within this home folder you should find your project folder under wur.YOUR_PROJECT_NAME. In this project folder you will find the original excel sheet that was used for the data registration under a metadata subfolder (after logging in and validation through the FAIR Data Station).
To download a file you can use the get command which will download the file into your current directory, you can add a progress bar by adding the flag --progress:

gocmd get unlock/home/wur.YOUR_PROJECT_NAME/some_file_to_download.txt

Conversely, put will upload a file:

gocmd put files/or/folders/to/upload unlock/home/wur.YOUR_PROJECT_NAME/destination