Using Allas with rclone from your local computer
π The graphical user interfaces of Allas can normally manage data transfers between Allas and your local computing environment as long as the amount of data and number of files is small. However, if you need to move large amounts of data, then using command-line tools like rclone
or allas-cli-utils
could be a more efficient way to use Allas.
π¬ In this exercise, weβll study how you can use Allas from your own computer using rclone
, which is available for all common operating systems including Windows and macOS. Note that in macOS and Linux machines you can also install the whole allas-cli-utils repository locally.
Step 1. Installing rclone
βπ» If you already have rclone
command available, skip to Step 2.
- Download
rclone
executable to your own machine. Executables can be found from https://rclone.org/downloads/. - In case of Windows, if you donβt know which version to choose, try the Intel/AMD 64 bit version.
Step 2. Configuring rclone-Swift connection in local machine
- Start the process by opening a command shell and executing command:
- Windows:
.\rclone.exe config
- Linux and macOS:
./rclone config
- Windows:
- The configuration process in now done interactively in your command shell. In case of Allas, you need to do the following selections:
- Select n to create a New remote
- Name the remote as:
allas
- From the list of storage protocols, select the number corresponding to: OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
- Select authentication option 2: Get swift credentials from environment vars.
- Select the default blank setting for all the remaining settings until you are back in the starting menu of the configuration process.
- Finally, choose q to stop the configuration process.
- You need to do this configuration only once.
Step 3. Authentication
π In addition to the configuration, you must define a set of environment variables to authenticate your Allas connection each time you start using rclone
. If you have access to Puhti, you can use it as an easy way to generate a list of commands to set the authentication:
- Open a terminal connection to Puhti and activate there a connection to the Allas project you wish to use so that you add option
--show-powershell
(Windows) or option--show-shell
(macOS and Linux) to theallas-conf
command. - With these options, the configuration process prints out environment variable setting commands that you can run in your local machine to enable authentication to Allas.
Windows PowerShell
- If your local machine is running Windows, execute the following commands in Puhti:
module load allas allas-conf --show-powershell
- Copy the last four lines, starting with
$Env:
, to the local PowerShell and execute them. Then, test therclone
connection with command:.\rclone.exe lsd allas:
- Note that also in this case the connection will work only for the next 8 hours.
macOS and Linux (bash and zsh)
- If your local machine is running macOS or Linux, then the default shell is often
bash
orzsh
. To activate Allas connection in these cases, run the following commands in Puhti:module load allas allas-conf --show-shell
- Copy the last four lines, starting with
export
, to the local shell session and execute them. Then, test therclone
connection with command:./rclone lsd allas:
- Note that also in this case the connection will work only for the next 8 hours.
Step 4. Upload and download from local computer
π¬ Use rclone
to upload a small directory from your local computer to Allas. The sample commands below are written for Windows PowerShell. In macOS and Linux you should replace rclone.exe
with rclone
and .\
in the directory paths with ./
.
βπ» For this test, choose some unimportant directory that contains only a small amount of data (less than 1 GiB).
- First check what would be copied by running
rclone
command with option--dry-run
. Prefix the target bucket name in Allas with your username to make it unique. So in the sample commands below you should replacelocal-directory
andusername
with you own values..\rclone.exe copy -P --dry-run .\local-directory allas:username_local-directory
- If the test command above works, then run the same command without
--dry-run
to actually copy the data:.\rclone.exe copy -P .\local-directory allas:username_local-directory
- What was the speed of transfer? Calculate how long time it would take to copy 10 GiB of data with the same speed?
- Check the results with command:
.\rclone.exe ls allas:username_local-directory
- Finally, copy the same data to a new directory on your local computer:
.\rclone.exe copy -P allas:username_local-directory .\username_local-directory
- What was the speed of transfer? Calculate how long time it would take to copy 10 GiB of data with the same speed?
More information
π‘ Docs CSC: Local rclone
configuration for Allas