Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Once the shared drive is initialized, it may be accessed from the supercomputer. It is highly recommend that these steps are followed from a Virtual Desktop session in our webapp web portal.

Code Block
languagebash
module load rclone/1.58.1
rclone config

...

Some users may wish to use a virtual desktop session as provided by our webapp, as one of the steps (prompt 10) will provide an authentication link and may attempt to open a browser window. This link may also be opened locally on the user’s computer. The guide assumes that the user is in a virtual desktop session.

Creating a Client ID and Secret through the Google API Console

Tip

The Green Info Box.

For those that are ready for production, rerun rclone config and edit the previous remote’s client_id and client_secret (Prompts 4 and 5). The steps below must be followed first (taken from the rclone Google Drive docs). Note that you only need one of these for all shared drives.

Here is how to create your own Google Drive client ID for rclone:

  1. Log into the Google API Console with your Google account. It doesn’t matter what Google account you use. (It need not be the same account as the Google Drive you want to access)

  2. Select a project or create a new project.

  3. Under “ENABLE APIS AND SERVICES” search for “Drive”, and enable the “Google Drive API”.

  4. Click “Credentials” in the left-side panel (not “Create credentials”, which opens the wizard), then “Create credentials”, then “OAuth client ID”. It will prompt you to set the OAuth consent screen product name, if you haven’t set one already.

  5. Choose an application type of “Desktop App”, and click “Create”. (the default name is fine)

  6. It will show you a client ID and client secret. Use these values in rclone config to add a new remote or edit an existing remote.

Table of Contents
minLevel4

Prompt 1 – New Remote – Response: n

The first prompt looks like this:

...

We respond with n, as the rclone configuration does not yet exist for our shared drive.

Prompt 2 – Name Remote – Response: <your-project-name>

The second prompt:

Code Block
languagebash
name>

This is arbitrary, but it’s wise to use the shared drive’s name. In this case, rc-drive.

Prompt 3 – Choose Cloud – Response: drive

The third prompt lists all the available cloud backends. Currently there are 46 enumerated options, but for simplicity, only the relevant option (# 17) is shown (N.B. in the future the number associated with Google Drive may change):

...

drive or 17 are both proper responses.

Prompt 4 – Client ID – Response: Client ID from the Green Info Box or None

This prompt and the next involve creating an application on Google Cloud, and may lead to improved throughput. Note that the steps for this are documented above in the green Info Box and also in the video documentation.

...

So the response here is to paste in the Client ID.

Prompt 5 – Client Secret – Response: Client Secret from the Green Info Box or None

This prompt and the previous involve creating an application on Google Cloud, and may lead to improved throughput. Note that the steps for this are documented above in the green Info Box and also in the video documentation.

...

So the response here is to paste in the Client Secret.

Prompt 6 – Remote Permissions (Scopes) – Response: 1

Another big prompt here, but rclone needs full access to all files. We will specify that rclone is limited to our shared drive by Prompt 13. Scopes are addressed here by the rclone devs and defined here by Google.

...

drive or 1 are both sufficient responses.

Prompt 7 – Root Folder ID – Response: None

We leave this next prompt’s response blank, as we want to work from the root of our shared drive.

...

We accept the default empty string (just hit the return key).

Prompt 8 – Service Account File – Reponse: None

Another advanced Google Cloud application feature, we ignore this. Service accounts may be used to automate certain tasks for users.

...

We accept the default empty string (just hit the return key).

Prompt 9 – Enter Advanced Config – Response: n

The basic configuration has been done by this point, and rclone offers to make it longer. The advanced configuration is optional and unrecommended.

...

n is the recommended response.

Prompt 10 – Auto Config – Response: n

We now inform rclone that we are on the supercomputer. Responding y here will lead to a remote browser session, which is not an issue if using a virtual desktop session as provided by our webapp. With ssh, n is recommended and assumed instead.

Code Block
languagebash
Remote config
Use auto config?
 * Say Y if not sure
 * Say N if you are working on a remote or headless machine or Y didn't work
y) Yes
n) No
y/n> 

We respond with n.

Prompt 11 – Configure Shared Drive – Response: y

This prompt configures rclone to only associate with a shared drive. Note that rclone refers to the shared drive as a team drive.

...

y is the recommended response.

Prompt 12 – Choose Shared Drive – Response: <integer_associated_with_shared_drive>

Assuming y was passed to Prompt 11, rclone retrieves a list of shared drives (referred to as team drives) from the user’s Google Drive.

...

To choose the shared drive noted in the example, either the integer associated with the shared drive or the alphanumeric string may be used as responses, that is 1 or 0XXXXXXXXXXXXXXXXXX.

Prompt 13 – Summary – Response: y

rclone then summarizes the configuration and asks for confirmation. The shared drive is specified by its alphanumeric id from Prompt 12, and the access tokens are saved in the JSON structure token.

Code Block
--------------------
[rc-drive]
type = drive
scope = drive
token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"1//XXX","expiry":"2019-10-15T16:38:26.358522694-07:00"}
team_drive = 0XXXXXXXXXXXXXXXXXX
--------------------
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d>

y confirms the summary.

Prompt 14 – Finished – Response: q

The configuration is complete, and rclone loops back to the first prompt but with an existing configuration.

...

Assuming there are no more remotes to configure, q may be passed to the prompt.

Post Prompt

Recalling that this was all done within an interactive session, the session should now be closed.

...