ID | IEP-52 |
Author | |
Sponsor | |
Created |
|
Status | DRAFT |
Currently, Apache Ignite is being shipped as a single monolith binary with lots of excess modules and libs, the majority of which are not required in most use case scenarios.
Also, current upgrade process is too tied to binary delivery, requiring users to copy the working directory, additional libs, and other configurations between version upgrades, which is rather error-prone.
This IEP targets to solve both problems the following way:
Final target – recreate binary delivery in a way, that will allow a user to upgrade Apache Ignite instance with only downloading a new binary and executing the same ignite command for the new version.
The binary delivery is narrowed down to a single ignite
command-line utility which is the essential toolchain for installing ignite modules, managing classpath, and node lifecycle.
Correspondingly update RPB/DEB packages to include the ignite
CLI utility
Replace the shipping of all Ignite libs with Maven-powered dependency management:
mvn:org.apache.ignite:ignite-core:2.9.0
)mvn:org.apache.ignite:ignite-core:2.9.0, mvn:org.apache.ignite:ignite-indexing:2.9.0, mvn:org.apache.ignite:ignite-spring:2.9.0
]For well-defined and predictable library management, the utility has a number of indirections when resolving work, configuration, and library storage paths. The resolution path depends on whether ignite
was configured locally or globally for a machine/container.
Ignite installation from a user perspective narrows down to a single package containing the command-line tool install via one of the package managers (apt-get, rpm, homebrew) or a manual download. Once the command-line tool is installed, further modules management is performed from the tool.
The utility version directly matches the server and client library versions which this utility will manage, i.e. ignite v.${version}
will use org.apache.ignite:ignite-core:${version}
, org.apache.ignite:ignite-spring.${version}
and so on.
In order to update Ignite, a user updates the single ignite package, which will later take care of updating installed modules. A user can easily switch between ignite
versions using regular update-alternatives (or similar) tools.
To differentiate between local and global configuration mode, the utility first attempts to read the .ignitecfg
file in the user local directory ${user.home}
. If this file exists, then the library and work directory paths are defined in there. If the file does not exist, the utility attempts to read the .ignitecfg
file in a predefined system folder (e.g. it may be /etc/ignite
for Linux systems, /Library/Ignite
for MacOS, Program Files\Ignite
for Windows). If this file exists, then the library and work directory paths are defined there. If none of the files exist, then the library and work directories default to ${user.home}/ignite-bin
and ${user.home}/ignite-work
.
file = if ${user.home}/.ignitecfg exists ${user.home}/.igniterc else if ${system.default}/.ignitecfg exists ${system.default}/.ignitecfg else None if file is None { libsDir = ${user.home}/ignite-bin workDir = ${user.home}/ignite-work } else { libsDir, workDir = read from file }
Modules and external libraries can be installed and uninstalled using ignite install
or ignite uninstall
commands. The command accepts a built-in alias for one or many Maven coordinates, maven coordinates, or a URI for external resource. The set of installed modules is written to a config file ignite.modules
located in the ${workDir}
folder, resolved previously (the configuration file is updated whenever a module is installed or uninstalled). Upon module installation, ignite
resolves corresponding artifacts and its dependencies from Maven and places them to the ${libsDir}/${version}
folder. Additionally, ignite
pre-builds and saves a classpath formed by all installed modules in a separate file for faster node start-up.
A default directory structure of installing Ignite 3.0.1 and then upgrading to Ignite 3.0.2 will look as follows:
/ | +---+Library/Ignite ignite | | | | +----3.0.1 | | | | | | | +----ignite-3.0.1 | | | | | +----3.0.2 | | | | | +----ignite-3.0.2 <----------+ | +----Users/John | +----ignite-bin | | | +----3.0.1 | | | | | +----ignite-core-3.0.1.jar | | | | | +----plugin-cli-0.0.1.jar | | | +---+3.0.2 | | | +----ignite-core-3.0.2.jar | | | +----plugin-cli-0.0.1.jar | +----ignite-work | +----ignite.modules={ignite-core,plugin-cli:0.0.1} | +----ignite.classpath={ignite-core-3.0.2.jar:plugin-cli-0.0.1.jar}
Unlike 2.x ignite.sh
script, the ignite run
command will start Ignite node in a separate process without attaching it to the current terminal. This is done to simplify the node management and support interactive REPL mode for ignite
. If no modules are installed (the default set is missing), the run command will report an error asking the user to install the modules first (this is done intentionally to prevent accidental downloads and internet access attempts on production servers).
Starting a new Ignite node may require some local initialization to have an ability to set up node-local properties and create local metastorage. The initialization will be performed via a local command and will take the node consistent ID. Similarly, the ignite run
command will require the node consistent ID. If the node metastorage is not initialized, the run command will initialize it with defaults and run the node; if it is initialized, the node will be started with existing metastorage.
Commands in the utility can be split into two groups: local commands (such as ignite run, ignite install), which can be executed without connection to a running cluster, and cluster commands (such as ignite baseline), which require connection to one of the ignite nodes. ignite
cluster commands must have a straightforward and unambiguous mapping to the cluster management HTTP REST endpoints. With such a strict mapping we can achieve:
ignite baseline
command)curl
)The ignite
utility should be extensible and allow plugging additional commands (both cluster and local). Upon the utility startup, it will scan the ${libsDir}/${version}
folder for files with -cli
suffix and search such files for command definitions. This allows a user to install additional commands using the same ignite install
command.
After installing ignite, a user will still need one-time access to the internet to download the rest of the libraries. This, however, carries low risk as the initial setup can be performed either via curl <link_to_ignite> && ./ignite install
command or a custom packed .sh script which will execute the install
command after download.
Development list: IEP-52: Binary Delivery & Upgradability Enhancements
n/a
n/a