Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSPL-2581: Splunk-operator Image with Graviton and ubuntu Linux 23.10 #1316

Open
wants to merge 66 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
89b98dd
changed to run nightly build pipeline only on sunday at 6 AM
vivekr-splunk Nov 28, 2023
11d92a4
testing graviton cluster creation and pipeline testing
vivekr-splunk Dec 6, 2023
20812f1
supporting multi stage build for different platform
vivekr-splunk Dec 11, 2023
8fc1550
Merge branch 'develop' into graviton-sok
vivekr-splunk Jan 16, 2024
a7638fa
adding more time for test
vivekr-splunk Jan 16, 2024
a41474e
Merge branch 'develop' into graviton-sok
vivekr-splunk Jan 22, 2024
0e46347
changing cpu type
vivekr-splunk Jan 23, 2024
f1bf0e3
Merge branch 'develop' into graviton-sok
vivekr-splunk Feb 20, 2024
0a9b88f
Merge branch 'develop' into graviton-sok
vivekr-splunk Feb 21, 2024
78fe2ed
graviton build and test
vivekr-splunk Feb 22, 2024
26204c9
graviton build and test
vivekr-splunk Feb 22, 2024
3892c1d
adding one command to build and push docker image
vivekr-splunk Feb 22, 2024
3346fb2
Remove push as docker buildx uses --push option already
akondur Feb 23, 2024
ab6c7b2
changes done to fix eks creation
vivekr-splunk Feb 23, 2024
3ce0350
adding one command to build and push docker image
vivekr-splunk Feb 23, 2024
5dcdbff
removed vulnerability scan
vivekr-splunk Feb 23, 2024
515b2ef
fixed an issue buildx
vivekr-splunk Feb 23, 2024
74b44e7
testing to add buildx for arm64
vivekr-splunk Feb 23, 2024
0821a93
adding macos14 as its arm64
vivekr-splunk Feb 23, 2024
2cef6d4
changing everything to macos-14
vivekr-splunk Feb 23, 2024
a071081
adding mac operator-sdk download
vivekr-splunk Feb 23, 2024
37ca514
changed back eks version 1.27
vivekr-splunk Feb 23, 2024
9ea1e42
splunk arm64 9.2.0 build
vivekr-splunk Feb 23, 2024
a828a25
changing build to be on ubuntu
vivekr-splunk Feb 23, 2024
6f43d94
awscli arm build
vivekr-splunk Feb 23, 2024
2e1d290
eksctl arm build
vivekr-splunk Feb 23, 2024
a0df39f
disable unit test for now
vivekr-splunk Feb 23, 2024
ba3f876
fixed an issue in script
vivekr-splunk Feb 23, 2024
a5d0ee0
fixed an issue in env
vivekr-splunk Feb 23, 2024
a67d4cb
adding int test for graviton
vivekr-splunk Feb 23, 2024
6ab9ac1
adding aws cli action
vivekr-splunk Feb 23, 2024
d78664d
changed workflow name
vivekr-splunk Feb 23, 2024
9f2258e
using awscli mac package
vivekr-splunk Feb 23, 2024
2364dc7
install docker
vivekr-splunk Feb 23, 2024
aadd6d6
install docker
vivekr-splunk Feb 23, 2024
c106afe
install docker using colma
vivekr-splunk Feb 23, 2024
027583e
install colima
vivekr-splunk Feb 23, 2024
2257d88
changes with static variables
vivekr-splunk Feb 23, 2024
2c37cec
few more changes
vivekr-splunk Feb 23, 2024
8b6983e
few more changes
vivekr-splunk Feb 23, 2024
d00a715
Make file formatting change
akondur Feb 23, 2024
6740df5
few more changes
vivekr-splunk Feb 23, 2024
7c94b0f
few more changes
vivekr-splunk Feb 23, 2024
c87831a
fixed an issue in splunk image
vivekr-splunk Feb 26, 2024
83602a4
graviton smoke test fixed
vivekr-splunk Feb 26, 2024
2ad2e22
graviton int test fixed
vivekr-splunk Feb 26, 2024
7be1896
commented kubectl top
vivekr-splunk Feb 27, 2024
71034c1
Change helm documentation
akondur Feb 28, 2024
b1a33d0
Merge branch 'develop' into graviton-sok
akondur Feb 28, 2024
38226cb
Merge branch 'develop' into graviton-sok
akondur Feb 29, 2024
7faec8e
adding debug messages to create cluster and deploy operator
vivekr-splunk Feb 29, 2024
1cca164
debug log for pod describe
vivekr-splunk Feb 29, 2024
af490f4
debug log for pod describe
vivekr-splunk Feb 29, 2024
d6b6331
debug log for pod describe
vivekr-splunk Mar 1, 2024
fa91970
Merge branch 'develop' into graviton-sok
akondur Mar 4, 2024
72ed57e
Merge branch 'develop' into graviton-sok
akondur Mar 7, 2024
d6f221c
changed to amazonlinux 2023
vivekr-splunk Mar 7, 2024
4fc5129
Fix docker buildx command to match smoke tests
akondur Mar 8, 2024
f0e84b5
Image is already pushed, avoid pulling locally
akondur Mar 8, 2024
4ff6249
Log the Splunk Enterprise image
akondur Mar 13, 2024
22f45d5
Modify command
akondur Mar 13, 2024
d20931c
Adding a command to dump a variable
akondur Mar 13, 2024
99affbd
for testing adding kubectl get pods yaml
vivekr-splunk Mar 13, 2024
d508bb4
Add a log to see image name, remove -o yaml from DumpGetPods
akondur Mar 14, 2024
8296a2d
adding target platform as ubuntu 23.10
vivekr-splunk Apr 4, 2024
4212039
Merge branch 'develop' into graviton-ubuntu
vivekr-splunk Apr 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ OPERATOR_SDK_VERSION=v1.31.0
REVIEWERS=vivekr-splunk,akondur
GO_VERSION=1.21.5
AWSCLI_URL=https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.8.6.zip
AWSCLI_ARM_URL=https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip
KUBECTL_VERSION=v1.29.1
AZ_CLI_VERSION=2.30.0
EKSCTL_VERSION=v0.143.0
EKS_CLUSTER_K8_VERSION=1.27
SPLUNK_ENTERPRISE_RELEASE_IMAGE=splunk/splunk:9.1.3
SPLUNK_ENTERPRISE_RELEASE_IMAGE=splunk/splunk:9.2.0
8 changes: 7 additions & 1 deletion .github/workflows/build-test-push-workflow.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Build and Test
on: push
on:
push:
branches:
- develop
- main
- feature**
jobs:
check-formating:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -153,6 +158,7 @@ jobs:
# This regex matches any string not containing smoke keyword
TEST_TO_SKIP: "^(?:[^s]+|s(?:$|[^m]|m(?:$|[^o]|o(?:$|[^k]|k(?:$|[^e])))))*$"
TEST_CLUSTER_PLATFORM: eks
EKS_INSTANCE_TYPE: m5.2xlarge
EKS_VPC_PRIVATE_SUBNET_STRING: ${{ secrets.EKS_VPC_PRIVATE_SUBNET_STRING }}
EKS_VPC_PUBLIC_SUBNET_STRING: ${{ secrets.EKS_VPC_PUBLIC_SUBNET_STRING }}
TEST_BUCKET: ${{ secrets.TEST_BUCKET }}
Expand Down
286 changes: 286 additions & 0 deletions .github/workflows/graviton-build-test-push-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,286 @@
name: Graviton Build and Test
on: push
jobs:
check-formating:
runs-on: macos-14
steps:
- uses: actions/checkout@v2
- name: Dotenv Action
id: dotenv
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ steps.dotenv.outputs.GO_VERSION }}
- name: Check Source formatting
run: make fmt && if [[ $? -ne 0 ]]; then false; fi
- name: Lint source code
run: make vet && if [[ $? -ne 0 ]]; then false; fi
#unit-tests:
# runs-on: macos-14
# needs: check-formating
# steps:
# - uses: actions/checkout@v2
# - name: Dotenv Action
# id: dotenv
# uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359
# - name: Setup Go
# uses: actions/setup-go@v2
# with:
# go-version: ${{ steps.dotenv.outputs.GO_VERSION }}
# - name: Install goveralls
# run: |
# go version
# go install github.com/mattn/goveralls@latest
# - name: Install Ginkgo
# run: |
# make setup/ginkgo
# go mod tidy
# - name: Run Unit Tests
# run: make test
# - name: Run Code Coverage
# run: goveralls -coverprofile=coverage.out -service=circle-ci -repotoken ${{ secrets.COVERALLS_TOKEN }}
# - name: Upload Coverage artifacts
# uses: actions/upload-artifact@82c141cc518b40d92cc801eee768e7aafc9c2fa2
# with:
# name: coverage.out
# path: coverage.out
build-graviton-operator-image:
runs-on: ubuntu-latest
needs: check-formating
env:
SPLUNK_ENTERPRISE_IMAGE: ${{ secrets.SPLUNK_ENTERPRISE_IMAGE }}
SPLUNK_OPERATOR_IMAGE_NAME: splunk/splunk-operator
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }}
S3_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
steps:
- uses: actions/checkout@v2
- name: Dotenv Action
id: dotenv
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ steps.dotenv.outputs.GO_VERSION }}
- name: Install Ginkgo
run: |
make setup/ginkgo
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.5.0
- name: Install Operator SDK
run: |
export ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac)
export OS=$(uname | awk '{print tolower($0)}')
export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/${{ steps.dotenv.outputs.OPERATOR_SDK_VERSION }}
sudo curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH}
sudo chmod +x operator-sdk_${OS}_${ARCH}
sudo mv operator-sdk_${OS}_${ARCH} /usr/local/bin/operator-sdk
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Make Splunk Operator Image and Push to ECR
run: |
export EKS_CLUSTER_K8_VERSION=${{ steps.dotenv.outputs.EKS_CLUSTER_K8_VERSION }}
export PLATFORMS=linux/arm64
export BUILDPLATFORM=linux/arm64
export TARGETOS=linux
export TARGETARCH=arm64
export EKS_INSTANCE_TYPE=c6g.4xlarge
export TARGETPLATFORM=ubuntu:23.10
make docker-buildx IMAGE_TAG_BASE=${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }} VERSION=$GITHUB_SHA IMG=${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA PLATFORMS=linux/arm64 BUILDPLATFORM=linux/arm64 TARGETOS=linux TARGETARCH=arm64 TARGETPLATFORM=ubuntu:23.10
smoke-tests:
needs: build-graviton-operator-image
strategy:
fail-fast: false
matrix:
test: [
basic,
appframeworks1,
managerappframeworkc3,
managerappframeworkm4,
managersecret,
managermc,
]
runs-on: ubuntu-latest
env:
CLUSTER_NODES: 1
CLUSTER_WORKERS: 3
SPLUNK_ENTERPRISE_IMAGE: ${{ secrets.SPLUNK_ENTERPRISE_IMAGE }}
SPLUNK_ENTERPRISE_RELEASE_IMAGE: ${{ secrets.SPLUNK_ENTERPRISE_RELEASE_IMAGE }}
SPLUNK_OPERATOR_IMAGE_NAME: splunk/splunk-operator
SPLUNK_OPERATOR_IMAGE_FILENAME: splunk-operator
TEST_FOCUS: "${{ matrix.test }}"
# This regex matches any string not containing smoke keyword
TEST_TO_SKIP: "^(?:[^s]+|s(?:$|[^m]|m(?:$|[^o]|o(?:$|[^k]|k(?:$|[^e])))))*$"
TEST_CLUSTER_PLATFORM: eks
EKS_INSTANCE_TYPE: m5.2xlarge
EKS_VPC_PRIVATE_SUBNET_STRING: ${{ secrets.EKS_VPC_PRIVATE_SUBNET_STRING }}
EKS_VPC_PUBLIC_SUBNET_STRING: ${{ secrets.EKS_VPC_PUBLIC_SUBNET_STRING }}
TEST_BUCKET: ${{ secrets.TEST_BUCKET }}
TEST_INDEXES_S3_BUCKET: ${{ secrets.TEST_INDEXES_S3_BUCKET }}
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }}
PRIVATE_REGISTRY: ${{ secrets.ECR_REPOSITORY }}
S3_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
ENTERPRISE_LICENSE_LOCATION: ${{ secrets.ENTERPRISE_LICENSE_LOCATION }}
EKS_SSH_PUBLIC_KEY: ${{ secrets.EKS_SSH_PUBLIC_KEY }}
CLUSTER_WIDE: "true"
DEPLOYMENT_TYPE: ""
steps:
- name: Set Test Cluster Name
run: |
echo "TEST_CLUSTER_NAME=eks-integration-test-cluster-${{ matrix.test }}-$GITHUB_RUN_ID" >> $GITHUB_ENV
- name: Chekcout code
uses: actions/checkout@v2
- name: Dotenv Action
id: dotenv
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359
- name: Change splunk enterprise to release image on main branches
if: github.ref == 'refs/heads/main'
run: |
echo "SPLUNK_ENTERPRISE_IMAGE=${{ steps.dotenv.outputs.SPLUNK_ENTERPRISE_RELEASE_IMAGE }}" >> $GITHUB_ENV
- name: Install Kubectl
uses: Azure/setup-kubectl@v3
with:
version: ${{ steps.dotenv.outputs.KUBECTL_VERSION }}
- name: Install Python
uses: actions/setup-python@v2
- name: Install AWS CLI
run: |
curl "${{ steps.dotenv.outputs.AWSCLI_URL}}" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install --update
aws --version
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ steps.dotenv.outputs.GO_VERSION }}
- name: Install Ginkgo
run: |
make setup/ginkgo
- name: Install Helm
run: |
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
chmod 700 get_helm.sh
./get_helm.sh
DESIRED_VERSION=v3.8.2 bash get_helm.sh
- name: Install EKS CTL
run: |
curl --silent --insecure --location "https://github.com/weaveworks/eksctl/releases/download/${{ steps.dotenv.outputs.EKSCTL_VERSION }}/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp
sudo mv /tmp/eksctl /usr/local/bin
eksctl version
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.5.0
- name: Install Operator SDK
run: |
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
sudo chmod +x /usr/local/bin/operator-sdk
- name: Configure Docker Hub credentials
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN}}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: Create EKS cluster
run: |
export EKS_CLUSTER_K8_VERSION=${{ steps.dotenv.outputs.EKS_CLUSTER_K8_VERSION }}
export PLATFORMS=linux/arm64
export BUILDPLATFORM=linux/arm64
export TARGETOS=linux
export TARGETARCH=arm64
export TARGETPLATFORM=ubuntu:23.10
export EKS_INSTANCE_TYPE=c6g.4xlarge
make cluster-up
- name: install metric server
run: |
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
- name: install k8s dashboard
run: |
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.5/aio/deploy/recommended.yaml
- name: Setup Kustomize
run: |
sudo snap install kustomize
mkdir -p ./bin
cp /snap/bin/kustomize ./bin/kustomize
- name: Run smoke test
id: smoketest
run: |
export SPLUNK_OPERATOR_IMAGE_GRAVITON=${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
export SPLUNK_ENTERPRISE_IMAGE_GRAVITON=${{ secrets.ECR_REPOSITORY }}/${{ steps.dotenv.outputs.SPLUNK_ENTERPRISE_RELEASE_IMAGE }}
make int-test
- name: Collect Test Logs
if: ${{ always() }}
run: |
mkdir -p /tmp/pod_logs
find ./test -name "*.log" -exec cp {} /tmp/pod_logs \;
- name: Archive Pod Logs
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: "splunk-pods-logs--artifacts-${{ matrix.test }}"
path: "/tmp/pod_logs/**"
- name: Cleanup Test Case artifacts
if: ${{ always() }}
run: |
make cleanup
make clean
- name: Cleanup up EKS cluster
if: ${{ always() }}
run: |
make cluster-down
#- name: Test Report
# uses: dorny/test-reporter@v1
# if: success() || failure() # run this step even if previous step failed
# with:
# name: Integration Tests # Name of the check run which will be created
# path: inttest-*.xml # Path to test results
# reporter: jest-junit # Format of test results
push-latest:
needs: smoke-tests
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
env:
SPLUNK_OPERATOR_IMAGE_NAME: splunk/splunk-operator
TAG: latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Dotenv Action
id: dotenv
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2.5.0
- name: Configure Docker Hub credentials
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PUSH_TOKEN}}
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v1
- name: Pull Splunk Operator Image Locally
run: |
docker pull ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA
- name: Change Operator Image Tag to latest
run: |
docker tag ${{ secrets.ECR_REPOSITORY }}/${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:$GITHUB_SHA ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:${{ env.TAG }}
- name: Push Splunk Operator Image to Docker Hub
run: docker push ${{ env.SPLUNK_OPERATOR_IMAGE_NAME }}:${{ env.TAG }}
Loading
Loading