Skip to content

Commit 63a5b77

Browse files
committed
Merge branches 'w/9.1/improvement/CLDSRV-717-s3c-tests-setup' and 'q/w/5914/9.0/improvement/CLDSRV-717-s3c-tests-setup' into tmp/octopus/q/9.1
3 parents 063e82b + bea5fe0 + 6c0f19d commit 63a5b77

File tree

8 files changed

+374
-0
lines changed

8 files changed

+374
-0
lines changed

.github/actions/setup-ci/action.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ runs:
99
shell: bash
1010
run: |
1111
sudo echo "127.0.0.1 bucketwebsitetester.s3-website-us-east-1.amazonaws.com" | sudo tee -a /etc/hosts
12+
sudo echo "127.0.0.1 bucketwebsitetester.s3-website-us-east-1.scality.com" | sudo tee -a /etc/hosts
1213
sudo echo "127.0.0.1 pykmip.local" | sudo tee -a /etc/hosts
1314
for i in `seq 1 50`; do sudo echo "127.0.0.$i $i.pykmip.local" | sudo tee -a /etc/hosts ; done
1415
- name: Setup Credentials

.github/docker/config.s3c.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"port": 8000,
3+
"maxScannedLifecycleListingEntries": 10000,
4+
"metricsPort": 8001,
5+
"internalPort": 8004,
6+
"replicationGroupId": "RG001",
7+
"restEndpoints": {
8+
"s3.amazonaws.com": "dc-1",
9+
"localhost": "dc-1",
10+
"scality.scality.com": "dc-1",
11+
"127.0.0.1": "dc-1",
12+
"node1.scality.com": "dc-1"
13+
},
14+
"websiteEndpoints": ["s3-website-us-east-1.scality.com"],
15+
"bucketd": {
16+
"bootstrap": ["0.0.0.0:9000"]
17+
},
18+
"vaultd": {
19+
"host": "127.0.0.1",
20+
"port": 8500
21+
},
22+
"clusters": 5,
23+
"kmsHideScalityArn": true,
24+
"healthChecks": {
25+
"allowFrom": ["127.0.0.1", "::1"]
26+
},
27+
"localCache": {
28+
"host": "localhost",
29+
"port": 6379,
30+
"password": ""
31+
},
32+
"log": {
33+
"logLevel": "info",
34+
"dumpLevel": "error"
35+
},
36+
"replicationEndpoints": [
37+
{"site": "zenko", "servers": ["127.0.0.1:9080"], "echo": false, "default": true},
38+
{"site": "us-east-2", "servers": ["127.0.0.1:9080"]}
39+
],
40+
"requests": {
41+
"extractClientIPFromHeader": "x-forwarded-for",
42+
"extractProtocolFromHeader": "x-forwarded-proto",
43+
"trustedProxyCIDRs": [
44+
"127.0.0.1/32",
45+
"::ffff:127.0.0.1/128",
46+
"127.0.0.1"
47+
],
48+
"viaProxy": true
49+
},
50+
"multiObjectDeleteEnableOptimizations": false,
51+
"supportedLifecycleRules": [
52+
"Expiration",
53+
"NoncurrentVersionExpiration",
54+
"AbortIncompleteMultipartUpload"
55+
],
56+
"bucketNotificationDestinations": [
57+
{
58+
"resource": "target1",
59+
"type": "dummy",
60+
"host": "localhost:6000"
61+
}
62+
]
63+
}

.github/docker/docker-compose.sse.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,18 @@ services:
3434
- ../../localData:/usr/src/app/localData
3535
- ../../localMetadata:/usr/src/app/localMetadata
3636
- ../../tests/functional/sse-kms-migration/config.json:/conf/config.json
37+
- ../../tests/locationConfig/locationConfigS3C.json:/conf/locationConfig.json
3738
environment:
3839
- S3_CONFIG_FILE=/conf/config.json
40+
- S3_LOCATION_FILE=/conf/locationConfig.json
3941
cloudserver-sse-migration:
4042
extends: cloudserver-sse-before-migration
4143
profiles: [sse-migration]
4244
command: sh -c "yarn start > /artifacts/s3.migration.log 2> /artifacts/s3-stderr.migration.log"
45+
metadata-standalone:
46+
image: ghcr.io/scality/metadata:8.11.0-standalone
47+
profiles: ['metadata-standalone']
48+
network_mode: 'host'
49+
volumes:
50+
- ./md-config-v0.json:/mnt/standalone_workdir/config.json:ro
51+
- /tmp/artifacts/${JOB_NAME}/md:/mnt/standalone_workdir/log

.github/docker/md-config-v0.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"raftSessions": 1,
3+
"raftMembers": 5,
4+
"bucketdCount": 1,
5+
"bucketdWorkers": 1,
6+
"basePorts": {
7+
"bucketd": 9000,
8+
"repd": 4200,
9+
"repdAdmin": 4250
10+
},
11+
"logLevel": "info",
12+
"env": {
13+
"METADATA_NEW_BUCKETS_VFORMAT": "v0",
14+
"S3_VERSION_ID_ENCODING_TYPE":"hex"
15+
},
16+
"migration": {
17+
"deploy": false,
18+
"raftSessions": 0,
19+
"raftMembers": 5,
20+
"bucketdCount": 1,
21+
"bucketdWorkers": 1,
22+
"basePorts": {
23+
"bucketd": 9001,
24+
"repd": 4700,
25+
"repdAdmin": 4750
26+
},
27+
"logLevel": "info"
28+
}
29+
}

.github/docker/setup-s3c.sh

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
#!/bin/bash
2+
3+
# setup S3C environment just like
4+
# https://github.com/scality/Integration/blob/development/9.5/tests/setup-environment/index.js
5+
6+
set -e -o pipefail
7+
8+
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
9+
10+
VAULTCLIENT=$SCRIPT_DIR/../../node_modules/vaultclient/bin/vaultclient
11+
CONFIG=$SCRIPT_DIR/admin.json
12+
13+
echo "Deleting and setting up S3C accounts like Integration (follow conf/authdata.json)"
14+
15+
$VAULTCLIENT --config $CONFIG delete-account --name Bart || true
16+
$VAULTCLIENT --config $CONFIG create-account \
17+
--name Bart \
18+
--email sampleaccount1@sampling.com \
19+
--accountid 123456789012 \
20+
--canonicalid 79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2be
21+
$VAULTCLIENT --config $CONFIG generate-account-access-key \
22+
--name Bart \
23+
--accesskey ACC1AK00000000000000 \
24+
--secretkey ACC1SK0000000000000000000000000000000000
25+
26+
$VAULTCLIENT --config $CONFIG delete-account --name Lisa || true
27+
$VAULTCLIENT --config $CONFIG create-account \
28+
--name Lisa \
29+
--email sampleaccount2@sampling.com \
30+
--accountid 123456789013 \
31+
--canonicalid 79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2bf
32+
$VAULTCLIENT --config $CONFIG generate-account-access-key \
33+
--name Lisa \
34+
--accesskey ACC2AK00000000000000 \
35+
--secretkey ACC2SK0000000000000000000000000000000000
36+
37+
# Replication account for backbeat replication tests
38+
$VAULTCLIENT --config $CONFIG delete-account --name Replication || true
39+
# Cannot use url as canonicalid for service account
40+
$VAULTCLIENT --config $CONFIG create-account \
41+
--name Replication \
42+
--email inspector@replication.info \
43+
--accountid 123456789015 \
44+
--canonicalid 79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2ba
45+
$VAULTCLIENT --config $CONFIG generate-account-access-key \
46+
--name Replication \
47+
--accesskey ACCREPAK000000000000 \
48+
--secretkey ACCREPSK00000000000000000000000000000000
49+
50+
echo "Copying s3c credentials to mem credentials"
51+
cp \
52+
$SCRIPT_DIR/../../tests/functional/aws-node-sdk/lib/json/s3c_credentials.json \
53+
$SCRIPT_DIR/../../tests/functional/aws-node-sdk/lib/json/mem_credentials.json
54+
55+
echo "Update conf/authdata.json account Replication canonicalID"
56+
REP_CANONICAL_ID=$(
57+
$VAULTCLIENT --config $CONFIG get-account --account-name Replication | jq -r .canonicalId
58+
)
59+
60+
# might need to undo changes if script was already ran before (manuallyoutside CI)
61+
git checkout -- $SCRIPT_DIR/../../conf/authdata.json || true
62+
sed -i "s/http:\/\/acs.zenko.io\/accounts\/service\/replication/$REP_CANONICAL_ID/g" $SCRIPT_DIR/../../conf/authdata.json

.github/workflows/tests.yaml

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,122 @@ jobs:
451451
source: /tmp/artifacts
452452
if: always()
453453

454+
# Configure and run as Integration run S3C tests
455+
s3c-ft-tests:
456+
# This job for now ignore errors until all unification and backbeat tests are fixed
457+
runs-on: ubuntu-24.04
458+
needs: build
459+
continue-on-error: true
460+
env:
461+
S3BACKEND: file
462+
S3DATA: scality
463+
S3METADATA: scality
464+
S3VAULT: scality
465+
CLOUDSERVER_IMAGE: ghcr.io/${{ github.repository }}:${{ github.sha }}
466+
MPU_TESTING: "yes"
467+
ENABLE_NULL_VERSION_COMPAT_MODE: true
468+
COMPOSE_FILE: docker-compose.yaml:docker-compose.sse.yaml
469+
S3_VERSION_ID_ENCODING_TYPE: hex
470+
JOB_NAME: ${{ github.job }}
471+
VAULT_IMAGE: ghcr.io/scality/vault:7.76.0
472+
S3_END_TO_END: true
473+
S3_TESTVAL_OWNERCANONICALID: 79a59df900b949e55d96a1e698fbacedfd6e09d98eacf8f8d5218e7cd47ef2be
474+
steps:
475+
- name: Checkout
476+
uses: actions/checkout@v4
477+
- name: Login to Registry
478+
uses: docker/login-action@v3
479+
with:
480+
registry: ghcr.io
481+
username: ${{ github.repository_owner }}
482+
password: ${{ github.token }}
483+
- name: Setup CI environment
484+
uses: ./.github/actions/setup-ci
485+
- name: Copy S3C config
486+
run: cp .github/docker/config.s3c.json tests/functional/sse-kms-migration/config.json
487+
- name: Setup CI services
488+
run: docker compose up -d --quiet-pull redis sproxyd metadata-standalone vault-sse-before-migration cloudserver-sse-before-migration
489+
working-directory: .github/docker
490+
- name: Wait for services to be ready
491+
run: |-
492+
set -o pipefail;
493+
bash wait_for_local_port.bash 81 40
494+
bash wait_for_local_port.bash 9000 40
495+
bash wait_for_local_port.bash 8000 40
496+
- name: Setup vault credentials like S3C Integration
497+
run: ./setup-s3c.sh
498+
working-directory: .github/docker
499+
- name: Run cloudserver-object tests
500+
continue-on-error: true
501+
env:
502+
S3_CONFIG_FILE: ${{ github.workspace }}/.github/docker/config.s3c.json
503+
S3_LOCATION_FILE: ${{ github.workspace }}/tests/locationConfig/locationConfigS3C.json
504+
run: |-
505+
set -o pipefail;
506+
yarn run ft_awssdk_objects_misc | tee /tmp/artifacts/${{ github.job }}/ft_awssdk_objects_misc.log
507+
- name: Run cloudserver-version tests
508+
continue-on-error: true
509+
env:
510+
S3_CONFIG_FILE: ${{ github.workspace }}/.github/docker/config.s3c.json
511+
S3_LOCATION_FILE: ${{ github.workspace }}/tests/locationConfig/locationConfigS3C.json
512+
run: |-
513+
set -o pipefail;
514+
yarn run ft_awssdk_versioning | tee /tmp/artifacts/${{ github.job }}/ft_awssdk_versioning.log
515+
- name: Run cloudserver-bucket tests
516+
continue-on-error: true
517+
env:
518+
S3_CONFIG_FILE: ${{ github.workspace }}/.github/docker/config.s3c.json
519+
S3_LOCATION_FILE: ${{ github.workspace }}/tests/locationConfig/locationConfigS3C.json
520+
run: |-
521+
set -o pipefail;
522+
yarn run ft_awssdk_buckets | tee /tmp/artifacts/${{ github.job }}/ft_awssdk_buckets.log
523+
- name: Run cloudserver-routes (metadata) tests
524+
continue-on-error: true
525+
env:
526+
S3_CONFIG_FILE: ${{ github.workspace }}/.github/docker/config.s3c.json
527+
S3_LOCATION_FILE: ${{ github.workspace }}/tests/locationConfig/locationConfigS3C.json
528+
run: |-
529+
set -o pipefail;
530+
yarn run ft_node_routes | tee /tmp/artifacts/${{ github.job }}/ft_node_routes.log
531+
- name: Run backbeat route tests
532+
continue-on-error: true
533+
env:
534+
S3_CONFIG_FILE: ${{ github.workspace }}/.github/docker/config.s3c.json
535+
S3_LOCATION_FILE: ${{ github.workspace }}/tests/locationConfig/locationConfigS3C.json
536+
run: |-
537+
set -o pipefail;
538+
yarn run ft_route_backbeat | tee /tmp/artifacts/${{ github.job }}/ft_route_backbeat.log
539+
- name: Run backbeat tests
540+
continue-on-error: true
541+
env:
542+
S3_CONFIG_FILE: ${{ github.workspace }}/.github/docker/config.s3c.json
543+
S3_LOCATION_FILE: ${{ github.workspace }}/tests/locationConfig/locationConfigS3C.json
544+
run: |-
545+
set -o pipefail;
546+
yarn run ft_backbeat | tee /tmp/artifacts/${{ github.job }}/ft_backbeat.log
547+
- name: Cleanup and upload coverage
548+
uses: ./.github/actions/cleanup-and-coverage
549+
with:
550+
codecov-token: ${{ secrets.CODECOV_TOKEN }}
551+
flags: s3c-ft-tests
552+
if: always()
553+
- name: Upload test results to Codecov
554+
uses: codecov/test-results-action@v1
555+
with:
556+
token: ${{ secrets.CODECOV_TOKEN }}
557+
files: '**/junit/*junit*.xml'
558+
flags: s3c-ft-tests
559+
if: always() && !cancelled()
560+
- name: Upload logs to artifacts
561+
uses: scality/action-artifacts@v4
562+
with:
563+
method: upload
564+
url: https://artifacts.scality.net
565+
user: ${{ secrets.ARTIFACTS_USER }}
566+
password: ${{ secrets.ARTIFACTS_PASSWORD }}
567+
source: /tmp/artifacts
568+
if: always()
569+
454570
utapi-v2-tests:
455571
runs-on: ubuntu-24.04
456572
needs: build
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"default": {
3+
"accessKey": "ACC1AK00000000000000",
4+
"secretKey": "ACC1SK0000000000000000000000000000000000"
5+
},
6+
"lisa": {
7+
"accessKey": "ACC2AK00000000000000",
8+
"secretKey": "ACC2SK0000000000000000000000000000000000"
9+
},
10+
"replication": {
11+
"accessKey": "ACCREPAK000000000000",
12+
"secretKey": "ACCREPSK00000000000000000000000000000000"
13+
}
14+
}

0 commit comments

Comments
 (0)