From a19cd72e1876474d22eeae31cce850aa23d3babb Mon Sep 17 00:00:00 2001 From: pokeeffe-molecula Date: Tue, 15 Feb 2022 11:31:12 -0600 Subject: [PATCH] install k6 instead of docker --- .gitlab/.perf-able-gitlab-ci.yml | 55 +++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 4 deletions(-) diff --git a/.gitlab/.perf-able-gitlab-ci.yml b/.gitlab/.perf-able-gitlab-ci.yml index 25b590f3c..26c3fbd0d 100644 --- a/.gitlab/.perf-able-gitlab-ci.yml +++ b/.gitlab/.perf-able-gitlab-ci.yml @@ -1,11 +1,58 @@ stages: - loadtest -loadtest: - image: - name: loadimpact/k6:latest - entrypoint: [''] +able_loadtest: stage: loadtest + image: registry.gitlab.com/gitlab-org/cloud-deploy/aws-base:latest + variables: + PROFILE: "service-terraform" + AWS_SSH_PRIVATE_KEY: $AWS_FBCI_SSH_KEY + AWS_ACCESS_KEY_ID: $AWS_FBCI_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY: $AWS_FBCI_SECRET_ACCESS_KEY + TF_VAR_cluster_prefix: "" + tags: + - aws + - docker + - fbsmoke + rules: + - if: '$CI_PIPELINE_SOURCE == "push"' + before_script: + - sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69 + - echo "deb https://dl.k6.io/deb stable main" | sudo tee /etc/apt/sources.list.d/k6.list + - sudo apt-get update + - sudo apt-get install k6 + + # - apt-get update && apt-get install -y gnupg software-properties-common curl git + # - curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - + # - apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" + # - apt-get update && apt-get install terraform + # - aws configure set aws_access_key_id $AWS_FBCI_ACCESS_KEY_ID --profile $PROFILE + # - aws configure set aws_secret_access_key $AWS_FBCI_SECRET_ACCESS_KEY --profile $PROFILE + # - aws configure set region "us-east-2" --profile $PROFILE + # - aws configure set aws_profile $PROFILE + # - echo $AWS_FBCI_SSH_KEY > gitlab-featurebase-ci.pem + # - chmod 400 gitlab-featurebase-ci.pem + # - 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )' + # - eval $(ssh-agent -s) + # - mkdir -p ~/.ssh + # - echo $AWS_FBCI_SSH_KEY > /root/.ssh/gitlab-featurebase-ci.pem + # - chmod 400 /root/.ssh/gitlab-featurebase-ci.pem + # - echo "$AWS_FBCI_SSH_KEY" | ssh-add - + # - chmod 700 /root/.ssh + # - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' + # - apt update && apt -y install jq wget + # - wget -q https://go.dev/dl/go1.17.5.linux-amd64.tar.gz + # - tar -C /usr/local -xzf go1.17.5.linux-amd64.tar.gz + # - export PATH=$PATH:/usr/local/go/bin + # - TF_VAR_cluster_prefix="smoke-$(openssl rand -base64 12 | tr -d /=+ | cut -c -16)" + # - echo "Cluster Prefix --> $TF_VAR_cluster_prefix" script: + #- ./qa/scripts/setupSmokeTest.sh + #- ./qa/scripts/testSmokeTest.sh - echo "executing local k6 in k6 container..." - k6 run ./qa/scripts/perf/able/script.js + + #after_script: + # - ./qa/scripts/teardownSmokeTest.sh + #needs: + # - job: build for linux arm64