...
IgniteClassPath properties:
Name - unique string identifier (app_v1, 01_07_2025, etc).Status - lifecycle status: CREATING, READY, REMOVING, etc.Set of libs and resources associated with IgniteClassPath.Version - version of ICP in the form of x.y.z (1.0.3, for example).
max version can be referenced as "latest".- Each instance available on each Ignite node, maybe on demand.
- Can be created and removed runtime - without any restarts.
- Instances independent from each other.
...
$ ./bin/flink run -C /path/to/dependency.jar -c com.example.MyJob my-flink-job.jar
Design
There are two perspectives for ICP operations: a user perspective and a cluster perspective.
The following operations with ICP must be implemented:
- create - when jars for ICP stored on control.sh running node.
- register - when jars for ICP exists on all server nodes, already.
- check - for registered ICP, check that
- safe remove from the cluster. Will wait until all code running on the top of ICP stops.
- unsafe remove. Will forcefully remove ICP regardless of code currently running.
- get ICP status in the cluster: list of all deployment units in the cluster with their statuses (will be defined below).
- get ICP status on a specific node. The main scenario for this operation is troubleshooting.
From a cluster perspective a deployment unit could be deployed on the cluster, but it could be not deployed on a particular node. So additional operation is required: create ICP on the target node (on demand).
Directories
All ICP must be placed in the ICP base directory which is a subdirectory under Ignite work directory:
<ignite_work_dir>/icp
For each ICP a directory should be created under the base directory. The name of this directory must be the same as ICP name and a nested directory for a particular version must be created.
Example:
- icp
- foo.example.job
- 1.0.0
- 1.0.1
- foo.example.task
- 1.0.0
- 2.0.0
|
Operations
create
- Send all jars to choosen server node:
- Select random server node - deploy coordinator.
- Initiate sending jar files to deploy coordinator.
- Deploy coordinator check metastorage for the ICP (name, version) record.
- if not exists then creates: (name, version, self_node_id, CREATING).
- if exists and node alive then return "already exists" to the user.
- if status not CREATING then return "already exists" to the user.
- remove existing record and create new: (name, version, self_node_id, CREATING).
- Deploy coordinator stores files into some temporary directory.
- After uploading complete, start the "Upload new ICP" distributed process.
- Sent
UploadNewICP message by discovery. - On receive
UploadNewICP message each server node request ICP files one by one from the deployment coordinator.- File download protocol used to receive file. Same protocol used during snapshot preload.
- Send
UploadNewICPDone single message on completion or fail. - Deploy coordinator on receiving all single messages completes "Upload new ICP" process with the corresponding status.
- If "Upload new ICP" succeed then change metastorage record status to READY, otherwise remove it.
- Return status of "Upload new ICP" process to the user.
register
- Send command to choosen server node
- Select random server node - register coordinator.
- Register coordinator check metastorage for the ICP (name, version) record.
- if not exists then creates: (name, version, self_node_id, CREATING).
- if exists and node alive then return "already exists" to the user.
- if status not CREATING then return "already exists" to the user.
- remove existing record and create new: (name, version, self_node_id, CREATING).
- Register coordinator starts "Register new ICP" distributed process.
- Sent
RegisterNewICP message by discovery. - On receive
RegisterNewICP message each node checks local files.- Get file list.
- Calculate consistent control sum for each file.
- Send
RegisterNewICPDone single message on completion or fail.
- Register coordinator on receive all single messages checks that all lists and control sums are the same.
- OK if true, FAIL otherwise.
- If "Register new ICP" succeed then change metastorage record status to READY, otherwise remove it.
- Return status of "Register new ICP" process to the user.
check
Invoke same procedure as register but without metastorage registration.
ICP must exists in cluster, already.
safe remove
- Send command to random server node.
- Update ICP status in metastorage.
- Return result to the user.
- When some code tries to start on top of ICP Ignite must check ICP status and throw exception if status not READY.
- Each server node must track usage count for ICP:
- When some user code starts - increase usageCount.
- decrease usageCount on finish.
- Eventually usageCount will become zero. Node must clean local resources then.
unsafe remove
- Send command to all server node.
- Remove ICP status in metastorage.
- Remove all files from local disk.
- Return result to the user.
Risks and Assumptions
We assume that p2p and deployment SPI will be removed from Ignite.
...
- https://spark.apache.org/docs/latest/submitting-applications.html
- https://tomcat.apache.org/tomcat-11.0-doc/deployer-howto.html
- https://nightlies.apache.org/flink/flink-docs-stable/docs/ops/debugging/debugging_classloading/
- https://nightlies.apache.org/flink/flink-docs-release-2.2/docs/ops/rest_api/
- IEP-103: Code Deployment
Tickets
| Jira |
|---|
| server | ASF JIRA |
|---|
| columnIds | issuekey,summary,issuetype,created,updated,duedate,assignee,reporter,priority,status,resolution |
|---|
| columns | key,summary,type,created,updated,due,assignee,reporter,priority,status,resolution |
|---|
| maximumIssues | 20 |
|---|
| jqlQuery | labels = IEP-144 and type != Epic |
|---|
| serverId | 5aa69414-a9e9-3523-82ec-879b028fb15b |
|---|
|
// Links or report with relevant JIRA tickets.