Skip to content

Commit 11600c6

Browse files
authored
Merge pull request #12394 from uncch-rdmc/12036-remove-minio-as-s3-storage-option
Replace MinIO with LocalStack as an S3 storage option
2 parents ec0a1a0 + b705ef1 commit 11600c6

8 files changed

Lines changed: 60 additions & 138 deletions

File tree

conf/keycloak/docker-compose-dev.yml

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,16 @@ services:
5353
-Ddataverse.files.localstack1.download-redirect=true
5454
-Ddataverse.files.localstack1.access-key=default
5555
-Ddataverse.files.localstack1.secret-key=default
56-
-Ddataverse.files.minio1.type=s3
57-
-Ddataverse.files.minio1.label=MinIO
58-
-Ddataverse.files.minio1.custom-endpoint-url=http://minio:9000
59-
-Ddataverse.files.minio1.custom-endpoint-region=us-east-1
60-
-Ddataverse.files.minio1.bucket-name=mybucket
61-
-Ddataverse.files.minio1.path-style-access=true
62-
-Ddataverse.files.minio1.upload-redirect=false
63-
-Ddataverse.files.minio1.download-redirect=false
64-
-Ddataverse.files.minio1.access-key=4cc355_k3y
65-
-Ddataverse.files.minio1.secret-key=s3cr3t_4cc355_k3y
56+
-Ddataverse.files.localstack_noredirect.type=s3
57+
-Ddataverse.files.localstack_noredirect.label=LocalStackNoRedirect
58+
-Ddataverse.files.localstack_noredirect.custom-endpoint-url=http://localstack:4566
59+
-Ddataverse.files.localstack_noredirect.custom-endpoint-region=us-east-2
60+
-Ddataverse.files.localstack_noredirect.bucket-name=mybucket-noredirect
61+
-Ddataverse.files.localstack_noredirect.path-style-access=true
62+
-Ddataverse.files.localstack_noredirect.upload-redirect=false
63+
-Ddataverse.files.localstack_noredirect.download-redirect=false
64+
-Ddataverse.files.localstack_noredirect.access-key=default
65+
-Ddataverse.files.localstack_noredirect.secret-key=default
6666
-Ddataverse.pid.providers=fake
6767
-Ddataverse.pid.default-provider=fake
6868
-Ddataverse.pid.fake.type=FAKE
@@ -260,23 +260,6 @@ services:
260260
tmpfs:
261261
- /localstack:mode=770,size=128M,uid=1000,gid=1000
262262

263-
dev_minio:
264-
container_name: "dev_minio"
265-
hostname: "minio"
266-
image: minio/minio
267-
restart: on-failure
268-
ports:
269-
- "9000:9000"
270-
- "9001:9001"
271-
networks:
272-
- dataverse
273-
volumes:
274-
- ./docker-dev-volumes/minio_storage:/data
275-
environment:
276-
MINIO_ROOT_USER: 4cc355_k3y
277-
MINIO_ROOT_PASSWORD: s3cr3t_4cc355_k3y
278-
command: server /data
279-
280263
previewers-provider:
281264
container_name: previewers-provider
282265
hostname: previewers-provider

conf/localstack/buckets.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
#!/usr/bin/env bash
22
# https://stackoverflow.com/questions/53619901/auto-create-s3-buckets-on-localstack
33
awslocal s3 mb s3://mybucket
4+
awslocal s3 mb s3://mybucket-noredirect

doc/sphinx-guides/source/installation/big-data-support.rst

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ If the bucket allows the wildcard ``*`` but the Dataverse application only allow
6868
Detailed information for the most common S3 admin tools around CORS:
6969

7070
- `AWS <https://docs.aws.amazon.com/AmazonS3/latest/userguide/enabling-cors-examples.html>`_
71-
- `Minio mc <https://docs.min.io/enterprise/aistor-object-store/reference/cli/mc-cors>`_
7271
- `s3cmd <https://servicedesk.surf.nl/wiki/spaces/WIKI/pages/215253125/Object+Store+S3+CORS+Policies>`_
7372

7473
Get Current CORS Policy on Bucket
@@ -80,9 +79,6 @@ If you'd like to check the CORS configuration on your bucket before making chang
8079
.. group-tab:: AWS CLI
8180
:code:`aws s3api get-bucket-cors --bucket <BUCKET_NAME>`
8281

83-
.. group-tab:: Minio Client (mc)
84-
:code:`mc cors get <STORE_NAME>/<BUCKET_NAME>`
85-
8682
Set CORS Policy on Bucket
8783
+++++++++++++++++++++++++
8884

@@ -107,9 +103,6 @@ Both JSON and XML format are explained in detail in `AWS Docs <https://docs.aws.
107103

108104
Alternatively, you can enable CORS using the AWS S3 web interface, using json-encoded rules as in the example above.
109105

110-
.. group-tab:: Minio Client (mc)
111-
Create a file :download:`cors.xml </_static/installation/cors/cors.xml>` as follows:
112-
113106
.. literalinclude:: /_static/installation/cors/cors.xml
114107
:name: xml-cors
115108
:language: xml
@@ -124,7 +117,7 @@ Both JSON and XML format are explained in detail in `AWS Docs <https://docs.aws.
124117
S3 Tags and Direct Upload
125118
~~~~~~~~~~~~~~~~~~~~~~~~~
126119

127-
Since the direct upload mechanism creates the final file rather than an intermediate temporary file, user actions, such as neither saving or canceling an upload session before closing the browser page, can leave an abandoned file in the store. The direct upload mechanism attempts to use S3 tags to aid in identifying/removing such files. Upon upload, files are given a "dv-state":"temp" tag which is removed when the dataset changes are saved and new files are added in the Dataverse installation. Note that not all S3 implementations support tags. Minio, for example, does not. With such stores, direct upload may not work and you might need to disable tagging. For details, see :ref:`s3-tagging` in the Installation Guide.
120+
Since the direct upload mechanism creates the final file rather than an intermediate temporary file, user actions, such as neither saving or canceling an upload session before closing the browser page, can leave an abandoned file in the store. The direct upload mechanism attempts to use S3 tags to aid in identifying/removing such files. Upon upload, files are given a "dv-state":"temp" tag which is removed when the dataset changes are saved and new files are added in the Dataverse installation. Note that not all S3 implementations support tags. With such stores, direct upload may not work and you might need to disable tagging. For details, see :ref:`s3-tagging` in the Installation Guide.
128121

129122
Trusted Remote Storage with the ``remote`` Store Type
130123
-----------------------------------------------------

doc/sphinx-guides/source/installation/config.rst

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,7 +1218,7 @@ You can configure this redirect properly in your cloud environment to generate a
12181218
Amazon S3 Storage (or Compatible)
12191219
+++++++++++++++++++++++++++++++++
12201220

1221-
The Dataverse Software supports Amazon S3 storage as well as other S3-compatible stores (like Minio, Ceph RADOS S3 Gateway and many more) for files uploaded to your Dataverse installation.
1221+
The Dataverse Software supports Amazon S3 storage as well as other S3-compatible stores (like Ceph RADOS S3 Gateway and many more) for files uploaded to your Dataverse installation.
12221222

12231223
The Dataverse Software S3 driver supports multi-part upload for large files (over 1 GB by default - see the min-part-size option in the table below to change this).
12241224

@@ -1264,7 +1264,7 @@ Please make note of the following details:
12641264

12651265
- **Endpoint URL** - consult the documentation of your service on how to find it.
12661266

1267-
* Example: https://play.minio.io:9000
1267+
* Example: http://localhost.localstack.cloud:4566
12681268

12691269
- **Region:** Optional, but some services might use it. Consult your service documentation.
12701270

@@ -1461,11 +1461,6 @@ You may provide the values for these via any `supported MicroProfile Config API
14611461
Reported Working S3-Compatible Storage
14621462
######################################
14631463

1464-
`Minio v2018-09-12 <https://minio.io>`_
1465-
Set ``dataverse.files.<id>.path-style-access=true``, as Minio works path-based. Works pretty smooth, easy to setup.
1466-
**Can be used for quick testing, too:** just use the example values above. Uses the public (read: unsecure and
1467-
possibly slow) https://play.minio.io:9000 service.
1468-
14691464
`StorJ Object Store <https://www.storj.io>`_
14701465
StorJ is a distributed object store that can be configured with an S3 gateway. Per the S3 Storage instructions above, you'll first set up the StorJ S3 store by defining the id, type, and label. After following the general installation, set the following configuration to use a StorJ object store: ``dataverse.files.<id>.chunked-encoding=false``. For step-by-step instructions see https://docs.storj.io/dcs/how-tos/dataverse-integration-guide/
14711466

docker-compose-dev.yml

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ services:
4444
-Ddataverse.files.localstack1.download-redirect=true
4545
-Ddataverse.files.localstack1.access-key=default
4646
-Ddataverse.files.localstack1.secret-key=default
47-
-Ddataverse.files.minio1.type=s3
48-
-Ddataverse.files.minio1.label=MinIO
49-
-Ddataverse.files.minio1.custom-endpoint-url=http://minio:9000
50-
-Ddataverse.files.minio1.custom-endpoint-region=us-east-1
51-
-Ddataverse.files.minio1.bucket-name=mybucket
52-
-Ddataverse.files.minio1.path-style-access=true
53-
-Ddataverse.files.minio1.upload-redirect=false
54-
-Ddataverse.files.minio1.download-redirect=false
55-
-Ddataverse.files.minio1.access-key=4cc355_k3y
56-
-Ddataverse.files.minio1.secret-key=s3cr3t_4cc355_k3y
47+
-Ddataverse.files.localstack_noredirect.type=s3
48+
-Ddataverse.files.localstack_noredirect.label=LocalStackNoRedirect
49+
-Ddataverse.files.localstack_noredirect.custom-endpoint-url=http://localstack:4566
50+
-Ddataverse.files.localstack_noredirect.custom-endpoint-region=us-east-2
51+
-Ddataverse.files.localstack_noredirect.bucket-name=mybucket-noredirect
52+
-Ddataverse.files.localstack_noredirect.path-style-access=true
53+
-Ddataverse.files.localstack_noredirect.upload-redirect=false
54+
-Ddataverse.files.localstack_noredirect.download-redirect=false
55+
-Ddataverse.files.localstack_noredirect.access-key=default
56+
-Ddataverse.files.localstack_noredirect.secret-key=default
5757
-Ddataverse.pid.providers=fake
5858
-Ddataverse.pid.default-provider=fake
5959
-Ddataverse.pid.fake.type=FAKE
@@ -252,23 +252,6 @@ services:
252252
tmpfs:
253253
- /localstack:mode=770,size=128M,uid=1000,gid=1000
254254

255-
dev_minio:
256-
container_name: "dev_minio"
257-
hostname: "minio"
258-
image: minio/minio
259-
restart: on-failure
260-
ports:
261-
- "9000:9000"
262-
- "9001:9001"
263-
networks:
264-
- dataverse
265-
volumes:
266-
- ./docker-dev-volumes/minio_storage:/data
267-
environment:
268-
MINIO_ROOT_USER: 4cc355_k3y
269-
MINIO_ROOT_PASSWORD: s3cr3t_4cc355_k3y
270-
command: server /data
271-
272255
previewers-provider:
273256
container_name: previewers-provider
274257
hostname: previewers-provider

scripts/dev/dev-start-frd.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ mkdir -p docker-dev-volumes/app/secrets
2828
mkdir -p docker-dev-volumes/postgresql/data
2929
mkdir -p docker-dev-volumes/solr/data
3030
mkdir -p docker-dev-volumes/solr/conf
31-
mkdir -p docker-dev-volumes/minio_storage
3231

3332
# Only disable DDL generation if database is already initialized
3433
# (on first run, we need create-tables to bootstrap the schema)

src/main/java/edu/harvard/iq/dataverse/dataaccess/S3AccessIO.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1331,8 +1331,8 @@ public void removeTempTag() throws IOException {
13311331
if (e.getCause() instanceof S3Exception) {
13321332
S3Exception s3e = (S3Exception) e.getCause();
13331333
if (s3e.statusCode() == 501) {
1334-
// In this case, it's likely that tags are not implemented at all (e.g. by
1335-
// Minio) so no tag was set either and it's just something to be aware of
1334+
// In this case, it's likely that tags are not implemented at all
1335+
// so no tag was set either and it's just something to be aware of
13361336
logger.warning("Temp tag not deleted: Object tags not supported by storage: " + driverId);
13371337
} else {
13381338
// In this case, the assumption is that adding tags has worked, so not removing

0 commit comments

Comments
 (0)