Skip to content

Commit

Permalink
Merge branch 'main' into feat/metrics-demo
Browse files Browse the repository at this point in the history
  • Loading branch information
bacherfl authored Apr 5, 2023
2 parents 0a0adba + e03f694 commit 190251f
Show file tree
Hide file tree
Showing 418 changed files with 82,772 additions and 83,899 deletions.
7 changes: 4 additions & 3 deletions .github/actions/deploy-klt-on-cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,19 @@ runs:
run: |
echo "Installing KLT using manifests"
sed -i 's/imagePullPolicy: Always/imagePullPolicy: Never/g' ~/download/artifacts/lifecycle-operator-manifest-test/release.yaml
sed -i 's/ghcr.keptn.sh\/keptn\/functions-runtime:.*/localhost:5000\/keptn\/functions-runtime:${{ inputs.functions_runtime_tag }}/g' ~/download/artifacts/lifecycle-operator-manifest-test/release.yaml
sed -i 's/ghcr.keptn.sh\/keptn\/functions-runtime:.*/localhost:5000\/keptn\/functions-runtime:${{ inputs.functions_runtime_tag }}/g' \
~/download/artifacts/lifecycle-operator-manifest-test/release.yaml
kubectl create namespace keptn-lifecycle-toolkit-system
kubectl apply -f ~/download/artifacts/lifecycle-operator-manifest-test
sed -i 's/imagePullPolicy: Always/imagePullPolicy: Never/g' ~/download/artifacts/certificate-operator-manifest-test/release.yaml
kubectl apply -f ~/download/artifacts/certificate-operator-manifest-test
kubectl rollout status deployment certificate-operator -n keptn-lifecycle-toolkit-system -w
sed -i 's/imagePullPolicy: Always/imagePullPolicy: Never/g' ~/download/artifacts/metrics-operator-manifest-test/release.yaml
kubectl apply -f ~/download/artifacts/metrics-operator-manifest-test
kubectl rollout status deployment metrics-operator -n keptn-lifecycle-toolkit-system -w
sed -i 's/imagePullPolicy: Always/imagePullPolicy: Never/g' ~/download/artifacts/scheduler-manifest-test/release.yaml
kubectl apply -f ~/download/artifacts/scheduler-manifest-test
kubectl rollout status deployment scheduler -n keptn-lifecycle-toolkit-system -w
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/deploy-prometheus-on-cluster/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ runs:
shell: bash
run: |
make install-prometheus
kubectl -n monitoring port-forward svc/prometheus-k8s 9090 &
kubectl -n monitoring port-forward svc/node-exporter 9100 &
# wait for port 9090 to become available
while ! nc -vz localhost 9090 > /dev/null 2>&1 ; do
echo "Sleeping until port-forward for Prometheus at port 9090 is ready..."
sleep 5
done
# wait until node exporter is available
while ! nc -vz localhost 9100 > /dev/null 2>&1 ; do
echo "Sleeping until port-forward for node exporter at port 9100 is ready..."
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
processor:
useRawDocstring: true
ignoreTypes: [ ]
ignoreTypes: []
ignoreFields:
- "status$"
- "TypeMeta$"
Expand Down
7 changes: 6 additions & 1 deletion .github/scripts/generate-crd-docs/generate-crd-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ RENDERER='markdown'
RENDERER_CONFIG_FILE='.github/scripts/generate-crd-docs/crd-docs-generator-config.yaml'

echo "Checking if code generator tool is installed..."
test -s crd-ref-docs || go install github.com/elastic/crd-ref-docs@${GENERATOR_VERSION}
if ! test -s crd-ref-docs; then
echo "Docs generator is not installed, installing now..."
go install github.com/elastic/crd-ref-docs@${GENERATOR_VERSION}
else
echo "Docs generator is installed, continuing..."
fi

echo "Running CRD docs auto-generator..."

Expand Down
87 changes: 47 additions & 40 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,18 @@ jobs:
- name: Get workflow run type
id: get_run_type
env:
NON_FORKED_AND_NON_ROBOT_RUN: >
${{
( github.actor != 'renovate[bot]' && github.actor != 'dependabot[bot]' ) &&
( github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository )
}}
run: |
NON_FORKED_AND_NON_ROBOT_RUN=${{ ( github.actor != 'renovate[bot]' && github.actor != 'dependabot[bot]' ) && ( github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository ) }}
echo "github.actor != 'renovate[bot]' = ${{ github.actor != 'renovate[bot]' }}"
echo "github.actor != 'dependabot[bot]' = ${{ github.actor != 'dependabot[bot]' }}"
echo "github.event_name == 'push' = ${{ github.event_name == 'push' }}"
echo "github.event.pull_request.head.repo.full_name == github.repository = ${{ github.event.pull_request.head.repo.full_name == github.repository }}"
echo "github.event.pull_request.head.repo.full_name == github.repository = \
${{ github.event.pull_request.head.repo.full_name == github.repository }}"
echo "NON_FORKED_AND_NON_ROBOT_RUN = $NON_FORKED_AND_NON_ROBOT_RUN"
echo "NON_FORKED_AND_NON_ROBOT_RUN=$NON_FORKED_AND_NON_ROBOT_RUN" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -188,36 +194,37 @@ jobs:

integration_tests:
name: Integration Tests
needs: [ prepare_ci_run, build_image ]
needs: [prepare_ci_run, build_image]
with:
functions_runtime_tag: dev-${{ needs.prepare_ci_run.outputs.DATETIME }}
uses: ./.github/workflows/integration-test.yml

load-tests:
name: Load Tests
needs: [ prepare_ci_run, build_image ]
needs: [prepare_ci_run, build_image]
with:
functions_runtime_tag: dev-${{ needs.prepare_ci_run.outputs.DATETIME }}
uses: ./.github/workflows/load-test.yml

e2e_tests:
name: End to End Tests
needs: [ prepare_ci_run, build_image ]
needs: [prepare_ci_run, build_image]
with:
functions_runtime_tag: dev-${{ needs.prepare_ci_run.outputs.DATETIME }}
uses: ./.github/workflows/e2e-test.yml

performance_tests:
name: Performance Tests
needs: [ prepare_ci_run, build_image ]
needs: [prepare_ci_run, build_image]
with:
functions_runtime_tag: dev-${{ needs.prepare_ci_run.outputs.DATETIME }}
uses: ./.github/workflows/performance-test.yml

upload_images:
name: Upload images to ghcr registry
needs: [ prepare_ci_run, test, component_tests, integration_tests, e2e_tests, performance_tests ]
if: github.event_name == 'push' && needs.prepare_ci_run.outputs.NON_FORKED_AND_NON_ROBOT_RUN == 'true' # only run on push to main/maintenance branches
needs: [prepare_ci_run, test, component_tests, integration_tests, e2e_tests, performance_tests]
# only run on push to main/maintenance branches
if: github.event_name == 'push' && needs.prepare_ci_run.outputs.NON_FORKED_AND_NON_ROBOT_RUN == 'true'
runs-on: ubuntu-22.04
env:
DATETIME: ${{ needs.prepare_ci_run.outputs.DATETIME }}
Expand Down Expand Up @@ -301,37 +308,37 @@ jobs:
helm_charts_build:
name: Publish helm chart changes to charts repo
if: github.event_name == 'push' && needs.prepare_ci_run.outputs.NON_FORKED_AND_NON_ROBOT_RUN == 'true'
needs: [ prepare_ci_run, build_image ]
needs: [prepare_ci_run, build_image]
runs-on: ubuntu-22.04
steps:
- name: Check out klt repo
uses: actions/checkout@v3

- name: Check out helm-charts repo
uses: actions/checkout@v3
with:
repository: 'keptn/lifecycle-toolkit-charts'
path: ./helm-charts-repository
token: ${{ secrets.KEPTN_BOT_TOKEN }}

- name: Generate helm charts
env:
RELEASE_REGISTRY: ghcr.keptn.sh/keptn
run: make helm-package

- name: Copy charts from klt to helm repo
run: rsync -av --delete --exclude='charts/*.tgz' ./helm/chart/ ./helm-charts-repository/charts/keptn-lifecycle-toolkit/

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.KEPTN_BOT_TOKEN }}
path: ./helm-charts-repository
commit-message: "feat: update KLT chart"
signoff: true
branch: klt-chart-update-${{ needs.prepare_ci_run.outputs.BRANCH_SLUG }}
delete-branch: true
base: main
title: "Update KLT Helm chart"
body: |
:robot: **This is an automated PR for updating and releasing Helm charts from keptn/lifecycle-toolkit!** :robot:
- name: Check out klt repo
uses: actions/checkout@v3

- name: Check out helm-charts repo
uses: actions/checkout@v3
with:
repository: 'keptn/lifecycle-toolkit-charts'
path: ./helm-charts-repository
token: ${{ secrets.KEPTN_BOT_TOKEN }}

- name: Generate helm charts
env:
RELEASE_REGISTRY: ghcr.keptn.sh/keptn
run: make helm-package

- name: Copy charts from klt to helm repo
run: rsync -av --delete --exclude='charts/*.tgz' ./helm/chart/ ./helm-charts-repository/charts/keptn-lifecycle-toolkit/

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.KEPTN_BOT_TOKEN }}
path: ./helm-charts-repository
commit-message: "feat: update KLT chart"
signoff: true
branch: klt-chart-update-${{ needs.prepare_ci_run.outputs.BRANCH_SLUG }}
delete-branch: true
base: main
title: "Update KLT Helm chart"
body: |
:robot: **This is an automated PR for updating and releasing Helm charts from keptn/lifecycle-toolkit!** :robot:
30 changes: 15 additions & 15 deletions .github/workflows/component-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@ jobs:
name: Component Tests
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
- name: Check out code
uses: actions/checkout@v3

- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true
cache-dependency-path: 'operator/go.sum'
- name: Set up Go 1.x
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true
cache-dependency-path: 'operator/go.sum'

- name: Execute Component Tests
working-directory: operator
run: make component-test
- name: Execute Component Tests
working-directory: operator
run: make component-test

- name: Report code coverage
uses: codecov/codecov-action@v3
with:
flags: component-tests
- name: Report code coverage
uses: codecov/codecov-action@v3
with:
flags: component-tests
2 changes: 1 addition & 1 deletion .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v3

- name: Setup cluster
uses: ./.github/actions/deploy-klt-on-cluster
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
- "!docs/**"
env:
# renovate: datasource=github-releases depName=golangci/golangci-lint
GOLANGCI_LINT_VERSION: "v1.52.1"
GOLANGCI_LINT_VERSION: "v1.52.2"
GO_VERSION: "~1.19"
jobs:
golangci-lint:
Expand All @@ -38,7 +38,7 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v3

- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/helm-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ jobs:
- name: Get workflow run type
id: get_run_type
run: |
NON_FORKED_AND_NON_ROBOT_RUN=${{ ( github.actor != 'renovate[bot]' && github.actor != 'dependabot[bot]' ) && ( github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository ) }}
NON_FORKED_AND_NON_ROBOT_RUN=${{ ( github.actor != 'renovate[bot]' && github.actor != 'dependabot[bot]' ) && \
( github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository ) }}
echo "github.actor != 'renovate[bot]' = ${{ github.actor != 'renovate[bot]' }}"
echo "github.actor != 'dependabot[bot]' = ${{ github.actor != 'dependabot[bot]' }}"
echo "github.event_name == 'push' = ${{ github.event_name == 'push' }}"
echo "github.event.pull_request.head.repo.full_name == github.repository = ${{ github.event.pull_request.head.repo.full_name == github.repository }}"
echo "github.event.pull_request.head.repo.full_name == github.repository = \
${{ github.event.pull_request.head.repo.full_name == github.repository }}"
echo "NON_FORKED_AND_NON_ROBOT_RUN = $NON_FORKED_AND_NON_ROBOT_RUN"
echo "NON_FORKED_AND_NON_ROBOT_RUN=$NON_FORKED_AND_NON_ROBOT_RUN" >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -120,7 +122,7 @@ jobs:

build_helm_chart:
name: Build Helm Chart
needs: [ prepare_ci_run, build_image ]
needs: [prepare_ci_run, build_image]
runs-on: ubuntu-22.04
env:
RELEASE_REGISTRY: "localhost:5000/keptn"
Expand Down Expand Up @@ -151,7 +153,7 @@ jobs:

integration_tests:
name: Integration Tests
needs: [ prepare_ci_run, build_helm_chart ]
needs: [prepare_ci_run, build_helm_chart]
with:
functions_runtime_tag: dev-${{ needs.prepare_ci_run.outputs.DATETIME }}
helm-install: true
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,23 @@ jobs:
uses: ./.github/actions/deploy-klt-on-cluster
with:
functions_runtime_tag: ${{ inputs.functions_runtime_tag }}
helm-install: ${{ inputs.helm-install }}
helm-install: ${{ inputs.helm-install }}

- name: Install and expose Prometheus
uses: ./.github/actions/deploy-prometheus-on-cluster

- name: Download KUTTL
env:
BASE_URL: "https://github.com/kudobuilder/kuttl/releases"
run: |
curl -fL https://github.com/kudobuilder/kuttl/releases/download/${{ env.KUTTL_VERSION }}/kubectl-kuttl_${KUTTL_VERSION#v}_linux_x86_64 -o kubectl-kuttl
curl -fL "${BASE_URL}/download/${{ env.KUTTL_VERSION }}/kubectl-kuttl_${KUTTL_VERSION#v}_linux_x86_64" -o kubectl-kuttl
chmod +x kubectl-kuttl
mv kubectl-kuttl /usr/local/bin
- name: Run Integration Tests
working-directory: .
run: make integration-test

- name: Create reports
if: always()
working-directory: ./.github/scripts
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/load-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ jobs:
uses: ./.github/actions/deploy-prometheus-on-cluster

- name: Download kube-burner
env:
BASE_URL: https://github.com/cloud-bulldozer/kube-burner/releases
run: |
curl -fL https://github.com/cloud-bulldozer/kube-burner/releases/download/${{ env.KUBE_BURNER_VERSION }}/kube-burner-${KUBE_BURNER_VERSION#v}-Linux-x86_64.tar.gz -o kube-burner-${KUBE_BURNER_VERSION#v}-Linux-x86_64.tar.gz
curl -fL \
"${BASE_URL}/download/${{ env.KUBE_BURNER_VERSION }}/kube-burner-${KUBE_BURNER_VERSION#v}-Linux-x86_64.tar.gz" \
-o kube-burner-${KUBE_BURNER_VERSION#v}-Linux-x86_64.tar.gz
tar -xf kube-burner-${KUBE_BURNER_VERSION#v}-Linux-x86_64.tar.gz
mv kube-burner /usr/local/bin
sleep 60 # wait to have the node exporter ready already with 60s of data before starting the test
Expand All @@ -46,7 +50,7 @@ jobs:
with:
name: load-tests-results
path: ./collected-metrics

- name: Create reports
if: always()
working-directory: ./.github/scripts
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/markdown-checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ jobs:
- name: Check TOC
run: |
git diff --exit-code '*.md' || (echo "Table of Contents is out of date. Please update the following files: $(git diff --name-status --exit-code)" && exit 1)
git diff --exit-code '*.md' || \
(echo "Table of Contents is out of date. Please update the following files: $(git diff --name-status --exit-code)" && exit 1)
- name: Lint Markdown files
run: make markdownlint
Expand All @@ -85,7 +86,8 @@ jobs:
- name: Check if docs are up to date
run: |
if ! diff -rq ./docs/content/en/docs/crd-ref ./docs/content/en/docs/crd-ref-old &>/dev/null; then
echo "The CRD docs have changes that are not reflected in the docs pages. Please use ./.github/scripts/generate-crd-docs/generate-crd-docs.sh to re-generate the docs."
echo "The CRD docs have changes that are not reflected in the docs pages."
echo "Please use ./.github/scripts/generate-crd-docs/generate-crd-docs.sh to re-generate the docs."
echo ""
echo "=========== Diff ==========="
diff -ru ./docs/content/en/docs/crd-ref ./docs/content/en/docs/crd-ref-old
Expand All @@ -94,4 +96,3 @@ jobs:
echo ""
echo "CRD docs are up to date!"
fi
Loading

0 comments on commit 190251f

Please sign in to comment.