Skip to content

Commit 4d45d44

Browse files
committed
CI | Mint Integration with NooBaa
Signed-off-by: Romy <35330373+romayalon@users.noreply.github.com>
1 parent 59ae8cf commit 4d45d44

File tree

13 files changed

+461
-44
lines changed

13 files changed

+461
-44
lines changed

.github/workflows/mint-nc-tests.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
name: Mint NC Tests
3+
on: [workflow_call]
4+
5+
jobs:
6+
mint-nc-tests:
7+
name: Mint NC Tests
8+
runs-on: ubuntu-latest
9+
timeout-minutes: 90
10+
permissions:
11+
actions: read # download-artifact
12+
contents: read # required for actions/checkout
13+
steps:
14+
- name: Checkout noobaa-core
15+
uses: actions/checkout@v4
16+
with:
17+
repository: 'noobaa/noobaa-core'
18+
path: 'noobaa-core'
19+
20+
- name: Download artifact
21+
uses: actions/download-artifact@v4
22+
with:
23+
name: noobaa-tester
24+
path: /tmp
25+
26+
- name: Load image
27+
run: docker load --input /tmp/noobaa-tester.tar
28+
29+
- name: Create Mint logs directory
30+
run: |
31+
set -x
32+
cd ./noobaa-core
33+
mkdir -p logs/mint-nc-test-logs
34+
chmod 777 logs/mint-nc-test-logs
35+
36+
- name: Run NC Mint tests
37+
run: |
38+
set -x
39+
cd ./noobaa-core
40+
make test-nc-mint -o tester
41+
42+
- name: Upload artifact
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: mint-nc-test-logs
46+
path: noobaa-core/logs/mint-nc-test-logs
47+
retention-days: "1"
48+

.github/workflows/mint-tests.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Mint Tests
2+
on: [workflow_call]
3+
4+
jobs:
5+
mint-tests:
6+
name: Mint Tests
7+
runs-on: ubuntu-latest
8+
timeout-minutes: 90
9+
permissions:
10+
actions: read # download-artifact
11+
contents: read # required for actions/checkout
12+
steps:
13+
- name: Checkout noobaa-core
14+
uses: actions/checkout@v4
15+
with:
16+
repository: 'noobaa/noobaa-core'
17+
path: 'noobaa-core'
18+
19+
- name: Download artifact
20+
uses: actions/download-artifact@v4
21+
with:
22+
name: noobaa-tester
23+
path: /tmp
24+
25+
- name: Load image
26+
run: docker load --input /tmp/noobaa-tester.tar
27+
28+
- name: Create Mint logs directory
29+
run: |
30+
set -x
31+
cd ./noobaa-core
32+
mkdir -p logs/mint-test-logs
33+
chmod 777 logs/mint-test-logs
34+
35+
- name: Run Mint tests
36+
run: |
37+
set -x
38+
cd ./noobaa-core
39+
make test-mint -o tester
40+
41+
- name: Upload artifact
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: mint-test-logs
45+
path: noobaa-core/logs/mint-test-logs
46+
retention-days: "1"
47+

.github/workflows/run-pr-tests.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ jobs:
4141
needs: build-noobaa-image
4242
uses: ./.github/workflows/warp-nc-tests.yaml
4343

44+
mint-tests:
45+
needs: build-noobaa-image
46+
uses: ./.github/workflows/mint-tests.yaml
47+
48+
mint-nc-tests:
49+
needs: build-noobaa-image
50+
uses: ./.github/workflows/mint-nc-tests.yaml
51+
4452
build-noobaa-image:
4553
name: Build Noobaa Image
4654
runs-on: ubuntu-latest

Makefile

Lines changed: 57 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,17 @@ ifdef testname
8181
endif
8282
endif
8383

84+
######################
85+
# S3SELECT VARIABLES #
86+
######################
87+
8488
BUILD_S3SELECT?=1
8589
BUILD_S3SELECT_PARQUET?=0
8690

87-
## RPM VARIABLES
91+
#################
92+
# RPM VARIABLES #
93+
#################
94+
8895
DATE := $(shell date +'%Y%m%d')
8996
NOOBAA_PKG_VERSION := $(shell jq -r '.version' < ./package.json)
9097
RPM_BASE_VERSION := noobaa-core-$(NOOBAA_PKG_VERSION)-${DATE}
@@ -96,6 +103,14 @@ endif
96103
RPM_FULL_PATH := $(RPM_BASE_VERSION).el${CENTOS_VER}.$(ARCH_SUFFIX).rpm
97104
install_rpm_and_deps_command := dnf install -y make && rpm -i $(RPM_FULL_PATH) && systemctl enable noobaa --now && systemctl status noobaa && systemctl stop noobaa
98105

106+
##################
107+
# MINT VARIABLES #
108+
##################
109+
110+
MINT_MOCK_ACCESS_KEY="aaaaaaaaaaaaaEXAMPLE"
111+
MINT_MOCK_SECRET_KEY="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaEXAMPLE"
112+
MINT_NOOBAA_HTTP_ENDPOINT_PORT=6001
113+
99114
###############
100115
# BUILD LOCAL #
101116
###############
@@ -353,6 +368,32 @@ test-nc-warp: tester
353368
$(CONTAINER_ENGINE) run $(CPUSET) --privileged --user root --name noobaa_$(GIT_COMMIT)_$(NAME_POSTFIX) --env "SUPPRESS_LOGS=$(SUPPRESS_LOGS)" -v $(PWD)/logs:/logs $(TESTER_TAG) "./src/test/system_tests/warp/run_nc_warp_on_test_container.sh"
354369
.PHONY: test-nc-warp
355370

371+
test-mint: tester
372+
@echo "\033[1;34mRunning mint tests with Postgres.\033[0m"
373+
@$(call create_docker_network)
374+
@$(call run_postgres)
375+
@echo "\033[1;34mRunning mint tests\033[0m"
376+
$(CONTAINER_ENGINE) run $(CPUSET) --name noobaa-$(GIT_COMMIT)-$(NAME_POSTFIX) -dit --network noobaa-net --env "SUPPRESS_LOGS=$(SUPPRESS_LOGS)" --env "POSTGRES_HOST=coretest-postgres-$(GIT_COMMIT)-$(NAME_POSTFIX)" --env "POSTGRES_USER=noobaa" --env "DB_TYPE=postgres" --env "POSTGRES_DBNAME=coretest" -v $(PWD)/logs:/logs $(TESTER_TAG) bash -c "./src/test/system_tests/mint/run_mint_on_test_container.sh &> /logs/mint-test-logs/run_mint_on_test_container.log & tail -f /dev/null"
377+
sleep 180
378+
$(CONTAINER_ENGINE) run --name mint-$(GIT_COMMIT)-$(NAME_POSTFIX) --network noobaa-net -v $(PWD)/logs/mint-test-logs/:/mint/log --env SERVER_ENDPOINT=noobaa-$(GIT_COMMIT)-$(NAME_POSTFIX):$(MINT_NOOBAA_HTTP_ENDPOINT_PORT) --env ACCESS_KEY=$(MINT_MOCK_ACCESS_KEY) --env SECRET_KEY=$(MINT_MOCK_SECRET_KEY) --env ENABLE_HTTPS=0 minio/mint minio-go s3cmd
379+
@$(call disconnect_container_from_noobaa_network, mint-$(GIT_COMMIT)-$(NAME_POSTFIX))
380+
@$(call stop_noobaa, noobaa-$(GIT_COMMIT)-$(NAME_POSTFIX))
381+
@$(call stop_postgres)
382+
@$(call remove_docker_network)
383+
.PHONY: test-mint
384+
385+
386+
test-nc-mint: tester
387+
@echo "\033[1;34mRunning mint tests on NC environment\033[0m"
388+
@$(call create_docker_network)
389+
$(CONTAINER_ENGINE) run $(CPUSET) --name noobaa-$(GIT_COMMIT)-$(NAME_POSTFIX) -dit --privileged --user root --env "SUPPRESS_LOGS=$(SUPPRESS_LOGS)" --network noobaa-net -v $(PWD)/logs:/logs $(TESTER_TAG) bash -c "./src/test/system_tests/mint/run_nc_mint_on_test_container.sh &> /logs/mint-nc-test-logs/run_nc_mint_on_test_container.log ; tail -f /dev/null"
390+
sleep 20
391+
$(CONTAINER_ENGINE) run --name mint-$(GIT_COMMIT)-$(NAME_POSTFIX) --network noobaa-net -v $(PWD)/logs/mint-nc-test-logs/:/mint/log --env RUN_ON_FAIL=0 --env SERVER_ENDPOINT=noobaa-$(GIT_COMMIT)-$(NAME_POSTFIX):$(MINT_NOOBAA_HTTP_ENDPOINT_PORT) --env ACCESS_KEY=$(MINT_MOCK_ACCESS_KEY) --env SECRET_KEY=$(MINT_MOCK_SECRET_KEY) --env ENABLE_HTTPS=0 minio/mint minio-go s3cmd
392+
@$(call disconnect_container_from_noobaa_network, mint-$(GIT_COMMIT)-$(NAME_POSTFIX))
393+
@$(call stop_noobaa, noobaa-$(GIT_COMMIT)-$(NAME_POSTFIX))
394+
@$(call remove_docker_network)
395+
.PHONY: test-nc-mint
396+
356397
test-nsfs-cephs3: tester
357398
@echo "\033[1;34mRunning Ceph S3 tests on NSFS Standalone platform\033[0m"
358399
$(CONTAINER_ENGINE) run $(CPUSET) --privileged --user root --name noobaa_$(GIT_COMMIT)_$(NAME_POSTFIX) --env "SUPPRESS_LOGS=$(SUPPRESS_LOGS)" -v $(PWD)/logs:/logs $(TESTER_TAG) "./src/test/system_tests/ceph_s3_tests/run_ceph_nsfs_test_on_test_container.sh"
@@ -412,10 +453,11 @@ clean:
412453
##########
413454

414455
define stop_noobaa
415-
@echo "\033[1;34mStopping/removing test container\033[0m"
416-
$(CONTAINER_ENGINE) network disconnect noobaa-net noobaa_$(GIT_COMMIT)_$(NAME_POSTFIX)
417-
$(CONTAINER_ENGINE) stop noobaa_$(GIT_COMMIT)_$(NAME_POSTFIX)
418-
$(CONTAINER_ENGINE) rm noobaa_$(GIT_COMMIT)_$(NAME_POSTFIX)
456+
$(eval noobaa_container_name := $(if $(1),$(1),noobaa_$(GIT_COMMIT)_$(NAME_POSTFIX)))
457+
@echo "\033[1;34mStopping/removing test container $(noobaa_container_name)\033[0m"
458+
$(call disconnect_container_from_noobaa_network, $(noobaa_container_name))
459+
$(CONTAINER_ENGINE) stop $(noobaa_container_name)
460+
$(CONTAINER_ENGINE) rm $(noobaa_container_name)
419461
@echo "\033[1;32mRemoving test container done.\033[0m"
420462
endef
421463

@@ -435,6 +477,12 @@ define remove_docker_network
435477
@echo "\033[1;32mRemove docker network done.\033[0m"
436478
endef
437479

480+
define disconnect_container_from_noobaa_network
481+
echo "\033[1;34mDisconnect container $(1) from noobaa network\033[0m"; \
482+
$(CONTAINER_ENGINE) network disconnect noobaa-net $(1); \
483+
echo "\033[1;34mDisconnect container $(1) from noobaa network done.\033[0m"
484+
endef
485+
438486
#########
439487
# MONGO #
440488
#########
@@ -447,7 +495,7 @@ endef
447495

448496
define stop_mongo
449497
@echo "\033[1;34mStopping/removing Mongo container\033[0m"
450-
$(CONTAINER_ENGINE) network disconnect noobaa-net coretest-mongo-$(GIT_COMMIT)-$(NAME_POSTFIX)
498+
$(call disconnect_container_from_noobaa_network, coretest-mongo-$(GIT_COMMIT)-$(NAME_POSTFIX))
451499
$(CONTAINER_ENGINE) stop coretest-mongo-$(GIT_COMMIT)-$(NAME_POSTFIX)
452500
$(CONTAINER_ENGINE) rm coretest-mongo-$(GIT_COMMIT)-$(NAME_POSTFIX)
453501
@echo "\033[1;32mStop mongo done.\033[0m"
@@ -467,7 +515,7 @@ endef
467515

468516
define stop_postgres
469517
@echo "\033[1;34mStopping/removing Postgres container\033[0m"
470-
$(CONTAINER_ENGINE) network disconnect noobaa-net coretest-postgres-$(GIT_COMMIT)-$(NAME_POSTFIX)
518+
$(call disconnect_container_from_noobaa_network, coretest-postgres-$(GIT_COMMIT)-$(NAME_POSTFIX))
471519
$(CONTAINER_ENGINE) stop coretest-postgres-$(GIT_COMMIT)-$(NAME_POSTFIX)
472520
$(CONTAINER_ENGINE) rm coretest-postgres-$(GIT_COMMIT)-$(NAME_POSTFIX)
473521
@echo "\033[1;32mStop postgres done.\033[0m"
@@ -487,7 +535,7 @@ endef
487535

488536
define stop_external_postgres
489537
@echo "\033[1;34mStopping/removing Postgres container\033[0m"
490-
$(CONTAINER_ENGINE) network disconnect noobaa-net ssl-pg-$(GIT_COMMIT)-$(NAME_POSTFIX)
538+
$(call disconnect_container_from_noobaa_network, ssl-pg-$(GIT_COMMIT)-$(NAME_POSTFIX))
491539
$(CONTAINER_ENGINE) stop ssl-pg-$(GIT_COMMIT)-$(NAME_POSTFIX)
492540
$(CONTAINER_ENGINE) rm ssl-pg-$(GIT_COMMIT)-$(NAME_POSTFIX)
493541
@echo "\033[1;32mStop postgres done.\033[0m"
@@ -518,7 +566,7 @@ define stop_blob_mock
518566
@echo "\033[1;34mStopping blob mock server if RUN_BLOB_MOCK=$(RUN_BLOB_MOCK) is true.\033[0m"
519567
@ if [ $(RUN_BLOB_MOCK) = true ]; then \
520568
echo "\033[1;34mStopping tests with Blob mock.\033[0m"; \
521-
$(CONTAINER_ENGINE) network disconnect noobaa-net blob-mock-$(GIT_COMMIT)-$(NAME_POSTFIX); \
569+
$(call disconnect_container_from_noobaa_network, blob-mock-$(GIT_COMMIT)-$(NAME_POSTFIX)); \
522570
$(CONTAINER_ENGINE) stop blob-mock-$(GIT_COMMIT)-$(NAME_POSTFIX); \
523571
$(CONTAINER_ENGINE) rm blob-mock-$(GIT_COMMIT)-$(NAME_POSTFIX); \
524572
fi

docs/CI & Tests/Mint.md

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Mint Github Action, Tests and Tool
2+
3+
1. [Introduction](#introduction)
4+
2. [Mint GitHub actions](#mint-github-actions)
5+
3. [Mint Makefile Targets](#mint-makefile-targets)
6+
4. [Manual Mint Installation](#manual-mint-installation)
7+
8+
9+
10+
## Introduction
11+
12+
[Mint](https://github.com/minio/mint) is a testing framework for S3-compatible object storage systems, NooBaa CI runs Mint as correctness/benchmarking and stress tests for the NooBaa system on both containerized and Non Containerized flavors.
13+
Following are the SDKs/tools used in correctness tests.
14+
15+
- awscli
16+
- aws-sdk-go
17+
- aws-sdk-java
18+
- aws-sdk-java-v2
19+
- aws-sdk-php
20+
- aws-sdk-ruby
21+
- healthcheck
22+
- mc
23+
- minio-go
24+
- minio-java
25+
- minio-js
26+
- minio-py
27+
- s3cmd
28+
- s3select
29+
- versioning
30+
31+
## Mint GitHub actions
32+
33+
NooBaa CI contains 2 Github actions that build, configure and run Mint. These Github actions run automatically on every PR and on every push, and can run by workflow dispatch manually.
34+
* [Mint Tests](../../.github/workflows/mint-tests.yaml) - Based on NooBaa Tester image, runs Mint on standard NooBaa (db configuration).
35+
* [Mint NC Tests](../../.github/workflows/mint-nc-tests.yaml) - Based on NooBaa Tester image, runs Mint on non-containerized NooBaa (ConfigFS configuration).
36+
37+
Our next goal is to add longer Mint runs as part of NooBaa's nightly CI process.
38+
39+
## Mint Makefile Targets
40+
41+
One can run Mint tests on NooBaa using Mint Makefile targets -
42+
* `make test-mint` - Based on NooBaa Tester image, runs Mint on standard NooBaa (db configuration).
43+
* `make test-nc-mint` - Based on NooBaa Tester image, runs Mint on non-containerized NooBaa (ConfigFS configuration).
44+
45+
The above makefile targets, build NooBaa tester image, and later deploy NooBaa (DB/ConfigFS deployments), create default account and runs the supported sdks on Mint per the deployment type.
46+
47+
Currently, the supported mint test frameworks are:
48+
1. s3cmd
49+
2. minio-go
50+
51+
## Manual Mint Installation
52+
53+
NC deployment -
54+
1. Tab 1 - Install NooBaa
55+
2. Tab 2 - Create a NooBaa account.
56+
2. Tab 2 - Run Mint pointing to NooBaa endpoint -
57+
```
58+
docker run -e SERVER_ENDPOINT=<noobaa-endpoint-address>:<noobaa-endpoint-http-port> -e ACCESS_KEY=<pre-existing-account-access-key> -e SECRET_KEY=<pre-existing-account-secret-key> -e ENABLE_HTTPS=0 minio/mint <sdk-or-tool-name>
59+
```
60+
61+
Developer notes -
62+
63+
64+
To manually run a MinIO Mint container that connects to a noobaa-tester container, ensure both containers are on the same Docker network (noobaa-net).
65+
66+
67+
If the noobaa-tester is already connected to noobaa-net, your Mint run command should look like this:
68+
```
69+
docker run -e SERVER_ENDPOINT=<noobaa-tester-container-id-or-name>:<noobaa-http-endpoint-port> -e ACCESS_KEY=<pre-existing-account-access-key> -e SECRET_KEY=<pre-existing-account-secret-key> -e ENABLE_HTTPS=0 --network noobaa-net minio/mint <sdk-or-tool-name>
70+
```
71+
72+
Replace <sdk-or-tool-name> with the specific SDK or tool you want to test (e.g., aws-sdk-java, minio-go, s3cmd, etc.).

src/endpoint/s3/s3_errors.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ S3Error.NoLoggingStatusForKey = Object.freeze({
332332
});
333333
S3Error.NoSuchBucket = Object.freeze({
334334
code: 'NoSuchBucket',
335-
message: 'The specified bucket does not exist.',
335+
message: 'The specified bucket does not exist',
336336
http_code: 404,
337337
});
338338
S3Error.NoSuchKey = Object.freeze({

0 commit comments

Comments
 (0)