Skip to content

Commit

Permalink
Merge branch 'w/1.14/improvement/S3UTILS-159' into w/1.15/improvement/S…
Browse files Browse the repository at this point in the history
  • Loading branch information
francoisferrand committed Apr 17, 2024
2 parents 1cf6c9d + fadff37 commit c172d80
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 64 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/alerts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Render and test count-items-cronjob
uses: scality/[email protected].2
uses: scality/[email protected].3
with:
alert_file_path: monitoring/count-items-cronjob/alerts.yaml
test_file_path: monitoring/count-items-cronjob/alerts.test.yaml
Expand All @@ -24,7 +24,7 @@ jobs:
github_token: ${{ secrets.GIT_ACCESS_TOKEN }}

- name: Render and test update-bucket-capacity-info-cronjob
uses: scality/[email protected].2
uses: scality/[email protected].3
with:
alert_file_path: monitoring/update-bucket-capacity-info-cronjob/alerts.yaml
test_file_path: monitoring/update-bucket-capacity-info-cronjob/alerts.test.yaml
Expand Down
27 changes: 10 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,49 @@ name: build
on:
workflow_call:
inputs:
namespace:
required: false
type: string
default: s3utils-dev
tag:
required: false
type: string
default: "${{ github.sha }}"

env:
REGISTRY_NAME: registry.scality.com
PROJECT_NAME: ${{ github.event.repository.name }}
NAMESPACE: ${{ inputs.namespace }}
TAG: ${{ inputs.tag }}

jobs:
build:
name: Build and Push
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Login to Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: registry.scality.com
username: ${{ secrets.REGISTRY_LOGIN }}
password: ${{ secrets.REGISTRY_PASSWORD }}
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}

- name: Push dashboards into the development namespace
run: |
oras push ${{ env.REGISTRY_NAME }}/${{ env.NAMESPACE }}/${{ env.PROJECT_NAME }}-dashboards:${{ env.TAG }} \
oras push ghcr.io/${{ github.repository }}/${{ env.PROJECT_NAME }}-dashboards:${{ inputs.tag }} \
count-items-cronjob/alerts.yaml:application/prometheus-alerts+yaml \
update-bucket-capacity-info-cronjob/alerts.yaml:application/prometheus-alerts+yaml
working-directory: monitoring

- name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
provenance: false
push: true
tags: "${{ env.REGISTRY_NAME }}/${{ env.NAMESPACE }}/${{ env.PROJECT_NAME }}:${{ env.TAG }}"
tags: ghcr.io/${{ github.repository }}:${{ inputs.tag }}
cache-from: type=gha
cache-to: type=gha,mode=max
6 changes: 3 additions & 3 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: javascript, python

- name: Build and analyze
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
4 changes: 2 additions & 2 deletions .github/workflows/dependency-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: 'Dependency Review'
uses: actions/dependency-review-action@v3
uses: actions/dependency-review-action@v4
4 changes: 1 addition & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ on:
required: false

env:
REGISTRY_NAME: registry.scality.com
PROJECT_NAME: ${{ github.event.repository.name }}

jobs:
build:
name: Build and Push
uses: ./.github/workflows/build.yml
with:
namespace: s3utils
tag: ${{ github.event.inputs.tag }}
secrets: inherit

Expand All @@ -31,7 +29,7 @@ jobs:
- build
steps:
- name: Create Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/security.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ jobs:
trivy:
needs: build
name: Trivy Vulnerability Scan for Code
uses: scality/workflows/.github/workflows/trivy.yaml@v1
uses: scality/workflows/.github/workflows/trivy.yaml@v2
with:
name: ${{ github.event.repository.name }}
namespace: s3utils-dev
registry: registry.scality.com
namespace: scality
28 changes: 11 additions & 17 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ concurrency:

env:
PROJECT_NAME: ${{ github.event.repository.name }}
NAMESPACE: ${{ inputs.namespace }}
TAG: ${{ inputs.tag }}

jobs:
prepare:
Expand All @@ -24,44 +22,42 @@ jobs:
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Docker Buildk
uses: docker/setup-buildx-action@v2
with:
buildkitd-flags: --debug
uses: docker/setup-buildx-action@v3

- name: Login to Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
password: ${{ github.token }}

- name: Build and push MongoDB
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
push: true
context: .github/dockerfiles/mongodb
tags: "ghcr.io/scality/s3utils/ci-mongodb:${{ github.sha }}"
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ghcr.io/${{ github.repository }}/ci-mongodb:${{ github.sha }}
cache-from: type=gha,scope=ci-mongodb
cache-to: type=gha,mode=max,scope=ci-mongodb

tests:
needs: prepare
runs-on: ubuntu-latest
services:
mongodb:
image: ghcr.io/scality/s3utils/ci-mongodb:${{ github.sha }}
image: ghcr.io/${{ github.repository }}/ci-mongodb:${{ github.sha }}
ports:
- 27017:27017
- 27018:27018
- 27019:27019
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16'
cache: 'yarn'
Expand All @@ -79,5 +75,3 @@ jobs:
- tests
uses: ./.github/workflows/build.yml
secrets: inherit
with:
namespace: s3utils-dev
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ S3 Connector and Zenko Utilities
Run the Docker container as (replace `<tag>` with the tag of s3utils image to be used)
```
docker run --net=host -e 'ACCESS_KEY=accessKey' -e 'SECRET_KEY=secretKey' -e 'ENDPOINT=http://127.0.0.1:8000' -e 'REPLICATION_GROUP_ID=RG001'
registry.scality.com/s3utils/s3utils:<tag> node scriptName bucket1[,bucket2...]
ghcr.io/scality/s3utils:<tag> node scriptName bucket1[,bucket2...]
```

## Trigger CRR on existing objects
Expand Down Expand Up @@ -294,7 +294,7 @@ node verifyBucketSproxydKeys.js
-e 'BUCKETD_HOSTPORT=127.0.0.1:9000' \
-e 'SPROXYD_HOSTPORT=127.0.0.1:8181' \
-e 'RAFT_SESSIONS=1' \
registry.scality.com/s3utils/s3utils:1.12.5 \
ghcr.io/scality/s3utils:1.12.5 \
node verifyBucketSproxydKeys.js
```
Expand All @@ -311,7 +311,7 @@ node verifyBucketSproxydKeys.js
-e 'SPROXYD_HOSTPORT=127.0.0.1:8181' \
-e 'BUCKETD_HOSTPORT=127.0.0.1:9000' \
-e 'KEYS_FROM_STDIN=1' \
registry.scality.com/s3utils/s3utils:1.12.5 \
ghcr.io/scality/s3utils:1.12.5 \
node verifyBucketSproxydKeys.js | tee ring_scan_raft_session_1.txt
```
Expand Down Expand Up @@ -621,7 +621,7 @@ docker run \
-e 'LISTING_DIGESTS_OUTPUT_DIR=/digests' \
-v "${DIGESTS_PATH}:/digests" \
-e 'NO_MISSING_KEY_CHECK=1' \
registry.scality.com/s3utils/s3utils:1.13.23 \
ghcr.io/scality/s3utils:1.13.23 \
node verifyBucketSproxydKeys.js \
| tee -a verifyBucketSproxydKeys.log
```
Expand Down Expand Up @@ -802,7 +802,7 @@ docker run --net=host --rm \
-v "${PWD}/scan-results:/scan-results" \
-e "DIFF_OUTPUT_FILE=/scan-results/scan-results.json" \
-e "EXCLUDE_FROM_CSEQS=$(cat /tmp/rs-cseqs.json)" \
registry.scality.com/s3utils/s3utils:1.13.23 \
ghcr.io/scality/s3utils:1.13.23 \
bash -c 'DATABASES=$(echo $DATABASES_GLOB) node CompareRaftMembers/followerDiff' \
| tee -a followerDiff.log

Expand Down Expand Up @@ -1229,7 +1229,7 @@ docker run --net=host --rm \
-v "${PWD}/scan-results:/scan-results" \
-e "DIFF_OUTPUT_FILE=/scan-results/scan-results.json" \
-e "EXCLUDE_FROM_CSEQS=$(cat /tmp/rs-cseqs.json)" \
registry.scality.com/s3utils/s3utils:1.13.23 \
ghcr.io/scality/s3utils:1.13.23 \
bash -c 'DATABASES1=$(echo $DATABASES1_GLOB) DATABASES2=$(echo $DATABASES2_GLOB) node CompareRaftMembers/compareFollowerDbs' \
| tee -a compareFollowerDbs.log

Expand Down Expand Up @@ -1406,7 +1406,7 @@ docker run -i --net=host --rm \
-e "BUCKETD_HOSTPORT=localhost:9000" \
-e "SPROXYD_HOSTPORT=localhost:8181" \
-e "DRY_RUN=1" \
registry.scality.com/s3utils/s3utils:1.13.23 \
ghcr.io/scality/s3utils:1.13.23 \
node CompareRaftMembers/repairObjects | tee -a repairObjects.log
```
Expand All @@ -1418,7 +1418,7 @@ cat scan-results.storage-{1..5}/scan-results.jsonl | \
docker run -i --net=host --rm \
-e "BUCKETD_HOSTPORT=localhost:9000" \
-e "SPROXYD_HOSTPORT=localhost:8181" \
registry.scality.com/s3utils/s3utils:1.13.23 \
ghcr.io/scality/s3utils:1.13.23 \
node CompareRaftMembers/repairObjects | tee -a repairObjects.log
```
Expand Down Expand Up @@ -1561,7 +1561,7 @@ duplicate "versionId" field found' and ignores other entries.
## Example
```
cat /tmp/verifyBucketSproxydKeys.log | docker run -i registry.scality.com/s3utils/s3utils:1.13.24 bash -c 'OBJECT_REPAIR_BUCKETD_HOSTPORT=127.0.0.1:9000 node repairDuplicateVersionIds.js' > /tmp/repairDuplicateVersionIds.log
cat /tmp/verifyBucketSproxydKeys.log | docker run -i ghcr.io/scality/s3utils:1.13.24 bash -c 'OBJECT_REPAIR_BUCKETD_HOSTPORT=127.0.0.1:9000 node repairDuplicateVersionIds.js' > /tmp/repairDuplicateVersionIds.log
```
# Cleanup Noncurrent Versions
Expand Down Expand Up @@ -1897,7 +1897,7 @@ The script also logs a progress update (a summary), every 10 seconds by default,
"dstBucket":"dst-bucket",
"srcBucket":"src-bucket",
"prefixFilters":["pref1","pref2"],
"skipOlderThan": "2022-11-30T00:00:00Z",
"skipOlderThan": "2022-11-30T00:00:00Z",
"level":"info",
"message":"completed replication verification",
"hostname":"scality.local",
Expand Down Expand Up @@ -1934,7 +1934,7 @@ docker run \
-e 'COMPARE_OBJECT_SIZE=1' \
-e 'SRC_BUCKET_PREFIXES=pref1,pref2' \
-e 'SKIP_OLDER_THAN="2022-11-30T00:00:00Z"' \
registry.scality.com/s3utils/s3utils:latest \
ghcr.io/scality/s3utils:latest \
node VerifyReplication/index.js
```

Expand Down
10 changes: 5 additions & 5 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## Docker Image Generation

Docker images are hosted on [registry.scality.com](registry.scality.com).
Docker images are hosted on [ghcr.io](https://github.com/orgs/scality/packages).
S3utils has two namespaces there:

* Production Namespace: registry.scality.com/s3utils
* Dev Namespace: registry.scality.com/s3utils-dev
* Production container image: ghcr.io/scality/s3utils
* Dashboard oras image: ghcr.io/scality/s3utils/s3utils-dashboards

With every CI build, the CI will push images, tagging the
content with the developer branch's short SHA-1 commit hash.
Expand All @@ -18,8 +18,8 @@ Tagged versions of s3utils will be stored in the production namespace.
## How to Pull Docker Images

```sh
docker pull registry.scality.com/s3utils-dev/s3utils:<commit hash>
docker pull registry.scality.com/s3utils/s3utils:<tag>
docker pull ghcr.io/scality/s3utils:<commit hash>
docker pull ghcr.io/scality/s3utils:<tag>
```

## Release Process
Expand Down

0 comments on commit c172d80

Please sign in to comment.