Skip to content

Commit f3b0ad3

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

File tree

13 files changed

+447
-43
lines changed

13 files changed

+447
-43
lines changed

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

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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-test-logs
34+
chmod 777 logs/mint-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+

.github/workflows/mint-tests.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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+

.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: 58 additions & 8 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,34 @@ 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 --privileged --user root --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) tail -f /dev/null
377+
$(CONTAINER_ENGINE) exec noobaa-$(GIT_COMMIT)-$(NAME_POSTFIX) bash -c "nohup ./src/test/system_tests/mint/run_mint_on_test_container.sh > /logs/mint_tests.log 2>&1 &"
378+
sleep 90
379+
$(CONTAINER_ENGINE) run --name mint-$(GIT_COMMIT)-$(NAME_POSTFIX) --network noobaa-net --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 aws-sdk-java minio-go s3cmd
380+
@$(call disconnect_container_from_noobaa_network, mint-$(GIT_COMMIT)-$(NAME_POSTFIX))
381+
@$(call stop_noobaa, noobaa-$(GIT_COMMIT)-$(NAME_POSTFIX))
382+
@$(call stop_postgres)
383+
@$(call remove_docker_network)
384+
.PHONY: test-mint
385+
386+
387+
test-nc-mint: tester
388+
@echo "\033[1;34mRunning mint tests on NC environment\033[0m"
389+
@$(call create_docker_network)
390+
$(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) tail -f /dev/null
391+
$(CONTAINER_ENGINE) exec noobaa-$(GIT_COMMIT)-$(NAME_POSTFIX) bash -c "nohup ./src/test/system_tests/mint/run_nc_mint_on_test_container.sh > /logs/mint_nc_tests.log 2>&1 &"
392+
sleep 20
393+
$(CONTAINER_ENGINE) run --name mint-$(GIT_COMMIT)-$(NAME_POSTFIX) --network noobaa-net --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 aws-sdk-java minio-go s3cmd
394+
@$(call disconnect_container_from_noobaa_network, mint-$(GIT_COMMIT)-$(NAME_POSTFIX))
395+
@$(call stop_noobaa, noobaa-$(GIT_COMMIT)-$(NAME_POSTFIX))
396+
@$(call remove_docker_network)
397+
.PHONY: test-nc-mint
398+
356399
test-nsfs-cephs3: tester
357400
@echo "\033[1;34mRunning Ceph S3 tests on NSFS Standalone platform\033[0m"
358401
$(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 +455,11 @@ clean:
412455
##########
413456

414457
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)
458+
$(eval noobaa_container_name := $(if $(1),$(1),noobaa_$(GIT_COMMIT)_$(NAME_POSTFIX)))
459+
@echo "\033[1;34mStopping/removing test container $(noobaa_container_name)\033[0m"
460+
$(call disconnect_container_from_noobaa_network, $(noobaa_container_name))
461+
$(CONTAINER_ENGINE) stop $(noobaa_container_name)
462+
$(CONTAINER_ENGINE) rm $(noobaa_container_name)
419463
@echo "\033[1;32mRemoving test container done.\033[0m"
420464
endef
421465

@@ -435,6 +479,12 @@ define remove_docker_network
435479
@echo "\033[1;32mRemove docker network done.\033[0m"
436480
endef
437481

482+
define disconnect_container_from_noobaa_network
483+
@echo "\033[1;34mDisconnect container $(1) from noobaa network\033[0m"
484+
$(CONTAINER_ENGINE) network disconnect noobaa-net $(1)
485+
@echo "\033[1;34mDisconnect container $(1) from noobaa network done.\033[0m"
486+
endef
487+
438488
#########
439489
# MONGO #
440490
#########
@@ -447,7 +497,7 @@ endef
447497

448498
define stop_mongo
449499
@echo "\033[1;34mStopping/removing Mongo container\033[0m"
450-
$(CONTAINER_ENGINE) network disconnect noobaa-net coretest-mongo-$(GIT_COMMIT)-$(NAME_POSTFIX)
500+
$(call disconnect_container_from_noobaa_network, coretest-mongo-$(GIT_COMMIT)-$(NAME_POSTFIX))
451501
$(CONTAINER_ENGINE) stop coretest-mongo-$(GIT_COMMIT)-$(NAME_POSTFIX)
452502
$(CONTAINER_ENGINE) rm coretest-mongo-$(GIT_COMMIT)-$(NAME_POSTFIX)
453503
@echo "\033[1;32mStop mongo done.\033[0m"
@@ -467,7 +517,7 @@ endef
467517

468518
define stop_postgres
469519
@echo "\033[1;34mStopping/removing Postgres container\033[0m"
470-
$(CONTAINER_ENGINE) network disconnect noobaa-net coretest-postgres-$(GIT_COMMIT)-$(NAME_POSTFIX)
520+
$(call disconnect_container_from_noobaa_network, coretest-postgres-$(GIT_COMMIT)-$(NAME_POSTFIX))
471521
$(CONTAINER_ENGINE) stop coretest-postgres-$(GIT_COMMIT)-$(NAME_POSTFIX)
472522
$(CONTAINER_ENGINE) rm coretest-postgres-$(GIT_COMMIT)-$(NAME_POSTFIX)
473523
@echo "\033[1;32mStop postgres done.\033[0m"
@@ -487,7 +537,7 @@ endef
487537

488538
define stop_external_postgres
489539
@echo "\033[1;34mStopping/removing Postgres container\033[0m"
490-
$(CONTAINER_ENGINE) network disconnect noobaa-net ssl-pg-$(GIT_COMMIT)-$(NAME_POSTFIX)
540+
$(call disconnect_container_from_noobaa_network, ssl-pg-$(GIT_COMMIT)-$(NAME_POSTFIX))
491541
$(CONTAINER_ENGINE) stop ssl-pg-$(GIT_COMMIT)-$(NAME_POSTFIX)
492542
$(CONTAINER_ENGINE) rm ssl-pg-$(GIT_COMMIT)-$(NAME_POSTFIX)
493543
@echo "\033[1;32mStop postgres done.\033[0m"

docs/CI & Tests/Mint.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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 run-mint` - Based on NooBaa Tester image, runs Mint on standard NooBaa (db configuration).
43+
* `make run-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+
48+
## Manual Mint Installation
49+
50+
NC deployment -
51+
1. Tab 1 - Install NooBaa
52+
2. Tab 2 - Create a NooBaa account.
53+
2. Tab 2 - Run Mint pointing to NooBaa endpoint -
54+
```
55+
docker run -e SERVER_ENDPOINT=<noobaa-endpoint-address>:<noobaa-endpoint-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>
56+
```

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)