Skip to content

Commit

Permalink
Fix rabbitmq connector ci
Browse files Browse the repository at this point in the history
Signed-off-by: Sanket Sudake <[email protected]>
  • Loading branch information
sanketsudake committed Nov 22, 2023
1 parent c54d644 commit ed016b4
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 51 deletions.
69 changes: 37 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ on:
pull_request:
branches:
- main
env:
KIND_URL: https://kind.sigs.k8s.io/dl
KIND_VER: v0.8.1
KIND_ENV: kind-linux-amd64

jobs:
check:
Expand All @@ -26,16 +22,16 @@ jobs:
filters: |
kafkachanges:
- 'kafka-http-connector/**'
# rabbitmqchanges:
# - 'rabbitmq-http-connector/**'
# sqschanges:
# - 'aws-sqs-http-connector/**'
# redischanges:
# - 'redis-http-connector/**'
# natschanges:
# - 'nats-streaming-http-connector/**'
# natsjetstreamchanges:
# - 'nats-jetstream-http-connector/**'
rabbitmqchanges:
- 'rabbitmq-http-connector/**'
sqschanges:
- 'aws-sqs-http-connector/**'
redischanges:
- 'redis-http-connector/**'
natschanges:
- 'nats-streaming-http-connector/**'
natsjetstreamchanges:
- 'nats-jetstream-http-connector/**'
kafka:
needs: check
Expand Down Expand Up @@ -99,21 +95,6 @@ jobs:
- name: Setup Keda
uses: ./.github/actions/setup-keda

- name: Create Docker Image for Rabbitmq KEDA Connector
run: |
cd rabbitmq-http-connector/
docker build -t localhost:5000/rabbit-keda:latest .
docker push localhost:5000/rabbit-keda:latest
- name: Create Rabbitmq Docker Image for Publisher
run: |
cd rabbitmq-http-connector/test/publisher/
docker build -t localhost:5000/rabbit-publisher:latest .
docker push localhost:5000/rabbit-publisher:latest
- name: Create Rabbitmq Docker Image for Consumer
run: |
cd rabbitmq-http-connector/test/consumer/
docker build -t localhost:5000/rabbit-consumer:latest .
docker push localhost:5000/rabbit-consumer:latest
- name: Deploy Rabbitmq Deployment files
run: |
cd rabbitmq-http-connector/test/kubernetes/
Expand All @@ -123,25 +104,47 @@ jobs:
kubectl apply -n rabbits -f rabbit-secret.yaml
kubectl apply -n rabbits -f rabbit-statefulset.yaml
bash rabbitmq-cluster-instances.sh
# - name: Create Docker Image for Rabbitmq KEDA Connector
# run: |
# cd rabbitmq-http-connector/
# docker build -t localhost:5000/rabbit-keda:latest .
# docker push localhost:5000/rabbit-keda:latest
# - name: Create Rabbitmq Docker Image for Publisher
# run: |
# cd rabbitmq-http-connector/test/publisher/
# docker build -t localhost:5000/rabbit-publisher:latest .
# docker push localhost:5000/rabbit-publisher:latest

# - name: Create Rabbitmq Docker Image for Consumer
# run: |
# cd rabbitmq-http-connector/test/consumer/
# docker build -t localhost:5000/rabbit-consumer:latest .
# docker push localhost:5000/rabbit-consumer:latest

- name: Publish Rabbitmq messages in a queue
run: |
cd rabbitmq-http-connector/test/publisher/
kubectl apply -f deployment.yaml
kubectl apply -f publisher-job.yaml
ko resolve -f publisher-job.yaml | kubectl apply -f - -n rabbits
- name: Bring up the Rabbitmq consumer queue and Listen for incoming messages
run: |
cd rabbitmq-http-connector/test/consumer/
kubectl apply -f consumer-deployment.yaml
ko resolve -f consumer-deployment.yaml | kubectl apply -f -
- name: Deploy Rabbitmq Keda Connector and Keda ScaledObject
run: |
cd rabbitmq-http-connector/test/kubernetes/
kubectl apply -f keda-deployment.yml
ko resolve -f keda-deployment.yml | kubectl apply -f - -n rabbits
kubectl wait pod -l keda=rabbitmq --for=condition=ready --timeout=-1s -n rabbits
kubectl apply -f Keda-ScaledObj.yml
- name: Get Rabbitmq consumed messages from queue
run: |
sleep 10s
kubectl logs -n rabbits deployment.apps/rabbitmq-consumer
sqs:
needs: check
if: contains(needs.check.outputs.packages, 'sqschanges')
Expand Down Expand Up @@ -182,6 +185,7 @@ jobs:
run: |
sleep 30s
kubectl logs -l app=queue
redis:
needs: check
if: contains(needs.check.outputs.packages, 'redischanges')
Expand Down Expand Up @@ -241,6 +245,7 @@ jobs:
kubectl logs deployment.apps/consumer-deployment
kubectl logs deployment.apps/consumer-deployment | grep -q "consumed"
echo $?
nats:
needs: check
if: contains(needs.check.outputs.packages, 'natschanges')
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ jobs:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check out code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@66b90a5db151a8042fa97405c6cf843bbe433f7b # v2.22.7
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -54,7 +54,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@66b90a5db151a8042fa97405c6cf843bbe433f7b # v2.22.7

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -68,4 +68,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@66b90a5db151a8042fa97405c6cf843bbe433f7b # v2.22.7
5 changes: 0 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ on:
- main
paths:
- "**/version"
pull_request:
branches:
- main
paths:
- "**/version"

jobs:
check:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ spec:
spec:
containers:
- name: rabbitmq-consumer
image: localhost:5000/rabbit-consumer:latest
image: ko://github.com/fission/keda-connectors/rabbitmq-http-connector/test/consumer
imagePullPolicy: Always
ports:
- containerPort: 80
Expand Down
9 changes: 4 additions & 5 deletions rabbitmq-http-connector/test/kubernetes/Keda-ScaledObj.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ spec:
name: keda-deployment
pollingInterval: 30
triggers:
- type: rabbitmq
metadata:
host: amqp://guest:[email protected]:5672/vhost
queueName: publisher

- type: rabbitmq
metadata:
host: amqp://guest:[email protected]:5672/vhost
queueName: publisher
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
spec:
containers:
- name: keda-rabbit-connector
image: localhost:5000/rabbit-keda:latest
image: ko://github.com/fission/keda-connectors/rabbitmq-http-connector
env:
- name: TOPIC
value: publisher
Expand Down
3 changes: 1 addition & 2 deletions rabbitmq-http-connector/test/publisher/publisher-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
spec:
containers:
- name: rabbit-publish
image: localhost:5000/rabbit-publisher:latest
image: ko://github.com/fission/keda-connectors/rabbitmq-http-connector/test/publisher/
ports:
- containerPort: 8000
env:
Expand All @@ -29,4 +29,3 @@ spec:
name: rabbitmq-publisher
key: RABBIT_PASSWORD
restartPolicy: Never

0 comments on commit ed016b4

Please sign in to comment.