Code Deployment
When working with GridGain, you may need to deploy user code to nodes. For example, you may need the code used in Distributed Computing.
In GridGain 9, when you deploy user code to the cluster, it is saved as a deployment unit. Deployment units have a unique ID and are immutable. When you need to update code version, you will need to deploy a new unit.
All interactions with deployment units are performed by using REST API. REST endpoints are available for deploying units, undeploying units, and checking deployment unit statuses either on node or across the whole cluster.
Deploying New Unit
To create a new deployment unit, send a request to the /management/v1/deployment/units/{unitId}/{unitVersion}
endpoint. You can deploy code to one node, and it will be propagated to the cluster as necessary, but generally it is better to provide the list of all nodes when deploying user code.
Below is the list of parameters for the endpoint:
Parameter | Type | Description |
---|---|---|
unitId |
path |
Required Unique unit ID. If a deployment unit with this ID does not exist, it is created. Otherwise, a new version is created instead. |
unitVersion |
path |
Required Unique version of the deployment unit. If a deployment unit with the specified UI and version already exists, HTTP 409 "Conflict" response is returned. |
deployMode |
query |
Defines how many nodes the unit will be deployed to. If set to |
initialNodes |
query |
The list of names of specific nodes to deploy the unit to. Cannot be used with the |
Getting Unit Information
Deployment unit information is available via multiple endpoints:
Getting Specific Unit Information
The /management/v1/deployment/node/units/{unitId}
and /management/v1/deployment/cluster/units/{unitId}
endpoints provide information about the deployment unit specified in the request, for the node or across the cluster respectively.
You can further narrow down the search by looking up only for specific versions or statuses.
Parameter | Type | Description |
---|---|---|
unitId |
path |
Required Unique unit ID of the deployment unit. |
version |
query |
Unique version of the deployment unit. If not specified, all versions of deployment unit will be returned. |
statuses |
query |
Statuses of the deployment units to return. Possible values:
If not specified, deployment units in all statuses will be returned. |
Getting Information for All Units
The /management/v1/deployment/node/units
and /management/v1/deployment/cluster/units
endpoints provide information about all deployments unit, for the node or across the cluster respectively. Optionally, you can search for only deployment units in a specific status.
Parameter | Type | Description |
---|---|---|
statuses |
query |
Statuses of the deployment units to return. Possible values:
If not specified, deployment units in all statuses will be returned. |
Undeploying Unit
When you no longer need a deployment unit version, send a request to the /management/v1/deployment/units/{unitId}/{unitVersion}
endpoint. When the cluster receives the request, it will delete the specified deployment unit version on all nodes. If the unit is used in a job, it will instead be moved to the OBSOLETE
status and removed once it is no longer required.
Parameter | Type | Description |
---|---|---|
unitId |
path |
Required Unique unit ID of the deployment unit to delete. |
unitVersion |
path |
Required Unique version of the deployment unit to delete. |
© 2024 GridGain Systems, Inc. All Rights Reserved. Privacy Policy | Legal Notices. GridGain® is a registered trademark of GridGain Systems, Inc.
Apache, Apache Ignite, the Apache feather and the Apache Ignite logo are either registered trademarks or trademarks of The Apache Software Foundation.