From OpenDCIM Wiki
Jump to: navigation, search

Repository Synchronization

A new feature introduced in version 4.0 of openDCIM is the ability for users to share their templates and images of systems with other users throughout the world and in a somewhat anonymous fashion. (Only the administrator of the repository knows who is submitting which templates, so if XYZ Corp wants to help, but not publicly acknowledge that they are helping with openDCIM, that information will remain private)

Flowchart

As you can see from the flowchart to the right, there are several stages to the script that is run for synchronization (repository_sync.php). There are a few requirements in order to make the current version work.

Requirements

  • The server running openDCIM must have an active internet connection - at minimum, it must be allowed to connect via SSL/HTTPS (port 443) to repository.opendcim.org. We hope to have a batch/client proxy version available in future versions, but didn't want to hold off on this feature while we tried to find the best method to accomplish it.
  • In order to share your templates to the repository, you must obtain an API Key from a repository administrator (best mechanism is to request via email to scott@opendcim.org)
  • All templates are currently in English units of measurement and English language. Future enhancement will be to automatically convert between your local installation and the repository.
  • All pictures must be free of any restriction from sharing
  • Templates must be for a base model with no expansion cards installed

Frequency

The repository_sync.php script is designed to be run as a cron job, with a frequency of once per day. If you set it to run every 5 minutes, we will add a firewall rule to the server so that you can no longer communicate with it. It has already happened once, and I am sure will happen, again. We have a finite amount of bandwidth on our hosting site - plenty if people adhere to the once a day rule, but not if dozens of folks request the same information every few minutes.

Steps

The order of operations shown is actually for post-4.0 releases. In the 4.0.x release numbers, the Push Templates happens first.

Synchronize Manufacturers

The first step is to make sure that for the most basic component of the installation, we are speaking the same language. That means making sure that your list of manufacturers has the same key (Global_ID) as the repository. The script will download a list of all manufacturers and do a case insensitive search in your local db for that same name - if you have different punctuation, or added in other elements (like adding , Inc.) then they won't match. If it finds the name locally, it will update the Global_ID to match the repository and any changes at the global level will automatically update your Manufacturer Name. If the name is not found locally, it will be added and the Global_ID will be set to the repository ID.

Pull Subscriptions

The second step is to pull any subscriptions that are marked locally. This is done by selecting a manufacturer (in your local installation) and selecting the "Subscribe to Repository" checkbox and saving your changes. All manufacturers that have the SubscribeToRepository flag and have the Global_ID synchronized to the repository will have the template list pulled down from the repository to synchronize. Remember that both of these conditions must be true.

Each template retrieved will be compared against the local db. If there is a template that was previously retrieved, it will already have a Global_ID set. If that template has the KeepLocal checkbox set on it, any changes from the repository for that template will be ignored, otherwise the local template information will be overwritten by the repository version. If the repository template has no local equivalent, it is simply added to the local database.

Push Templates

This requires an API Key to complete. If you have not set a valid API Key in the Configuration section, this subsection will not even attempt to execute. Additionally, only templates that have been saved with the "Share to Repository" checkbox enabled and that have a Synchronized Manufacturer Global_ID set, will be sent. The script will iterate through all templates checked for sharing and submit them to a queue on the repository.

Once templates have been submitted to the queue, one of the Repository Administrators will have to log in to the administrative interface and check the template for accuracy and completeness. If the template submission is approved, it will become available to all other clients the next time that they run the synchronization script. Whether the template is accepted or rejected, the submitter will receive no notification.