Skip to content

Commit 8344d76

Browse files
committed
CSPL-1754
1 parent 46eebbc commit 8344d76

File tree

1 file changed

+139
-0
lines changed

1 file changed

+139
-0
lines changed
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
name: Namespace-scope Operator Integration Test WorkFlow
2+
on:
3+
schedule:
4+
- cron: "0 02 * * WED,SUN"
5+
jobs:
6+
int-tests:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
test: [appframeworks1, appframeworkc3, appframeworkm4, secret, smartstore, monitoringconsole, scaling, crcrud, licensemaster]
11+
runs-on: ubuntu-latest
12+
env:
13+
CLUSTER_NODES: 1
14+
CLUSTER_WORKERS: 3
15+
SPLUNK_ENTERPRISE_IMAGE: splunk/splunk:edge
16+
SPLUNK_OPERATOR_IMAGE_NAME: splunk/splunk-operator
17+
SPLUNK_OPERATOR_IMAGE_FILENAME: splunk-operator
18+
TEST_FOCUS: "${{ matrix.test }}"
19+
# This regex matches any string not containing integration keyword
20+
TEST_TO_SKIP: "^(?:[^i]+|i(?:$|[^n]|n(?:$|[^t]|t(?:$|[^e]|e(?:$|[^g]|g(?:$|[^r]|r(?:$|[^a]|a(?:$|[^t]|t(?:$|[^i]|i(?:$|[^o]|o(?:$|[^n])))))))))))*$"
21+
TEST_CLUSTER_PLATFORM: eks
22+
EKS_VPC_PRIVATE_SUBNET_STRING: ${{ secrets.EKS_VPC_PRIVATE_SUBNET_STRING }}
23+
EKS_VPC_PUBLIC_SUBNET_STRING: ${{ secrets.EKS_VPC_PUBLIC_SUBNET_STRING }}
24+
TEST_BUCKET: ${{ secrets.TEST_BUCKET }}
25+
TEST_INDEXES_S3_BUCKET: ${{ secrets.TEST_INDEXES_S3_BUCKET }}
26+
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }}
27+
PRIVATE_REGISTRY: ${{ secrets.ECR_REPOSITORY }}
28+
S3_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
29+
ENTERPRISE_LICENSE_LOCATION: ${{ secrets.ENTERPRISE_LICENSE_LOCATION }}
30+
CLUSTER_WIDE: "false"
31+
steps:
32+
- name: Set Test Cluster Name
33+
run: |
34+
echo "TEST_CLUSTER_NAME=eks-integration-test-cluster-${{ matrix.test }}-$GITHUB_RUN_ID" >> $GITHUB_ENV
35+
- name: Set Test Cluster Nodes and Parallel Runs
36+
run: >-
37+
if grep -q "appframework" <<< "${{ matrix.test }}"; then
38+
echo "CLUSTER_WORKERS=5" >> $GITHUB_ENV
39+
echo "CLUSTER_NODES=2" >> $GITHUB_ENV
40+
fi
41+
- name: Checkout code
42+
uses: actions/checkout@v2
43+
with:
44+
ref: develop
45+
- name: Dotenv Action
46+
id: dotenv
47+
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359
48+
- name: Install Kubectl
49+
uses: Azure/setup-kubectl@v1
50+
with:
51+
version: ${{ steps.dotenv.outputs.KUBECTL_VERSION }}
52+
- name: Install Python
53+
uses: actions/setup-python@v2
54+
- name: Install AWS CLI
55+
run: |
56+
curl "${{ steps.dotenv.outputs.AWSCLI_URL}}" -o "awscli-bundle.zip"
57+
unzip awscli-bundle.zip
58+
sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
59+
aws --version
60+
- name: Setup Go
61+
uses: actions/setup-go@v2
62+
with:
63+
go-version: ${{ steps.dotenv.outputs.GO_VERSION }}
64+
- name: Install Go Lint
65+
run: |
66+
go version
67+
go install golang.org/x/lint/golint
68+
- name: Install Ginkgo
69+
run: |
70+
go get github.com/onsi/ginkgo/ginkgo
71+
go get github.com/onsi/gomega/...
72+
- name: Install EKS CTL
73+
run: |
74+
curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
75+
sudo mv /tmp/eksctl /usr/local/bin
76+
eksctl version
77+
- name: setup-docker
78+
uses: docker-practice/actions-setup-docker@v1
79+
- name: Install Operator SDK
80+
run: |
81+
sudo curl -L -o /usr/local/bin/operator-sdk https://github.com/operator-framework/operator-sdk/releases/download/${{ steps.dotenv.outputs.OPERATOR_SDK_VERSION }}/operator-sdk-${{ steps.dotenv.outputs.OPERATOR_SDK_VERSION }}-x86_64-linux-gnu
82+
sudo chmod +x /usr/local/bin/operator-sdk
83+
- name: Configure Docker Hub credentials
84+
uses: docker/login-action@v1
85+
with:
86+
username: ${{ secrets.DOCKERHUB_USERNAME }}
87+
password: ${{ secrets.DOCKERHUB_TOKEN}}
88+
- name: Pull Splunk Enterprise Edge Image
89+
run: docker pull ${{ env.SPLUNK_ENTERPRISE_IMAGE }}
90+
- name: Configure AWS credentials
91+
uses: aws-actions/configure-aws-credentials@v1
92+
with:
93+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
94+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
95+
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
96+
- name: Login to Amazon ECR
97+
id: login-ecr
98+
uses: aws-actions/amazon-ecr-login@v1
99+
- name: Make Splunk Operator Image
100+
run: |
101+
docker pull registry.access.redhat.com/ubi8/ubi-minimal:latest
102+
make docker-build IMG=${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
103+
- name: Push Splunk Operator Image to ECR
104+
run: |
105+
echo "Uploading Image to ECR:: ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA"
106+
make docker-push IMG=${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
107+
- name: Tag and Push Splunk Enterprise Image to ECR
108+
run: |
109+
docker tag ${{ env.SPLUNK_ENTERPRISE_IMAGE }} ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_ENTERPRISE_IMAGE }}
110+
docker push ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_ENTERPRISE_IMAGE }}
111+
- name: Create EKS cluster
112+
run: |
113+
make cluster-up
114+
- name: install metric server
115+
run: |
116+
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
117+
- name: install k8s dashboard
118+
run: |
119+
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.5/aio/deploy/recommended.yaml
120+
- name: Run Integration test
121+
run: |
122+
export SPLUNK_OPERATOR_IMAGE=${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
123+
make int-test
124+
- name: Collect Test Logs
125+
if: ${{ always() }}
126+
run: |
127+
mkdir -p /tmp/pod_logs
128+
find ./test -name "*.log" -exec cp {} /tmp/pod_logs \;
129+
- name: Archive Pod Logs
130+
if: ${{ always() }}
131+
uses: actions/upload-artifact@v2
132+
with:
133+
name: "splunk-pods-logs--artifacts-${{ matrix.test }}"
134+
path: "/tmp/pod_logs/**"
135+
- name: Cleanup up EKS cluster
136+
if: ${{ always() }}
137+
run: |
138+
make cluster-down
139+

0 commit comments

Comments
 (0)