Skip to content

Commit

Permalink
Merge branch 'k8s-operatorhub:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Milica-Cvrkota-IBM authored Sep 26, 2023
2 parents 39176fa + d435751 commit b5d8664
Show file tree
Hide file tree
Showing 15,156 changed files with 3,549,008 additions and 138,290 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
8 changes: 4 additions & 4 deletions .github/workflows/dco_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:
OPP_THIS_BRANCH: "main"
OPP_PROD: 0
OPP_DRY_RUN: 0
KIND_KUBE_VERSION: "v1.24.0"
KIND_KUBE_VERSION: "v1.27.2"
OPP_PRODUCTION_TYPE: "k8s"
OPP_REVIEWERS_ENABLED: 1

Expand All @@ -32,12 +32,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- id: files
uses: jitterbit/get-changed-files@v1
uses: masesgroup/retrieve-changed-files@v2
continue-on-error: true
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/dco_workflow_complete.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: 'Download artifact'
uses: actions/github-script@v3.1.0
uses: actions/github-script@v6
with:
script: |
var artifacts = await github.actions.listWorkflowRunArtifacts({
var artifacts = await github.rest.actions.listWorkflowRunArtifacts({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: ${{github.event.workflow_run.id }},
});
var matchArtifact = artifacts.data.artifacts.filter((artifact) => {
return artifact.name == "pr"
})[0];
var download = await github.actions.downloadArtifact({
var download = await github.rest.actions.downloadArtifact({
owner: context.repo.owner,
repo: context.repo.repo,
artifact_id: matchArtifact.id,
Expand All @@ -38,7 +38,8 @@ jobs:
- name: 'PR Number'
id: pr-number
run: |
PR=$(cat ./NR)
PR=$(tr -dc [0-9] <./NR)
[ -z "$PR" ] && echo "Invalid PR number" && exit 1
echo "pr=${PR}" >> $GITHUB_OUTPUT
- uses: actions/github-script@v6
Expand All @@ -65,11 +66,13 @@ jobs:
if: needs.pr.outputs.pr != '0'
uses: actions/github-script@v6
continue-on-error: true
env:
PR: "${{ needs.pr.outputs.pr }}"
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
github.rest.issues.removeLabel({
issue_number: ${{ needs.pr.outputs.pr }},
issue_number: process.env.PR,
owner: context.repo.owner,
repo: context.repo.repo,
name: 'dco-failed'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
container: quay.io/operator_testing/community-operators-mkdocs
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
repository: redhat-openshift-ecosystem/community-operators-pipeline
ref: documentation
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/operator_ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,12 @@ jobs:
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
assignees: [ "J0zi", "mvalarh" ]
assignees: ['mporrato', 'Allda']
});
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/operator_ci_approved.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ env:
OPP_THIS_BRANCH: "main"
OPP_PROD: 0
OPP_DRY_RUN: 0
KIND_KUBE_VERSION: "v1.24.0"
KIND_KUBE_VERSION: "v1.27.2"
OPP_PRODUCTION_TYPE: "k8s"
OPP_REVIEWERS_ENABLED: 1

Expand All @@ -33,7 +33,7 @@ jobs:
steps:

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/operator_ci_index_sha.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ env:
OPP_MIRROR_INDEX_REGISTRY: "quay.io"
OPP_MIRROR_INDEX_ORGANIZATION: "operatorhubio"
OPP_MIRROR_INDEX_NAME: "catalog"
IIB_INPUT_REGISTRY_USER: "mavala"
OPP_REGISTRY_MIRROR_USER: "mavala"
IIB_INPUT_REGISTRY_USER: "framework_automation"
OPP_REGISTRY_MIRROR_USER: "framework_automation"

#QUAY_API_TOKEN_OPENSHIFT_COMMUNITY_OP: ${{ secrets.QUAY_API_TOKEN_OPENSHIFT_COMMUNITY_OP }}
#QUAY_API_TOKEN_OPERATORHUBIO: ${{ secrets.QUAY_API_TOKEN_OPERATORHUBIO }}
Expand Down
90 changes: 90 additions & 0 deletions .github/workflows/operator_convert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@

name: "Operator Convert"
on:
workflow_dispatch:
inputs:
operators:
description: 'List of operators divided by space (aqua dell-csi-operator). Value all is also supported'
required: true
default: 'aqua dell-csi-operator'
target_branch:
description: 'Target branch'
required: true
#default: 'main'
default: 'manifest-to-bundle'
playbook_repo:
description: 'Playbook repo'
required: true
default: 'https://github.com/redhat-openshift-ecosystem/operator-test-playbooks'
playbook_branch:
description: 'Playbook branch'
required: true
default: 'upstream-community'
env:
OPP_OPERATORS: ${{ github.event.inputs.operators }}
OPP_ANSIBLE_PULL_REPO: "${{ github.event.inputs.playbook_repo }}"
OPP_ANSIBLE_PULL_BRANCH: "${{ github.event.inputs.playbook_branch }}"
ANSIBLE_FORCE_COLOR: 1
ANSIBLE_DISPLAY_SKIPPED_HOSTS: 0
ANSIBLE_STDOUT_CALLBACK: "yaml"
OPP_TARGET_BRANCH: "${{ github.event.inputs.target_branch }}"
OPP_PRODUCTION_TYPE: "k8s"


jobs:
convert:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.FRAMEWORK_MERGE }}
- name: Conversion
run: |
set -x
PROJECT_DIR=$(pwd)
FAKE_RC=false
git config --local user.email "41898282+framework-automation[bot]@users.noreply.github.com" || $FAKE_RC
git config --local user.name "framework-automation" || $FAKE_RC
if [[ $OPP_TARGET_BRANCH != "main" ]];then
git switch -C $OPP_TARGET_BRANCH
git reset --hard main
fi
if [[ $OPP_OPERATORS == "all" ]];then
echo "Searching for all operators ..."
OPP_OPERATORS=$(find operators/ -name "*package.yaml" | cut -d '/' -f 2 | tr '\n' ' ')
fi
PLAYBOOK_DIR="/tmp/operator-test-playbooks"
git clone $OPP_ANSIBLE_PULL_REPO -b $OPP_ANSIBLE_PULL_BRANCH $PLAYBOOK_DIR
ANSIBLE_TAGS="reset_tools,operator_info"
ANSIBLE_ARGS=
[ "$OPP_PRODUCTION_TYPE" == "ocp" ] && ANSIBLE_ARGS="-e supported_cluster_versions=v4.10,v4.11,v4.12,v4.13,v4.14"
for op in $OPP_OPERATORS;do
# TODO: Check if it is package manifest already
[ ! -d $PROJECT_DIR/operators/$op ] && { echo "Operator '$op' was not found, skipping ...";continue; } || true
IS_PACKAGEMANIFEST=$(find $PROJECT_DIR/operators/$op -name "*package.yaml")
[ -z $IS_PACKAGEMANIFEST ] && { echo "Operator '$op' is in bundle format already, skipping ...";continue; } || true
cd $PLAYBOOK_DIR
ansible-playbook -i localhost, -e ansible_connection=local -e run_upstream=true -e run_prepare_catalog_repo_upstream=false -e run_remove_catalog_repo=false upstream/local.yml --tags $ANSIBLE_TAGS \
-e operator_dir=$PROJECT_DIR/operators/$op -e cluster_type=$OPP_PRODUCTION_TYPE -e strict_cluster_version_labels=true -e strict_k8s_bundles=true -e automatic_cluster_version_label=true \
-e oi_index_skip=true $ANSIBLE_ARGS
ANSIBLE_TAGS="operator_info"
cd $PROJECT_DIR
echo "Moving bundle for '$op' ..."
[ -e $PROJECT_DIR/operators/$op/ci.yaml ] && mv $PROJECT_DIR/operators/$op/ci.yaml /tmp/operator-test/operators/$op/ || echo "ci.yaml file does not exist, skipping ..."
rm -rf $PROJECT_DIR/operators/$op
mv /tmp/operator-test/operators/$op $PROJECT_DIR/operators/$op
find $PROJECT_DIR/operators/$op -name 'bundle.Dockerfile' -delete
cd $PROJECT_DIR
git add . || $FAKE_RC
git commit -m "Operator '$op' converted from packagemanifest to bundle format" -a || $FAKE_RC
git push origin $OPP_TARGET_BRANCH -f || $FAKE_RC
done
71 changes: 52 additions & 19 deletions .github/workflows/operator_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ env:
OPP_MIRROR_INDEX_MULTIARCH_BASE: "quay.io/operator-framework/opm"
OPP_MULTIARCH_SUPPORTED_VERSIONS: "latest"
OPP_MIRROR_INDEX_MULTIARCH_POSTFIX: "s"
IIB_INPUT_REGISTRY_USER: "mavala"
OPP_REGISTRY_MIRROR_USER: "mavala"
IIB_INPUT_REGISTRY_USER: "framework_automation"
OPP_REGISTRY_MIRROR_USER: "framework_automation"
OPP_THIS_REPO_BASE: "https://github.com"
OPP_THIS_REPO: "k8s-operatorhub/community-operators"
OPP_THIS_BRANCH: "main"
Expand All @@ -70,16 +70,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- id: files
uses: jitterbit/get-changed-files@v1
uses: masesgroup/retrieve-changed-files@v2
continue-on-error: true

- id: prinfo
uses: actions-ecosystem/action-get-merged-pull-request@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
Expand All @@ -91,7 +93,9 @@ jobs:
OPP_MODIFIED_FILES: "${{ steps.files.outputs.modified }}"
OPP_RENAMED_FILES: "${{ steps.files.outputs.renamed }}"
OPP_REMOVED_FILES: "${{ steps.files.outputs.removed }}"

OPP_LABELS: "${{ steps.prinfo.outputs.labels }}"

run: |
if [ -z "${{ github.event.inputs.list_of_operators }}" ]
then
Expand All @@ -114,6 +118,7 @@ jobs:
echo "PR : ${{ steps.prinfo.outputs.number }}"
echo "labels : ${{ steps.prinfo.outputs.labels }}"
echo "OPP_LABELS=$OPP_LABELS"
echo "Using script '$OPP_SCRIPT_ENV_URL' ..."
bash <(curl -sL $OPP_SCRIPT_ENV_URL)
Expand All @@ -123,7 +128,9 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
outputs:

opp_labels: "${{ steps.prinfo.outputs.labels }}"

opp_test_ready: "${{ steps.op-traffic-light.outputs.opp_test_ready }}"
opp_release_ready: "${{ steps.op-traffic-light.outputs.opp_release_ready }}"
opp_stream: "${{ steps.op-traffic-light.outputs.opp_stream }}"
Expand Down Expand Up @@ -314,7 +321,7 @@ jobs:
env:
OPP_LABELS: "${{ needs.pr-check.outputs.opp_labels }}"
OPP_AUTO_PACKAGEMANIFEST_CLUSTER_VERSION_LABEL: "${{ needs.pr-check.outputs.opp_auto_packagemanifest_cluster_version_label }}"
OPP_IIB_INSTALL: 1
OPP_IIB_INSTALL: 0
#OPP_MIRROR_INDEX_ENABLED: 0
OPP_FORCE_INDEX_UPDATE: 1
OPP_SKIP_BUNDLES: 1
Expand All @@ -332,6 +339,7 @@ jobs:
[[ $FAKE_TYPE == *maintenance* ]] && exit 0 || true
bash <(curl -sL $OPP_SCRIPT_CLEANUP_URL)
echo "orange_${OPERATOR_INDEX_TAG} operators/sync $OPP_THIS_REPO $OPP_THIS_BRANCH"
bash <(curl -sL $OPP_SCRIPT_URL) orange_${OPERATOR_INDEX_TAG} operators/sync $OPP_THIS_REPO $OPP_THIS_BRANCH || $FAKE_RC
- name: Print space info (after)
Expand All @@ -354,7 +362,7 @@ jobs:
fail-fast: false
steps:
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
Expand Down Expand Up @@ -407,21 +415,46 @@ jobs:
bash <(curl -sL $OPP_SCRIPT_TRIGGER_OHIO_URL) ${CI_OHIO_BRANCH}
slack-notification:
name: "Slack notification"
name: "Monitoring notification"
needs: [ pr-check, remove-k8s, operators-k8s, release-k8s, index-verify-k8s, ohio-image-k8s, ohio-page-k8s ]


if: failure()
runs-on: ubuntu-latest
steps:
- name: Report Status
uses: ravsamhq/notify-slack-action@master
with:
notification_title: 'Release pipeline failed: ${{ needs.pr-check.outputs.opp_pr_title }}'
footer: 'monitoring'
# status: ${{ needs.pr-check.result }}
status: 'failure'
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}
continue-on-error: true
- name: Google Chat Notification
run: |
echo "title: Release pipeline failed: ${{ needs.pr-check.outputs.opp_pr_title }}"
echo "subtitle: failure"
curl --location --request POST '${{ secrets.GCHAT_WEBHOOK }}' \
--header 'Content-Type: application/json' \
--data-raw '{
"cards": [
{
"header": {
"title": "Release pipeline failed: ${{ needs.pr-check.outputs.opp_pr_title }}",
"subtitle": "failure"
},
"sections": [
{
"widgets": [
{
"buttons": [
{
"textButton": {
"text": "Open the release queue",
"onClick": {
"openLink": {
"url": "https://github.com/${{ github.repository }}/actions/workflows/operator_release.yaml"
}
}
}
}
]
}
]
}
]
}
]
}'
Loading

0 comments on commit b5d8664

Please sign in to comment.