Storj/Object Mount and CaraOne can be integrated together fairly easily. You will need an object storage, and valid user credentials that can read and write to that object storage.  For installing Storj/Object Mount and getting the object storage mounted appropriately follow the help guides on their support site or contact Storj/Object Mount  directly.   2nd link below is detailed information for set-up.

https://supportdcs.storj.io/hc/en-us

https://cuno-cunofs.readthedocs-hosted.com/en/stable/getting-started-download-and-installation.html


CaraOne Server setup

To connect the CaraOne server to Storj/Object Mount, you first need to download Storj/Object Mount via wget, and install it via apt:

wget https://github.com/cunoFS/cunoFS/releases/latest/download/cuno-glibc-installer.run

sudo sh cuno-glibc-installer.run

You will be prompted to read and agree to the terms to continue the install. 


License

You will be able to do a free evaluation for 14 days.  Contact sales@cuno.io for a quote to get a permanent license.  If you are using the free evaluation license, no need to run the activate command.

cuno creds activate


Test

You will be able to test to make sure the software is working correctly.

cuno version


To test to make sure the Object Mount software is working correctly, you can type in the following and should see similar results.

$ cuno run sh -c "ls s3://stpubdata/"

galex  hst  jwst  k2  kepler  panstarrs  tess

$ cuno run sh -c "ls s3://stpubdata/tess/public/*"

's3://stpubdata/tess/public/ffi':
s0001  s0005  s0009  s0013  s0017  s0021  s0025  s0029 ... [truncated]

's3://stpubdata/tess/public/mast':
tess-s0001-1-1-cube.fits  tess-s0012-1-4-cube.fits  tess-s0023-2-3-cube.fits ... [truncated]

... [truncated]


Object Storage Devices

Object Mount supports AWS S3, Microsoft Azure, Google Cloud Storage and S3 compatible storages.  Refer to the installation link above for details on each mount type.


This example will be for connecting a AWS S3 storage.

1. Create a Credentials file on your CaraOne server. 

Example: touch /home/user/credentials.txt

 sudo touch /home/user/credentials.txt

The file needs to have in this case aws_access_key_id and aws_secret_access_key.  (refer the above links for other S3 devices)

sudo vi /home/user/credentials.txt


The file should look like this:

aws_access_key_id = xxxxxxxxxxxxxxxxxx
aws_secret_access_key = xxxxxxxxxxxxxxxxxx


After saving the file, change its permissions to 0600.

sudo chmod 0600 /home/user/credentials.txt



Credentials for Object Mount.

Copy your credentials to the default location:

sudo mkdir -p ~/.aws 
sudo cp /home/user/credentials.txt ~/.aws/credentials

This is assuming your saved credentials are in the file "credentials.txt" 

cuno creds import /home/user/credentials.txt


Test your credentials.

Try listing your paired buckets:

ls s3://


Try listing objects:

ls s3://bucket_name/


Try writing to the bucket:

echo "hello world" > s3://bucket_name/helloworld.txt


Try reading the file:

cat s3://bucket_name/helloworld.txt


Try deleting the file:

rm s3://bucket_name/helloworld.txt


Usage

Access the path via path or URI formats.

$ cuno
(cuno)$ ls s3://<bucket>/<path>
(cuno)$ ls /cuno/s3/<bucket>/<path>


Mounting storage

Object Mount allow you to mount an object storage path in a directory within the system.

mkdir /mnt/CaraOne
cuno mount /mnt/CaraOne
cuno mount --technician s3://bucket_name /mnt/CaraOne

** Note technician is our username.  


Persistent mount

You will want to set-up a persistent mount so the mount will happen after reboots.

Create a wrapper file, for example /opt/cuno/libexec/cunomnt-posix-restart 

sudo vi /opt/cuno/libexec/cunomnt-posix-restart
#!/bin/bash
/opt/cuno/libexec/cuno-mount $@ --posix --auto-restart

(Above is if enabling posix mode and it hasn’t been enabled on the bucket already using cuno creds setposix s3://bucketname true) 


Make the file executable:

sudo chmod a+x /opt/cuno/libexec/cunomnt-posix-restart


The fstab file should look like this:

/opt/cuno/libexec/cunomnt-posix-restart#--root=s3://bucket/path/ /my/local/mountpath fuse _netdev 0 0


Or look like this:

/opt/cuno/libexec/cunomnt-posix-restart#--root=s3://bucket/path/ /my/local/mountpath fuse _netdev,uid=1001,gid=1002,filemode=0664,dirmode=0775 0 0

Once this is set-up, then follow the standard CaraOne storage setup tp get CaraOne indexing the Object Storage location.



Client Setup

You will first Download the Object Mount client ( Windows or Mac  ) and consult Object Mount support for any questions and download locations. 

https://supportdcs.storj.io/hc/en-us


Launch the Object Mount client and provide the same filesystem and user authentication used on the server. This will create the mount point as a Drive letter on Windows, and a volume in /Volumes on a mac. 


You will need to update your CaraOne client config with the correct server and local mountpoint. 

You are now able to search within CaraOne to your object storage location.