|
| 1 | +# S3 as Storage backend |
| 2 | + |
| 3 | +## I chose S3 when initializing the repository! |
| 4 | + |
| 5 | +If you are reading the section you are lucky! you will only have to perform a few configuration changes. If on the contrary you didn't choose S3 as storage when initializing the repository file system, [navigate below](#i-didnt-choose-s3-when-initializing) to follow more in depth changes! |
| 6 | + |
| 7 | +### Create a bucket |
| 8 | + |
| 9 | +InvenioRDM uses a [minio](https://min.io/download) container for S3 alike storage. To create a bucket in minio you can: |
| 10 | + |
| 11 | +a. Install the [mc tool](https://docs.min.io/docs/minio-client-quickstart-guide.html) and run the following command, where `defaul-bucket` is the name of your bucket. |
| 12 | + |
| 13 | +``` console |
| 14 | +$ mc mb default-bucket |
| 15 | +``` |
| 16 | + |
| 17 | +b. Use the web UI (https://localhost[:9000]/minio). In the bottom right you will see a `+` sign, click there and add a new bucket. |
| 18 | + |
| 19 | +### Create a new location |
| 20 | + |
| 21 | +Now you need to tell InvenioRDM where is that bucket, for that create a new location. If you are running a local (development) instance, run: |
| 22 | + |
| 23 | +``` console |
| 24 | +$ cd path/to/your/instance |
| 25 | +$ pipenv run invenio files location s3-default s3://default-bucket --default |
| 26 | +``` |
| 27 | + |
| 28 | +If you are running the containerized version, run: |
| 29 | + |
| 30 | +``` console |
| 31 | +$ docker exec -it < web_[api|ui] container name or id> /bin/bash |
| 32 | +$ invenio files location s3-default s3://default-bucket --default |
| 33 | +``` |
| 34 | + |
| 35 | +### Set your credentials |
| 36 | + |
| 37 | +The last step is to set your credentials so your instance can authenticate against the S3 container. |
| 38 | + |
| 39 | +By default the `ACCESS_KEY` and the `ACCESS_ID` of minio are "CHANGE_ME", and so they are set in the `invenio.cfg` file. If you changed them (you should) modify them accordingly in the config file. |
| 40 | + |
| 41 | +It's done! Ready to roll! |
| 42 | + |
| 43 | +## I didn't choose S3 when initializing |
| 44 | + |
| 45 | +You are here, but do not panic, is not difficult just longer. |
| 46 | + |
| 47 | +This docs will come soon, for now we apologize for the hussle, but could you create a new instance to test S3? |
0 commit comments