You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Introduction

For JS7 - Automated Deployment use of a Deployment Server is recommended.

The Deployment Server is used for the following purposes:

Purpose

Use of a Deployment Server is beneficial for the following purposes:

  • Desired State Configuration
    • The JS7 - Deployment Descriptor specifies the desired state of the installation and configuration on a target machine.
    • The concept includes not to deploy individual files or configuration items but to view an installation holistically with all installation files and configuration files being deployed to guarantee consistency.
  • Provisioning
    • Considering Desired State Configuration it makes no difference if a JS7 component is initially installed, is updated, upgraded or patched.
    • Deployment processes are repeatable at any time. This suggests not to rely on backups of target machines for the purpose of restoring JS7 components in case of data loss in the target machine. Instead, deployment is repeated in case that a target machine has been newly set up. Consider what data will be lost in case that a target machine's file system will crash:
      • Log Data: retention of older JS7 component log files might not be too relevant in a crash situation. At the same time most recent additions to log files might anyway be lost. Consider that log data exclude job logs and order logs that are streamed in near real-time from Agents via Controllers to the JOC Cockpit database.
      • Transaction Data: due to the ephemeral nature of JS7 - Order State Transitions there is no way to consistently backup a Controller's or Agent's journal. Instead, clustering of Controllers and Agents on separate machines brings the required redundancy.
      • For details see JS7 - How to backup the job scheduling environment.
  • Probing
    • The deployment process includes to temporarily install JS7 components in the working area of the Deployment Server. 
    • This allows to check if all required configuration files including certificates are in place.
    • In most situations it will be possible to start up the JS7 component on the Deployment Server. This might not include for example to run jobs with a JS7 Agent as the job environment might not be available with the Deployment Server. However, it allows to check if the JS7 component will perfectly start - using the expected configuration items such as certificates - and will terminate normally. In addition it includes to check the JS7 component's log files for warnings and errors on start-up and termination.
  •  Parallelism
    • During upgrade to newer minor JS7 releases users might find an inconsistent status of JS7 components.
      • This applies to upgrading, for example from a 2.2.1 release to a 2.4.1 release. 
      • This does not apply to updating, for example from a 2.2.1 release to a 2.2.3 release.
    • A newer Controller release 2.5.1 might not work with an older Agent release 2.2.3. As the Controller has to be upgraded before Agents are upgraded we find a period during which no jobs are executed on Agents using older releases. In fact the related orders will not be lost, however, they will be put to the BLOCKED state until the Agent is upgraded. It is therefore preferable to have the period for upgrading a larger number of Agents as short as possible.
    • The JS7 - Deployment Workflow provides unlimited parallelism for deployments as it can run a larger number of tasks, >15000, in parallel on the same Agent.
      • Typically the time to shut down a JS7 Agent, to replace its installation and to restart the JS7 Agent requires less than 60s.
      • When stopping Agents this will allow the Agent to delay termination until any running tasks are completed. This includes to delay the update/upgrade process. At the same time this guarantees that no running tasks are killed. However, users can force immediate termination of an Agent, see JS7 - Agent Command Line Operation.
  • Fallback
    • Though use of a Deployment Server allows probing to some extent there might be situations when deployment to a target machine fails. Such situations frequently do not suggest lengthy analysis of the target machine but immediate action to roll back the installation and to fall back to the previous release.
    • With Deployment Packages and Deployment Descriptors for previous releases being available on the Deployment Server users can start the fallback procedure to deploy a previous release within seconds.
    • Error handling in the Deployment Workflow allows to decide if deployments are considered being failed with a single Agent not being successfully deployed or if user intervention is required to decide if processing of the Deployment Workflow should be cancelled or if execution for individual target machines is retried.

Prerequisites

No specific software requirements apply to a Deployment Server. The following factors should be considered:

  • Storage
    • Storage capacity has to match the number of packages that are stored per JS7 release, per JS7 component and target machines.
      • Example
        • Assume that the Deployment Server is used to deploy JS7 Agents to 100 target machines.
        • The average disk space consumption of a JS7 Agent package is around 175 MB.
        • If you intend to keep the latest three JS7 releases then this will make 300 packages with an overall disk space consumption of ca. 53 GB.
    • The working area in the Deployment Server is used to temporarily store JS7 installations. A rough estimate of 10 GB will be sufficient for most purposes.
    • Storage for JS7 release tarballs should be considered. For Unix environments the tarballs for JOC Cockpit, Controller and Agent require approx. 600 MB per release.
  • Computing Power
    • Speed matters only when it comes to packaging. This process is performed once per new JS7 release that should be deployed.
    • It can be considered a waste of resources having a powerful server being used <1% of the time.
  • Network
    • The Deployment Server requires decent connectivity as it has to connect to any target machine to which it deploys JS7 components.
      • Considering firewalls users could think about "opening the gates" for the timeslot of deployment only.
    • Transfer of tarball packages to target machines preferably happens in parallel in order to have a short period of time in which mixed releases of JS7 components are in place.

Security

It is essential to have a consistent and secure deployment process in place.

  • Security is the basic reason why the JS7 deployment scripts ship as shell scripts and not from a high level programming language that might require installation and updates. Transparency and adjustability are key. Users are free to modify deployment scripts at their will and to request changes within the scope of SOS professional services.
  • The source of JS7 installation tarballs is a major concern. Basically the installer scripts for JS7 components offer to download components on demand from the SOS Web Site. Users are strongly discouraged to make use of this feature for automated deployment. Instead, the JS7 components should be separately downloaded and checked that no tampered versions of the installer files have been download to exclude man-in-the-middle attacks.
  • Good understanding of the deployment process and of the working of deployment scripts is key.

Directory Layout

The suggested directory layout for the Deployment Server includes the following directories and files:

  • archive (holds deployment packages)
    • <deployment-descriptor> (specifies the Deployment Descriptor)
      • agents (holds Agent deployment packages)
        • <agent-id> (specifies the Agent ID)
          • js7_deploy_agent_unix.<agent-id>.<release>.config.tar.gz (deployment package for the Agent's configuration directory)
          • js7_deploy_agent_unix.<agent-id>.<release>.install.tar.gz (deployment package for the Agent's installation directory)
          • run_deploy_agent.sh (deployment script)
          • run_install_agent.sh (wrapper script for parameterized call to js7_install_agent.sh)
        • <agent-id> (specifies the Agent ID)
        • ...
      • controllers (holds Controller deployment packages)
        • <controller-id> (specifies the Controller ID)
          • <controller-type> (specifies the type of the Controller instance which is primary or secondary
            • js7_deploy_controller_unix.<controller-id>.<controller-type>.<release>.config.tar.gz (deployment package for the Controller instance's configuration directory)
            • js7_deploy_controller_unix.<controller-id>.<controller-type>.<release>.install.tar.gz (deployment package for the Controller instance's installation directory)
            • run_deploy_controller.sh (deployment script)
            • run_install_controller.sh (wrapper script for parameterized call to js7_install_controller.sh)
          • <controller-type> (specifies the type of the Controller instance which is primary or secondary
      • js7_import_tar.gz (holds the Deployment Workflow for import to JS7 JOC Cockpit)
    • <deployment-descriptor> (specifies the Deployment Descriptor)
    • ...
  • bin (holds executable files, preferably individual scripts, deployment scripts and installer scripts available from JS7 - Download)
  • ca  (holds the Certificate Authority as explained from  JS7 - How to create self-signed Certificates, not used if an external Certificate Authority is in place)
    • certs (holds CA-signed Certificates)
    • csr (holds Certificate Signing Requests)
    • private (holds Private Keys)
  • config (holds configuration files)
    • agents (holds Agent configuration files)
      • instances (holds configuration files specific for an Agent)
        • <agent-id> (specifies the Agent ID for directories and files that are specific to an Agent)
          • config (general configuration)
            • private (specific configuration)
              • trusted-pgp-keys (optionally holds PGP public key files and keyring files used for signing, see JS7 - Deployment of Scheduling Objects)
                • <pgp-public-key> (public key file or keyring file)
                • <pgp-public-key> (public key file or keyring file)
                • ...
              • trusted-x509-keys (optionally holds X.509 certificate files used for signing, see JS7 - Deployment of Scheduling Objects)
                • <x509-certificate> (X.509 certificate file)
                • <x509-certificate> (X.509 certificate file)
                • ...
              • https-keystore.p12 (optional default location and file name of a PKCS12 truststore)
              • https-truststore.p12 (optional default location and file name of a PKCS12 truststore)
              • private.conf (optional configuration file, for example to specify keystore, truststore and Distinguished Names of Controller certificate, see JS7 - Agent Configuration Items)
              • log4j2.xml (optional log configuration file, see JS7 - Log Levels and Debug Options)
            • agent.conf (optional configuration file, see JS7 - Agent Configuration Items)
        • <agent-id> (specifies the Agent ID for directories and files that are specific to an Agent)
        • ...
      • templates (holds configuration files that act as templates for a number of Agents)
        • <ag
    • certs (holds certificate files for deployment with Agents and Controllers)
      • ca  (optional Root Certificate Authority used for self-signed certificates)
        • <root-ca-certificate> (the Root CA Certificate file, frequently available with a .pem, .crt extension)
      • server (Server Authentication Certificates)
        • <server-certificate> (Server Certificate file, frequently available with a .pem, .crt extension)
        • <server-certificate> (Server Certificate file, frequently available with a .pem, .crt extension)
        • ....
      • client (Client Authentication Certificates)
        • <client-certificate> (Client Certificate file, frequently available with a .pem, .crt extension)
        • <client-certificate> (Client Certificate file, frequently available with a .pem, .crt extension)
        • ...
    • controllers
      • <controller-id> (specifies the Controller ID for directories and files that are specific to a Controller)
    • joc
  • desc (holds Deployment Descriptors)
    • <deployment-descriptor>.json (Deployment Descriptor .json file)
    • <deployment-descriptor>.json (Deployment Descriptor .json file)
    • ...
  • release  (holds the installation tarballs for JS7 releases)
    • ... (users can apply an arbitrary directory hierarchy at this level)
      • js7_agent_unix.<release>.tar.gz (JS7 Agent installation tarball as download from the SOS Web Site)
      • js7_controller_unix.<release>.tar.gz (JS7 Controller installation tarball as download from the SOS Web Site)
      • js7_joc_linux.<release>.tar.gz (JS7 JOC Cockpit installation tarball as download from the SOS Web Site)
  • work (the working area is preferably used to perform installation of JS7 components during packaging)
    • agents (directory for Agent installation during packaging)
      • <agent-id> (specifies the Agent ID for directories and files that are specific to an Agent)
        • ... (sub-directory used for Agent installation)
      • <agent-id> (specifies the Agent ID for directories and files that are specific to an Agent)
      • ...
    • controllers (directory for Controller installation during packaging)
      • <controller-id> (specifies the Controller ID for directories and files that are specific to a Controller)
        • ... (sub-directory used for Controller installation)
      • <controller-id> (specifies the Controller ID for directories and files that are specific to a Controller)
      • ...
    • tmp (temporary files are written to this directory, if the --keep-work switch is used when invoking the JS7 - Deployment Packaging Script then files will remain in this directory which suggests cleanup by the user)
  • env.sh (Environment Script, see next chapter)

Explanation on Individual Files

Environment Script env.sh

The Environment Script initializes a number of environment variables that map to directories as explained above.

The script has to be invoked before running any script to install, to package and to deploy packages to target machines.

Example for Environment File env.sh
#!/bin/sh

SCRIPT_HOME=$HOME/js7.deploy

DEP_ARCHIVE="${DEP_ARCHIVE:-$SCRIPT_HOME/archive}"
DEP_BIN="${DEP_BIN:-$SCRIPT_HOME/bin}"
DEP_CONFIG="${DEP_CONFIG:-$SCRIPT_HOME/config}"
DEP_DESC="${DEP_DESC:-$SCRIPT_HOME/desc}"
DEP_INSTALL="${DEP_INSTALL:-$SCRIPT_HOME/install}"
DEP_RELEASE=/mnt/releases/scheduler_setups
DEP_TARGET="/home/sos/js7.target"
DEP_WORK="${DEP_WORK:-$SCRIPT_HOME/work}"

JAVA_HOME="${SCRIPT_HOME}"/jdk-11.0.2
PATH=${JAVA_HOME}/bin:${PATH}

export JAVA_HOME PATH DEP_ARCHIVE DEP_BIN DEP_CONFIG DEP_DESC DEP_INSTALL DEP_RELEASE DEP_TARGET DEP_WORK


The Environment Script has to be sourced to make environment variables available to shell scripts in the Deployment Server:

Example for Environment File env.sh
. ./env.sh





  • No labels