diff --git a/users/how-to/quota_pb_minio.ipynb b/users/how-to/quota_pb_minio.ipynb new file mode 100644 index 0000000..d70172b --- /dev/null +++ b/users/how-to/quota_pb_minio.ipynb @@ -0,0 +1,1221 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "2ce331a6-818a-4b43-a139-942f2f9361a2", + "metadata": {}, + "source": [ + "# Can't create file of 100 MiB on minIO space??" + ] + }, + { + "cell_type": "markdown", + "id": "74798628-59e8-49e3-87fa-56c377588c8e", + "metadata": {}, + "source": [ + "## Clear my space" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "id": "df739287-646b-4db2-97c1-8a0fa408ebc0", + "metadata": {}, + "outputs": [], + "source": [ + "import s3fs\n" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "id": "c660357b-4cff-4f07-8f01-7bcd743bea6f", + "metadata": {}, + "outputs": [], + "source": [ + "access_key = !aws configure get aws_access_key_id\n", + "access_key = access_key[0]\n", + "secret_key = !aws configure get aws_secret_access_key\n", + "secret_key = secret_key[0]" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "id": "3f938612-2a10-48f0-97ef-f6ce5d14f8a2", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[]" + ] + }, + "execution_count": 3, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "client_kwargs={'endpoint_url': 'https://pangeo-eosc-minioapi.vm.fedcloud.eu/'}\n", + "\n", + "#s3 = s3fs.S3FileSystem(anon=False, client_kwargs=client_kwargs) # Works only when using s3 in this Notebook, not with distributed.\n", + "s3 = s3fs.S3FileSystem(key=access_key, secret=secret_key, client_kwargs=client_kwargs)\n", + "s3.rm(\"s3://todaka-test/myfile\")\n", + "s3.rm(\"s3://todaka-test/myfile_pr_an_limit\")\n", + "\n", + "s3.ls(\"s3://todaka-test/\")\n" + ] + }, + { + "cell_type": "markdown", + "id": "3baa6fe0-b049-44b2-8537-80e1e7301e46", + "metadata": {}, + "source": [ + "## Create test dataset for writing\n", + "\n", + "Change the value \n", + "size_in_MiB \n", + "for tests" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "id": "8957eb61-3479-488d-a8f3-0b9710008a9c", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
<xarray.Dataset>\n", + "Dimensions: (x: 50, y: 128, z: 1024)\n", + "Coordinates:\n", + " * x (x) int64 0 1 2 3 4 5 6 7 8 9 10 ... 40 41 42 43 44 45 46 47 48 49\n", + " * y (y) int64 0 1 2 3 4 5 6 7 8 ... 120 121 122 123 124 125 126 127\n", + " * z (z) int64 0 1 2 3 4 5 6 7 ... 1017 1018 1019 1020 1021 1022 1023\n", + "Data variables:\n", + " variable (x, y, z) float64 dask.array<chunksize=(50, 128, 1024), meta=np.ndarray>
<xarray.Dataset>\n", + "Dimensions: (x: 50, y: 128, z: 1024)\n", + "Coordinates:\n", + " * x (x) int64 0 1 2 3 4 5 6 7 8 9 10 ... 40 41 42 43 44 45 46 47 48 49\n", + " * y (y) int64 0 1 2 3 4 5 6 7 8 ... 120 121 122 123 124 125 126 127\n", + " * z (z) int64 0 1 2 3 4 5 6 7 ... 1017 1018 1019 1020 1021 1022 1023\n", + "Data variables:\n", + " variable (x, y, z) float64 dask.array<chunksize=(50, 128, 1024), meta=np.ndarray>