Skip to content

Commit 808428d

Browse files
committed
Added CI to run ceph tests on ns aws using minio
Signed-off-by: Aayush Chouhan <[email protected]>
1 parent 5b2f75c commit 808428d

File tree

8 files changed

+708
-8
lines changed

8 files changed

+708
-8
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Ceph NS AWS S3 Tests
2+
on: [workflow_call]
3+
4+
jobs:
5+
ceph-ns-aws-s3-tests:
6+
name: Ceph NS AWS S3 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: Run Ceph NS AWS s3-tests
29+
run: |
30+
set -x
31+
cd ./noobaa-core
32+
mkdir -p logs/ceph-ns-aws-test-logs
33+
chmod 777 logs/ceph-ns-aws-test-logs
34+
make test-cephs3-ns-aws -o tester

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ jobs:
3232
needs: build-noobaa-image
3333
uses: ./.github/workflows/ceph-s3-tests.yaml
3434

35+
ceph-ns-aws-s3-tests:
36+
needs: build-noobaa-image
37+
uses: ./.github/workflows/ceph-ns-aws-s3-tests.yaml
38+
3539
ceph-nsfs-s3-tests:
3640
needs: build-noobaa-image
3741
uses: ./.github/workflows/ceph-nsfs-s3-tests.yaml

Makefile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,17 @@ MINT_MOCK_ACCESS_KEY="aaaaaaaaaaaaaEXAMPLE"
111111
MINT_MOCK_SECRET_KEY="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaEXAMPLE"
112112
MINT_NOOBAA_HTTP_ENDPOINT_PORT=6001
113113

114+
####################
115+
# MINIO VARIABLES #
116+
###################
117+
118+
MINIO_IMAGE?="quay.io/minio/minio"
119+
AWS_CLI_IMAGE?="amazon/aws-cli"
120+
MINIO_PORT?=9000
121+
MINIO_USER?="miniotest"
122+
MINIO_PASSWORD?="miniotest123"
123+
MINIO_TEST_BUCKET?="minio-test-bucket"
124+
114125
###############
115126
# BUILD LOCAL #
116127
###############
@@ -352,6 +363,19 @@ test-cephs3: tester
352363
@$(call remove_docker_network)
353364
.PHONY: test-cephs3
354365

366+
test-cephs3-ns-aws: tester
367+
@echo "\033[1;34mRunning ceph-s3 tests with namespace store pointing to s3 bucket in Minio\033[0m"
368+
@$(call create_docker_network)
369+
@$(call run_minio)
370+
@$(call run_postgres)
371+
@echo "\033[1;34mRunning tests\033[0m"
372+
$(CONTAINER_ENGINE) run $(CPUSET) --privileged --user root --network noobaa-net --name noobaa_$(GIT_COMMIT)_$(NAME_POSTFIX) --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" --env "USE_NAMESPACE_RESOURCE=true" --env "MINIO_ENDPOINT=http://coretest-minio-$(GIT_COMMIT)-$(NAME_POSTFIX):$(MINIO_PORT)" --env "MINIO_USER=$(MINIO_USER)" --env "MINIO_PASSWORD=$(MINIO_PASSWORD)" --env "MINIO_TEST_BUCKET=$(MINIO_TEST_BUCKET)" -v $(PWD)/logs:/logs $(TESTER_TAG) "./src/test/external_tests/ceph_s3_tests/run_ceph_test_on_test_container.sh"
373+
@$(call stop_noobaa)
374+
@$(call stop_postgres)
375+
@$(call stop_minio)
376+
@$(call remove_docker_network)
377+
.PHONY: test-cephs3-ns-aws
378+
355379
test-warp: tester
356380
@echo "\033[1;34mRunning warp tests with Postgres.\033[0m"
357381
@$(call create_docker_network)
@@ -581,3 +605,27 @@ define stop_blob_mock
581605
fi
582606
@echo "\033[1;32mBlob mock server stop done.\033[0m"
583607
endef
608+
609+
#########
610+
# MINIO #
611+
#########
612+
613+
define run_minio
614+
@echo "\033[1;34mRunning Minio container\033[0m"
615+
$(CONTAINER_ENGINE) run -d $(CPUSET) --network noobaa-net --name coretest-minio-$(GIT_COMMIT)-$(NAME_POSTFIX) -p $(MINIO_PORT):$(MINIO_PORT) --env "MINIO_ROOT_USER=$(MINIO_USER)" --env "MINIO_ROOT_PASSWORD=$(MINIO_PASSWORD)" $(MINIO_IMAGE) server /data --address ":$(MINIO_PORT)"
616+
@echo "\033[1;34mWaiting for Minio to start..\033[0m"
617+
sleep 20
618+
@echo "\033[1;34mCreating test bucket in Minio..\033[0m"
619+
$(CONTAINER_ENGINE) run --rm --network noobaa-net --env "AWS_ACCESS_KEY_ID=$(MINIO_USER)" --env "AWS_SECRET_ACCESS_KEY=$(MINIO_PASSWORD)" --env "AWS_DEFAULT_REGION=us-east-1" $(AWS_CLI_IMAGE) s3 mb s3://$(MINIO_TEST_BUCKET) --endpoint-url http://coretest-minio-$(GIT_COMMIT)-$(NAME_POSTFIX):$(MINIO_PORT)
620+
@echo "\033[1;34mVerifying bucket creation..\033[0m"
621+
$(CONTAINER_ENGINE) run --rm --network noobaa-net --env "AWS_ACCESS_KEY_ID=$(MINIO_USER)" --env "AWS_SECRET_ACCESS_KEY=$(MINIO_PASSWORD)" --env "AWS_DEFAULT_REGION=us-east-1" $(AWS_CLI_IMAGE) s3 ls --endpoint-url http://coretest-minio-$(GIT_COMMIT)-$(NAME_POSTFIX):$(MINIO_PORT)
622+
@echo "\033[1;32mRun Minio done.\033[0m"
623+
endef
624+
625+
define stop_minio
626+
@echo "\033[1;34mStopping/removing Minio container\033[0m"
627+
$(call disconnect_container_from_noobaa_network, coretest-minio-$(GIT_COMMIT)-$(NAME_POSTFIX))
628+
$(CONTAINER_ENGINE) stop coretest-minio-$(GIT_COMMIT)-$(NAME_POSTFIX)
629+
$(CONTAINER_ENGINE) rm coretest-minio-$(GIT_COMMIT)-$(NAME_POSTFIX)
630+
@echo "\033[1;32mStop Minio done.\033[0m"
631+
endef

src/test/external_tests/ceph_s3_tests/run_ceph_test_on_test_container.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,13 @@ export MGMT_ADDR=wss://${NOOBAA_MGMT_SERVICE_HOST:-localhost}:${NOOBAA_MGMT_SERV
3434
export BG_ADDR=wss://localhost:5445
3535
export HOSTED_AGENTS_ADDR=wss://localhost:5446
3636

37-
export CEPH_TEST_LOGS_DIR=/logs/ceph-test-logs
37+
# set logs directory based on test type
38+
# later we will add more test types and logs directories on the basis of namespace resource type
39+
if [ "${USE_NAMESPACE_RESOURCE}" = "true" ]; then
40+
export CEPH_TEST_LOGS_DIR=/logs/ceph-ns-aws-test-logs
41+
else
42+
export CEPH_TEST_LOGS_DIR=/logs/ceph-test-logs
43+
fi
3844

3945
export CONFIG_JS_OBJECT_SDK_BUCKET_CACHE_EXPIRY_MS=0 # Needed for disabling cache for ceph cors test and maybe some more
4046
export CONFIG_JS_allow_anonymous_access_in_test=true # Needed for allowing anon access for tests using ACL='public-read-write'

0 commit comments

Comments
 (0)