This repository is currently being migrated. It's locked while the migration is in progress.
-
Notifications
You must be signed in to change notification settings - Fork 5
Adds Kubecover tests as Github Actions #121
Open
anas-domesticus
wants to merge
30
commits into
master
Choose a base branch
from
pr_k8s_tests
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
c4f335b
Adding PR flow
anas-domesticus b759bfa
Fixing name
anas-domesticus 5a03f0b
Moving where test runs
anas-domesticus bdf40c6
Adding token
anas-domesticus 413ba7b
Correcting syntax
anas-domesticus 4c8ef78
Testing performing test synchronously
anas-domesticus 4cb5cb4
Using stable platform builder
anas-domesticus 5f7d294
Full test suite
1e4967a
Trying empty test RegEx
db96d62
Trying empty test RegEx
0f1e316
Adding image build step
2d048a1
No longer using makefile
84483a5
Syntax
1d5cecc
Adding "build-" prefix
0eaaa76
Moving back to docker hub
4531631
Passing secret through
d0f05ff
Trying direct docker login
c8f554d
Adding quotes
e8cda5a
foo
116c0ad
Chibre
76503b6
Adding a checkout step
ab73169
Moving to stable & master refs
a11e4de
Version bump
78e4177
Allowing use of preexisting cluster
anas-domesticus 6fe795b
Testing on branch
anas-domesticus d96a053
Pointing to stable
anas-domesticus bd147a9
Correcting version of kubecover image
anas-domesticus e4f48e0
No longer using existing cluster
anas-domesticus f921843
Updating to include platform options
angelos-p 26e1029
Adding ondat org token
angelos-p File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,241 @@ | ||
| name: Kubecover Reusable Workflow | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| platform_builder_version: | ||
| required: true | ||
| type: string | ||
| default: "stable" | ||
| kubecover_version: | ||
| required: true | ||
| type: string | ||
| default: "stable" | ||
| platform_version: | ||
| required: true | ||
| type: string | ||
| platform: | ||
| required: true | ||
| type: string | ||
| operator_version: | ||
| required: true | ||
| type: string | ||
| node_container: | ||
| required: true | ||
| type: string | ||
| tests_regex: | ||
| required: true | ||
| type: string | ||
| use_existing_cluster: | ||
| required: true | ||
| type: string | ||
| workers_num: | ||
| required: true | ||
| type: string | ||
| disk_size: | ||
| required: true | ||
| type: string | ||
| instance_type: | ||
| required: true | ||
| type: string | ||
| csi_cluster_driver_registrar_container: | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| csi_external_attacher_container: | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| csi_external_provisioner_container: | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| csi_liveness_probe_container: | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| csi_node_driver_registrar_container: | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| etcd_host: | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| init_container: | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| nfs_container: | ||
| required: false | ||
| type: string | ||
| default: "" | ||
| secrets: | ||
| ONDAT_ORG_TOKEN: | ||
| required: true | ||
| CR_USER: | ||
| required: true | ||
| CR_PAT: | ||
| required: true | ||
| OPENSHIFT_IAM_USER_ACCESS_ID: | ||
| required: true | ||
| OPENSHIFT_IAM_USER_SECRET_KEY: | ||
| required: true | ||
|
|
||
| jobs: | ||
| build_image: | ||
| runs-on: self-hosted | ||
| steps: | ||
| - name: Init | ||
| uses: actions/checkout@v2 | ||
| - name: Build & push container image | ||
| run: | | ||
| docker login -u "${{ secrets.CR_USER }}" -p "${{ secrets.CR_PAT }}" docker.io | ||
| docker build -t storageos/api-manager:build-$GITHUB_HEAD_REF . | ||
| docker push storageos/api-manager:build-$GITHUB_HEAD_REF | ||
|
|
||
| create: | ||
| container: | ||
| image: 120921464587.dkr.ecr.eu-west-2.amazonaws.com/platform-builder:${{ inputs.platform_builder_version }} | ||
| runs-on: self-hosted | ||
| steps: | ||
| - name: Echo Inputs | ||
| run: | | ||
| echo Platform Builder version: ${{ inputs.platform_builder_version }} | ||
| echo Platform version: ${{ inputs.platform_version }} | ||
| echo Platfrom: ${{ inputs.platform }} | ||
| echo Ondat version: ${{ inputs.operator_version }} | ||
| echo Tests Regex: ${{ inputs.tests_regex }} | ||
| echo Use existing cluster: ${{ inputs.use_existing_cluster }} | ||
| echo Workers Num: ${{ inputs.workers_num }} | ||
| echo Disk size: ${{ inputs.disk_size }} | ||
| echo csi_cluster_driver_registrar_container: ${{ inputs.csi_cluster_driver_registrar_container }} | ||
| echo csi_external_attacher_container: ${{ inputs.csi_external_attacher_container }} | ||
| echo csi_external_provisioner_container: ${{ inputs.csi_external_provisioner_container }} | ||
| echo csi_liveness_probe_container: ${{ inputs.csi_liveness_probe_container }} | ||
| echo csi_node_driver_registrar_container: ${{ inputs.csi_node_driver_registrar_container }} | ||
| echo api_manager_container: storageos/api-manager:build-$GITHUB_HEAD_REF | ||
| echo etcd_host: ${{ inputs.etcd_host }} | ||
| echo init_container: ${{ inputs.init_container }} | ||
| echo nfs_container: ${{ inputs.nfs_container }} | ||
| echo node_container: ${{ inputs.node_container }} | ||
| echo secret: ${{ secrets.gh_token }} | ||
|
|
||
| - name: Init | ||
| uses: actions/checkout@v2 | ||
| - name: Checkout GitHub Action Repo | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| path: .github/actions/github-actions | ||
| ref: stable | ||
| repository: ondat/github_actions | ||
| token: ${{ secrets.ONDAT_ORG_TOKEN }} | ||
|
|
||
| - name: Get Cluster | ||
| id: get_cluster | ||
| uses: ./.github/actions/github-actions/get_cluster | ||
| env: | ||
| OCP_AWS_ACCESS_KEY_ID: ${{ secrets.OPENSHIFT_IAM_USER_ACCESS_ID }} | ||
| OCP_AWS_SECRET_ACCESS_KEY: ${{ secrets.OPENSHIFT_IAM_USER_SECRET_KEY }} | ||
| with: | ||
| platform: ${{ inputs.platform }} | ||
| platform_version: ${{ inputs.platform_version }} | ||
| use_existing_cluster: ${{ inputs.use_existing_cluster }} | ||
| workers_num: ${{ inputs.workers_num }} | ||
| disk_size: ${{ inputs.disk_size }} | ||
| instance_type: ${{ inputs.instance_type }} | ||
|
|
||
| install_ondat: | ||
| needs: [create, build_image] | ||
| container: | ||
| image: 120921464587.dkr.ecr.eu-west-2.amazonaws.com/kubecover:${{ inputs.kubecover_version }} | ||
| runs-on: self-hosted | ||
| steps: | ||
| - name: Init | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: Checkout GitHub Action Repo | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| path: .github/actions/github-actions | ||
| ref: stable | ||
| repository: ondat/github_actions | ||
| token: ${{ secrets.ONDAT_ORG_TOKEN }} | ||
|
|
||
| - name: Install Ondat | ||
| id: install_ondat | ||
| uses: ./.github/actions/github-actions/install_ondat | ||
| with: | ||
| csi_cluster_driver_registrar_container: ${{ inputs.csi_cluster_driver_registrar_container }} | ||
| csi_external_attacher_container: ${{ inputs.csi_external_attacher_container }} | ||
| csi_external_provisioner_container: ${{ inputs.csi_external_provisioner_container }} | ||
| csi_liveness_probe_container: ${{ inputs.csi_liveness_probe_container }} | ||
| csi_node_driver_registrar_container: ${{ inputs.csi_node_driver_registrar_container }} | ||
| api_manager_container: storageos/api-manager:build-$GITHUB_HEAD_REF | ||
| etcd_host: ${{ inputs.etcd_host }} | ||
| init_container: ${{ inputs.init_container }} | ||
| nfs_container: ${{ inputs.nfs_container }} | ||
| node_container: ${{ inputs.node_container }} | ||
| operator_version: ${{ inputs.operator_version }} | ||
| platform: ${{ inputs.platform }} | ||
|
|
||
| run-tests: | ||
| needs: [install_ondat] | ||
| container: | ||
| image: 120921464587.dkr.ecr.eu-west-2.amazonaws.com/kubecover:${{ inputs.kubecover_version }} | ||
| runs-on: self-hosted | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v2 | ||
|
|
||
| - name: Checkout GitHub Action Repo | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| path: .github/actions/github-actions | ||
| ref: stable | ||
| repository: ondat/github_actions | ||
| token: ${{ secrets.ONDAT_ORG_TOKEN }} | ||
|
|
||
| - name: Run Tests | ||
| id: kubecover_tests | ||
| uses: ./.github/actions/github-actions/kubecover_tests | ||
| env: | ||
| ACTIONS_TOKEN: ${{ secrets.ONDAT_ORG_TOKEN }} | ||
| with: | ||
| tests_regex: ${{ inputs.tests_regex }} | ||
|
|
||
| cleanup: | ||
| needs: [run-tests] | ||
| if: always() | ||
| container: | ||
| image: 120921464587.dkr.ecr.eu-west-2.amazonaws.com/platform-builder:${{ inputs.platform_builder_version }} | ||
| runs-on: self-hosted | ||
| steps: | ||
| - name: Checkout GitHub Action Repo | ||
| uses: actions/checkout@v2 | ||
| with: | ||
| path: .github/actions/github-actions | ||
| ref: stable | ||
| repository: ondat/github_actions | ||
| token: ${{ secrets.ONDAT_ORG_TOKEN }} | ||
|
|
||
| - uses: actions/download-artifact@v2 | ||
| with: | ||
| name: cluster_name | ||
|
|
||
| - name: Set cluster name var from artefact | ||
| id: vars | ||
| shell: bash | ||
| run: | | ||
| echo "CLUSTER_NAME=$(cat cluster_name)" >> $GITHUB_ENV | ||
| export CLUSTER_NAME=$(cat cluster_name) | ||
|
|
||
| - name: Destroy Cluster | ||
| id: destroy_cluster | ||
| uses: ./.github/actions/github-actions/destroy_cluster | ||
| env: | ||
| OCP_AWS_ACCESS_KEY_ID: ${{ secrets.OPENSHIFT_IAM_USER_ACCESS_ID }} | ||
| OCP_AWS_SECRET_ACCESS_KEY: ${{ secrets.OPENSHIFT_IAM_USER_SECRET_KEY }} | ||
| name: | ||
| platform: ${{ inputs.platform }} | ||
| cluster_name: ${{ env.cluster_name }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| name: API Manager Kubecover Flow | ||
|
|
||
| on: [pull_request] | ||
|
|
||
| jobs: | ||
| kubecover: | ||
| uses: storageos/api-manager/.github/workflows/kubecover-actions-flow.yaml@pr_k8s_tests | ||
| with: | ||
| platform_builder_version: "stable" | ||
| kubecover_version: "latest" | ||
| platform: 'k8s' | ||
| platform_version: '1.22' | ||
| operator_version: 'v2.6.0' | ||
| node_container: 'storageos/node:v2.6.0' | ||
| init_container: 'storageos/init:v2.1.1' | ||
| tests_regex: "." | ||
| use_existing_cluster: 'n' | ||
| workers_num: '3' | ||
| disk_size: '100' | ||
| instance_type: 't3.large' | ||
| secrets: | ||
| ONDAT_ORG_TOKEN: ${{ secrets.ONDAT_ORG_TOKEN }} | ||
| CR_USER: ${{ secrets.CR_USER }} | ||
| CR_PAT: ${{ secrets.CR_PAT }} | ||
| OCP_AWS_ACCESS_KEY_ID: ${{ secrets.OPENSHIFT_IAM_USER_ACCESS_ID }} | ||
| OCP_AWS_SECRET_ACCESS_KEY: ${{ secrets.OPENSHIFT_IAM_USER_SECRET_KEY }} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.