ci: making some improvements to e2e-k3s workflow (#615)

Signed-off-by: Yoni Bettan <ybettan@redhat.com>
This commit is contained in:
Yoni Bettan 2022-01-17 12:29:27 +02:00 committed by GitHub
parent e0e4c7afe6
commit b0b235cbc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,28 +9,22 @@ jobs:
e2e-k3s: e2e-k3s:
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: ${{ github.event.label.name == 'ok-to-test' }} if: ${{ github.event.label.name == 'ok-to-test' }}
env:
DOCKER_TAG: pull-${{ github.event.number }}
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Build query-service image - name: Build query-service image
env:
DOCKER_TAG: pull-${{ github.event.number }}
run: make build-query-service-amd64 run: make build-query-service-amd64
- name: Build frontend image - name: Build frontend image
env:
DOCKER_TAG: pull-${{ github.event.number }}
run: make build-frontend-amd64 run: make build-frontend-amd64
- name: Create a k3s cluster - name: Create a k3s cluster
uses: AbsaOSS/k3d-action@v2 uses: AbsaOSS/k3d-action@v2
with: with:
cluster-name: "signoz-cluster" cluster-name: "signoz"
- name: Inject the images to the cluster - name: Inject the images to the cluster
env: run: k3d image import signoz/query-service:$DOCKER_TAG signoz/frontend:$DOCKER_TAG -c signoz
DOCKER_TAG: pull-${{ github.event.number }}
run: k3d image import signoz/query-service:$DOCKER_TAG signoz/frontend:$DOCKER_TAG -c signoz-cluster
- name: Deploy the app - name: Deploy the app
env:
DOCKER_TAG: pull-${{ github.event.number }}
run: | run: |
helm dependency update deploy/kubernetes/platform helm dependency update deploy/kubernetes/platform
helm install signoz deploy/kubernetes/platform/ -n platform --create-namespace \ helm install signoz deploy/kubernetes/platform/ -n platform --create-namespace \
@ -47,15 +41,21 @@ jobs:
run: | run: |
kubectl create ns sample-application kubectl create ns sample-application
kubectl -n sample-application apply -Rf sample-apps/hotrod/ kubectl -n sample-application apply -Rf sample-apps/hotrod/
kubectl -n sample-application get deploy --output name | xargs -r -n1 -t kubectl -n sample-application rollout status kubectl -n sample-application get deploy --output name | xargs -r -n1 -t kubectl -n sample-application rollout status --timeout=300s
#TODO: we can remove that sleep once the sample app readiness prob is fixed.
sleep 300 # if we don't wait the curl command return success but doesn't kick-of the requests
kubectl -n sample-application run strzal --image=djbingham/curl \ kubectl -n sample-application run strzal --image=djbingham/curl \
--restart='OnFailure' -i --rm --command -- curl -X POST -F \ --restart='OnFailure' -i --rm --command -- curl -X POST -F \
'locust_count=6' -F 'hatch_rate=2' http://locust-master:8089/swarm 'locust_count=6' -F 'hatch_rate=2' http://locust-master:8089/swarm
sleep 600 # give some time for the data to reach signoz
- name: Get commit short sha
uses: benjlevesque/short-sha@v1.2
id: short-sha
- name: Start tunnel - name: Start tunnel
env: env:
DOCKER_TAG: pull-${{ github.event.number }} COMMIT_SHA: pr-${{ steps.short-sha.outputs.sha }}
run: | run: |
npm install -g localtunnel npm install -g localtunnel
host=$(kubectl get svc -n platform | grep signoz-frontend | tr -s ' ' | cut -d" " -f4) host=$(kubectl get svc -n platform | grep signoz-frontend | tr -s ' ' | cut -d" " -f4)
port=$(kubectl get svc -n platform | grep signoz-frontend | tr -s ' ' | cut -d" " -f5 | cut -d":" -f1) port=$(kubectl get svc -n platform | grep signoz-frontend | tr -s ' ' | cut -d" " -f5 | cut -d":" -f1)
lt -p $port -l $host -s "$DOCKER_TAG" lt -p $port -l $host -s $COMMIT_SHA