Skip to content

Commit 0419ead

Browse files
committed
feat: new minio version
upgraded minio from 2023.3.24 to 2025.6.13 community edition. Improved tests: added quota test
1 parent 6d77e1d commit 0419ead

File tree

9 files changed

+105
-23
lines changed

9 files changed

+105
-23
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone &
137137
curl -sL "$WSK_BASE/$WSK_VERSION/OpenWhisk_CLI-$WSK_VERSION-linux-$ARCH.tgz" | tar xzvf - -C /usr/bin/ && \
138138
# install minio
139139
MINIO_BASE=https://dl.min.io/client/mc/release/linux && \
140-
MC_VER=RELEASE.2023-03-23T20-03-04Z && \
140+
MC_VER=RELEASE.2025-05-21T01-59-54Z && \
141141
curl -sL "$MINIO_BASE-$ARCH/archive/mc.${MC_VER}" -o /usr/bin/mc && chmod +x /usr/bin/mc && \
142142
# install taskfile
143143
curl -sL https://taskfile.dev/install.sh | sh -s -- -d -b /usr/bin

nuvolaris/minio_util.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,23 @@ def mc(self, *kwargs):
5454
error = res.stderr.decode()
5555

5656
if returncode != 0:
57+
self.last_output = error
5758
logging.error(error)
5859
else:
60+
self.last_output = output
5961
logging.info(output)
6062

6163
return returncode == 0
6264
except Exception as e:
63-
logging.error(e)
64-
return e
65+
logging.error(e)
66+
return e
67+
68+
def get_last_output(self):
69+
"""
70+
returns the last output of the executed command
71+
"""
72+
return self.last_output if hasattr(self, 'last_output') else None
73+
6574

6675
def add_user(self, username, secret_key):
6776
"""
@@ -101,6 +110,7 @@ def assign_quota_to_bucket(self, bucket_name, quota):
101110
assign the specified quota on the given bucket
102111
"""
103112
return util.check(self.mc("quota","set",f"{self.alias}/{bucket_name}","--size", f"{quota}m"),"assign_quota_to_bucket",True)
113+
104114

105115
def assign_policy_to_user(self, username, policy):
106116
"""

nuvolaris/policies/minio_rw_policy_tpl.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,7 @@
77
],
88
"Effect": "Allow",
99
"Resource": [
10-
{% for bucket_arn in bucket_arns -%}
11-
"arn:aws:s3:::{{bucket_arn}}"
12-
{% if not loop.last %}
13-
,
14-
{% endif %}
15-
{% endfor %}
10+
{% for bucket_arn in bucket_arns %}"arn:aws:s3:::{{ bucket_arn }}"{{ "," if not loop.last }}{% endfor %}
1611
]
1712
}
1813
]

nuvolaris/templates/01-minio-dep.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ spec:
4343
{% endif %}
4444
containers:
4545
- name: minio
46-
image: bitnami/minio:2023.3.24
46+
image: bitnami/minio:2025.6.13
4747
securityContext:
4848
capabilities:
4949
drop:
@@ -53,11 +53,7 @@ spec:
5353
allowPrivilegeEscalation: false
5454
readOnlyRootFilesystem: false
5555
runAsNonRoot: true
56-
command:
57-
- /bin/bash
58-
- -c
59-
args:
60-
- minio server /data --console-address :9090
56+
command: ["/bin/bash", "-c", "minio server /data --console-address :9090"]
6157
env:
6258
- name: MINIO_ROOT_USER
6359
value: {{minio_root_user}}

nuvolaris/testutil.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,3 +311,11 @@ def load_sample_runtimes(name="runtimes"):
311311

312312
def enable_debug_logging():
313313
logging.basicConfig(level=logging.DEBUG)
314+
315+
def run_proc(cmd):
316+
try:
317+
get_ipython().system(cmd)
318+
except NameError:
319+
import subprocess
320+
subprocess.run(cmd.split(), check=True)
321+

tests/kind/minio_quota_test.ipy

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
#
18+
import os
19+
20+
import nuvolaris.config as cfg
21+
import nuvolaris.minio_deploy as minio
22+
import nuvolaris.minio_util as mutil
23+
import nuvolaris.testutil as tu
24+
import nuvolaris.util as util
25+
import json
26+
27+
tu.run_proc("kubectl -n nuvolaris delete all --all")
28+
tu.run_proc("kubectl -n nuvolaris delete pvc --all")
29+
30+
# test
31+
assert(cfg.configure(tu.load_sample_config()))
32+
assert(cfg.detect_storage()["nuvolaris.storageclass"])
33+
34+
os.environ['MINIO_API_HOST']='localhost'
35+
assert(minio.create())
36+
37+
pod_name = util.get_pod_name("{.items[?(@.metadata.labels.app == 'minio')].metadata.name}")
38+
assert(pod_name)
39+
40+
minioClient = mutil.MinioClient()
41+
assert(minioClient.make_bucket("ftt-data"))
42+
assert(minioClient.make_public_bucket("ftt-web"))
43+
assert(minioClient.add_user("ftt","jgfkjsgcasgfjgdsafgsdkfgkaj"))
44+
assert(minioClient.assign_rw_bucket_policy_to_user("ftt",["ftt-web/*","ftt-data/*"]))
45+
46+
assert(minioClient.assign_quota_to_bucket("ftt-data",10))
47+
48+
# upload 7M
49+
tu.run_proc(f"dd if=/dev/urandom of=/tmp/__minio_test_file1 bs=1M count=7")
50+
minioClient.mc("cp", f"/tmp/__minio_test_file1", f"local_ftt/ftt-data/file1")
51+
os.remove(f"/tmp/__minio_test_file1")
52+
53+
# check quota is 7M
54+
assert(minioClient.mc("du", "local/ftt-data", "--json"))
55+
last_output = minioClient.get_last_output()
56+
quota_info = json.loads(last_output)
57+
size = quota_info.get('size', 0)
58+
assert(size == 7340032)
59+
60+
61+
tu.run_proc(f"dd if=/dev/urandom of=/tmp/__minio_test_file2 bs=1M count=15")
62+
res = minioClient.mc("cp", f"/tmp/__minio_test_file2", f"local_ftt/ftt-data/file2")
63+
assert (res is False)
64+
last_output = minioClient.get_last_output()
65+
os.remove(f"/tmp/__minio_test_file2")
66+
assert(last_output.index("Bucket quota exceeded") >= 0)
67+
68+
69+
assert(minio.delete())

tests/kind/minio_static_test.ipy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
#
18-
!kubectl -n nuvolaris delete all --all
19-
!kubectl -n nuvolaris delete pvc --all
2018

2119
import os
2220

@@ -25,6 +23,10 @@ import nuvolaris.minio_deploy as minio
2523
import nuvolaris.storage_static as static
2624
import nuvolaris.testutil as tu
2725

26+
27+
tu.run_proc("kubectl -n nuvolaris delete all --all")
28+
tu.run_proc("kubectl -n nuvolaris delete pvc --all")
29+
2830
# test
2931
assert(cfg.configure(tu.load_sample_config()))
3032
assert(cfg.detect_storage()["nuvolaris.storageclass"])

tests/kind/minio_test.ipy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
#
18-
!kubectl -n nuvolaris delete all --all
19-
!kubectl -n nuvolaris delete pvc --all
20-
2118
import os
2219

2320
import nuvolaris.config as cfg
@@ -26,6 +23,9 @@ import nuvolaris.minio_deploy as minio
2623
import nuvolaris.testutil as tu
2724
import nuvolaris.util as util
2825

26+
tu.run_proc("kubectl -n nuvolaris delete all --all")
27+
tu.run_proc("kubectl -n nuvolaris delete pvc --all")
28+
2929
# test
3030
assert(cfg.configure(tu.load_sample_config()))
3131
assert(cfg.detect_storage()["nuvolaris.storageclass"])

tests/kind/minio_util_test.ipy

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
#
18-
!kubectl -n nuvolaris delete all --all
19-
!kubectl -n nuvolaris delete pvc --all
20-
2118
import os
2219

2320
import nuvolaris.config as cfg
@@ -26,6 +23,11 @@ import nuvolaris.minio_util as mutil
2623
import nuvolaris.testutil as tu
2724
import nuvolaris.util as util
2825

26+
tu.enable_debug_logging()
27+
28+
tu.run_proc("kubectl -n nuvolaris delete all --all")
29+
tu.run_proc("kubectl -n nuvolaris delete pvc --all")
30+
2931
# test
3032
assert(cfg.configure(tu.load_sample_config()))
3133
assert(cfg.detect_storage()["nuvolaris.storageclass"])

0 commit comments

Comments
 (0)