![]() |
失望的日光灯 · 校党委书记徐兰宾赴新疆克州考察对口援疆工作· 4 月前 · |
![]() |
谦虚好学的柚子 · java中双引号转义字符 - CSDN文库· 5 月前 · |
![]() |
个性的小刀 · vue启动不了_jetlinks-ui-vu ...· 6 月前 · |
![]() |
风流倜傥的饭卡 · 思想史脉络下的《齐物论》-中国社会科学网· 6 月前 · |
![]() |
冷静的抽屉 · Try out Nullable ...· 6 月前 · |
![]() |
阳光的甜瓜
1 年前 |
kubectl
This manual covers the post-installation configuration and operation of Gradle Enterprise . It is useful for administrators and maintainers of Gradle Enterprise installations.
For installation instructions, please see the Gradle Enterprise Kubernetes Helm Installation Manual for Kubernetes cluster installations or the Gradle Enterprise Helm Standalone Installation Manual for installation onto a single host.
Basic installation settings for Gradle Enterprise are configured via Helm values. This includes how Gradle Enterprise is accessed via the network, and how it stores its persistent data. These settings are covered in the installation manuals linked-to above.
Other configuration aspects are configured via the Gradle Enterprise application. Only users with the administration permission can do this, and they can do so by using the user menu in the top right of the application and choosing “Administration”. Until user accounts have been created, or in the case that no user accounts will be used, the system user can be used for this purpose.
Please read each of the following sections for information on recommended configuration.
The “system user” is an ever-present local user account that can be used to bootstrap the configuration of an installation, or for emergency local access in case of a failure with an external authentication provider once configured. The system user is hardcoded to have the “Administer Gradle Enterprise” permission (see Access control ).
The system user has a username of
system
and a default password that is randomly generated for new installations.
The first time a user logs in (as the system user) using the default password, they will be prompted to change the password. The new password should be recorded and kept secret as it can be used to access Gradle Enterprise as an administrator.
It is recommended that the system user account not be used regularly. Instead, real administrator user accounts should be created by configuring access control.
There are several ways to find the default password:
The
Gradle Enterprise Admin CLI
also has a command to get the default system password:
(admin-cli) system get-default-system-password
.
In addition to the
get-default-system-password
command, the Admin CLI also has a
system reset-system-password
command that will set the system password to a value you provide. This can be used as an alternative to looking up the default system password, and skips having to choose a new password after the first login. The new password should be recorded and kept secret as it can be used to access Gradle Enterprise as an administrator.
kubectl
If you have
kubectl
installed and configured, you can view the default system password using the following command:
$ kubectl -n gradle-enterprise get secret gradle-default-system-password-secret --template={{.data.password}} | base64 --decode
When the default system password is used, it is logged on startup by the
gradle-enterprise-app-*
pods. It can be found by searching for
Using default system password:
.
While
kubectl logs
can be used to get the app logs, it does not have an option to get the beginning of the log, only the end. As such, this method likely won’t be of much use except with an external log aggregator or viewer.
Gradle Enterprise allows locally managed user accounts and permissions, and externally managed via an LDAP service or SAML 2.0 identity provider.
Initial setup can be performed by the system user. Subsequently, any user with the “Administer Gradle Enterprise” permission can configure access control by using the user menu in the top right of the application to access “Administration” and then “Access control”.
The following permissions are available to grant access to the described function:
View build scans and build data
viewScan
Allows viewing of build scans and associated build data and use of Predictive Test Selection
Publish build scans
publishScan
Allows publishing of build scans
Access build data via the API
exportData
Allows access to the Gradle Enterprise API
Use Test Distribution
testDistribution
Allows use of Test Distribution
Read build cache data
readCache
Allows reading of Build Cache data
Read and write build cache data
writeCache
Allows reading and writing of Build Cache data
Read build cache data and write Bazel CAS data
readCacheWriteCas
Allows reading of Build Cache data as well as writing data to the
content-addressable storage
exposed by the Build Cache’s
Bazel
functionality. If you typically assign read-only access to the cache for developers and write access only for the CI, consider assigning developers using Bazel this permission instead. The
readCacheWriteCas
permission allows developers using Bazel to benefit from richer local build scans while maintaining a similar level of security.
Access all data without an associated project
accessDataWithoutAssociatedProject
Allows users to access and push data that is not associated with a project
Access all data with or without associated project
accessAllDataWithOrWithoutAssociatedProject
Allow users to access and push all data for all projects, as well as data that is not associated with a project.
Configure build caches
administerCache
Allows configuration of Build Cache functionality
Configure projects
administerProjects
Allows configuration of projects and project groups for project-level access control from the Administration console, or by using the Gradle Enterprise API.
Administer Gradle Enterprise
administerGe
Allows general administration of Gradle Enterprise (e.g. access control).
Users' permissions are managed via assigning roles to them, either in Gradle Enterprise or by mapping an external Identity Provider’s roles. Both methods are described later in this section.
Gradle Enterprise comes with a basic set of roles pre-configured, which are shown in the table below. They should be enough for many use-cases. Custom roles can be created and managed by going to “Administration” via the top right hand user menu, then “Access control” → “Roles”, or by using unattended configuration .
Administrator
Administer Gradle Enterprise
Configure build caches
Configure projects
Administer Gradle Enterprise
ci-agent
CI Agent
Use Gradle Enterprise for CI builds
Publish build scans
Use Test Distribution
Read build cache data
Read and write build cache data
developer
Developer
Use Gradle Enterprise
View build scans and build data
Publish build scans
Use Test Distribution
Read build cache data
By default, Gradle Enterprise allows anonymous viewing and creation of build scans. This makes it easier to get started by reducing build configuration, but may not be suitable for your environment. Anonymous access to the built-in Build Cache node is not enabled by default.
Permissions for anonymous users can be changed by going to “Administration” via the top right hand user menu, then “Access control” → “Anonymous access”.
Builds can authenticate with Gradle Enterprise by supplying an “access key”.
Please consult the Gradle Enterprise Gradle Plugin User Manual or Gradle Enterprise Maven Extension User Manual for guidance on how to configure builds to authenticate with Gradle Enterprise.
Locally managed user accounts can be created to allow users to access Gradle Enterprise. They are not mutually exclusive with externally managed user accounts and both can co-exist provided the usernames and emails are unique.
From the Administration page, navigate to “Access control” → “Users”
Click Add .
Enter details for the user and set an initial password.
Assign the required roles for the user.
Click Save .
A SAML 2.0 identity provider can be configured to allow users to access Gradle Enterprise using their organization credentials. User accounts for users authenticating with the SAML provider will be created on first login.
A user cannot login via a SAML provider if a locally defined account exists for the same username or email.
Sign out from Gradle Enterprise will not log users out of the SAML identity provider.
From the Administration page, navigate to “Access control” → “Identity provider”
Check ”Enable external identity provider”
Choose “SAML 2.0” from Identity provider type options
Enter a name for the identity provider
Create a SAML application at your identity provider using the displayed “Service provider SSO URL” and “Service provider entity ID”.
Download the metadata for the SAML application from your identity provider, and select this file for the “Identity provider metadata file” field.
Configure signing/encryption options
Configure attribute mapping ( described below )
Configure role management ( described below )
Click Save .
If any signing or encryption is being used, use “Download service provider config” to obtain a configuration file that will need to provided your identity provider.
User’s “first name”, “last name” and “email” attributes can be obtained from the identity provider or prompted for on first login.
To obtain an attribute from the identity provider, select “Manage in identity provider” for the attribute and specify the name of the SAML attribute that will provide the value. Attribute changes made at the SAML identity provider will only take affect after either a user initiated logout, administrator force logout, or session expiry.
Locally managed attributes can be updated for a user by an administrator.
User role membership can be defined by the identity provider or managed locally.
To use identity provider specified role membership, select “Defined by identity provider” in the “Role membership” section. The name of the SAML attribute that defines the roles for a user must be specified, along with the values to map to Gradle Enterprise access roles.
When using “Defined by Gradle Enterprise” as the “Role membership” option, the default roles for users can be specified. Users will be assigned the default roles when they first sign in. Changing the default roles will change the role membership of users with default roles enabled. Administrators can change role membership for individual users after they have signed in for the first time, including whether the default roles should be enabled for the user.
An LDAP identity provider can be configured to allow users to access Gradle Enterprise using their organization credentials. User accounts for users authenticating with the LDAP identity provider will be created on first login.
A user cannot login via an LDAP provider if a locally defined account exists for the same username or email.
From the Administration page, navigate to “Access control” → “Identity provider”
Check ”Enable external identity provider”
Choose “LDAP” from Identity provider type options
Complete the connection details for your LDAP provider.
Configure user attributes ( described below )
Configure role management ( described below )
Click Save .
There are five required fields in Gradle Enterprise: “username”, ”first name”, “last name”, “email“, and “UUID”. These fields are required to be mapped to fields in your LDAP identity provider.
When using “Defined by Gradle Enterprise” as the “Role membership” option, the default roles for users can be specified. Users will be assigned the default roles when they first sign in. Changing the default roles will change the role membership of users with default roles enabled. Administrators can change role membership for individual users after they have signed in for the first time, including whether the default roles should be enabled for the user
Recursive group membership is supported, via an opt-in option.
Gradle Enterprise supports integration with other systems via the System for Cross-domain Identity Management (SCIM 2.0) protocol. This allows for automating management of users and groups.
By default, SCIM support is disabled. To enable it:
From the Administration page, navigate to “Access control” → “SCIM”
Check “Enable SCIM integration”
Click Generate token .
If you have enabled SCIM previously, a “Regenerate token” button will be present instead.
Copy the “Base URL” and “SCIM token” values to a secure location for later use.
Click Save .
A header will appear alerting you to pending configuration changes. Click Apply and confirm again by clicking Apply .
In your system that uses SCIM (often an identity provider), use the “Base URL” and “SCIM token” values saved earlier to configure the SCIM integration.
Specific instructions for the following SCIM-capable systems are available:
Authentication is only supported via Bearer Tokens.
Usernames will always be normalized to lowercase.
Users created via SCIM are local to Gradle Enterprise and will block using that “userName” with an identity provider.
Identity providers create users on first login; attempts to update a user before first login will fail.
The following
User
attributes are supported (others may work):
active
emails
name.familyName
name.givenName
The following
Group
attributes are supported (others may work):
displayName
members
Navigate to your Gradle Enterprise application in Azure Active Directory
Navigate to “Manage” → “Provisioning”
Navigate to “Manage” → “Provisioning” (again)
In the “Provisioning Mode” field, select “Automatic”
Set the “Tenant URL” field to the “Base URL”
value from the Gradle Enterprise application
(should look like
https://«hostname»/identity/scim/v2
)
Set the “Secret Token” field to the “SCIM token” value from the Gradle Enterprise application
Click Save .
Navigate to “Mappings” → “Provision Azure Active Directory Groups”
Set “Enabled” to “No”
Click Save and confirm by clicking Yes .
Navigate to “Provisioning”
Navigate to “Mappings” → “Provision Azure Active Directory Users”
In the “Target Object Actions” section, uncheck “Create”
Click Save and confirm by clicking Yes .
Navigate to “Provisioning”
In the “Settings” section, set “Provisioning Status” to “On”
Click Save .
Navigate to your SAML 2.0 app integration
Navigate to the “General” tab
In the “App Settings” section:
Click Edit .
In the “Provisioning” field, check “Enable SCIM provisioning”
Click Save .
Navigate to the “Provisioning” tab (will not be visible if you missed the previous step)
In the “Settings” → “Integration” section:
Click Edit .
Set the “SCIM connector base URL” field to the “Base URL”
value from the Gradle Enterprise application
(should look like
https://«hostname»/identity/scim/v2
)
Set the “Unique identifier field for users” field to “userName”
In the “Supported provisioning actions” section, check “Push Profile Updates”
In the “Authentication Mode” field, select “HTTP Header”
Set the “HTTP Header”, “Authorization”, “Bearer” field to the “SCIM token” value from the Gradle Enterprise application
Click Test Connector Configuration .
Review the results and click Close .
Click Save .
In the “Settings” → “To App” section (will not be visible if you missed the previous step):
Click Edit .
In the “Update User Attributes” field, check “Enable”
In the “Deactivate Users” field, check “Enable”
Click Save .
Viewing build scan data, including in dashboards or via the Gradle Enterprise API
Publishing build scans
Reading or writing build cache data (including Bazel cache data)
Using Test Distribution
Using Predictive Test Selection
Once a build specifies a project, access to that project will be required to take any of these actions. Additionally, builds will only have access to data from their own project. For example, a build associated with project “A” will only be able to read cache entries that were stored by builds associated with project “A”.
When project-level access control is enabled, builds that do not specify a project will only be able to publish build scans and use Gradle Enterprise features if the user running the build is granted the “Access all data without an associated project” permission. See Migrating to project-level access control for details.To configure access to a project in Gradle Enterprise, it first has to be created.
Gradle Enterprise automatically creates any projects referenced in published builds, However, users cannot access those projects because they are not associated with any users. To avoid this, we recommend creating and assigning projects in Gradle Enterprise before using them in your builds.
To manage projects:
Navigate to “Administration” via the top right hand user menu.
Navigate to the “Access control” page, then the “Projects” tab.
Scroll to the “Projects” section.
In the “Projects” section you can:
View and search the projects known to Gradle Enterprise.
Create projects using the “Add project” button.
Edit a project, by clicking on it in the project list. The display name, description, and the project groups the project is part of can all be edited.
Navigate to “Administration” via the top right hand user menu.
Navigate to the “Access control” page, then the “Projects” tab.
Scroll to the “Project Groups” section.
In the “Project Groups” section you can:
View and search the project groups known to Gradle Enterprise.
Create project groups using the “Add project group” button.
Edit project groups, by clicking on the project in the project list. The display name, description, and the projects the group contains can all be edited.
Assigning project groups to users is done when editing a user, identically to how roles are assigned. Like roles, project groups can also be mapped from an external identity provider .
The “Access all data without an associated project” and “Access all data with or without associated project” permissions can be used to circumvent some level of per-project access control, as described in the access control section . Frequently using these permissions reduces the usefulness of project-level access control. However, they may be useful for bot accounts or CI agents, or to maintain visibility of past data that does not have an associated project.
In addition to the manual configuration outlined above, the Gradle Enterprise API can be used to manage projects and project groups. Project groups are still assigned to users manually or using an identity provider mapping.
The API is documented in the Gradle Enterprise API documentation . All of the project related API endpoints require the “Configure projects” permission.
Apache Maven™: Gradle Enterprise Maven Extension User Manual
By default, project-level access control is disabled and Gradle Enterprise does not enforce project-level access for builds associated with a project. You can configure project access before enabling project-level access control.
To enable project-level access control:
Navigate to “Administration” via the top right hand user menu.
Navigate to the “Access control” page, then the “Projects” tab.
Check “Enable project-level access control”.
Save your settings.
Project-level access control will take effect once the configuration is applied.
Once you enable project-level access control, the “Allow data without an associated project” checkbox appears. The “Allow data without an associated project” setting controls whether data without an associated project can be submitted to Gradle Enterprise. It is enabled by default, and we recommend keeping it that way at least until all of your builds specify a project ID.
When enabling project-level access control, it is important to do so carefully, otherwise existing builds could begin to fail and users could unintentionally lose access to data. There are two paths to enabling project-level access control that we recommend: an all at once path that enables project-level access control for all builds and all projects at the same time, and a progressive path that enables projects one by one.
Create all projects you wish to use.
Use those projects in all of your builds. All of your builds should be associated with a project.
Assign all users the necessary projects using project groups.
Enable project-level access control.
Disable “Allow data without an associated project”.
It is important to ensure that all of your builds use a project in step 2. Otherwise, once you complete step 4, builds without a project will fail to authenticate with Gradle Enterprise. This is because while data without an associated project is still accepted, no users have permission to work with it.
Once you complete step 4, users will lose access to historical data that does not have an associated project. To avoid this, you can wait long enough between steps 2 and 4 to ensure that all relevant data has a project associated, or grant users who should have access to the historical data the “Access all data with or without associated project” permission.Assign all users the “Access all data with or without associated project” permission. This can be done by assigning it to the anonymous user.
Enable project-level access control.
At this point, no builds should specify projects, but all builds will continue to work. This is because despite project-level access control being enabled, data without an associated project is allowed and all users have permission to work with it.
When you wish to enable project-level access control for a build, do the following:
Create the project you wish to use, if it does not already exist.
Assign it to all users that should have access using project groups.
Use the project in the build.
Project-level access control will now be enforced for that build. If this has been done for all existing builds, and you wish to prevent the submission of new data that is not associated with a project, disable “Allow data without an associated project”. You can then remove “Access all data with or without associated project” from any users. However, it is required to view historical data that is not associated with a project, and by itself does not allow the creation of any new data that isn’t associated with a project, so you may with to leave it in place for some time.
Build scans can be stored in the Gradle Enterprise database, or in an object store . By default, build scans are stored in the database that Gradle Enterprise is configured to connect to .
In most installations, storage space usage is dominated by the storage of Build Scan data. The amount of space used is dependent on how many scans are being published and how much information is being recorded for each build.
When Build Scan data is stored in the database, compression and deduplication techniques are used. This means that data growth is non-linear; storing data for twice as many builds does not mean that twice the space will be required.
When Build Scan data is stored in S3, each scan is stored as a compressed, self-contained object. This makes estimation of required storage easier: twice as many scans results in roughly twice as much storage being used.
To control the amount of storage space used, Gradle Enterprise can be configured to remove build scans based on their age. To avoid running out of disk space, you can configure automatic deletion of old build scans when the amount of free space drops below a specified percentage, as well as automatic rejection of incoming data when free space drops below a specified percentage. Additionally, the system can be configured to send warning emails when free space drops below a specified percentage.
These settings can be changed by going to “Administration” via the top right-hand user menu, then “Build Scans”.
A configuration that maintains a predictable build scan retention period is:
Specify a maximum build scan age
Send a warning email when there is less than 10% of space free
Reject incoming data when there is less than 5% of space free
When storing scans in the database, an alternative configuration that stores as much build scan history as space permits is:
Do not specify a maximum build scan age
Automatically delete old build scans when there is less than 15% of space free
Send a warning email when there is less than 10% of space free
Reject incoming data when there is less than 5% of space free
When enabling automatic deletion of old build scans when disk space is low, be mindful that the result of another process filling the volume that Gradle Enterprise is using will be that all build scan data will be deleted.
If backups are created on the same volume, make sure to leave enough room for them in your thresholds. For example, if the total space that your backups take up is 40% of the disk, the above recommended settings would be 55%, 50% and 45%. Store backups on a separate volume to simplify space management. When storing Build Scans in object storage, the space used will not be taken into account in the above calculations. This means that if your installation is running low on database space, the likely cause will not be Build Scan data, so automatic deletion of build scans wil not recover much space. It is not recommended to set an auto-deletion threshold when storing Build Scan data in S3.It is possible to store build scans in an object store such as Amazon S3 .
While this is a more complex setup, there are a number of benefits:
High traffic installations typically see an improvement in build scan processing and cleanup performance.
S3 is a highly scalable and fault tolerant service, typically more so than an individual database.
It is cheaper to store more build scans.
With the vast majority of Build Scan data in S3, the main Gradle Enterprise database typically requires much less storage, and the installation (for embedded databases) or the user-managed database can be provisioned with fewer resources.
Database backup management is easier when the database is much smaller, and backups themselves take up less space and are cheaper to store.
There are some downsides:
Installation is more complex.
More memory must be allocated to the Gradle Enterprise application (2GB is the increase we recommend).
The persistent data of Gradle Enterprise is no longer fully contained within a database backup, because build scans are no longer stored in the database. This makes it more complicated to clone a Gradle Enterprise instance.
S3 storage is only supported for AWS installations.
See the Kubernetes Helm Chart Configuration Guide or Standalone Helm Chart Configuration Guide for object storage configuration details.
Once object storage is configured in your helm chart, perform the following steps to store incoming Build Scan data in the store:
Go to the "Administration" → "Build Scans" page.
Select "Store incoming build scans in object storage".
Click "Save".
You will be prompted to restart to allow the configuration changes to be applied. Do not do this yet.
Go to the "Administration" → "Advanced".
Increase the "App" → "Heap memory" setting by 2048 MiB.
Click "Save".
You will be prompted to restart to allow the configuration changes to be applied. Do so.
If you are using EKS service account based credentials, ensure that you have configured Helm with the necessary service account annotation and redeployed.
Once Gradle Enterprise has restarted, all new build scans will be stored in the configured object store. Any existing build scans will be loaded from the database, and will eventually be evicted according to the configured age-based retention period . If one of your reasons for adopting object storage was to reduce the size of your database, note that you will only start to see the size of your database reducing once Build Scan data starts aging out after the retention window. To reduce the size of the database, Build Scan data needs to be deleted, and the space it took up needs to be reclaimed - a process which happens regularly, both daily and weekly.
An administrator can be notified of the backup process outcome, which is particularly important in the case of failures. This requires administrator email details and SMTP server settings to be configured for the Gradle Enterprise instance.
The backup location is currently configured separately during installation. For standalone installations please see the Gradle Enterprise Helm Standalone Installation Manual . For Kubernetes installations please see the Gradle Enterprise Helm Kubernetes Installation Manual .
See below for details on restoring backups.
Email server settings can be configured by going to “Administration” via the top right-hand user menu, then “Email server”.
With an email server specified, Gradle Enterprise can send email notifications on completion of backups or when disk space is low. See the Disk space management and Creating backups sections for more details.
Once configured, it is possible to test email configuration by running the
Gradle Enterprise Admin CLI
system test-notification
command.
Gradle Enterprise can be configured to use a proxy by going to “Administration” via the top right-hand user menu, “Network” page and then “HTTP proxy”.
With a proxy configured, Gradle Enterprise will use the configured proxy to make all outbound HTTP/HTTPS requests (to external endpoints on the internet). Both HTTP and HTTPS are supported as proxy protocols.
Proxy can also be configured during installation using the unattended configuration mechanism, see the Proxy configuration section of the installation guide (the instructions are identical for standalone installations).
Gradle Enterprise can be configured to trust additional SSL certificates by going to “Administration” via the top right-hand user menu, “Network” page and then “SSL trust”.
As the page notes, certificates should be added as X509 certificates in PEM format, newline seperated if there are more than one.
Additional trusted certificates can also be configured during installation using the unattended configuration mechanism, see the Untrusted SSL certificates section of the installation guide (the instructions are identical for standalone installations).
Gradle Enterprise provides system backup and restore capabilities to facilitate disaster recovery. Backups can be triggered manually or scheduled to be done automatically on a periodic basis, and require no system downtime.
The backup process produces a single compressed archive which can be used to restore all user data to a state at the time of the backup. It is highly recommended that this archive additionally be copied to an off-host location, in the case of a complete loss of the host system or volume used to store backup archives.
In addition to disaster recovery, backup archives can be used to migrate your Gradle Enterprise data to a new host system. This can be useful in scenarios where a trial instance is promoted to a production one.
See Scheduled backups for details on configuring automated backups
In addition to configuring automatic scheduled backups, you may trigger a manual backup at any time by running Gradle Enterprise Admin CLI commands:
To create a backup, run the
backup create
command.
You can download the newly created backup locally by running the
backup copy
command.
The backup archive will be copied to the directory in which the command is executed. If multiple backups exist you will be prompted to select the backup you would like to copy.
Once a backup archive is created you may use it to restore a Gradle Enterprise instance to the backup state at any time, by running the
Gradle Enterprise Admin CLI
backup restore
command.
This command will require some downtime on Gradle Enterprise until the restore has finished.
When Gradle Enterprise is using a user-managed database, customer support may not be able to assist with configuring the database for disaster recovery or restoring the database from a backup. We strongly recommend you ensure you have a working and tested disaster recovery procedure for the Gradle Enterprise database.
Stop the application by running the
Gradle Enterprise Admin CLI
system stop
command.
Follow your database provider’s instructions on restoring a backup. This may be running a tool like
pg_restore
or restoring a database snapshot, depending on your database provider and backup type.
If you are not providing superuser credentials to Gradle Enterprise, run the current database setup script used during database setup (see your installation manual) on the database and ensure that working application and migrator passwords are configured in the configuration interface or
Secret
resources being used.
Restart Gradle Enterprise by running the
Gradle Enterprise Admin CLI
system start
command.
Stop the application by running the
Gradle Enterprise Admin CLI
system stop
command.
Follow your database provider’s instructions on restoring a backup to a new instance. This may be running a tool like
pg_restore
or restoring a database snapshot, depending on your database provider and backup type.
Configure Gradle Enterprise with the new instance connection details and superuser credentials if those are being provided. This will mean re-running Helm, or updating the specified
ConfigMap
and
Secret
resources.
If you are not providing superuser credentials to Gradle Enterprise, run the current database setup script used during database setup (see your installation manual) on the database and ensure that working application and migrator passwords are configured in the configuration interface or
Secret
resources being used.
Restart Gradle Enterprise by running the
Gradle Enterprise Admin CLI
system start
command.
If you are experiencing issues with Gradle Enterprise or related components please submit a support ticket at support.gradle.com , including details of the issue and an attached support bundle.
Support bundles assist our engineers in troubleshooting your issue by providing the following information about your Gradle Enterprise installation:
Server logs
System performance metrics
Gradle Enterprise database statistics
To generate a support bundle:
From the Administration page, navigate to “Support”.
Enter the system user password, and click “Generate”.
Download the support bundle.
It is also possible to generate a support bundle using the
Gradle Enterprise Admin CLI
, by executing the
support-bundle
command. This method should be used when the Gradle Enterprise user interface is not available.
Example downloading a support bundle using Admin CLI JAR file:
$ java -jar gradle-enterprise-admin-<VERSION>.jar \
--kube-ns=gradle-enterprise \
support-bundle
Example downloading a support bundle using Admin CLI Docker image:
$ docker run --rm -it \
-v "${HOME}/.kube/config:/kube-config:ro" \
-v "${HOME}/bundles:/home" \
gradle/gradle-enterprise-admin-cli \
--kube-ns=gradle-enterprise \
support-bundle
The generated support bundle will be stored in the mounted directory (in this case it will be
${HOME}/bundles
).
If you have questions about a particular build scan, please submit a support ticket at support.gradle.com , and attach a dump of the build scan.
To generate one, replace
/s/
with
/scan-dump/
in the build scan url, e.g.
https://your-ge-server/scan-dump/vbdei7xhyojq2
Running Gradle Enterprise requires a valid license, which is initially provided by the user as a license file during installation.
Gradle Enterprise’s current license can be viewed by going to “Administration” via the top right-hand user menu, then “License”.
In the event your license expires, Gradle Enterprise will continue to function. However, it will be read-only. In practice, this means that the following permissions are not granted to any users:
Publish build scans
Read and write build cache data
Use Test Distribution
In some cases, Kuberenetes may fail to pull Gradle Enterprise docker images and may fail to start new Gradle Enterprise instances.
Full functionality will be restored if the Gradle Enterprise license expiration date is updated (see below), and users' permissions will be restored automatically.
To extend or renew your Gradle Enterprise license, reach out to your Gradle sales or customer success representative. If the expiration date on your license does not match the date on your contract, please submit a support ticket at support.gradle.com .
Online installations automatically check Gradle’s license server for license updates. It does so both on startup and every hour thereafter. If a license update requires a restart to take effect, a notification is displayed to administrators.
If license checks fail for 72 hours, the instance will fail to restart.
For online installations, all that is needed to avoid expiration is to ensure that your customer success representative has extended your license. There is no need to obtain or install a new license file, as the update will be applied automatically. If the application has failed to start due to license expiration, restart it after your customer success representative has extended your license.
In online installations, the “Administration” section “License” tab can also be used to:
verify the current license’s information, such as expiration date
compare the current license and updated license (when an updated license has been downloaded)
restart Gradle Enterprise to apply the updated license (when an updated license has been downloaded)
check whether license checks are functioning properly
initiate an on-demand license check
Airgap installations do not receive automatic license updates. If you need an updated license file, contact your customer success representative. When you receive an updated Gradle Enterprise license file, it can be applied using
helm upgrade
. Further details can be found in the “Changing configuration values” section of the
Gradle Enterprise Upgrade Guide
.
A Build Scan is a shareable record of a build that provides insights into what happened and why.
For information on how to create build scans, please consult the links below.
Gradle: the Gradle Enterprise Gradle Plugin User Manual and the Getting Started with Gradle Enterprise guide for Gradle users
Apache Maven™: the Gradle Enterprise Maven Extension User Manual and the Getting Started with Gradle Enterprise guide for Maven users
Compatibility between versions of Gradle Enterprise and the Gradle Build Scan plugin or the Gradle Enterprise Maven extension can be found here .
Build caching dramatically decreases build times for both local development and continuous integration builds. Build Caches store outputs from Gradle tasks and Maven goal executions and serve them to later builds to reuse, instead of the outputs being built again.
Gradle Enterprise provides a built-in Build Cache node as part of each installation, and allows optionally connecting one or more remote nodes to use as discrete caches or replicas for reducing network latency.
For information on how to use the Gradle Enterprise Build Cache, please consult the Getting Started guides for Gradle or Maven .
Build Cache administration is available at
/cache-admin
of your Gradle Enterprise installation.
The built-in Build Cache is configured with the following defaults:
All cache access is disabled.
Target cache size of 10 GiB (how much data to retain in the cache).
Free space buffer size of 1 GiB (how much free disk space to ensure is available at all times, reducing cache size if necessary).
Maximum artifact size of 100 MiB (the largest cache artifact to accept).
No limit on cache entry age.
To change this configuration, click the Nodes item in the left menu to access the node listing, then click View built-in node details .
By default, access to the built-in cache node is disabled. There are two access control mechanisms that can be used. Which one you should use depends on the version of the Gradle Enterprise Gradle plugin or Gradle Enterprise Maven extension you will be using.
Version 3.11+ of the Gradle Enterprise Gradle plugin and version 1.15+ of the Gradle Enterprise Maven extension can authenticate to the build cache with Gradle Enterprise access keys. Permissions for these users are managed via the same access control mechanism used for other functions . Users with the “Build cache read” permission can read data from any connected build cache, while users with the “Build cache write” permission can read and write data from any connected build cache.
To control access for earlier versions, separate username and password credentials can be specified in the “Build Cache” section of Gradle Enterprise, in the details section for each build cache node. This section of Gradle Enterprise is only accessible by users with the "Build cache admin" permission.
How to configure your builds to supply credentials is described in the Gradle Enterprise Gradle Plugin User Manual for Gradle, and in the Gradle Enterprise Maven Extension User Manual for Maven.
Anonymous access control can also be configured using the same anonymous access control mechanism used for other functions , or by configuring node-specific anonymous permissions in the details section for each build cache node. When both are configured, the most permissive setting is used.
Remote build cache nodes are installed separately from Gradle Enterprise. They can be used to separate cache artifacts, distribute load, or improve build performance by having a better network link between the build and the node.
By connecting remote nodes to a Gradle Enterprise instance, you are able to configure them centrally from Gradle Enterprise, and have them replicate entries from other cache nodes.
Installation and operation of remote build cache nodes is documented in the dedicated Build Cache Node User Manual .
To connect a remote node to your Gradle Enterprise installation, you first need to create a record for the node with Gradle Enterprise by following either of these options:
Visit
/cache-admin
of your Gradle Enterprise installation, and select
Nodes
from the left menu. In the
Remote nodes > Create new node
section, enter the name for your node and click
Create new node
.
In case nodes are required to be managed by provisioning software (e.g., Terraform ) Gradle Enterprise offers an unattended option to register the node via the Gradle Enterprise API . Please consult the access control section of the API manual on how to connect to the Build Cache section of the Gradle Enterprise API.
Once you have access to the Gradle Enterprise API, we can start with the registration of a node via the Gradle Enterprise API.
The following example uses
ge.mycompany.com
as the installation host,
7asejatf24zun43yshqufp7qi4ovcefxpykbwzqbzilcpwzb52ja
as the access key of the user which has the
Cache admin
role, and
cURL
as the HTTP client.
First, a new node (referred to as
node-1
) is registered in Gradle Enterprise using the Create/Update endpoint by specifying a unique descriptive value for the name of the node, e.g.:
$ curl -X PUT https://ge.mycompany.com/api/build-cache/nodes/node-1 \
-d '{"enabled":true}' \
-H "Authorization: Bearer 7asejatf24zun43yshqufp7qi4ovcefxpykbwzqbzilcpwzb52ja" \
-H "Content-Type: application/json"
If applicable, a replication configuration (in this example a preemptive replication from
parent-node-1
is configured) can be specified at creation time:
$ curl -X PUT https://ge.mycompany.com/api/build-cache/nodes/node-1 \
-d '{"enabled":true,"replication":{"source":"parent-node-1","preemptive":true}}' \
-H "Authorization: Bearer 7asejatf24zun43yshqufp7qi4ovcefxpykbwzqbzilcpwzb52ja" \
-H "Content-Type: application/json"
Second, a request to the secret endpoint is made using the name of the node used in the previous step. This generates a key-secret pair that the node requires for connecting to Gradle Enterprise:
$ curl -X POST https://ge.mycompany.com/api/build-cache/nodes/node-1/secret \
-H "Authorization: Bearer 7asejatf24zun43yshqufp7qi4ovcefxpykbwzqbzilcpwzb52ja"
"key":"fqysvmfd3u5dcgis5reunrxjce",
"secret":"cpgovxdo6f6phkdyxdrfzyy43q5hflatc2umzgguxv6adap2qyyi"
As a last step you need to update the node configuration with the returned key and secret . Please consult the reference documentation of the Gradle Enterprise API for further functionality with regard to node management.
The node must also be configured with details of the server to connect with, including the assigned key and secret . Please consult the Gradle Enterprise Registration section of the Build Cache Node User Manual for information on how to do this.
The bandwidth and latency of the network link between a build and a build cache significantly affects build performance. Replication allows users to use a cache node that they have a better network link to, while reusing artifacts from another cache node that is further away. This is particularly effective for geographically distributed teams.
The replication settings for each node can be configured via the node’s configuration page in Gradle Enterprise. They can not be configured for remote nodes via the remote node’s user interface or configuration file.
A typical arrangement is to have continuous integration builds push to a cache node on a local network, and have other nodes used by developers in different locations, ideally on their local network, use it as their replication source.
By default, cache entries are replicated on demand . Nodes will copy a cache entry from their replication source when that particular cache entry is requested for the first time. This avoids copying entries between nodes that will never be used, but forces builds to wait for the transfer on first use.
Preemptive replication enables better build cache performance, at the expense of more network transfer between nodes. When preemptive replication is enabled, nodes will copy cache entries from their replication source as soon as they are added. The downside of this approach is that entries may be copied that are never used. If network bandwidth usage between nodes is not a concern, this is the best configuration.
Only cache entries that are added to the replication source after the node has connected are copied preemptively. Any already existing entries will be copied on demand.
Each node may have a status of
OK
,
WARN
or
ERROR
. If all nodes are reported as
OK
, you can be assured that your build cache network is operating well.
WARN
indicates that there is a non-critical issue, or that there is a problem that is expected to resolve itself soon. If the issue does not resolve itself, or for immediately critical issues, the
ERROR
status is used.
A monitoring tool friendly version of this page is available via the
Monitoring page
link towards the bottom of the page. This endpoint returns the statuses in plain text. If there are any
ERROR
statuses, the HTTP response status code for this page will be
503
. Otherwise, it will be
200
.
Gradle Enterprise Test Distribution takes your existing test suites and distributes them across multiple compute resources to execute them faster. It requires connecting one or more test execution “agents” to Gradle Enterprise. Builds that have enabled Test Distribution connect to Gradle Enterprise, which then distributes the tests to be executed on connected agents.
Please consult the Gradle Enterprise Test Distribution User Manual for information on build configuration.
Gradle Enterprise users must be granted the “Test Distribution” access control role to be able to use Test Distribution.
The first part of the label indicates the root project name of the build, while the second part identifies the particular task or goal. The count of assigned/desired agents shows how many agents are currently assigned to/desired by the job. More agents may be assigned as they become available. The count of compatible agents shows how many currently connected agents have capabilities that satisfy the requirements of the job.
API keys are used by agents to authorize their connection to Gradle Enterprise, and for authorizing connections to Test Distribution APIs provided by Gradle Enterprise.
API keys can be generated on the “Configuration” tab. A single API key may be used my multiple agents. Multiple can be created to facilitate a rolling update if required. Revoking an API key prevents it from being used for future registrations and API access. Connected agents will be forcibly disconnected one hour after the API key they used to connect is revoked.
Utilizing Test Distribution requires connecting additional compute resources, called agents, to Gradle Enterprise. The Test Distribution agent is available as a Docker image or standalone JAR and is easy to deploy and operate via Kubernetes or any modern compute platform. Please consult the Gradle Enterprise Test Distribution Agent User Manual for more on deploying and operating agents.
The “Agents” tab shows all currently connected agents.
An agent pool is a group of agents that are to be scaled up and down based on demand. Each pool has a generated unique ID that is specified by an agent when connecting to indicate its pool, and can be used by compute platform auto scalers to determine the desired number of agents at any time for that pool.
The minimum and maximum size of an agent pool is used to determine the desired number of agents at a given moment.
Ultimately, the actual number of agents is determined by the compute platform, which may impose incompatible limits. Where possible, ensure that the limits imposed by the compute platform are either identical to or compatible with those configured in Gradle Enterprise.
To temporarily disable a pool, set both minimum and maximum to zero.
Agents in a pool are expected to provide a certain set of capabilities. While an agent may provide additional capabilities, it will be rejected when connecting without at least the mandatory capabilities configured on its agent pool.
While computing the number of desired agents for a pool its capabilities are matched against the requirements of the current jobs. A pool is only utilized if it satisfies all of a job’s requirements. Therefore, you should at least add a
jdk=…
capability to each agent pool since such a requirement is added implicitly to each job. Moreover, each agent has an implicit
os=…
capability which should be added to the agent pool for the sake of consistency and in case it’s an explicit requirement of any job.
Already connected agents that don’t provide all mandatory capabilities will stay connected for up to 4 hours after adding capabilities to an agent pool. During that time they will be shown with a warning indicator on the “Agents” tab. In order to add capabilities to an existing pool, it is recommended to first add the capability to all connected agents and then edit the agent pool.
Pools with higher priority are utilized before pools with lower priority. If tests to be executed can be executed by agents from different pools, agents of the pool with the highest priority are requested. When scaling to meet demand, higher priority pools are scaled to their configured maximum before scaling lower priority pools.
You can change the priority of agent pools by dragging them on the “Configuration” tab. Pools that are higher on the list are prioritized over those below.
Agent pools can be deleted at will when they are no longer needed. It is recommended to stop all agents in the agent pool before deleting it.
Already connected agents will stay connected for up to 4 hours after deleting an agent pool. During that time they will be shown with a warning indicator on the “Agents” tab.
Agent auto scaling relies on auto scaling machinery of a compute platform regularly querying Gradle Enterprise for a pool’s desired size and starting/stopping agents to match the desired size.
The
https://«hostname»/api/test-distribution/agent-pools/«pool-id»/status
endpoint conveys a pool’s desired size at the moment, along with other information about the pool, as a JSON document.
Accessing the endpoint requires an access key provided via an
Authorization: Bearer «access-key»
HTTP header, with the user having the
Test Distribution
permission. It can also be accessed in a browser when signed in to Gradle Enterprise and having the
Test Distribution
permission.
To create an access key, log into Gradle Enterprise and go to
https://«hostname»/settings/access-keys
and click on the
Generate
button.
The following demonstrates using
curl
to access the endpoint:
$ curl -H "Authorization: Bearer «access-key»" https://«hostname»/api/test-distribution/agent-pools/«pool-id»/status
Which will produce output of the following form:
"id": "«pool-id»", "name": "Linux", "capabilities": [ "jdk=11", "os=linux" "minimumAgents": 1, "maximumAgents": 100, "connectedAgents": 25, "idleAgents": 9, "desiredAgents": 16
Auto scalers need only consider the
desiredAgents
field and adjust the number of running agents to match this number.
Gradle Enterprise Predictive Test Selection allows developers to get faster feedback by running only tests that are likely to provide useful feedback on a particular code change using a probabilistic machine learning model. It is available for Gradle and Apache Maven™ builds.
Builds that have enabled Predictive Test Selection connect to Gradle Enterprise to select relevant tests. Gradle Enterprise users must be granted the “Build scan view” access control role to be able to use Predictive Test Selection. For information on how to use Predictive Test Selection, please consult the Predictive Test Selection User Manual .
Gradle Enterprise comes in two distribution options. These are referred to as the Gradle Enterprise standalone distribution and the Gradle Enterprise Kubernetes distribution. You might notice that the two installation manuals ( standalone , Kubernetes ) are named accordingly.
To find out which installation you are using, you can check the name of the Helm chart you used to install Gradle Enterprise by e.g. looking at the output of
helm ls --namespace <the namespace where your gradle enterprise instance is installed>
. The Helm chart for your installation will be prefixed with "gradle-enterprise-standalone" if you are using the standalone distribution, whereas it will be prefixed only with "gradle-enterprise" if you are using the Kubernetes distribution.
The standalone distribution is an installation of Gradle Enterprise that runs on a single host, using K3s , a lightweight Kubernetes distribution. It is designed for administrators who want an "out-of-the-box" experience.
The Kubernetes distribution is an installation of Gradle Enterprise that is intended for use by organisations with existing Kubernetes infrastructure and administrators who are comfortable operating a Kubernetes cluster.
Many aspects of Gradle Enterprise’s behaviour can be configured via the Admin user interface as described above.
Gradle Enterprise can optionally have this configuration set without user intervention, by specifying the configuration to Helm during installation and upgrades. This allows scripted installations or installation by configuration management tools.
In addition, the current configuration can be exported and then re-imported later, allowing rollback or restoration of configuration changes.
The configuration takes the form of a yaml file, with an optional encryption key used to encrypt secrets. The expected yaml content of file is described by a schema .
Making changes to the unattended configuration will overwrite any configuration changes made in the user interface. If you make configuration changes in the user interface, be sure to update your unattended configuration so that important settings are not lost the next time the unattended configuration is applied. See How Gradle Enterprise determines the configuration it should use for more details.The easiest way to get a functional configuration yaml file is to configure Gradle Enterprise using the Admin UI, and then export the yaml file. You can download the Gradle Enterprise configuration file from a running installation by vising the Administration page , then going to Import/export and then Export .
You should then have a yaml file downloaded, and if you encrypted secrets in the file with a key, you will need to keep this key available to provide to Helm.
The Gradle Enterprise configuration file must be well-formed yaml and conform to a specific schema. There is a brief reference of some common options later in this guide.
When editing the file you can use the latest JSON schema for code completion and validation. You can also use schemastore support on your preferred editor.
In addition, the latest
Gradle Enterprise Admin CLI
tool can be used to validate a the file, by running the
config-file validate
command.
Below is a minimal example of a valid Gradle Enterprise configuration file. It must contain the configuration schema version and the hashed password of the system user.
version: 4
systemPassword: XXXXXXXXXXXXXX==
To hash the value for the system password, use the
Gradle Enterprise Admin CLI
config-file hash
command:
$ echo "secret-password" | gradle-enterprise-admin config-file hash -o secret.txt -s -
$ gradle-enterprise-admin config-file generate-key -o - > key.txt
$ echo "secret-password" | docker run --rm -i -v $(pwd)/key.txt:/key.txt \
gradle/gradle-enterprise-admin-cli config-file encrypt -k /key.txt -o - -s -
Upon startup, if Gradle Enterprise has been configured with an unattended configuration file, it will store this in the database and use its configuration immediately.
Otherwise it will use a previously stored configuration set by making changes in the Administration UI, or will generate a new one based on defaults.
A given configuration file will only be used once. This means that if a configuration file has been applied, and then later changes are made through the Administration UI, the configuration file will not be reapplied unless its content changes. This ensures that changes made through the UI persist and are not overwritten.
Updating the Gradle Enterprise configuration file and restarting the system will result in its configuration being imported. Any configuration changes made via the Admin UI since the last import will be overwritten. If the file is unchanged between system restarts, any configuration changes made via the Admin UI will be preserved.The JSON schema describes all configuration options. Some common settings are described in more detail here.
Additionally, you can learn more about what these configuration options do by reading above , and exploring the administration page of your Gradle Enterprise instance.
dailyMaintenanceTime
Every day, Gradle Enterprise runs maintenance operations on the database to keep things running smoothly. This maintenance temporarily effects Gradle Enterprise’s performance, so you should set this to a time of day (UTC) in which you anticipate low build scan ingest traffic.
network.additionalTrust
A newline-separated list of certificates which Gradle Enterprise should trust when communicating with servers using certificates not trusted by default, for example if they are signed by an internal CA.
network.proxy.protocol
The protocol used to connect to the proxy. Supported values are
http
and
https
, default value is
http
.
network.proxy.host
HTTP proxy host name.
network.proxy.port
HTTP proxy port.
network.proxy.excludedHosts
A comma-delimited list that controls what hosts should not be proxied. The list can contain individual host names as well as domain patterns (e.g. '*.internal') which match all hosts for a particular domain. Any requests sent to these hosts will be sent directly rather than being sent through the HTTP proxy.
network.proxy.auth.username
A username used to authenticate with the HTTP Proxy.
network.proxy.auth.password
A password used to authenticate with the HTTP Proxy.
email.administratorAddress
Some events related to Gradle Enterprise may warrant a notification to the administrators of your installation. For example, if your installation’s disk space is running low, or if a backup was created. The
email.administratorAddress
configuration value determines which email address such administrator notifications are sent to. Note that in order for Gradle Enterprise to send such emails, the other options under
email
need to be correctly filled in.
auth.anonymousPermissions
Determines the permissions of users of your Gradle Enterprise instance who are not logged in. For example, you may want only authenticated developers to be able to publish build scans, in which case you should not enable the
buildScanPublish
anonymous permission. On the other hand, you may want to allow anybody to administrate build cache nodes that are connected to Gradle Enterprise, even if they aren’t logged in, in which case you should allow the
cacheAdministration
anonymous permission.
auth.roles
Configures the roles that can be used to assign permissions to users, and how those roles are mapped from any external identity providers. For example, you could create a
superuser
role that grants all permissions. You can also configure the user-facing name and description of the roles here.
auth.external
Configures external identity providers, using either LDAP or SAML. For example, your organisation might use a Google or Microsoft product to manage permissions for all tools centrally and globally. You can configure
auth.external
in order to integrate Gradle Enterprise with your identity provider. This allows users to access Gradle Enterprise by clicking a button such as "Log in with SomeIdP".
backup.schedule
Can be set to one of
daily
,
weekly
or
cron
. The other properties to set under
backup
depend on which of these you choose for the schedule.
For a
daily
scheduled backup, you need to set the
dailyTimeOfDay
e.g.
04:00
.
For a
weekly
scheduled backup, you need to set
timeOfDay
e.g.
04:00
, and also
dayOfWeek
e.g.
sunday
.
For a
cron
scheduled backup, you need to set
cronExpression
to something like
0 1 * * 0
,
which translates to 1AM every Sunday
.
To configure Gradle Enterprise to store incoming Build Scan data in object storage, add the following to your configuration file:
If using a static Access Key ID / Secret Access Key pair, you should first encrypt the secret key . The configuration should then look like this:
config.yamlbuildScans:
incomingStorageType: objectStorage
You should increase the heap memory allocated to the Gradle Enterprise application. If you already have a heap memory setting, increase this by 2048. If you do not, set the value to 5632.
config.yamladvanced:
heapMemory: 5632
You will also need to increase Gradle Enterprise’s memory requests and limits by the same amount in your Helm values file:
values.yamlenterprise:
resources:
requests:
memory: 6Gi (1)
limits:
memory: 6Gi (1)
Releases prior to 2023.2 allowed specifying a prefix to use within a bucket when storing Build Scan data. This is now deprecated, and all Build Scan data will be stored under the prefix
build-scans
, which was the previous default value used if not specified.
For installations with significant Build Scan data stored under a custom prefix, it is possible to continue to use that prefix using an advanced app parameter:
config.yamladvanced:
params:
buildScanStorage.prefix: my/prefix
This override will be removed in a future release. Administrators using a custom prefix are encouraged to copy their data to the
build-scans
prefix and remove the override.
To migrate Build Scan data to the standard
build-scans
prefix, follow these steps:
Decide on a copying strategy. A basic approach suitable for < 10GB of data would just use the
AWS CLI s3 sync
command, something like
aws s3 sync --delete s3://example-bucket/custom-prefix s3://example-bucket/build-scans
.
This AWS resource
lists strategies suitable for transferring larger volumes of data. Ensure that the strategy chosen will allow deleting files from the destination if they are not at the source.
While the app is running, copy most data to the new location by running the copy process chosen.
If configuring through the UI, remove the
buildScanStorage.prefix
advanced parameter described above. Save and restart the app if prompted.
Stop the Gradle Enterprise by running the
Gradle Enterprise Admin CLI
system stop
command, or by manually scaling all deployments to zero.
Run the copy process again to sync any last additions and deletions.
If configuring through unattended configuration, remove the
buildScanStorage.prefix
advanced parameter described above and rerun
helm upgrade
. This should restart the app. Further details can be found in the “Changing configuration values” section of the
Gradle Enterprise Kubernetes Helm Installation Manual
for Kubernetes cluster installations or the
Gradle Enterprise Helm Standalone Installation Manual
for installation onto a single host.
If configuring through the UI, restart Gradle Enterprise by running the
Gradle Enterprise Admin CLI
system start
command, or by manually scaling all deployments back up to their original number of replicas.
Verify that data is in the expected place by viewing some recent Build Scan pages.
At this point, Build Scan data under the custom prefix can be deleted using
aws s3 rm --recursive s3://example-bucket/custom-prefix
or equivalent.
In releases prior to 2023.3, Gradle Enterprise connection settings for S3 object storage was configured by the Administration interface or via unattended configuration. From Gradle Enterprise 2023.3 onwards, object storage settings are configured as Helm values.
To migrate object storage configuration to Helm, follow these steps:
Add object storage settings to your Helm values file. See the Kubernetes Helm Chart Configuration Guide or Standalone Helm Chart Configuration Guide for details.
Redeploy Gradle Enterprise by running
helm upgrade
, see
Changing standalone configuration values
or
Changing Kubernetes configuration values
.
Verify that you can list and view new Build Scans.
If you were using unattended configuration to configure object storage previously, remove the configuration:
For version 8 configuration used by Gradle Enterprise 2023.3, remove the top-level
legacyObjectStorage
node.
For version 7 configuration used by Gradle Enterprise 2023.2, remove the top-level
objectStorage
node.
For configuration versions 5 and 6 used by Gradle Enterprise versions 2022.3-2023.1, remove the
buildScans.storage.s3
node.
Redeploy Gradle Enterprise as above.
If you use the Administration interface to configure object storage:
Export the current configuration from the Administration Import/export page.
Remove the object storage settings as in step 4.
Import the result via the Administration Import/export page.
Restart when prompted.
Verify that you can list and view new Build Scans.
You will need to know the AWS region that your Gradle Enterprise installation is running in.
If using the AWS web console:
Go to S3 in the AWS console
In the navigation pane, choose Buckets and then choose Create bucket .
Enter the name you want for your bucket e.g.
gradle-enterprise-build-scans
. Make sure the bucket is in the same region as your Gradle Enterprise installation. Leave the other settings as their default values.
Click Create bucket .
Alternatively, use the AWS command line utility :
$ aws s3 mb s3://«your-bucket-name»
The following policy allows access to the S3 bucket. Granting the policy to a user or role that Gradle Enterprise will access it as is a separate step.
If using the AWS web console:
Go to IAM in the AWS console
In the navigation pane, choose Policies and then choose Create policy .
Click on the JSON tab to define the policy using JSON directly.
Enter the following policy JSON, replacing
«your-bucket-name»
with the name of your bucket:
Click Next: Tags .
Add any tags that your organisation requires, and click Next: Review .
Enter a name for this policy e.g.
GradleEnterpriseBuildScanStorage
, and optionally also a description
Click Create policy .
the policy attached to the role of
enterprise
does not require
s3:DeleteObject
permission
the policy attached to the role of
enterpriseBackgroundProcessor
requires the
s3:DeleteObject
permission
If
enterpriseBackgroundProcessor
pod is
not
enabled in
values.yaml
:
the policy attached to the role of
enterprise
requires the
s3:DeleteObject
permission.
Go to IAM in the AWS console
In the navigation pane, choose Users and then choose Add users .
Enter a user name e.g.
gradle-enterprise-build-scans
.
Select Access key - programmatic access for the AWS credential type.
Click Next: Permissions .
Select Attach existing policies directly .
Select the IAM policy you created above , and no others.
Click Next: Tags * and add any tags that your organisation requires.
Click Next: Review , then Create user
At this point, you will be shown the access key credentials for your new user, the Access key ID and the Secret access key . Store these somewhere secure. They will be needed to configure Gradle Enterprise for S3 Build Scan storage.
Alternatively, use the AWS command line utility :
$ aws iam create-user --user-name "«your-user-name»"
$ aws iam create-access-key --user-name "«your-user-name»"
It is possible to add tags using the CLI, see the documentation .
The output will contain the access key credentials for your new user in the
AccessKeyId
and
SecretAccessKey
fields. Store these somewhere secure. They will be needed to configure Gradle Enterprise for S3 Build Scan storage.
Go to IAM in the AWS console
In the navigation pane, choose Roles and then choose Create role .
For the Trusted Entity type , choose AWS service , then EC2 for the Use case .
Click Next .
Find and select the IAM policy you created above .
If you are running Gradle Enterprise in Amazon EKS and wish to use
node-associated roles
, also add the built-in
AmazonEKSWorkerNodePolicy
and
AmazonEC2ContainerRegistryReadOnly
policies, and an applicable network policy. See
here
for full steps on finding these in the console.
Click Next .
Add a role name, e.g.
gradle-enterprise-build-scans
.
Add any tags that your organisation requires.
Click Create role .
Alternatively, use the AWS command line utility :
Create a file
ec2-role-trust-policy.json
and save it with the following content:
Run the following commands, using the ARN of the policy created above :
$ aws iam create-role \
--role-name "«your-role-name»" \
--assume-role-policy-document file://ec2-role-trust-policy.json
$ aws iam attach-role-policy \
--role-name "«your-role-name»" \
--policy-arn "«your-policy-arn»"
$ aws iam create-instance-profile \
--instance-profile-name "«your-role-name»"
$ aws iam add-role-to-instance-profile \
--instance-profile-name "«your-role-name»" \
--role-name "«your-role-name»"
It is possible to add tags using the CLI, see the documentation .
The service account name:
gradle-enterprise-app
The namespace that Gradle Enterprise is installed in.
The EKS cluster name.
The ARN of the policy created above .
Once you have these, perform the following steps:
Create an IAM OIDC provider for your EKS cluster if one doesn’t already exist.
Create an IAM role associated with the Gradle Enterprise service account and attach the IAM policy created above
. You will want to use the
--role-only
flag, since you will configure Gradle Enterprise’s service account to use the role via Helm.
AWS’s documentation
for the same process contains some more details.
Note the created role ARN.
Configure Helm with the necessary service account annotation and redeploy .
gradle-enterprise-config-schema-8.json ( SHA-256 checksum , PGP signature , PGP signature SHA-256 checksum )
gradle-enterprise-config-schema-7.json ( SHA-256 checksum , PGP signature , PGP signature SHA-256 checksum )
gradle-enterprise-config-schema-6.json ( SHA-256 checksum , PGP signature , PGP signature SHA-256 checksum )
gradle-enterprise-config-schema-5.json ( SHA-256 checksum , PGP signature , PGP signature SHA-256 checksum )
gradle-enterprise-config-schema-4.json ( SHA-256 checksum , PGP signature , PGP signature SHA-256 checksum )
gradle-enterprise-config-schema-3.json ( SHA-256 checksum , PGP signature , PGP signature SHA-256 checksum )
gradle-enterprise-config-schema-2.json ( SHA-256 checksum , PGP signature , PGP signature SHA-256 checksum )
gradle-enterprise-config-schema-1.json ( SHA-256 checksum , PGP signature , PGP signature SHA-256 checksum )
![]() |
失望的日光灯 · 校党委书记徐兰宾赴新疆克州考察对口援疆工作 4 月前 |
![]() |
谦虚好学的柚子 · java中双引号转义字符 - CSDN文库 5 月前 |
![]() |
风流倜傥的饭卡 · 思想史脉络下的《齐物论》-中国社会科学网 6 月前 |