Skip to content

Commit

Permalink
Merge pull request #10 from biigle/patch-1
Browse files Browse the repository at this point in the history
Remove the aruna disk type
  • Loading branch information
mzur authored Feb 27, 2024
2 parents 63339e9 + a939cc3 commit ab0a6e6
Show file tree
Hide file tree
Showing 10 changed files with 145 additions and 374 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
}
],
"require": {
"biigle/laravel-aruna-driver": "^1.0",
"league/flysystem-aws-s3-v3": "^3.12",
"league/flysystem-read-only": "^3.3"
},
Expand Down
29 changes: 29 additions & 0 deletions src/Database/migrations/2024_02_26_110100_remove_aruna_type.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

use Biigle\Modules\UserDisks\UserDisk;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
UserDisk::where('type', 'aruna')->delete();
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
};
2 changes: 1 addition & 1 deletion src/Http/Requests/StoreUserDisk.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function rules()
{
return array_merge([
'name' => 'required',
'type' => 'required|in:s3,aruna',
'type' => 'required|in:s3',
], $this->getTypeValidationRules());
}

Expand Down
29 changes: 0 additions & 29 deletions src/config/user_disks.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*/
'types' => [
's3' => 'S3',
'aruna' => 'Aruna Object Storage',
],

/*
Expand All @@ -34,18 +33,6 @@
'secret' => '',
'endpoint' => '',
],
'aruna' => [
// These options are fixed.
'driver' => 'aruna',
'apiUri' => 'https://api.aruna-storage.org',
// These should be configured by the user.
'bucket' => '',
'key' => '',
'secret' => '',
'endpoint' => '',
'collectionId' => '',
'token' => '',
],
],

/*
Expand All @@ -60,14 +47,6 @@
'key' => 'required',
'secret' => 'required',
],
'aruna' => [
'bucket' => 'required',
'endpoint' => 'required|url',
'key' => 'required',
'secret' => 'required',
'collectionId' => 'required',
'token' => 'required',
],
],

/*
Expand All @@ -82,14 +61,6 @@
'key' => 'filled',
'secret' => 'filled',
],
'aruna' => [
'bucket' => 'filled',
'endpoint' => 'filled|url',
'key' => 'filled',
'secret' => 'filled',
'collectionId' => 'filled',
'token' => 'filled',
],
],

/*
Expand Down
5 changes: 2 additions & 3 deletions src/resources/views/manual/tutorials/about.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@
</div>
</div>

@foreach(config('user_disks.types') as $type => $name)
@include("user-disks::manual.types.{$type}")
@endforeach
@include("user-disks::manual.types.s3")

@include("user-disks::manual.types.aos")
</div>
@endsection
113 changes: 113 additions & 0 deletions src/resources/views/manual/types/aos.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<h4><a name="aos"></a>Aruna Object Storage</h4>

<p>
The <a href="https://aruna-storage.org/">Aruna Object Storage</a> (AOS) is a storage service for the German initiative for a national research data infrastructure (<a href="https://www.nfdi.de/">NFDI</a>). Before you can start using AOS, you have to sign up for a user account on the <a href="https://aruna-storage.org/">website</a>.
</p>

<p>
While the connection to AOS can be established via the same S3 protocol that is described above, the setup and configuration works a little differently. Here is a description of the S3 options for AOS:
</p>

<dl>
<dt>Bucket name</dt>
<dd>
<p>
The name of your AOS project.
</p>
</dd>

<dt>Endpoint</dt>
<dd>
<p>
The endpoint is the URL <code>https://&lt;bucket&gt;.data.gi.aruna-storage.org</code> where <code>&lt;bucket&gt;</code> is replaced with the bucket name above.
</p>
</dd>

<dt>Access key</dt>
<dd>
<p>
The "AccessKey" that is provided with new data proxy credentials.
</p>
</dd>

<dt>Secret key</dt>
<dd>
<p>
The "SecretKey" that is provided with new data proxy credentials.
</p>
</dd>
</dl>

<p>
Detailed setup instructions:
</p>

<ol>
<li>
<p>
Log in to the <a href="https://dev.aruna-storage.org">AOS dashboard</a>, select "Explore" and then "Resources" in the menu at the top.
</p>
</li>
<li>
<p>
Click on the "Create new" button and create a new project (we call it "myproject" here). The project name is the value of the <strong>Bucket name</strong> field that is required to create the new storage disk. With the project name you can also fill the <strong>Endpoint</strong> field.
</p>
</li>
<li>
<p>
Now select "Access" and then "Data proxies" in the AOS menu at the top. Choose a data proxy where you would like to store your data. There, click on the "Create Credential" button. The AccessKey is the value of the <strong>Access key</strong> field and the SecretKey is the value of the <strong>Secret key</strong> field that is required to create the new storage disk.
</p>
</li>
</ol>

<p>
Now you have the values for all fields that are required to create the new storage disk. However, one more step is required before you can annotate your data without restrictions in BIIGLE. You have to configure "Cross-origin resource sharing (CORS)". This is done as follows:
</p>

<ol>
<li>
<p>
Install <code>s3cmd</code> and run <code>s3cmd --configure</code>. Enter the access key and secret key from above. Don't change the default region. Enter the S3 endpoint <code>data.gi.aruna-storage.org</code> and the bucket template <code>%(bucket)s.data.gi.aruna-storage.org</code>. Leave the remaining options unchanged. Don't run the test with the supplied credentials and save the settings.
</p>
</li>
<li>
<p>
Create a file called <code>cors.xml</code> with the following content:
</p>
<pre>
&lt;CORSConfiguration&gt;
&lt;CORSRule&gt;
&lt;AllowedOrigin&gt;{{url('/')}}&lt;/AllowedOrigin&gt;
&lt;AllowedMethod&gt;GET&lt;/AllowedMethod&gt;
&lt;AllowedHeader&gt;*&lt;/AllowedHeader&gt;
&lt;MaxAgeSeconds&gt;30&lt;/MaxAgeSeconds&gt;
&lt;/CORSRule&gt;
&lt;/CORSConfiguration&gt;
</pre>
<p>
Then run the following command: <code>s3cmd setcors cors.xml s3://myproject</code> (you should replace "myproject" with the actual name of your project). That's it. Now CORS is configured for your project.
</p>
</li>
</ol>

<p>
Here is a brief example for how you can upload files to your project. This is also done with <code>s3cmd</code>;
</p>

<ol>
<li>
<p>
Make sure <code>s3cmd</code> is configured as described above.
</p>
</li>
<li>
<p>
Now navigate to the parent of the directory that you want to upload. Upload the whole directory with the following command (replace "mydir" with the name of the directory to upload and "myproject" with the name of your project):
</p>
<pre>s3cmd put -r mydir s3://myproject/</pre>
<p>
The directory will be created as a new dataset as part of your AOS project. In BIIGLE, you will see it as a directory in the file browser.
</p>
</li>
</ol>

124 changes: 0 additions & 124 deletions src/resources/views/manual/types/aruna.blade.php

This file was deleted.

Loading

0 comments on commit ab0a6e6

Please sign in to comment.