In this guide, we’ll link a OVH object storage to a Valohai project.
Requirements
- An OVH Cloud project that you can administer.
- A Valohai project or organization to link OVH object Storage to.
Create OVH Object Storage
To set up new object storage within the OVH console, follow these steps:
- Navigate to your OVH project and select ‘Object storage’ under the ‘Storage’ section.
- Click on ‘Create an object container’.
- Choose ‘S3 API’ as the solution.
- Select any preferred region.
- At the ‘Link User’ step, click ‘Create User’. Be sure to save the credentials generated during this step.
- Enter a name for your container and then create it.
Permissions
Now, let’s grant the new S3 user access to the files in the bucket:
- Create a JSON file with the necessary policy using your terminal:
echo '{"Statement":[{"Action":["s3:*"],"Effect":"Allow","Resource":["*"],"Sid":"FullAccess"}]}' > my_policy.json
- Navigate to the “S3 Users” tab under “Object Storage”, select your user, and choose “Import S3 Policy”.
- Select the newly created
my_policy.json
file to import the policy.
Once the policy is imported we are ready to link this bucket to Valohai.
Link the Store to Valohai
You can connect this data store either to a single project or create it on the organization level.
Link to a Valohai Organization
- Navigate to
Hi, <username>
(the top-right menu) ->Manage <organization>
- Open the “Data Stores” tab and add your store’s details. The data store can be shared with everyone in the organization, or you can expose the data store only to certain teams.
Link the Store to a Valohai Project
- Navigate to Project -> Settings -> Data Stores -> Add Amazon S3.
- Name: usually makes sense to use the same name as the bucket name.
- Bucket: the bucket name; “ovh-bucket-test” in this example; use the name that you set when creating the object storage in OVH.
- Access Keys: provide the
Access Key
andSecret Access Key
associated with your S3 user. - Set the region: check the region in OVH Object Storage, use lowercase, for example if ‘DE’ type ‘de’.
- Check the box labeled
Use put_object for uploads
. - When you create the store, the credentials provided will be checked by creating a small test file in the bucket. If the creation succeeds, you are good to go.
- Once the data store is linked, you can set it as your project’s default upload store under Settings -> General -> Default upload store. This ensures that uploaded outputs will be stored in this particular OVH storage by default.