Skip to content

Commit 9639a4b

Browse files
authored
Merge pull request #8374 from shirady/nsfs-nc-docs-bucket-policy-fix-and-ceph-update
NC | Docs | Update Ceph S3 Tests Instructions in NC + Fix Bucket Policy All Principals
2 parents 5819f58 + c477b04 commit 9639a4b

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

docs/NooBaaNonContainerized/S3Ops.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ Warning: this policy allows `<account-name>` to run all S3 operations.
9595
##### Principal Field:
9696
A bucket policy defines which principals can perform actions on the bucket. The Principal element specifies the user or account that is either allowed or denied access to a resource.
9797
Currently we support a couple of options:
98-
1. Grant anonymous permissions (all principals): either `"Principal": { "AWS": "*" }` or `"Principal": { "*" }`.
98+
1. All principals (includes anonymous account): either `"Principal": { "AWS": "*" }` or `"Principal": "*"`.
9999
2. Principal by account name: `"Principal": { "AWS": [ "<account-name-1>", "<account-name-2>", ... ,"<account-name-n>"] }`
100100
3. Principal by account ID: `"Principal": { "AWS": [ "<account-ID-1>", "<account-ID-2>", ... ,"<account-ID-n>"] }`
101101

docs/dev_guide/ceph_s3_tests/ceph_s3_tests_guide.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
4) Debug a Single Ceph S3 Test
99
5) Compare to AWS Response (Inside Tester Pod)
1010
6) Examples
11+
7) Run a Single Ceph S3 Test in NC deployment Manually
1112
* This guide describes developer steps to run Ceph S3 on a Noobaa system on minikube.
1213

1314
## General Settings For Ceph S3 Tests
@@ -287,4 +288,48 @@ S3TEST_CONF=${PWD}/src/test/system_tests/ceph_s3_tests/test_ceph_s3_config.conf
287288

288289
Notice that even though test commands succeeded the test itself was skipped. The test prints `1 skipped` meaning one test was skipped
289290

291+
## Run a Single Ceph S3 Test in NC deployment Manually
292+
293+
### NC local on your machine
294+
#### Account creation
295+
Create the needed accounts for the Ceph configurations, for example:
296+
1. ceph (main account)
297+
2. ceph_alt (an account that is used on tests when two different accounts are needed, this is the alternative account - for example I saw it used in one of the bucket policy tests)
298+
3. ceph_tenant
299+
300+
In cases that you don't need additional account you can simply copy the main account access keys in the ceph configuration file.
301+
302+
To create the accounts in NC with access key and secret key that you chose is by running:
303+
`sudo node src/cmd/manage_nsfs account add --name ceph --new_buckets_path <new-buckets-path> --access_key <access-key> --secret_key <secret-key> --uid <uid> --gid <gid>`
304+
(more information can be found in [NooBaa CLI](./../../NooBaaNonContainerized/NooBaaCLI.md))
305+
for example:
306+
`sudo node src/cmd/manage_nsfs account add --name ceph --new_buckets_path /private/tmp/nsfs_root1 --access_key <access-key> --secret_key <secret-key> --uid 1001 --gid 1001`.
307+
Note: before creating the account need to give permission to the `new_buckets_path`, in this example: `mkdir -p /private/tmp/nsfs_root1; sudo chmod 777 /private/tmp/nsfs_root1`.
308+
309+
#### NSFS Server
310+
Start the NSFS server with: `sudo node src/cmd/nsfs --debug 5`
311+
Note: on every code change you would need to stop the server (ctrl + c) and run it again.
312+
313+
### Ceph S3 repository:
314+
1) Clone the repository [ceph/s3-test](https://github.com/ceph/s3-tests):
315+
`git clone https://github.com/ceph/s3-tests.git`
316+
317+
2) Edit the attached config, you can rename it and use this config only in the commands that you run, for example:
318+
`cp s3tests.conf.SAMPLE test_nsfs_ceph_s3_config.conf`, inside the file change the following values `vi test_nsfs_ceph_s3_config.conf`:
319+
- host = localhost
320+
- port = 6443
321+
- is_secure = True
322+
- ssl_verify = False
323+
- bucket prefix = your-name-{random}
324+
- under "[s3 main]" under "main AWS access key" add the ceph account credentials
325+
- under "[s3 alt]" under "alt AWS access key set in vstart.sh" add the ceph_alt credentials (if your tests do not need it you can copy the ceph credentials)
326+
- under "[s3 tenant]" under "tenant AWS secret key set in vstart.sh" add 3. ceph_tenant credentials (if your tests do not need it you can copy the ceph credentials)
327+
- user_id - it depends if your tests uses it and for what purpose, usually you can add the account id, I saw a case where it was for principal in bucket policy and there you can add the account name
328+
329+
3) Run a single test by running:
330+
`S3TEST_CONF=<configuration-file> tox -- <test-full-name>`
331+
for example:
332+
`S3TEST_CONF=test_nsfs_ceph_s3_config.conf tox -- s3tests_boto3/functional/test_s3.py::test_versioning_multi_object_delete_with_marker_create`.
333+
Make sure that you run it from the Ceph repo: `pwd` will be `<path-to-ceph-S3-repo>/s3-tests`.
334+
Note: In case you need install boto3 and tox: `python3 -m pip install boto3` and `python3 -m pip install tox`
290335

0 commit comments

Comments
 (0)