Build Infra
Introduction
The CI process involves activities that require infra resources such as CPU, memory (RAM), and many more. The amount of resources required depends on the complexity of the application. In other words, large applications require more resources compared to small applications.
Therefore, applying a common infra configuration to all applications is not optimal. Since resources incur heavy costs, it's wise to efficiently allocate resources (not more, not less).
With the 'Build Infra' feature, Devtron makes it possible for you to tweak the resources as per the needs of your applications. The build (ci-runner) pod will be scheduled on an available node (considering applied taints and tolerations) in the cluster on which 'Devtron' is installed.
Steps to Configure Build Infra
From the left sidebar, go to Global Configurations → Build Infra.
![](https://docs.devtron.ai/~gitbook/image?url=https%3A%2F%2Fdevtron-public-asset.s3.us-east-2.amazonaws.com%2Fimages%2Fglobal-configurations%2Fbuild-infra%2Fgc-build-infra.jpg&width=768&dpr=4&quality=100&sign=5dd6e947&sv=1)
You will see the Default Profile and a list of Custom Profiles (if they exist). Setting up profiles makes it easier for you to manage the build infra configurations, ensuring its reusability in the long term.
Default Profile
This contains the default infra configuration applicable to all the applications, be it large or small.
![](https://docs.devtron.ai/~gitbook/image?url=https%3A%2F%2Fdevtron-public-asset.s3.us-east-2.amazonaws.com%2Fimages%2Fglobal-configurations%2Fbuild-infra%2Fdefault-profile.jpg&width=768&dpr=4&quality=100&sign=58b30738&sv=1)
You may click it to modify the following:
CPU - Processor core allocated to the build process. See CPU units.
Memory - RAM allocated to the build process. See memory units.
Build Timeout - Max. time limit allocated to the build process. See timeout units.
![](https://docs.devtron.ai/~gitbook/image?url=https%3A%2F%2Fdevtron-public-asset.s3.us-east-2.amazonaws.com%2Fimages%2Fglobal-configurations%2Fbuild-infra%2Fdefault-infra-config.jpg&width=768&dpr=4&quality=100&sign=280bd88e&sv=1)
Furthermore, CPU and Memory have 2 fields each:
Request - Use this field to specify the minimum guaranteed amount of CPU/Memory resources your application needs for its CI build. In our example, we required 1500m or 1.5 cores CPU along with 6 GB of RAM.
Limit - Use this field to set the maximum amount of CPU/Memory resources the build process can use, even if there is a lot available in the cluster.
Instead of default profile, you can create custom profiles having different infra configurations. Example: One profile for Python apps, a second profile for large apps, and a third profile for small apps, and many more.
Click Create Profile.
Figure 4: Creating Custom Profile Give a name to the profile along with a brief description, and select the configurations to specify the values.
Figure 5a: Empty Profile Figure 5b: Filled Profile Click Save. Your custom profile will appear under the list of custom profiles as shown below.
Figure 6: Listed Profile
Attaching Profile
Once you create a profile, attach it to the intended applications, or else the default profile will remain applied.
Go to the Applications tab.
Figure 7: Applications Tab Choose an application and click the dropdown below it.
Figure 8: Profile Dropdown Choose the profile you wish to apply from the dropdown.
Figure 9: Selecting a Profile Click Change to apply the profile to your application.
Figure 10: Confirming Profile Change
Tip: If you missed creating a profile but selected your application(s), you can use the 'Create Profile' button. This will quickly open a new tab for creating a profile. Once done, you can return and click the refresh icon as shown below.
![](https://docs.devtron.ai/~gitbook/image?url=https%3A%2F%2Fdevtron-public-asset.s3.us-east-2.amazonaws.com%2Fimages%2Fglobal-configurations%2Fbuild-infra%2Fquick-profile-creation.jpg&width=768&dpr=4&quality=100&sign=35d2b15e&sv=1)
Performing Bulk Action
If you wish to apply a profile to multiple applications at once, you can do that too.
Simply use the checkboxes to select the applications. You can do this even if there are many applications spanning multiple pages. You will see a draggable floating widget as shown below.
![](https://docs.devtron.ai/~gitbook/image?url=https%3A%2F%2Fdevtron-public-asset.s3.us-east-2.amazonaws.com%2Fimages%2Fglobal-configurations%2Fbuild-infra%2Ffloating-widget.jpg&width=768&dpr=4&quality=100&sign=4f0deedc&sv=1)
Select the profile you wish to apply from the dropdown and confirm the changes.
![](https://docs.devtron.ai/~gitbook/image?url=https%3A%2F%2Fdevtron-public-asset.s3.us-east-2.amazonaws.com%2Fimages%2Fglobal-configurations%2Fbuild-infra%2Fprofile-selection-bulk.jpg&width=768&dpr=4&quality=100&sign=c1c388cc&sv=1)
Once you apply a profile, it will show the count of applications attached to it.
![](https://docs.devtron.ai/~gitbook/image?url=https%3A%2F%2Fdevtron-public-asset.s3.us-east-2.amazonaws.com%2Fimages%2Fglobal-configurations%2Fbuild-infra%2Fprofile-applicable-count.jpg&width=768&dpr=4&quality=100&sign=dd102486&sv=1)
Editing or Deleting Profile
You can edit or delete a custom profile using the respective icons as shown below.
![](https://docs.devtron.ai/~gitbook/image?url=https%3A%2F%2Fdevtron-public-asset.s3.us-east-2.amazonaws.com%2Fimages%2Fglobal-configurations%2Fbuild-infra%2Fedit-delete-icons-v2.jpg&width=768&dpr=4&quality=100&sign=2c8d48b5&sv=1)
If you delete a profile attached to one or more applications, the default profile will apply from the next build.
![](https://docs.devtron.ai/~gitbook/image?url=https%3A%2F%2Fdevtron-public-asset.s3.us-east-2.amazonaws.com%2Fimages%2Fglobal-configurations%2Fbuild-infra%2Fdelete-dialog.jpg&width=768&dpr=4&quality=100&sign=1fc96d7d&sv=1)
Need More Options?
If you need extra control on the build infra configuration apart from CPU, memory, and build timeout, feel free to open a GitHub issue for us to help you.
Extras
CPU Units
CPU resources are measured in millicore. 1000m or 1000 millicore is equal to 1 core. If a node has 4 cores, the node's CPU capacity would be represented as 4000m.
Memory Units
Memory is measured in bytes. You can enter memory with suffixes (E, P, T, G, M, K, and Ei, Pi, Ti, Gi, Mi, Ki).
Symbol | Prefix | Value (Bytes) |
---|---|---|
m | - | 0.001 byte |
byte | - | 1 byte |
k | Kilo | 1,000 bytes |
Ki | Kibi | 1,024 bytes |
M | Mega | 1,000,000 bytes |
Mi | Mebi | 1,048,576 bytes |
G | Giga | 1,000,000,000 bytes |
Gi | Gibi | 1,073,741,824 bytes |
T | Tera | 1,000,000,000,000 bytes |
Ti | Tebi | 1,099,511,627,776 bytes |
P | Peta | 1,000,000,000,000,000 bytes |
Pi | Petabi | 1,125,899,906,842,624 bytes |
E | Exa | 1,000,000,000,000,000,000 bytes |
Ei | Exabi | 1,152,921,504,606,846,976 bytes |
Timeout Units
You can specify timeouts in the following units, beyond which the build process would be marked as failed:
seconds
minutes
hours
Last updated