The Server Deployment Package (SDP) is the implementation of Perforce's recommendations for operating and managing a production Perforce Helix Core Version Control System.
The SDP provides a set of management scripts for operating various Perforce Helix Core topology components, such as:
For p4d in particular, the SDP provides an implementation of best practices suited for production environments, such as performing daily offline checkpoints with zero downtime, rotating logs and journals routinely. The SDP provides optimized init scripts that do database sanity/safety check before starting the server. Init scripts support both SysV and systemd init mechanisms.
The SDP supports a variety of methods for achieving high availability that benefit simple, single-server environments and sophisticated global enterprise environments, and all in between. Standardized and documented recovery procedures, offline databases, and optional replication (made easier with the SDP) all make HA easier to achieve.
Just as with HA, the SDP makes it easier to implement robust, reliable DR strategies.
The SDP makes upgrades of Helix server products fast and easy, regardless of the scale of your environment. By taking advantage of the offline database structure, the SDP enables upgrades with just a few minutes of downtime (enough to do a journal rotation).
The p4d executable, without any configuration, is optimized for evaluation and demonstration purposes. While it has many features that can make it reliable and robust, many of those features must be configured. The SDP is intended to be used for production environments or more realistic Proof of Concept installations.
See the Helix Installer which makes quick work of installing the SDP for PoC evaluation with a production-like setup, complete with the Sample Depot training data set.
The SDP also maintains, on an ongoing basis, a set of best-practices configuration settings (e.g. 'configurables' and environment settings) suited to production environments, which often differ from p4d defaults.
The SDP provides a standard structure for operating Perforce that is optimized for performance, scalability, and ease of backup. The SDP Guide includes documentation that promotes volume layout and storage architecture best practices.
To simplify backup, all digital assets are in a single directory. Live databases that cannot be backed up live in another, and active log files in another. For any scale environment, this makes it easy to back up the server's critical data. For larger scale environments, these directories become storage volume mount points, with the layout promoting best performance and data safety.
In addition to the basics, the SDP provides structure, standards, guidance, and automation that greatly simplify deployment and management of sophisticated Helix global topologies. For example, the SDP includes tools that greatly simplify complex tasks such as creating new replicas, backing up edge servers without down time, etc.
The SDP supports operation of multiple instances of Helix on a machine, allowing each instance to have differing configuration, e.g. different:
The SDP provides standard mechanism for defining a controlled shell environment. This benefits p4d and other Perforce software products directly, and also provides good examples of controlling the environment for supporting automation.
The SDP defines a standard for installing and configuring derived APIs. For example, Python is built with P4Python in /p4/common/python, and Perl with P4Perl in /p4/common/perl.
Many Perforce customers use the SDP as-is. Others benefit by incorporating concepts and ideas from the SDP into their own environments, e.g. for development of custom policy enforcement triggers, systems integrations, promoting or enforcing local naming conventions, etc.
The Helix Management System (HMS) is the latest addition to the SDP, and is included with the SDP. HMS provides:
When deployed by Perforce Consulting, the core functionality of the SDP (including init scripts, offline checkpoint mechanism, and backup-related scripts) are officially supported by Perforce Support. Also, using the SDP with its standard structure makes your environment easier to Support. Note that supplemental scripts, such as Helix Management System (HMS) and various maintenance scripts included with the SDP are supported by Perforce Consulting only.
The SDP is open source software (see the LICENSE), and accepts contributions (pending code review) from the user community.
Perforce Jobs are used to file bugs and request enhancements to the SDP. The list of jobs (other than closed ones) can be viewed here.
You can see all jobs (including closed ones if desired) from the command line interface. Connect to The Workshop and run the <code>p4 jobs</code> command, something like this:
p4 jobs -l -e "Project=perforce-software-sdp ^Status=closed"
While there is currently no formal roadmap for the SDP, it is actively maintained and continues to evolve alongside P4D and other Helix Core components it manages. Jobs are occasionally reviewed and addressed as time allows for consultants and contributors, sometimes driven by customer-funded consulting projects.
Contributions to the SDP are most welcome! Note that contributing requires a basic user knowledge of working with Perforce.
For contributing small changes, contribute by shelving changelists to the 'dev' branch your workspace.
All registered Workshop users have open access (but not write) to the SDP dev branch. This allows shelving (but not submitting) updates to the SDP dev branch path:
//guest/perforce_software/sdp/dev/...
To contribute by shelving, create a workspace that maps that path, named something like 'your_user.your_hostname.sdp'. Make your changes in that workspace, provide a good changelist description, and include a <code>#review</code> tag in your changelist description.
When you are ready, shelve the changelist. Perforce Consultants will review the change, and either incorporate it or provide feedback. Be sure to provide a detailed change description, and don't forget include the <code>#review</code> tag in your changelist description to initiate a Swarm pre-commit code review.
Optionally, you may also branch the SDP dev branch, or some subset of it, into your own guest area. Creating a branch spec is recommended for this purpose, e.g. with a branch spec like this:
Branch: your_name-sdp
Owner: your_name
Description:
SDP Updates by your_name.
Options: unlocked
View:
//guest/perforce_software/sdp/dev/.. //guest/your_name/sdp/dev/...
If you branch a subset, maintain the full path structure (as in the example above), so you can easily expand the scope of what you branched initially at some later date.
Edit, test and submit changes in your branch. Keep your code up to date with other changes by merging down from the shared dev branch to your dev branch, e.g. by doing:
p4 merge -b your_name-sdp
... followed by the usual resolve and submit.
When you'e ready to copy your versions up to our dev branch, do like so:
p4 change
p4 copy -c YourCL -r -b your_name-sdp
Be sure that your changelist has a clear and accurate description, and that the description contains a <code>#review</code> tag on a line by itself. That will trigger a code review process when you shelve the change, like so:
p4 shelve -c YourCL
Perforce Consultants will review the change, and either incorporate it or provide feedback. Be sure to provide a detailed change description, and don't forget include the <code>#review</code> tag in your changelist description to initiate a Swarm pre-commit code review.
In line with the "Version Everything" mindset, the SDP itself should be versioned in your environment. The best way to version the SDP is to do a "Tight Ship" installation, using the Helix Management System (HMS) tight ship setup script, hms_ts_setup.sh.
This script, which is included in the SDP, initializes a separate <code>/p4/hms</code> instance of the SDP to manage the SDP. It will get you started on the path to enterprise-grade Helix Core server management. It creates an initial workspace for managing the SDP files, creates a connection to The Workshop, and enables a 'fetch' and 'merge' workflow to use the power of Perforce merging to greatly simplify taking future updates to the SDP.
When Tight Ship management is used, we recommend deploying an optional Swarm instance for the hms instance, to provide the usual Swarm benefits (code review, email notification, transparency of changes, etc.).
If you have an earlier version of the Server Deployment Package (SDP) installed and are not using Tight Ship style of management, you'll want to be aware of the <code>-test</code> flag to the SDP setup script, <code>mkdirs.sh</code>. The following update instructions assume a simple, single-server topology. (For older SDP installations, this path may be <code>/depotdata/sdp</code>.)
Get the new software from The Workshop, which you'll find in the form of a SDP.Unix.*.tgz zipped tar file. Put the tar file in the <code>/hxdepots</code> folder on your server. BE SURE TO MOVE THE OLD <code>/hxdepots/sdp</code> folder aside first if it is there, e.g. to <code>/hxdepots/sdp.old.2014-10-08</code>.
Then unpack it like this:
tar -xzvpf SDP.Unix.2017.5.####.tgz
cd /hxdepots/sdp/Unix/setup
Modify the mkdirs.sh script to suit your environment (possibly borrowing values from your old <code>mkdirs.sh</code> script).
Then run it:
mkdirs.sh 1 -test
That'll do a mock install, creating a <code>/tmp/p4</code> structure, with folders like <code>/tmp/p4/common/bin</code> and <code>/tmp/p4/1/bin</code>. The output will suggest some <code>diff -r</code> commands to run to to view the diffs and apply updates manually, being careful not to lose any customizations or local configuration changes you may have made.
If the SDP itself is versioned in Perforce in your environment, you can also put the new things from /tmp/p4 into your Perforce server where the SDP is. Commonly, there is a branch for receiving pristine updates of the generic SDP, e.g. 'p4c', which allow you to use Perforce merging to merge update into your local SDP mainline.
Contact Perforce Consulting Services to ask about engaging professional services to upgrade the SDP for you.
A few quick things to be aware of:
The old <code>p4_1_init</code> script (more generically <code>p4_instance_init</code>) was renamed to <code>p4d_1_init</code>. This will require updates to init script or symlink, e.g. in <code>/etc/init.d</code>.
Once you upgrade p4d to 2014.1+, you can do away with the SDP trigger that updates depot spec map fields. You can clear the <code>Map:</code> fields of depots, and use the <code>server.depot.root</code> configurable. Going forward, you'd only use <code>Map:</code> fields for depots that really do require a unique path, e.g. archive depots.
The SDP structure enables two major views of a Perforce server, the system administrator/storage architect view, and the application administrator view. THe system admin sees this structure:
/hxdepots
/hxmetadata1
/hxmetadata2
/hxlogs
System administrators know they need to backup <code>/hxdepots</code>. Backing up <code>/hxlogs</code> is optional, and /hxmetadata1 & /hxmetadata2 are to be avoided by backup utilities, virus scanners, and anything else that might touch files in that area. This view is designed for optimizing for performance, as each of those folders has different performance profiles and usage patterns demanded by p4d. This view is not concerned with how many instances there are, or how they vary.
Application administrators (Perforce Admins), though a structure of symlinks, see Perforce from a view like this:
/p4/1/bin
/p4/1/depots
/p4/1/root
/p4/1/tmp
/p4/common/config
/p4/common/bin
/p4/ssl
This structure illustrates an instance named '1' (it need not be numeric), and a /p4/common area containing files common to all instances. Each of those folders is physically stored under an appropriate storage folder or volume as defined in the system admin view above.
The <code>/p4/instance/bin</code> folder defines which Perforce products are active for that instance on the current machine (p4d, p4broker, p4p, etc.). The root folder contains P4ROOT, while depots contains archive files.
There are two flavors of the SDP, Unix and Windows. Both are available in the same folder structure in the Workshop.
An automated regression test suite and pre-commit code review processes help ensure code quality.
What is the Server Deployment Package (SDP)? === Overview --- The Server Deployment Package (SDP) is the implementation of Perforce's recommendations for operating and managing a production Perforce Helix Core Version Control System. Simplified Management --- The SDP provides a set of management scripts for operating various Perforce Helix Core topology components, such as: * **p4d** - Helix Core Version Control System, including master/commit servers, replicas, and edge servers. * **p4broker** - A topology component of Helix Core * **p4p** - Perforce Helix Proxy * **p4dtg** - Perforce Defect Tracking Gateway * and others ... For **p4d** in particular, the SDP provides an implementation of best practices suited for production environments, such as performing daily _offline checkpoints_ **with zero downtime**, rotating logs and journals routinely. The SDP provides optimized init scripts that do database sanity/safety check before starting the server. Init scripts support both SysV and systemd init mechanisms. High Availability (HA) --- The SDP supports a variety of methods for achieving high availability that benefit simple, single-server environments and sophisticated global enterprise environments, and all in between. Standardized and documented recovery procedures, offline databases, and optional replication (made easier with the SDP) all make HA easier to achieve. Disaster Recovery (DR) --- Just as with HA, the SDP makes it easier to implement robust, reliable DR strategies. Fast and Safe Upgrades --- The SDP makes upgrades of Helix server products fast and easy, regardless of the scale of your environment. By taking advantage of the offline database structure, the SDP enables upgrades with just a few minutes of downtime (enough to do a journal rotation). Production Focus --- The p4d executable, without any configuration, is optimized for evaluation and demonstration purposes. While it has many features that can make it reliable and robust, many of those features must be configured. The SDP is intended to be used for production environments or more realistic Proof of Concept installations. See the [Helix Installer](https://swarm.workshop.perforce.com/projects/perforce_software-helix-installer) which makes quick work of installing the SDP for PoC evaluation with a production-like setup, complete with the Sample Depot training data set. Best Practice Configurables --- The SDP also maintains, on an ongoing basis, a set of best-practices configuration settings (e.g. 'configurables' and environment settings) suited to production environments, which often differ from p4d defaults. Optimal Performance, Data Safety, and Simplified Backup --- The SDP provides a standard structure for operating Perforce that is optimized for performance, scalability, and ease of backup. The SDP Guide includes documentation that promotes volume layout and storage architecture best practices. To simplify backup, all digital assets are in a single directory. Live databases that cannot be backed up live in another, and active log files in another. For any scale environment, this makes it easy to back up the server's critical data. For larger scale environments, these directories become storage volume mount points, with the layout promoting best performance and data safety. Sophistication Simplified --- In addition to the basics, the SDP provides structure, standards, guidance, and automation that greatly simplify deployment and management of sophisticated Helix global topologies. For example, the SDP includes tools that greatly simplify complex tasks such as creating new replicas, backing up edge servers without down time, etc. Multi-Instance Management --- The SDP supports operation of multiple instances of Helix on a machine, allowing each instance to have differing configuration, e.g. different: * versions of software components (p4d, p4broker, etc.) * case sensitivity setting (sensitive/insensitive) * Unicode setting (enabled/disabled) Shell Environment Management --- The SDP provides standard mechanism for defining a controlled shell environment. This benefits p4d and other Perforce software products directly, and also provides good examples of controlling the environment for supporting automation. Perforce Automation Standards --- The SDP defines a standard for installing and configuring derived APIs. For example, Python is built with P4Python in /p4/common/python, and Perl with P4Perl in /p4/common/perl. Stock vs. Custom SDP --- Many Perforce customers use the SDP as-is. Others benefit by incorporating concepts and ideas from the SDP into their own environments, e.g. for development of custom policy enforcement triggers, systems integrations, promoting or enforcing local naming conventions, etc. Helix Management System --- The Helix Management System (HMS) is the latest addition to the SDP, and is included with the SDP. HMS provides: * Helix Topology Definition Standard * Centralized Helix Management * Tight Ship Management of SDP in a global topology * Automation of Failover Execution (Human Initiated) * Simplified Topology-Wide Update/Upgrade (future, not yet implemented) Supported Open Source Software --- *When deployed by Perforce Consulting*, the core functionality of the SDP (including init scripts, offline checkpoint mechanism, and backup-related scripts) are officially supported by Perforce Support. Also, using the SDP with its standard structure makes your environment easier to Support. Note that supplemental scripts, such as Helix Management System (HMS) and various maintenance scripts included with the SDP are supported by Perforce Consulting only. The SDP is open source software (see the [LICENSE](https://swarm.workshop.perforce.com/projects/perforce-software-sdp/files/main/LICENSE)), and accepts contributions (pending code review) from the user community. Bugs, Enhancements, and Future Plans === Perforce Jobs are used to file bugs and request enhancements to the SDP. The list of jobs (other than closed ones) can be viewed [here](https://swarm.workshop.perforce.com/projects/perforce-software-sdp/jobs "SDP Open Jobs"). You can see all jobs (including closed ones if desired) from the command line interface. Connect to The Workshop and run the <code>p4 jobs</code> command, something like this: ``` p4 jobs -l -e "Project=perforce-software-sdp ^Status=closed" ``` While there is currently no formal roadmap for the SDP, it is actively maintained and continues to evolve alongside P4D and other Helix Core components it manages. Jobs are occasionally reviewed and addressed as time allows for consultants and contributors, sometimes driven by customer-funded consulting projects. Contributing === Contributions to the SDP are most welcome! Note that contributing requires a basic user knowledge of working with Perforce. Contributing by Shelving (Small Changes) --- For contributing small changes, contribute by shelving changelists to the 'dev' branch your workspace. All registered Workshop users have **open** access (but not **write**) to the SDP dev branch. This allows shelving (but not submitting) updates to the SDP dev branch path: ``` //guest/perforce_software/sdp/dev/... ``` To contribute by shelving, create a workspace that maps that path, named something like '*your_user*.*your_hostname*.sdp'. Make your changes in that workspace, provide a good changelist description, and include a <code>#review</code> tag in your changelist description. When you are ready, shelve the changelist. Perforce Consultants will review the change, and either incorporate it or provide feedback. Be sure to provide a detailed change description, and don't forget include the <code>#review</code> tag in your changelist description to initiate a Swarm pre-commit code review. Contributing by Branching (Bigger Changes) --- Optionally, you may also branch the SDP dev branch, or some subset of it, into your own guest area. Creating a branch spec is recommended for this purpose, e.g. with a branch spec like this: ``` Branch: your_name-sdp Owner: your_name Description: SDP Updates by your_name. Options: unlocked View: //guest/perforce_software/sdp/dev/.. //guest/your_name/sdp/dev/... ``` If you branch a subset, maintain the full path structure (as in the example above), so you can easily expand the scope of what you branched initially at some later date. Edit, test and submit changes in your branch. Keep your code up to date with other changes by merging down from the shared dev branch to your dev branch, e.g. by doing: ``` p4 merge -b your_name-sdp ``` ... followed by the usual resolve and submit. When you'e ready to copy your versions up to our dev branch, do like so: ``` p4 change p4 copy -c YourCL -r -b your_name-sdp ``` Be sure that your changelist has a clear and accurate description, and that the description contains a <code>#review</code> tag on a line by itself. That will trigger a code review process when you shelve the change, like so: ``` p4 shelve -c YourCL ``` Perforce Consultants will review the change, and either incorporate it or provide feedback. Be sure to provide a detailed change description, and don't forget include the <code>#review</code> tag in your changelist description to initiate a Swarm pre-commit code review. Guidelines for SDP Contributors --- * Communicate! Use Swarm or email! Let folks know what you're planning before you work too hard on something that might already be underway. * File a job (Project=**perforce-software-sdp**) first. That's not required, but increases the transparency of what you're doing, and helps promote it. * We prefer changes that are generic, and have a wide appeal. * The core of the SDP, the scripts that do offline checkpoints for p4d, prioritize Perforce best practices over scripting magic. Don't get too fancy! :) Versioning the SDP Locally === Tight Ship Management --- In line with the "Version Everything" mindset, the SDP itself should be versioned in your environment. The best way to version the SDP is to do a "Tight Ship" installation, using the Helix Management System (HMS) tight ship setup script, [hms_ts_setup.sh](https://swarm.workshop.perforce.com/projects/perforce-software-sdp/view/dev/doc/hms_ts_setup.command_summary.txt). This script, which is included in the SDP, initializes a separate <code>/p4/hms</code> instance of the SDP to manage the SDP. It will get you started on the path to enterprise-grade Helix Core server management. It creates an initial workspace for managing the SDP files, creates a connection to The Workshop, and enables a 'fetch' and 'merge' workflow to use the power of Perforce merging to greatly simplify taking future updates to the SDP. When Tight Ship management is used, we recommend deploying an optional Swarm instance for the hms instance, to provide the usual Swarm benefits (code review, email notification, transparency of changes, etc.). Upgrading Older Existing SDP Installations --- If you have an earlier version of the Server Deployment Package (SDP) installed and are *not* using Tight Ship style of management, you'll want to be aware of the <code>-test</code> flag to the SDP setup script, <code>mkdirs.sh</code>. The following update instructions assume a simple, single-server topology. (For older SDP installations, this path may be <code>/depotdata/sdp</code>.) Get the new software from The Workshop, which you'll find in the form of a SDP.Unix.\*.tgz zipped tar file. Put the tar file in the <code>/hxdepots</code> folder on your server. **BE SURE TO MOVE THE OLD** <code>/hxdepots/sdp</code> folder aside first if it is there, e.g. to <code>/hxdepots/sdp.old.2014-10-08</code>. Then unpack it like this: ``` tar -xzvpf SDP.Unix.2017.5.####.tgz cd /hxdepots/sdp/Unix/setup ``` Modify the mkdirs.sh script to suit your environment (possibly borrowing values from your old <code>mkdirs.sh</code> script). Then run it: mkdirs.sh 1 -test That'll do a mock install, creating a <code>**/tmp/**p4</code> structure, with folders like <code>/tmp/p4/common/bin</code> and <code>/tmp/p4/1/bin</code>. The output will suggest some <code>diff -r</code> commands to run to to view the diffs and apply updates manually, being careful not to lose any customizations or local configuration changes you may have made. If the SDP itself is versioned in Perforce in your environment, you can also put the new things from /tmp/p4 into your Perforce server where the SDP is. Commonly, there is a branch for receiving pristine updates of the generic SDP, e.g. 'p4c', which allow you to use Perforce merging to merge update into your local SDP mainline. Contact [Perforce Consulting Services](mailto:consulting@perforce.com) to ask about engaging professional services to upgrade the SDP for you. A few quick things to be aware of: * The old <code>p4_1_init</code> script (more generically <code>p4_instance_init</code>) was renamed to <code>p4**d**_1_init</code>. This will require updates to init script or symlink, e.g. in <code>/etc/init.d</code>. * Once you upgrade p4d to 2014.1+, you can do away with the SDP trigger that updates depot spec map fields. You can clear the <code>Map:</code> fields of depots, and use the <code>server.depot.root</code> configurable. Going forward, you'd only use <code>Map:</code> fields for depots that really do require a unique path, e.g. archive depots. SDP Structure === The SDP structure enables two major views of a Perforce server, the system administrator/storage architect view, and the application administrator view. THe system admin sees this structure: /hxdepots /hxmetadata1 /hxmetadata2 /hxlogs System administrators know they need to backup <code>/hxdepots</code>. Backing up <code>/hxlogs</code> is optional, and /hxmetadata1 & /hxmetadata2 are to be avoided by backup utilities, virus scanners, and anything else that might touch files in that area. This view is designed for optimizing for performance, as each of those folders has different performance profiles and usage patterns demanded by p4d. This view is not concerned with how many instances there are, or how they vary. Application administrators (Perforce Admins), though a structure of symlinks, see Perforce from a view like this: ``` /p4/1/bin /p4/1/depots /p4/1/root /p4/1/tmp /p4/common/config /p4/common/bin /p4/ssl ``` This structure illustrates an instance named '1' (it need not be numeric), and a /p4/common area containing files common to all instances. Each of those folders is physically stored under an appropriate storage folder or volume as defined in the system admin view above. The <code>/p4/*instance*/bin</code> folder defines which Perforce products are active for that instance on the current machine (p4d, p4broker, p4p, etc.). The **root** folder contains P4ROOT, while **depots** contains archive files. The Windows SDP === There are two flavors of the SDP, Unix and Windows. Both are available in the same folder structure in the Workshop. SDP Code Quality === An automated regression test suite and pre-commit code review processes help ensure code quality.
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 24292 | gmc | "Forking branch Dev of perforce-software-sdp to gmc-sdp." | ||
//guest/perforce_software/sdp/dev/README.md | |||||
#10 | 23353 | C. Thomas Tyler | Fixed typo/grammatical error. | ||
#9 | 23315 | C. Thomas Tyler |
Overhauled SDP README page to better convey its value, and much more strongly promote the SDP. This also documents the the nature of offical Perforce Support for the SDP, and the limitations of that Support to core SDP functionality. |
||
#8 | 16784 | C. Thomas Tyler |
Routine Merge Down to dev from main using: p4 -s merge -n -b perforce_software-sdp-dev |
||
#7 | 15797 | C. Thomas Tyler | Routine Merge Down to dev from main for SDP. | ||
#6 | 13729 | C. Thomas Tyler | Tweaked formatting on README.md. | ||
#5 | 12028 | C. Thomas Tyler | Refreshed SDP dev branch, merging down from main. | ||
#4 | 11535 | Russell C. Jackson (Rusty) | Updated dev from main. | ||
#3 | 11463 | Russell C. Jackson (Rusty) | Updated dev to prepare for Summit agreed changes. | ||
#2 | 11038 | Robert Cowham | Catchup from Main | ||
#1 | 10638 | C. Thomas Tyler | Populate perforce_software-sdp-dev. | ||
//guest/perforce_software/sdp/main/README.md | |||||
#1 | 10611 | C. Thomas Tyler | Added README file for the SDP in The Workshop. |