Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • 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 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 files have been download.
  • Good understanding of the deployment process and of the working of deployment scripts is key.

...

Summary of Steps to perform Deployment

Deployment is an operation that is performed by the following steps:

  1. Create a .json file for the JS7 - Deployment Descriptor.
  2. Run the JS7 - Deployment Packaging Script indicating the .json Deployment Descriptor file. This step will create related Deployment Packages in the <archive>/<deployment-descriptor> directory.
  3. Run the JS7 - Deployment Workflow
    • Import the js7_import.tar.gz Deployment Workflow file available from the <archive>/<deployment-descriptor> directory to JOC Cockpit, for details see JS7 - Inventory Export and Import.
    • Check the imported workflow and adjust to your needs, for example assignment of an Agent with access to the deployment directories in the Deployment Server.
    • Adjust the imported schedule to your needs should you want to schedule execution of deployments to a specific date and time. Alternatively you can add an ad hoc order to the Deployment Workflow from the JOC Cockpit's Workflows view. This step offers to copy the parameterization available from the schedule to the current order.
    • Run the Deployment Workflow from a scheduled order or from an ad hoc order and check results.

Anchor
directory_layout
directory_layout
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>

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 the 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 Deployment Package for the Controller instanceAgent's configuration directory)
          • js7_deploy_controlleragent_unix.<controller<agent-id>.<controller-type>.<release>.install.tar.gz(deployment package Deployment Package for the Controller instanceAgent's installation directory)
          • run_deploy_controlleragent.sh (deployment script)
          • run_install_controlleragent.sh (wrapper script for the parameterized call to js7_install_controlleragent.sh)<controller
        • <agent-type>id>(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)
            • wrapper script for the 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
    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)
                • <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 keystore)
              • 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)
        • <template-name> (arbitrary directory names for templates can be used)
        • <template-name> (arbitrary directory names for templates can be used)
        • ...
    • 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 (holds Controller configuration files)
      • instances (holds configuration files specific for a Controller instance)
        • <controller-id>.<controller-type>(specifies the Controller ID for directories and files that are specific to a Controller instance with the instance type being primary or secondary)
          • 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 keystore)
              • 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 JOC Cockpit certificate, see JS7 - Controller Configuration Items)
              • log4j2.xml (optional log configuration file, see JS7 - Log Levels and Debug Options)
            • controller.conf (optional configuration file, see JS7 - Controller Configuration Items)
        • <controller-id>.<controller-type>(specifies the Controller ID for directories and files that are specific to a Controller)
        • ...
      • templates (holds configuration files that act as templates for a number of Controllers)
        • <template-name> (arbitrary directory names for templates can be used)
        • <template-name> (arbitrary directory names for templates can be used)
        • ...
    • joc  (holds JOC Cockpit configuration files)
      • instances (holds configuration files that are specific for a JOC Cockpit instance)
        • <server>.<instance-type> (holds configuration files for a JOC Cockpit instance running on a specific server with the instance type being primary or secondary)
          • resources (optionally holds configuration files such as the joc.properties file, keystore, truststore files etc.)
          • response (holds response files, mainly the joc_install.xml response file, that are copied to the JOC Cockpit's setup directory)
        • <server>.<instance-type> (holds configuration files for a JOC Cockpit instance running on a specific server with the instance type being primary or secondary)
        • ...
      • templates (holds configuration files that act as templates for a number of JOC Cockpit instances)
        • <template-name> (arbitrary directory names for templates can be used)
          • resources (optionally holds configuration files such as the joc.properties file, keystore, truststore files etc.)
          • response (holds response files, mainly the joc_install.xml response file, that are copied to the JOC Cockpit's setup directory)
        • <template-name> (arbitrary directory names for templates can be used)
        • ...
  • desc (holds Deployment Descriptors)
    • <deployment-descriptor>.json (Deployment Descriptor .json file)
    • <deployment-descriptor>.json (Deployment Descriptor .json file)
    • ...
  • release  logs (holds the installation tarballs for JS7 releaseslog files)
    • deployment_package.<deployment-descriptor>.<host>.<timestamp>.log (Packaging Script log files)
    • install_js7_agent.<host>.<timestamp>.log (Agent Installer log files)
    • install_js7_controller.<host>.<timestamp>.log (Controller Installer log files)
    • install_js7_joc.<host>.<timestamp>.log (JOC Cockpit Installer log files)
  • release  (holds the installation tarballs for JS7 releases)
    • ... (users (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-directories 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-directories 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)

...

Code Block
titleExample for Environment File env.sh
linenumberstrue
#!/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_INSTALLLOGS="${DEP_INSTALLLOGS:-$SCRIPT_HOME/installlogs}"
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_INSTALLLOGS DEP_RELEASE DEP_TARGET DEP_WORK

...

  • Any environment variable makes use of a fallback if not otherwise specified.
    • By default the env.sh script's directory is assumed to hold the directory layout of the Deployment Server.
  • Each environment variable in the script points to a directory with a specific purpose that can be located outside of the suggested directory layout.
    • In the above example the DEP_RELEASE environment variable specifies a location of JS7 installation files from a mount point.
    • The DEP_ARCHIVE, DEP_BIN, DEP_CONFIG, DEP_DESC, DEP_LOGS, DEP_WORK environment variables point to directories explained with the directory layout.
    • The DEP_TARGET environment variable points to a location on the same server to simulate deployments to target machines.
  • The JAVA_HOME environment variable is specified to enforce use of a specific Java version for temporary installation of JS7 components during packaging.
  • Consider that environment variables have to be exported in order to be applied by subsequent calls to deployment scripts.

...

Code Block
titleExample for use of an individual script to create deployment packages
linenumberstrue
#!/bin/sh

set -e

SCRIPT_HOME=$(cd "$(dirname "$0")" >/dev/null && pwd)

DEP_ARCHIVE=${DEP_ARCHIVE:-$(dirname "${SCRIPT_HOME}")/archive}
DEP_BIN=${DEP_BIN:-$(dirname "${SCRIPT_HOME}")/bin}
DEP_CONFIG=${DEP_CONFIG:-$(dirname "${SCRIPT_HOME}")/config}
DEP_DESC=${DEP_DESC:-$(dirname "${SCRIPT_HOME}")/desc}
DEP_WORK=${DEP_WORK:-$(dirname "${SCRIPT_HOME}")/work}


${DEP_BIN}/js7_create_deployment_package.sh \
    --deploy-desc=${DEP_DESC}/agent-https-2022-12-04.json \
    --deploy-dir=${DEP_CONFIG} \
    --archive-dir=${DEP_ARCHIVE} \
    --script-dir=${DEP_BIN} \
    --work-dir=${DEP_WORK} \
    --deploy-agent-id=deploymentAgent \
    --keep-script \
    --keep-work

Explanation:

...

-

...

Summary of Steps to perform Deployment

Deployment is an operation that is performed in the following steps:

...

-keep-work


Explanation:

  • The example of an individual script to create deployment packages makes use of existing environment variables to apply individual directories or to fall back to the default directory layout.
  • Use of set -e is recommended in order not to proceed execution of scripts in case of errors.
  • Use of environment variables from the above example allows to execute the script from any working directory

...

  • .

Resources

...