This documentation is for WSO2 Private PaaS 4.0.0. View documentation for the latest release.
Artifact Distribution Coordinator - WSO2 Private PaaS 4.0.0 - WSO2 Documentation
                                                                                                                                                                                                                                                                                                                                                                                                           
||
Skip to end of metadata
Go to start of metadata

An artifact is a deployable unit that is supported by a specific Cartridge type (e.g., a PHP file in a PHP Cartridge,  a web app ( .war ) in an Application Server Cartridge etc.). Artifact Distribution Coordinator (ADC) is responsible for distributing artifacts among the cartridge instances. The artifact distribution process is referred to as Deployment Synchronization.

Deployment synchronization

Users in the Private PaaS environment typically upload their artifacts to a remote Git repository, which is specified at the time of subscribing to a cartridge. The deployed artifact must be synchronized from the Git repository across the relevant cartridge instance nodes to deploy the relevant artifact in the relevant cartridge instance node. Deployment Synchronization refers to the latter mentioned synchronization process. While, the Deployment Synchronizer is the component that provides this capability. Initially, the deployment synchronization process will take place automatically at the time of subscribing to a cartridge. However, after subscribing to a cartridge there may be situations where the artifacts in the Git repository and the cartridge differ due to one of the following reasons:

  • Artifacts being updated due to a one-off reason in the Git repository.
  • Artifacts being continuously updated in the Git repository.
  • Artifacts in a instance being updated and auto commit being enabled. 

In such instances it is important that all the changes made in the Git repository are propagated into the respective cartridge. Deployment Synchronization can be done either automatically or manually.

Automated Artifact Update

A Webhook needs to be added to the remote Git repository for the deployment synchronization process to take place automatically. The diagram below explains the process involved in uploading an artifact to a cartridge instance automatically using a webhook. 

 

When a tenant user needs to upload an artifact, they will push the artifact into their remote Git repository by issuing a git push. This will make the GitRepo send a "push" event to Stratos Manager.  When a git push triggers the ADC, it will publish a "Artifact Update" event to the “Instance Notifier” topic, which is within the Message Broker. Thereafter, the relevant cartridge instances will subscribe to the Artifact Update  message and update its artifacts by  issuing a git pull to  the tenant user's remote Git repository.   

Manual Artifact Update

The diagram below explains the flow involved in uploading an artifact to a cartridge instance manually:

When a tenant user needs to upload an artifact, they will initially issue a git commit to update their local repository and then they will push the artifact into their remote Git repository by issuing a git push. Thereafter, the tenant user will carryout the deployment  synchronization process manually using one of the following methods: CLI tool, Private PaaS Console (UI) or REST API. This will trigger the "Artifact Update" event to be published to the "Instance Notifier" topic, which is within the Message Broker. Thereafter, the relevant cartridge instances will subscribe to the "Artifact Update" message and update its artifacts by  issuing a git pull to the tenant user's remote Git repository.

Auto Commit

Generally, upstream commits from the instance to the Git repository will not take place. However, if Auto Commit is enabled, the instance will automatically push commits to the respective remote Git repository. Auto Commit is an optional feature.

Single tenant and multi-tenant cartridges can be present in any of the following cartridge types: Data cartridge, Framework cartridge and Application cartridge. If required, Auto Commit can only be enabled for single tenant framework cartridges or multi-tenant framework cartridges, as application cartridges and data cartridges do not use Git repositories. In single tenant cartridges, Auto Commit is enabled at the time of subscribing to a cartridge instance. Therefore, for a single tenant framework cartridge based on the mode of subscription, Auto Commit can be enabled as follows:

Subscription ModeMethod of Enabling Auto Commit
Stratos Manager Console (UI)By checking the  Auto Commit  checkbox.
CLIBy specifying the  -cm  flag in the CLI command.
REST API By specifying the following in the REST API request payload:
"commitsEnabled" : "true" ,

In multi-tenant cartridges, Auto Commit is enabled at the time of deploying the service. Therefore, if Auto Commit needs to be enabled for a multi-tenant framework cartridge, it needs to be specified in the cartridge definition JSON as follows: 

    {
     "name": "payload_parameter.COMMIT_ENABLED",
     "value": "true"
    }

 

  • No labels