mirror of
https://github.com/krkn-chaos/krkn.git
synced 2026-03-21 10:57:09 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3db5e1abbe | ||
|
|
1e699c6cc9 | ||
|
|
0ebda3e101 | ||
|
|
8a5be0dd2f | ||
|
|
62dadfe25c |
129
.github/workflows/docker-image.yml
vendored
129
.github/workflows/docker-image.yml
vendored
@@ -6,48 +6,117 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ matrix.runner }}
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- platform: amd64
|
||||
runner: ubuntu-latest
|
||||
- platform: arm64
|
||||
runner: ubuntu-24.04-arm
|
||||
steps:
|
||||
- name: Check out code
|
||||
uses: actions/checkout@v3
|
||||
- name: Build the Docker images
|
||||
if: startsWith(github.ref, 'refs/tags')
|
||||
run: |
|
||||
./containers/compile_dockerfile.sh
|
||||
docker build --no-cache -t quay.io/krkn-chaos/krkn containers/ --build-arg TAG=${GITHUB_REF#refs/tags/}
|
||||
docker tag quay.io/krkn-chaos/krkn quay.io/redhat-chaos/krkn
|
||||
docker tag quay.io/krkn-chaos/krkn quay.io/krkn-chaos/krkn:${GITHUB_REF#refs/tags/}
|
||||
docker tag quay.io/krkn-chaos/krkn quay.io/redhat-chaos/krkn:${GITHUB_REF#refs/tags/}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Test Build the Docker images
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
if: github.event_name == 'pull_request'
|
||||
run: |
|
||||
./containers/compile_dockerfile.sh
|
||||
docker build --no-cache -t quay.io/krkn-chaos/krkn containers/ --build-arg PR_NUMBER=${{ github.event.pull_request.number }}
|
||||
- name: Login in quay
|
||||
docker buildx build --no-cache \
|
||||
--platform linux/${{ matrix.platform }} \
|
||||
-t quay.io/krkn-chaos/krkn \
|
||||
-t quay.io/redhat-chaos/krkn \
|
||||
containers/ \
|
||||
--build-arg PR_NUMBER=${{ github.event.pull_request.number }}
|
||||
|
||||
- name: Login to krkn-chaos quay
|
||||
if: startsWith(github.ref, 'refs/tags')
|
||||
run: docker login quay.io -u ${QUAY_USER} -p ${QUAY_TOKEN}
|
||||
env:
|
||||
QUAY_USER: ${{ secrets.QUAY_USERNAME }}
|
||||
QUAY_TOKEN: ${{ secrets.QUAY_PASSWORD }}
|
||||
- name: Push the KrknChaos Docker images
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: quay.io
|
||||
username: ${{ secrets.QUAY_USERNAME }}
|
||||
password: ${{ secrets.QUAY_PASSWORD }}
|
||||
|
||||
- name: Build and push krkn-chaos images
|
||||
if: startsWith(github.ref, 'refs/tags')
|
||||
run: |
|
||||
docker push quay.io/krkn-chaos/krkn
|
||||
docker push quay.io/krkn-chaos/krkn:${GITHUB_REF#refs/tags/}
|
||||
- name: Login in to redhat-chaos quay
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
run: docker login quay.io -u ${QUAY_USER} -p ${QUAY_TOKEN}
|
||||
env:
|
||||
QUAY_USER: ${{ secrets.QUAY_USER_1 }}
|
||||
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN_1 }}
|
||||
- name: Push the RedHat Chaos Docker images
|
||||
./containers/compile_dockerfile.sh
|
||||
TAG=${GITHUB_REF#refs/tags/}
|
||||
docker buildx build --no-cache \
|
||||
--platform linux/${{ matrix.platform }} \
|
||||
--provenance=false \
|
||||
-t quay.io/krkn-chaos/krkn:latest-${{ matrix.platform }} \
|
||||
-t quay.io/krkn-chaos/krkn:${TAG}-${{ matrix.platform }} \
|
||||
containers/ \
|
||||
--build-arg TAG=${TAG} \
|
||||
--push --load
|
||||
|
||||
- name: Login to redhat-chaos quay
|
||||
if: startsWith(github.ref, 'refs/tags')
|
||||
run: |
|
||||
docker push quay.io/redhat-chaos/krkn
|
||||
docker push quay.io/redhat-chaos/krkn:${GITHUB_REF#refs/tags/}
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: quay.io
|
||||
username: ${{ secrets.QUAY_USER_1 }}
|
||||
password: ${{ secrets.QUAY_TOKEN_1 }}
|
||||
|
||||
- name: Push redhat-chaos images
|
||||
if: startsWith(github.ref, 'refs/tags')
|
||||
run: |
|
||||
TAG=${GITHUB_REF#refs/tags/}
|
||||
docker tag quay.io/krkn-chaos/krkn:${TAG}-${{ matrix.platform }} quay.io/redhat-chaos/krkn:${TAG}-${{ matrix.platform }}
|
||||
docker tag quay.io/krkn-chaos/krkn:${TAG}-${{ matrix.platform }} quay.io/redhat-chaos/krkn:latest-${{ matrix.platform }}
|
||||
docker push quay.io/redhat-chaos/krkn:${TAG}-${{ matrix.platform }}
|
||||
docker push quay.io/redhat-chaos/krkn:latest-${{ matrix.platform }}
|
||||
|
||||
manifest:
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
if: startsWith(github.ref, 'refs/tags')
|
||||
steps:
|
||||
- name: Login to krkn-chaos quay
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: quay.io
|
||||
username: ${{ secrets.QUAY_USERNAME }}
|
||||
password: ${{ secrets.QUAY_PASSWORD }}
|
||||
|
||||
- name: Create and push KrknChaos manifests
|
||||
run: |
|
||||
TAG=${GITHUB_REF#refs/tags/}
|
||||
docker manifest create quay.io/krkn-chaos/krkn:${TAG} \
|
||||
quay.io/krkn-chaos/krkn:${TAG}-amd64 \
|
||||
quay.io/krkn-chaos/krkn:${TAG}-arm64
|
||||
docker manifest push quay.io/krkn-chaos/krkn:${TAG}
|
||||
|
||||
docker manifest create quay.io/krkn-chaos/krkn:latest \
|
||||
quay.io/krkn-chaos/krkn:latest-amd64 \
|
||||
quay.io/krkn-chaos/krkn:latest-arm64
|
||||
docker manifest push quay.io/krkn-chaos/krkn:latest
|
||||
|
||||
- name: Login to redhat-chaos quay
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: quay.io
|
||||
username: ${{ secrets.QUAY_USER_1 }}
|
||||
password: ${{ secrets.QUAY_TOKEN_1 }}
|
||||
|
||||
- name: Create and push RedHat Chaos manifests
|
||||
run: |
|
||||
TAG=${GITHUB_REF#refs/tags/}
|
||||
docker manifest create quay.io/redhat-chaos/krkn:${TAG} \
|
||||
quay.io/redhat-chaos/krkn:${TAG}-amd64 \
|
||||
quay.io/redhat-chaos/krkn:${TAG}-arm64
|
||||
docker manifest push quay.io/redhat-chaos/krkn:${TAG}
|
||||
|
||||
docker manifest create quay.io/redhat-chaos/krkn:latest \
|
||||
quay.io/redhat-chaos/krkn:latest-amd64 \
|
||||
quay.io/redhat-chaos/krkn:latest-arm64
|
||||
docker manifest push quay.io/redhat-chaos/krkn:latest
|
||||
|
||||
- name: Rebuild krkn-hub
|
||||
if: startsWith(github.ref, 'refs/tags')
|
||||
uses: redhat-chaos/actions/krkn-hub@main
|
||||
with:
|
||||
QUAY_USER: ${{ secrets.QUAY_USERNAME }}
|
||||
|
||||
@@ -558,5 +558,31 @@
|
||||
"separator": ",",
|
||||
"default": "False",
|
||||
"required": "false"
|
||||
},
|
||||
{
|
||||
"name": "resiliency-score",
|
||||
"short_description": "Enable resiliency score calculation",
|
||||
"description": "The system outputs a detailed resiliency score as a single-line JSON object, facilitating easy aggregation across multiple test scenarios.",
|
||||
"variable": "RESILIENCY_SCORE",
|
||||
"type": "boolean",
|
||||
"required": "false"
|
||||
},
|
||||
{
|
||||
"name": "disable-resiliency-score",
|
||||
"short_description": "Disable resiliency score calculation",
|
||||
"description": "Disable resiliency score calculation",
|
||||
"variable": "DISABLE_RESILIENCY_SCORE",
|
||||
"type": "boolean",
|
||||
"required": "false"
|
||||
},
|
||||
{
|
||||
"name": "resiliency-file",
|
||||
"short_description": "Resiliency Score metrics file",
|
||||
"description": "Custom Resiliency score file",
|
||||
"variable": "RESILIENCY_FILE",
|
||||
"type": "file",
|
||||
"required": "false",
|
||||
"mount_path": "/home/krkn/resiliency-file.yaml"
|
||||
}
|
||||
|
||||
]
|
||||
@@ -320,7 +320,7 @@ class Resiliency:
|
||||
)
|
||||
detailed = self.get_detailed_report()
|
||||
|
||||
if run_mode == "controller":
|
||||
if run_mode == "detailed":
|
||||
# krknctl expects the detailed report on stdout in a special format
|
||||
try:
|
||||
detailed_json = json.dumps(detailed)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
duration: 60
|
||||
duration: 10
|
||||
workers: '' # leave it empty '' node cpu auto-detection
|
||||
hog-type: cpu
|
||||
image: quay.io/krkn-chaos/krkn-hog
|
||||
|
||||
@@ -597,7 +597,7 @@ class TestFinalizeAndSave(unittest.TestCase):
|
||||
prom_cli=self.mock_prom,
|
||||
total_start_time=self.start,
|
||||
total_end_time=self.end,
|
||||
run_mode="controller",
|
||||
run_mode="detailed",
|
||||
)
|
||||
|
||||
mock_print.assert_called()
|
||||
|
||||
Reference in New Issue
Block a user