diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..6f5761d --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,35 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the +// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile +{ + "name": "Gatling Operator Dev Container", + "build": { + // Sets the run context to one level up instead of the .devcontainer folder. + "context": "..", + // Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename. + "dockerfile": "../Dockerfile.dev" + }, + "mounts": [ + // Mount the host's Docker socket. + // Official document: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/docker.md + "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" + ], + "runArgs": [ + "--name=gatling-operator-dev-container", + "--hostname=gatling-operator-dev-container", + // Set network mode to host to communicate with other containers. + "--network=host" + ], + "containerEnv": { + "IN_DEV_CONTAINER": "true" + }, + // Restore the local kubectl config to a dev container. + "postStartCommand": "if [ -d ${containerWorkspaceFolder}/.kube ]; then cp -r ${containerWorkspaceFolder}/.kube $HOME/.kube; fi", + "customizations": { + "vscode": { + "extensions": [ + "streetsidesoftware.code-spell-checker", + "mhutchie.git-graph" + ] + } + } +} diff --git a/.github/ISSUE_TEMPLATE/trivy-results.tpl b/.github/ISSUE_TEMPLATE/trivy-results.tpl new file mode 100644 index 0000000..f68e2ec --- /dev/null +++ b/.github/ISSUE_TEMPLATE/trivy-results.tpl @@ -0,0 +1,27 @@ +{{ $d := dict "CRITICAL" "🔴" "HIGH" "🟠" "MEDIUM" "🟡" "UNKNOWN" "🟤" }} + +{{- range . -}} +## {{ .Target }} + +### {{ .Type }} [{{ .Class }}] + +{{ if .Vulnerabilities -}} +| Title | Severity | CVE | Package Name | Installed Version | Fixed Version | PrimaryURL | +| :--: | :--: | :--: | :--: | :--: | :--: | :-- | +{{- range .Vulnerabilities }} +| {{ .Title -}} +| {{ get $d .Severity }}{{ .Severity -}} +| {{ .VulnerabilityID -}} +| {{ .PkgName -}} +| {{ .InstalledVersion -}} +| {{ .FixedVersion -}} +| {{ .PrimaryURL -}} +| +{{- end }} + +{{ else -}} +_No vulnerabilities found_ + +{{ end }} + +{{- end }} diff --git a/.github/workflows/daily-vul-scan.yml b/.github/workflows/daily-vul-scan.yml new file mode 100644 index 0000000..c6b0dec --- /dev/null +++ b/.github/workflows/daily-vul-scan.yml @@ -0,0 +1,72 @@ +name: daily vulnerability scan + +on: + schedule: + - cron: '0 0 * * *' + +env: + IMAGE_NAME: zozo-gatling-operator + TRIVY_RESULTS_MARKDOWN: trivy-results.md + +permissions: + contents: read + issues: write + +jobs: + build-scan-and-save-results: + name: Build, scan, and save results + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v4 + with: + go-version-file: ./go.mod + cache: true + + - name: Go modules sync + run: go mod tidy + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build an image from Dockerfile + run: | + make docker-build IMG="${{ env.IMAGE_NAME }}:${{ github.sha }}" + + - name: Run Trivy vulnerability scanner + uses: aquasecurity/trivy-action@master + with: + scan-type: image + image-ref: "${{ env.IMAGE_NAME }}:${{ github.sha }}" + exit-code: 1 + ignore-unfixed: true + vuln-type: os,library + severity: HIGH,CRITICAL + timeout: 10m0s + scanners: vuln,secret,config + format: template + template: "@.github/ISSUE_TEMPLATE/trivy-results.tpl" + output: ${{ env.TRIVY_RESULTS_MARKDOWN }} + + - name: Insert YAML front matter into the results markdown + if: always() + run: | + sed -i '1i\ + ---\ + title: "[DO NOT CHANGE] Security Alert"\ + labels: "trivy, vulnerability"\ + ---\ + ' "${{ env.TRIVY_RESULTS_MARKDOWN }}" + + - name: Create or update the trivy results issue + uses: JasonEtco/create-an-issue@v2 + if: always() + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + filename: ${{ env.TRIVY_RESULTS_MARKDOWN }} + update_existing: true + search_existing: open diff --git a/.gitignore b/.gitignore index c0a7a54..69cec61 100644 --- a/.gitignore +++ b/.gitignore @@ -17,6 +17,7 @@ testbin/* # Kubernetes Generated files - skip generated files, except for vendored files !vendor/**/zz_generated.* +.kube # editor and IDE paraphernalia .idea diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..62bfdd1 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "cSpell.words": [ + "devcontainer" + ] +} diff --git a/Dockerfile b/Dockerfile index b388374..e79cac9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ COPY controllers/ controllers/ COPY pkg/ pkg/ # Build -RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o manager main.go +RUN CGO_ENABLED=0 GOOS=linux GOARCH=$(dpkg --print-architecture) go build -a -o manager main.go # Use distroless as minimal base image to package the manager binary # Refer to https://github.com/GoogleContainerTools/distroless for more details diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 0000000..ab39f0f --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,53 @@ +FROM ubuntu:22.04 + +ENV GO_VERSION 1.17.13 +ENV KUBECTL_VERSION v1.21.10 + +# KEEP the value as arm64. +# This environment variable is for arm64, but should be left as is for any architecture +# References: +# https://github.com/etcd-io/etcd/issues/10677 +# https://github.com/k0sproject/k0s/issues/424 +ENV ETCD_UNSUPPORTED_ARCH arm64 + +# Development tools +RUN apt-get update && apt-get upgrade -y && apt-get install -y \ + wget \ + git \ + make \ + gcc + +# Docker CLI +# Referring to https://docs.docker.com/engine/install/ubuntu/#installation-methods +RUN apt-get install -y \ + ca-certificates \ + curl \ + gnupg \ + && install -m 0755 -d /etc/apt/keyrings \ + && curl -fsSL https://download.docker.com/linux/ubuntu/gpg \ + | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \ + && chmod a+r /etc/apt/keyrings/docker.gpg \ + && echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ + "$(. /etc/os-release && echo "${VERSION_CODENAME}")" stable" \ + | tee /etc/apt/sources.list.d/docker.list > /dev/null \ + && apt-get update && apt-get install -y \ + docker-ce-cli + +# kubectl +# Referring to https://kubernetes.io/ja/docs/tasks/tools/install-kubectl/ +RUN curl -LO "https://dl.k8s.io/release/${KUBECTL_VERSION}/bin/linux/"$(dpkg --print-architecture)"/kubectl" \ + && chmod +x ./kubectl \ + && mv ./kubectl /usr/local/bin/kubectl + +# golang +# Referring to https://go.dev/doc/install +RUN wget "https://go.dev/dl/go${GO_VERSION}.linux-"$(dpkg --print-architecture)".tar.gz" \ + && tar -C /usr/local -xzf "go${GO_VERSION}.linux-"$(dpkg --print-architecture)".tar.gz" +ENV PATH "${PATH}:/usr/local/go/bin" +ENV PATH "${PATH}:/root/go/bin" + +# kind +# References: +# https://github.com/kind-ci/examples/blob/master/.github/workflows/kind.yml +# https://kind.sigs.k8s.io/docs/user/resources/ +RUN GO111MODULE=on go install sigs.k8s.io/kind@latest diff --git a/Makefile b/Makefile index 7b43661..b24e571 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,8 @@ SHELL = /usr/bin/env bash -o pipefail .SHELLFLAGS = -ec ENVTEST_ASSETS_DIR=$(shell pwd)/testbin -KIND_CONFIG_DIR=$(shell pwd)/config/kind +KIND_CLUSTER_CONFIG_DIR=$(shell pwd)/config/kind +KUBECONFIG_BACKUP_DIR=$(shell pwd)/.kube all: build @@ -46,12 +47,16 @@ all: build help: ## Display this help. @awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST) -kind-create: ## Create a kind cluster named ${KIND_CLUSTER_NAME} locally if necessary +kind-create: ## Create a kind cluster named ${KIND_CLUSTER_NAME} locally if necessary and save the kubectl config. ifeq (1, $(shell kind get clusters | grep ${KIND_CLUSTER_NAME} | wc -l | tr -d ' ')) @echo "Cluster already exists" else @echo "Creating Cluster" - kind create cluster --name ${KIND_CLUSTER_NAME} --image=kindest/node:${K8S_NODE_IMAGE} --config ${KIND_CONFIG_DIR}/cluster.yaml + kind create cluster --name ${KIND_CLUSTER_NAME} --image=kindest/node:${K8S_NODE_IMAGE} --config ${KIND_CLUSTER_CONFIG_DIR}/cluster.yaml +ifeq ($(IN_DEV_CONTAINER), true) + @echo "kubeconfig backup =>" + mkdir -p ${KUBECONFIG_BACKUP_DIR} && kind get kubeconfig --name ${KIND_CLUSTER_NAME} > ${KUBECONFIG_BACKUP_DIR}/kind-conifg.yaml +endif endif ##@ Development diff --git a/README.md b/README.md index 70a8e34..2bbd6a1 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Gatling Operator -[![Go Report Card](https://goreportcard.com/badge/github.com/st-tech/gatling-operator)](https://goreportcard.com/report/github.com/st-tech/gatling-operator) [![CI](https://github.com/st-tech/gatling-operator/actions/workflows/ci.yml/badge.svg?branch=main&event=push)](https://github.com/st-tech/gatling-operator/actions/workflows/ci.yml) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/st-tech/gatling-operator) +[![Go Report Card](https://goreportcard.com/badge/github.com/st-tech/gatling-operator)](https://goreportcard.com/report/github.com/st-tech/gatling-operator) [![CI](https://github.com/st-tech/gatling-operator/actions/workflows/ci.yml/badge.svg?branch=main&event=push)](https://github.com/st-tech/gatling-operator/actions/workflows/ci.yml) [![daily vulnerability scan](https://github.com/st-tech/gatling-operator/actions/workflows/daily-vul-scan.yml/badge.svg?branch=main)](https://github.com/st-tech/gatling-operator/actions/workflows/daily-vul-scan.yml) ![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/st-tech/gatling-operator) [Gatling](https://gatling.io/) is an open source load testing tool that allows to analyze and measure the performance of a variety of services. [Gatling Operator](https://github.com/st-tech/gatling-operator) is a Kubernetes Operator for running automated distributed Gatling load testing. @@ -19,7 +19,7 @@ The desired state of a distributed Gatling load testing is described through a K - Horizontal scaling: number of pods running in parallel during a load testing can be configured - Vertical scaling: CPU and RAM resource allocation for Gatling runner Pod can be configured - Allows Gatling load testing to start running at a specific time - - By default, the Gatling load testing starts running as soon as the runner Pod's init container gets ready. By specifing the start time, the Gatling load testing waits to start running until the specified time + - By default, the Gatling load testing starts running as soon as the runner Pod's init container gets ready. By specifying the start time, the Gatling load testing waits to start running until the specified time - Gatling Pod attributions - Gatling runtime container image - [rclone](https://rclone.org/) container image @@ -43,11 +43,13 @@ The desired state of a distributed Gatling load testing is described through a K ## Quick Start - [Quick Start Guide](docs/quickstart-guide.md) + ## Documentations - [Architecture](docs/architecture.md) - [Gatling CRD Reference](docs/api.md) - [User Guide](docs/user-guide.md) +- [How to build Gatling Operator](docs/build-guide.md) ## Contributing diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index fd84f47..d80112b 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated /* diff --git a/docs/build-guide.md b/docs/build-guide.md new file mode 100644 index 0000000..2185df4 --- /dev/null +++ b/docs/build-guide.md @@ -0,0 +1,196 @@ +# How to build and run Gatling Operator + +This guide explains how to build Gatling Operator from its source code and run a sample in your local environment. +In this guide, we use makefile to build and run Gatling Operator. + +- [How to build and run Gatling Operator](#how-to-build-and-run-gatling-operator) + - [Pre-requisites](#pre-requisites) + - [Get the Source code](#get-the-source-code) + - [Install the tools](#install-the-tools) + - [Create a Kubernetes cluster](#create-a-kubernetes-cluster) + - [Build \& Deploy Gatling Operator](#build--deploy-gatling-operator) + - [Create All in One manifest](#create-all-in-one-manifest) + +## Pre-requisites + +### Get the Source code + +The main repository is `st-tech/gatling-operator`. +This contains the Gatling Operator source code and the build scripts. + +``` +git clone https://github.com/st-tech/gatling-operator +``` + +### Install the tools + +- [kubectl](https://kubernetes.io/docs/tasks/tools/) +- [kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation) +- [go](https://go.dev/doc/install) + - go version must be 1.17 + +## Create a Kubernetes cluster + +Create a Kubernetes cluster for test Gatling Operator sample using kind. + +```bash +make kind-create +``` + +
+sample output + +```bash +❯ make kind-install + +No kind clusters found. +Creating Cluster +kind create cluster --name "gatling-cluster" --image=kindest/node:v1.19.11 --config ~/github/gatling-operator/config/kind/cluster.yaml +Creating cluster "gatling-cluster" ... + ✓ Ensuring node image (kindest/node:v1.19.11) đŸ–ŧ + ✓ Preparing nodes đŸ“Ļ đŸ“Ļ đŸ“Ļ + ✓ Writing configuration 📜 + ✓ Starting control-plane 🕹ī¸ + ✓ Installing CNI 🔌 + ✓ Installing StorageClass 💾 + ✓ Joining worker nodes 🚜 +Set kubectl context to "kind-gatling-cluster" +You can now use your cluster with: + +kubectl cluster-info --context kind-gatling-cluster +``` + +
+ +`make kind-create` command creates a Kubernetes cluster named `gatling-cluster` using kind. +You can check the cluster details with the following commands. +Get node information with kubectl and check that one control plane and one worker are ready. + +```bash +❯ kind get clusters +gatling-cluster +❯ kubectl get node +NAME STATUS ROLES AGE VERSION +gatling-cluster-control-plane Ready master 150m v1.19.11 +gatling-cluster-worker Ready 150m v1.19.11 +``` + +If your cluster contexts are not set, you can set the contexts with the following command. + +```bash +kubectl config get-contexts +kubectl config use-context kind-gatling-cluster +``` + +## Build & Deploy Gatling Operator + +1. Build Gatling Operator with makefile. + + ```bash + make build + ``` + +2. Install CRD to your Kubernetes cluster. + + ```bash + make install-crd + ``` + + You can check the Gatling Operator CRD with the following command. + + ```bash + ❯ kubectl get crd + NAME CREATED AT + gatlings.gatling-operator.tech.zozo.com 2023-08-01T04:43:54Z + ``` + +3. Try to run Controller Manager in local + + ```bash + make run + ``` + + The commands runs Gatling Operator Controller Manager in your local environment. You can stop in ctrl+c. + + ``` + ~/github/gatling-operator/bin/controller-gen "crd:trivialVersions=true,preserveUnknownFields=false" rbac:roleName=manager-role webhook paths="./..." output:crd:artifacts:config=config/crd/bases + ~/github/gatling-operator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..." + go fmt ./... + api/v1alpha1/zz_generated.deepcopy.go + go vet ./... + go run ./main.go + 2021-10-05T11:26:35.704+0900 INFO controller-runtime.metrics metrics server is starting to listen {"addr": ":8080"} + 2021-10-05T11:26:35.705+0900 INFO setup starting manager + 2021-10-05T11:26:35.705+0900 INFO controller-runtime.manager starting metrics server {"path": "/metrics"} + 2021-10-05T11:26:35.705+0900 INFO controller-runtime.manager.controller.gatling Starting EventSource {"reconciler group": "gatling-operator.tech.zozo.com", "reconciler kind": "Gatling", "source": "kind source: /, Kind="} + 2021-10-05T11:26:35.810+0900 INFO controller-runtime.manager.controller.gatling Starting Controller {"reconciler group": "gatling-operator.tech.zozo.com", "reconciler kind": "Gatling"} + 2021-10-05T11:26:35.810+0900 INFO controller-runtime.manager.controller.gatling Starting workers {"reconciler group": "gatling-operator.tech.zozo.com", "reconciler kind": "Gatling", "worker count": 1} + ... snip... + ``` + +4. Build Docker image + + ``` + : This build command image tag is %Y%m%d-%H%M%S format Timestamp + make docker-build + : You can define Image name and tag in this command + make docker-build IMG=/zozo-gatling-operator: + ``` + +
+ Sample + + ```bash + ❯ DOCKER_REGISTRY=1234567890.dkr.ecr.ap-northeast-1.amazonaws.com + ❯ DOCKER_IMAGE_REPO=zozo-gatling-operator + ❯ DOCKER_IMAGE_TAG=v0.0.1 + ❯ make docker-build IMG=${DOCKER_REGISTRY}/${DOCKER_IMAGE_REPO}:${DOCKER_IMAGE_TAG} + ❯ docker images + REPOSITORY TAG IMAGE ID CREATED SIZE + 1234567890.dkr.ecr.ap-northeast-1.amazonaws.com/zozo-gatling-operator v0.0.1 c66287dc8dc4 3 hours ago 46.2MB + ``` + +
+ +5. Deploy Controller to Cluster + + - Deploy to Local Kind Cluster + + ```bash + make kind-deploy + ``` + + - Deploy to Remote k8s Cluster + + ```bash + make deploy IMG=${DOCKER_REGISTRY}/${DOCKER_IMAGE_REPO}:${DOCKER_IMAGE_TAG} + ``` + + - You can check gatling-operator controller forom the following command. + + ```bash + ❯ kubectl get pods -n gatling-system + NAME READY STATUS RESTARTS AGE + gatling-operator-controller-manager-579bd7bc49-h46l2 2/2 Running 0 31m + ``` + +6. Deploy sample scenario and check Gatling Operator works + + ```bash + kustomize build config/samples | kubectl apply -f - + ``` + +## Create All in One manifest + +This command creates an all in one manifest for Gatling Operator. +All in One manifest create CRD and Gatling Operator Controller. + +```bash +make manifests-release IMG=/zozo-gatling-operator: +``` + +You can apply Gatling Operator to your Kubernetes cluster with the following command. + +```bash +kubectl apply -f gatling-operator.yaml +``` diff --git a/gatling/Dockerfile b/gatling/Dockerfile index d6cc9d3..f57fb50 100644 --- a/gatling/Dockerfile +++ b/gatling/Dockerfile @@ -2,23 +2,20 @@ # https://github.com/denvazh/gatling/tree/master/3.2.1 # # Gatling is a highly capable load testing tool. -# -# Documentation: https://gatling.io/docs/3.2/ -# Cheat sheet: https://gatling.io/docs/3.2/cheat-sheet/ -FROM openjdk:8-jdk-alpine +FROM openjdk:17-jdk-slim-bullseye # working directory for gatling WORKDIR /opt # gating version -ENV GATLING_VERSION 3.2.1 +ENV GATLING_VERSION 3.9.5 # create directory for gatling install RUN mkdir -p gatling # install gatling -RUN apk add --update wget bash libc6-compat && \ +RUN apt-get update && apt-get upgrade -y && apt-get install -y wget unzip && \ mkdir -p /tmp/downloads && \ wget -q -O /tmp/downloads/gatling-$GATLING_VERSION.zip \ https://repo1.maven.org/maven2/io/gatling/highcharts/gatling-charts-highcharts-bundle/$GATLING_VERSION/gatling-charts-highcharts-bundle-$GATLING_VERSION-bundle.zip && \ diff --git a/go.mod b/go.mod index 5597a64..575598c 100644 --- a/go.mod +++ b/go.mod @@ -26,7 +26,7 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/cespare/xxhash/v2 v2.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/emicklei/go-restful v2.9.5+incompatible // indirect + github.com/emicklei/go-restful v2.16.0+incompatible // indirect github.com/evanphx/json-patch v4.12.0+incompatible // indirect github.com/form3tech-oss/jwt-go v3.2.3+incompatible // indirect github.com/fsnotify/fsnotify v1.5.1 // indirect diff --git a/go.sum b/go.sum index 5ef550e..d1151f2 100644 --- a/go.sum +++ b/go.sum @@ -123,8 +123,9 @@ github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3 github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= -github.com/emicklei/go-restful v2.9.5+incompatible h1:spTtZBk5DYEvbxMVutUuTyh1Ao2r4iyvLdACqsl/Ljk= github.com/emicklei/go-restful v2.9.5+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= +github.com/emicklei/go-restful v2.16.0+incompatible h1:rgqiKNjTnFQA6kkhFe16D8epTksy9HQ1MyrbDXSdYhM= +github.com/emicklei/go-restful v2.16.0+incompatible/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= diff --git a/pkg/commands/commands.go b/pkg/commands/commands.go index 4913210..89cf49c 100644 --- a/pkg/commands/commands.go +++ b/pkg/commands/commands.go @@ -66,7 +66,7 @@ fi if [ ! -d ${RESULTS_DIR_PATH} ]; then mkdir -p ${RESULTS_DIR_PATH} fi -gatling.sh -sf ${SIMULATIONS_DIR_PATH} -s %s -rsf ${RESOURCES_DIR_PATH} -rf ${RESULTS_DIR_PATH} %s +gatling.sh -sf ${SIMULATIONS_DIR_PATH} -s %s -rsf ${RESOURCES_DIR_PATH} -rf ${RESULTS_DIR_PATH} %s %s GATLING_EXIT_STATUS=$? if [ $GATLING_EXIT_STATUS -ne 0 ]; then @@ -81,6 +81,8 @@ exit $GATLING_EXIT_STATUS generateLocalReportOption = "" } + runModeOptionLocal := "-rm local" + return fmt.Sprintf(template, simulationsDirectoryPath, tempSimulationsDirectoryPath, @@ -88,7 +90,8 @@ exit $GATLING_EXIT_STATUS resultsDirectoryPath, startTime, simulationClass, - generateLocalReportOption) + generateLocalReportOption, + runModeOptionLocal) } func GetGatlingTransferResultCommand(resultsDirectoryPath string, provider string, region string, storagePath string) string {