Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Antonio Carmona <[email protected]>
  • Loading branch information
joancafom authored Oct 11, 2023
2 parents f7f41a9 + ed389d6 commit fca1c25
Show file tree
Hide file tree
Showing 583 changed files with 2,346 additions and 8,155 deletions.
26 changes: 2 additions & 24 deletions .github/workflows/cd-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,34 +75,12 @@ jobs:
name: Checkout Repository
with:
path: charts
- id: get-asset-vib-config
name: Get asset-specific configuration for VIB action
run: |
config_file="charts/.vib/${{ needs.get-chart.outputs.chart }}/vib-action.config"
# Supported configuration customizations and default values
verification_mode="PARALLEL"
if [[ -f $config_file ]]; then
verification_mode="$(cat $config_file | grep 'verification-mode' | cut -d'=' -f2)"
fi
runtime_parameters_file=""
if [[ -f "charts/.vib/${{ needs.get-chart.outputs.chart }}/runtime-parameters.yaml" ]]; then
# The path is relative to the .vib folder
runtime_parameters_file="${{ needs.get-chart.outputs.chart }}/runtime-parameters.yaml"
fi
echo "verification_mode=${verification_mode}" >> $GITHUB_OUTPUT
echo "runtime_parameters_file=${runtime_parameters_file}" >> $GITHUB_OUTPUT
- uses: vmware-labs/vmware-image-builder-action@v0
name: Verify and publish ${{ needs.get-chart.outputs.chart }}
name: Publish ${{ needs.get-chart.outputs.chart }}
with:
pipeline: ${{ needs.get-chart.outputs.chart }}/vib-publish.json
config: charts/.vib/
verification-mode: ${{ steps.get-asset-vib-config.outputs.verification_mode }}
runtime-parameters-file: ${{ steps.get-asset-vib-config.outputs.runtime_parameters_file }}
env:
VIB_ENV_TARGET_PLATFORM: ${{ secrets.VIB_ENV_TARGET_PLATFORM }}
VIB_ENV_ALTERNATIVE_TARGET_PLATFORM: ${{ secrets.VIB_ENV_ALTERNATIVE_TARGET_PLATFORM }}
VIB_ENV_S3_URL: s3://${{ secrets.AWS_S3_BUCKET }}/bitnami
VIB_ENV_S3_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
VIB_ENV_S3_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
Expand Down Expand Up @@ -179,7 +157,7 @@ jobs:
name: Notify unsuccessful CD run
steps:
- name: Notify in Slack channel
if: ${{ needs.vib-publish.result != 'success' || needs.update-index.result != 'success' }}
if: ${{ needs.update-index.result != 'success' }}
uses: slackapi/[email protected]
with:
channel-id: ${{ secrets.CD_SLACK_CHANNEL_ID }}
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:
name: Get modified charts
permissions:
contents: read
if: ${{ github.event.pull_request.state != 'closed' }}
outputs:
chart: ${{ steps.get-chart.outputs.chart }}
result: ${{ steps.get-chart.outputs.result }}
Expand All @@ -50,7 +49,11 @@ jobs:
num_version_bumps="$(filterdiff -s -i "*Chart.yaml" $TEMP_FILE | grep -c "+version" || true)"
non_readme_files=$(echo "$files_changed" | grep -vc "\.md" || true)
if [[ "$non_readme_files" -le "0" ]]; then
if [[ $(curl -Lks ${{ github.event.pull_request.url }} | jq '.state | index("closed")') != *null* ]]; then
# The PR for which this workflow run was launched is now closed -> SKIP
echo "error=The PR for which this workflow run was launched is now closed. The tests will be skipped." >> $GITHUB_OUTPUT
echo "result=skip" >> $GITHUB_OUTPUT
elif [[ "$non_readme_files" -le "0" ]]; then
# The only changes are .md files -> SKIP
echo "result=skip" >> $GITHUB_OUTPUT
elif [[ "$num_charts_changed" -ne "$num_version_bumps" ]]; then
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/retry-failed-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright VMware, Inc.
# SPDX-License-Identifier: APACHE-2.0

name: '[CI/CD] Retry release PRs'
on:
schedule:
# Every 2 hours
- cron: '0 */2 * * *'
# Remove all permissions by default
permissions: {}
jobs:
retry-failed-pr-releases:
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- name: Retry "CI Pipeline" failed runs in releases PRs
env:
WORKFLOW_ID: "35553382"
TEMP_FILE: "${{runner.temp}}/failed_runs.json"
ACTIONS_API_ENDPOINT: "${{ github.api_url }}/repos/${{ github.repository }}/actions"
run: |
# Obtain "CI Pipeline" failed runs and filter those from release PRs with less than 3 attempts
curl -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -X GET -Lkso ${{ env.TEMP_FILE }} ${{ env.ACTIONS_API_ENDPOINT }}/workflows/${{ env.WORKFLOW_ID }}/runs?status=failure
readarray -t failed_runs_ids < <(jq '.workflow_runs[] | select((.run_attempt < 3) and (.display_title | contains("Release")) and (.head_commit.author.email=="[email protected]")).id' ${{ env.TEMP_FILE }})
for run_id in "${failed_runs_ids[@]:0:15}"; do
echo "Retrying workflow $(jq --argjson id $run_id '.workflow_runs[] | select(.id==$id) | .html_url' ${{ env.TEMP_FILE }})"
curl -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' -X POST -Lks ${{ env.ACTIONS_API_ENDPOINT }}/workflows/runs/${run_id}/rerun
done
41 changes: 0 additions & 41 deletions .github/workflows/vib-files-validator.yml

This file was deleted.

51 changes: 0 additions & 51 deletions .vib/airflow/vib-publish.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,57 +16,6 @@
}
]
},
"verify": {
"context": {
"resources": {
"url": "{SHA_ARCHIVE}",
"path": "/bitnami/airflow"
},
"target_platform": {
"target_platform_id": "{VIB_ENV_TARGET_PLATFORM}",
"size": {
"name": "M4"
}
}
},
"actions": [
{
"action_id": "health-check",
"params": {
"endpoint": "lb-airflow-http",
"app_protocol": "HTTP"
}
},
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "airflow/goss/goss.yaml",
"remote": {
"pod": {
"workload": "deploy-airflow-web"
}
}
}
},
{
"action_id": "cypress",
"params": {
"resources": {
"path": "/.vib/airflow/cypress"
},
"endpoint": "lb-airflow-http",
"app_protocol": "HTTP",
"env": {
"username": "user",
"password": "ComplicatedPassword123!4"
}
}
}
]
},
"publish": {
"actions": [
{
Expand Down
7 changes: 0 additions & 7 deletions .vib/airflow/vib-verify.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@
}
},
"actions": [
{
"action_id": "health-check",
"params": {
"endpoint": "lb-airflow-http",
"app_protocol": "HTTP"
}
},
{
"action_id": "goss",
"params": {
Expand Down
48 changes: 0 additions & 48 deletions .vib/apache/vib-publish.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,54 +16,6 @@
}
]
},
"verify": {
"context": {
"resources": {
"url": "{SHA_ARCHIVE}",
"path": "/bitnami/apache"
},
"target_platform": {
"target_platform_id": "{VIB_ENV_TARGET_PLATFORM}",
"size": {
"name": "S4"
}
}
},
"actions": [
{
"action_id": "health-check",
"params": {
"endpoint": "lb-apache-http",
"app_protocol": "HTTP"
}
},
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "apache/goss/goss.yaml",
"vars_file": "apache/runtime-parameters.yaml",
"remote": {
"pod": {
"workload": "deploy-apache"
}
}
}
},
{
"action_id": "cypress",
"params": {
"resources": {
"path": "/.vib/apache/cypress"
},
"endpoint": "lb-apache-http",
"app_protocol": "HTTP"
}
}
]
},
"publish": {
"actions": [
{
Expand Down
7 changes: 0 additions & 7 deletions .vib/apache/vib-verify.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@
}
},
"actions": [
{
"action_id": "health-check",
"params": {
"endpoint": "lb-apache-http",
"app_protocol": "HTTP"
}
},
{
"action_id": "goss",
"params": {
Expand Down
51 changes: 0 additions & 51 deletions .vib/apisix/vib-publish.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,57 +16,6 @@
}
]
},
"verify": {
"context": {
"resources": {
"url": "{SHA_ARCHIVE}",
"path": "/bitnami/apisix"
},
"target_platform": {
"target_platform_id": "{VIB_ENV_ALTERNATIVE_TARGET_PLATFORM}",
"size": {
"name": "S4"
}
}
},
"actions": [
{
"action_id": "health-check",
"params": {
"endpoint": "lb-apisix-data-plane-http"
}
},
{
"action_id": "goss",
"params": {
"resources": {
"path": "/.vib"
},
"tests_file": "apisix/goss/goss.yaml",
"vars_file": "apisix/runtime-parameters.yaml",
"remote": {
"pod": {
"workload": "deploy-apisix-data-plane"
}
}
}
},
{
"action_id": "cypress",
"params": {
"resources": {
"path": "/.vib/apisix/cypress"
},
"endpoint": "lb-apisix-dashboard-http",
"app_protocol": "HTTP",
"env": {
"username": "vib-user",
"password": "ComplicatedPassword123!4"
}
}
}
]
},
"publish": {
"actions": [
{
Expand Down
6 changes: 0 additions & 6 deletions .vib/apisix/vib-verify.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@
}
},
"actions": [
{
"action_id": "health-check",
"params": {
"endpoint": "lb-apisix-data-plane-http"
}
},
{
"action_id": "goss",
"params": {
Expand Down
Loading

0 comments on commit fca1c25

Please sign in to comment.