If i set the step to use 2x the memory and only use half of it, how much of my bill time/minutes will it use. Or am i better of increasing the limits of sonar to use all the available mem?
- step: &sonarcloud
name: Analyze on SonarCloud
size: 2x
caches:
- node
- sonar
script:
- pipe: sonarsource/sonarcloud-scan:2.0.0
variables:
SONAR_TOKEN: ${SONAR_TOKEN}
EXTRA_ARGS: "-Dsonar.projectKey=${SONAR_PROJECT_KEY} -Dsonar.organization=${SONAR_ORGANISATION}"
SONAR_SCANNER_OPTS: -Xmx4096m
EXTRA_ARGS: "-Dsonar.projectKey=${SONAR_PROJECT_KEY} -Dsonar.organization=${SONAR_ORGANISATION} -Dsonar.javascript.node.maxspace=4096"
Hi @simon,
2x steps use twice the number of build minutes of a 1x step. So, if the step takes e.g. 5 minutes to complete, then 10 minutes are going to be used out of your available build minutes.
I see that your step is using a pipe. A pipe runs in a separate docker container and uses a docker service (even if you don't explicitly define a docker service for the step). A service container gets 1024 MB of memory by default.
If you want to assign more memory to the docker service that the pipe is using, you can use in your yml file a definition as follows:
definitions:
services:
docker:
memory: 2048
Reference:
This value can be configured up to 3072 MB for 1x steps and up to 7128 MB for 2x steps.
Kind regards,
Theodora
So would the step definition stay the same and just update the definitions section as you indicate at the top of the pipeline spec file ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @simon ,
The definitions part can go either at the top or at the bottom of the yml file.
You can leave the step as is if you want 2x memory for the step, and you can also adjust the memory you specify in the pipe variables depending on how much memory you give to the docker service.
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.