Arbutus object storage clients: Difference between revisions

Jump to navigation Jump to search
Marked this version for translation
No edit summary
(Marked this version for translation)
Line 2: Line 2:
<translate>
<translate>


<!--T:1-->
For information on obtaining Arbutus Object Storage, please see the [[Arbutus_Object_Storage_User_Guide|Object Storage User Guide]].  This page describes how to configure and use two common object storage clients:
For information on obtaining Arbutus Object Storage, please see the [[Arbutus_Object_Storage_User_Guide|Object Storage User Guide]].  This page describes how to configure and use two common object storage clients:
# s3cmd
# s3cmd
# WinSCP
# WinSCP


<!--T:2-->
It is important to note that Arbutus' Object Storage solution does not use Amazon's [https://documentation.help/s3-dg-20060301/VirtualHosting.html S3 Virtual Hosting] (i.e. DNS-based bucket) approach which these clients assume by default. They need to be configured not to use that approach as described below.
It is important to note that Arbutus' Object Storage solution does not use Amazon's [https://documentation.help/s3-dg-20060301/VirtualHosting.html S3 Virtual Hosting] (i.e. DNS-based bucket) approach which these clients assume by default. They need to be configured not to use that approach as described below.


== s3cmd ==
== s3cmd == <!--T:3-->
=== Installing s3cmd ===
=== Installing s3cmd ===
Depending on your Linux distribution, the <code>s3cmd</code> command can be installed using the appropriate <code>yum</code> (RHEL, CentOS) or <code>apt</code> (Debian, Ubuntu) command:
Depending on your Linux distribution, the <code>s3cmd</code> command can be installed using the appropriate <code>yum</code> (RHEL, CentOS) or <code>apt</code> (Debian, Ubuntu) command:


<!--T:4-->
<code>$ sudo yum install s3cmd</code><br/>
<code>$ sudo yum install s3cmd</code><br/>
<code>$ sudo apt install s3cmd </code>
<code>$ sudo apt install s3cmd </code>


=== Configuring s3cmd ===
=== Configuring s3cmd === <!--T:5-->
To configure the <code>s3cmd</code> tool use the command:</br>
To configure the <code>s3cmd</code> tool use the command:</br>
<code>$ s3cmd --configure</code>
<code>$ s3cmd --configure</code>


<!--T:6-->
And make the following configurations with the keys provided by the Arbutus team:
And make the following configurations with the keys provided by the Arbutus team:
<pre>
<pre>
Line 24: Line 28:
Refer to user manual for detailed description of all options.
Refer to user manual for detailed description of all options.


<!--T:7-->
Access key and Secret key are your identifiers for Amazon S3. Leave them empty for using the env variables.
Access key and Secret key are your identifiers for Amazon S3. Leave them empty for using the env variables.
Access Key []: 20_DIGIT_ACCESS_KEY
Access Key []: 20_DIGIT_ACCESS_KEY
Line 29: Line 34:
Default Region [US]:
Default Region [US]:


<!--T:8-->
Use "s3.amazonaws.com" for S3 Endpoint and not modify it to the target Amazon S3.
Use "s3.amazonaws.com" for S3 Endpoint and not modify it to the target Amazon S3.
S3 Endpoint []: object-arbutus.cloud.computecanada.ca
S3 Endpoint []: object-arbutus.cloud.computecanada.ca


<!--T:9-->
Use "%(bucket)s.s3.amazonaws.com" to the target Amazon S3. "%(bucket)s" and "%(location)s" vars can be used
Use "%(bucket)s.s3.amazonaws.com" to the target Amazon S3. "%(bucket)s" and "%(location)s" vars can be used
if the target S3 system supports dns based buckets.
if the target S3 system supports dns based buckets.
DNS-style bucket+hostname:port template for accessing a bucket []: object-arbutus.cloud.computecanada.ca
DNS-style bucket+hostname:port template for accessing a bucket []: object-arbutus.cloud.computecanada.ca


<!--T:10-->
Encryption password is used to protect your files from reading
Encryption password is used to protect your files from reading
by unauthorized persons while in transfer to S3
by unauthorized persons while in transfer to S3
Line 41: Line 49:
Path to GPG program []: /usr/bin/gpg
Path to GPG program []: /usr/bin/gpg


<!--T:11-->
When using secure HTTPS protocol all communication with Amazon S3
When using secure HTTPS protocol all communication with Amazon S3
servers is protected from 3rd party eavesdropping. This method is
servers is protected from 3rd party eavesdropping. This method is
Line 46: Line 55:
Use HTTPS protocol []: Yes
Use HTTPS protocol []: Yes


<!--T:12-->
On some networks all internet access must go through a HTTP proxy.
On some networks all internet access must go through a HTTP proxy.
Try setting it here if you can't connect to S3 directly
Try setting it here if you can't connect to S3 directly
Line 51: Line 61:
</pre>
</pre>


=== Create buckets ===
=== Create buckets === <!--T:13-->
The next task is to make a bucket.  Buckets contain files. Bucket names must be globally unique across the Arbutus object storage solution.  Therefore, you will need to create a uniquely named bucket which will not conflict with other users.  For example, the buckets "s3://test/" and "s3://data/" are likely already taken.  Consider creating buckets reflective of your project, for example "s3://def-test-bucket1" or "s3://atlas_project_bucket".  Valid bucket names may only use the upper case characters, lower case characters, digits, periods, dashes, and underscores (i.e. A-Z, a-z, 0-9, ., -, and _ ).
The next task is to make a bucket.  Buckets contain files. Bucket names must be globally unique across the Arbutus object storage solution.  Therefore, you will need to create a uniquely named bucket which will not conflict with other users.  For example, the buckets "s3://test/" and "s3://data/" are likely already taken.  Consider creating buckets reflective of your project, for example "s3://def-test-bucket1" or "s3://atlas_project_bucket".  Valid bucket names may only use the upper case characters, lower case characters, digits, periods, dashes, and underscores (i.e. A-Z, a-z, 0-9, ., -, and _ ).


<!--T:14-->
To create a bucket, use the tool's <code>mb</code> (make bucket) command:
To create a bucket, use the tool's <code>mb</code> (make bucket) command:


<!--T:15-->
<code>$ s3cmd mb s3://BUCKET_NAME/</code>
<code>$ s3cmd mb s3://BUCKET_NAME/</code>


<!--T:16-->
To see the status of a bucket, use the <code>info</code> command:
To see the status of a bucket, use the <code>info</code> command:


<!--T:17-->
<code>$ s3cmd info s3://BUCKET_NAME/</code>
<code>$ s3cmd info s3://BUCKET_NAME/</code>


<!--T:18-->
The output will look something like this:
The output will look something like this:


<!--T:19-->
<pre>
<pre>
s3://BUCKET_NAME/ (bucket):
s3://BUCKET_NAME/ (bucket):
Line 76: Line 92:
</pre>
</pre>


=== Upload files ===
=== Upload files === <!--T:20-->
To upload a file to the bucket, use the <code>put</code> command similar to this:
To upload a file to the bucket, use the <code>put</code> command similar to this:


<!--T:21-->
<code>$ s3cmd put --guess-mime-type FILE_NAME.dat s3://BUCKET_NAME/FILE_NAME.dat</code>
<code>$ s3cmd put --guess-mime-type FILE_NAME.dat s3://BUCKET_NAME/FILE_NAME.dat</code>


<!--T:22-->
Where the bucket name and the file name are specified.  Multipurpose Internet Mail Extensions (MIME) is a mechanism for handling files based on their type. The <code>--guess-mime-type</code> command parameter will guess the MIME type based on the file extension.  The default MIME type is <code>binary/octet-stream</code>.
Where the bucket name and the file name are specified.  Multipurpose Internet Mail Extensions (MIME) is a mechanism for handling files based on their type. The <code>--guess-mime-type</code> command parameter will guess the MIME type based on the file extension.  The default MIME type is <code>binary/octet-stream</code>.


=== Delete File ===
=== Delete File === <!--T:23-->
To delete a file from the bucket, use the  <code>rm</code> command similar to this:<br/>
To delete a file from the bucket, use the  <code>rm</code> command similar to this:<br/>
<code>$ s3cmd rm s3://BUCKET_NAME/FILE_NAME.dat</code>
<code>$ s3cmd rm s3://BUCKET_NAME/FILE_NAME.dat</code>


=== ACLs and Policies ===
=== ACLs and Policies === <!--T:24-->
Buckets can have Access Control Lists (ACLs) and policies which govern who can access what resources in the object store.  These features are quite sophisticated.  Here are two simple examples of using ACLs using the tool's <code>setacl</code> command.
Buckets can have Access Control Lists (ACLs) and policies which govern who can access what resources in the object store.  These features are quite sophisticated.  Here are two simple examples of using ACLs using the tool's <code>setacl</code> command.


<!--T:25-->
<code>$ s3cmd setacl --acl-public -r s3://BUCKET_NAME/</code>
<code>$ s3cmd setacl --acl-public -r s3://BUCKET_NAME/</code>


<!--T:26-->
The result of this command is that the public can access the bucket and recursively (-r) every file in the bucket.  Files can be accessed via URLs such as<br/>
The result of this command is that the public can access the bucket and recursively (-r) every file in the bucket.  Files can be accessed via URLs such as<br/>
https://object-arbutus.cloud.computecanada.ca/BUCKET_NAME/FILE_NAME.dat.
https://object-arbutus.cloud.computecanada.ca/BUCKET_NAME/FILE_NAME.dat.


<!--T:27-->
The second ACL example limits access to the bucket to only the owner:
The second ACL example limits access to the bucket to only the owner:


<!--T:28-->
<code>$ s3cmd setacl --acl-private s3://BUCKET_NAME/</code>
<code>$ s3cmd setacl --acl-private s3://BUCKET_NAME/</code>


<!--T:29-->
Other more sophisticated examples can be found in the s3cmd man page.
Other more sophisticated examples can be found in the s3cmd man page.


== WinSCP ==
== WinSCP == <!--T:30-->


=== Installing WinSCP ===
=== Installing WinSCP === <!--T:31-->
WinSCP can be downloaded from https://winscp.net/ and installed by launching the downloaded WinSCP installer.
WinSCP can be downloaded from https://winscp.net/ and installed by launching the downloaded WinSCP installer.


=== Configuring WinSCP ===
=== Configuring WinSCP === <!--T:32-->
Under "New Session", make the following configurations:
Under "New Session", make the following configurations:
<ul>
<ul>
Line 116: Line 139:
and "Save" these settings as shown below
and "Save" these settings as shown below


<!--T:33-->
[[File:WinSCP Configuration.png|600px|thumb|center|WinSCP configuration screen]]
[[File:WinSCP Configuration.png|600px|thumb|center|WinSCP configuration screen]]


<!--T:34-->
Next, click on the "Edit" button and then click on "Advanced..." and navigate to "Environment" to "S3" to "Protocol options" to "URL style:" which <b>must</b> changed from "Virtual Host" to "Path" as shown below:
Next, click on the "Edit" button and then click on "Advanced..." and navigate to "Environment" to "S3" to "Protocol options" to "URL style:" which <b>must</b> changed from "Virtual Host" to "Path" as shown below:


<!--T:35-->
[[File:WinSCP Path Configuration.png|600px|thumb|center|WinSCP Path Configuration]]
[[File:WinSCP Path Configuration.png|600px|thumb|center|WinSCP Path Configuration]]


<!--T:36-->
This "Path" setting is important, otherwise WinSCP will not work and you will see hostname resolution errors, like this:
This "Path" setting is important, otherwise WinSCP will not work and you will see hostname resolution errors, like this:
[[File:WinSCP resolve error.png|400px|thumb|center|WinSCP resolve error]]
[[File:WinSCP resolve error.png|400px|thumb|center|WinSCP resolve error]]


=== Using WinSCP ===
=== Using WinSCP === <!--T:37-->
Click on the "Login" button and use the WinSCP GUI to create buckets and to transfer files:
Click on the "Login" button and use the WinSCP GUI to create buckets and to transfer files:


<!--T:38-->
[[File:WinSCP transfers.png|800px|thumb|center|WinSCP file transfer screen]]
[[File:WinSCP transfers.png|800px|thumb|center|WinSCP file transfer screen]]


=== ACLs and Policies ===
=== ACLs and Policies === <!--T:39-->
Unfortunately, as of version 5.19 WinSCP is not capable of managing object storage ACLs and Policies.
Unfortunately, as of version 5.19 WinSCP is not capable of managing object storage ACLs and Policies.


<!--T:40-->
[[Category:CC-Cloud]]
[[Category:CC-Cloud]]
</translate>
</translate>
rsnt_translations
56,420

edits

Navigation menu