Page History
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl "https://download.sos-berlin.com/JobScheduler/js7_deploy.tar.gz" --output "js7_deploy.tar.gz" |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
cd $HOME tar -xzf js7.deploy.tar.gz |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
#!/bin/sh SCRIPT_HOME=${HOME}/js7.deploy DEP_ARCHIVE="${DEP_ARCHIVE:-$SCRIPT_HOME/archive}" DEP_BIN="${DEP_BIN:-$SCRIPT_HOME/bin}" DEP_CA="${DEP_CA:-$SCRIPT_HOME/ca}" DEP_CONFIG="${DEP_CONFIG:-$SCRIPT_HOME/config}" DEP_DESC="${DEP_DESC:-$SCRIPT_HOME/desc}" DEP_RELEASE="${DEP_RELEASE:-$SCRIPT_HOME/release}" DEP_WORK="${DEP_WORK:-$SCRIPT_HOME/work}" JAVA_HOME="/usr/lib/jvm/jdk-11.0.2" PATH=${JAVA_HOME}/bin:${PATH} export JAVA_HOME PATH DEP_ARCHIVE DEP_BIN DEP_CA DEP_CONFIG DEP_DESC DEP_RELEASE DEP_WORK |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
. ./env.sh |
Download JS7 Release
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
curl "https://download.sos-berlin.com/JobScheduler.2.5/js7_agent_unix.2.5.0.tar.gz" --output "js7_agent_unix.2.5.0.tar.gz" curl "https://download.sos-berlin.com/JobScheduler.2.5/js7_controller_unix.2.5.0.tar.gz" --output "js7_controller_unix.2.5.0.tar.gz" curl "https://download.sos-berlin.com/JobScheduler.2.5/js7_joc_linux.2.5.0.tar.gz" --output "js7_joc_linux.2.5.0.tar.gz" |
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
{ "descriptor": { "descriptorId": "standalone-agent-http-2022-12-04", "title": "Install or update Agent Standalone instance using HTTP connections", "account": "sos", "scheduled": "2022-12-02T06:19:12+01:00", "created": "2022-11-30T23:19:12+01:00" }, "agents": [ { "agent_001": { "target": { "connection": { "host": "centostest-primary", "port": 22 }, "authentication": { "method": "publickey", "user": "sos", "keyFile": "/home/sos/.ssh/sos_rsa" }, "packageLocation": "/tmp" }, "media": { "release": "2.5.0", "tarball": "${DEP_RELEASE}/2.5.0/js7_agent_unix.2.5.0.tar.gz" }, "installation": { "home": "/opt/sos-berlin.com/js7/agent-standalone", "data": "/var/sos-berlin.com/js7/agent-standalone", "httpPort": "31445", "javaHome": "/opt/java/jdk8u202-b08" } } } ], "controllers": [], "joc": [] } |
...
With the Deployment Descriptor being available the Deployment Package can be created from a script. The Deployment Package will be stored to the js7.deploy/archive
directory.
The Deployment Packaging script performs the following steps:
...
The Deployment Packaging Script is available from the js7.deploy/bin
directory.
The script can be is parameterized for example like this:
--deploy-desc
: specifies the location of the Deployment Descriptor,--make-dirs
: specifies that new sub-directories should be created if they do not exist.
Find more details about parameterization from the JS7 - Deployment Packaging article.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
${DEP_BIN}/js7_create_deployment_package.sh \ --deploy-desc=${DEP_DESC}/standalone/standalone-agent-http-2022-12-04 \ --make-dirs |
Output of the script can will look like this:
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
-- begin of log -------------- /home/sos/js7.depdeploy/bin/js7_create_deployment_package.sh --deploy-desc=/home/sos/js7.depdeploy/desc/standalone/standalone-agent-http-2022-12-04.json --make-dirs -- begin of output ----------- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- .. creating deployment package for Agent ID: agent_001 ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- .... creating install script: /home/sos/js7.depdeploy/work/tmp/js7_deploy_package_install_17858.sh .... running install script: /home/sos/js7.depdeploy/work/tmp/js7_deploy_package_install_17858.sh -- begin of log -------------- /home/sos/js7.depdeploy/bin/js7_install_agent.sh --real-path-prefix=/home/sos/js7.depdeploy/work/agents/agent_001 --release=2.5.0 --tarball=/home/sos/js7.depdeploy/release/2.5.0/js7_agent_unix.2.5.0.tar.gz --home=/home/sos/js7.depdeploy/work/agents/agent_001/opt/sos-berlin.com/js7/agent-standalone --data=/home/sos/js7.depdeploy/work/agents/agent_001/var/sos-berlin.com/js7/agent-standalone --http-port=31445 --java-home=/opt/java/jdk8u202-b08 --make-dirs -- begin of output ----------- .. using tarball: /home/sos/js7.depdeploy/release/2.5.0/js7_agent_unix.2.5.0.tar.gz .. extracting tarball to temporary directory: /tmp/js7_install_agent_18024.tmp .. creating Agent home directory: /home/sos/js7.depdeploy/work/agents/agent_001/opt/sos-berlin.com/js7/agent-standalone .. creating Agent data directory: /home/sos/js7.depdeploy/work/agents/agent_001/var/sos-berlin.com/js7/agent-standalone .. copying files from extracted tarball directory: /tmp/js7_install_agent_18024.tmp/agent to Agent home: /home/sos/js7.depdeploy/work/agents/agent_001/opt/sos-berlin.com/js7/agent-standalone .. creating Agent data directory: /home/sos/js7.depdeploy/work/agents/agent_001/var/sos-berlin.com/js7/agent-standalone .. copying files to Agent data directory: /home/sos/js7.depdeploy/work/agents/agent_001/var/sos-berlin.com/js7/agent-standalone .. copying Agent Instancee Start Script /home/sos/js7.depdeploy/work/agents/agent_001/opt/sos-berlin.com/js7/agent-standalone/bin/agent_instance.sh-example to /home/sos/js7.depdeploy/work/agents/agent_001/opt/sos-berlin.com/js7/agent-standalone/bin/agent_31445.sh .. copying /home/sos/js7.depdeploy/work/agents/agent_001/opt/sos-berlin.com/js7/agent-standalone/bin/agent.service-example to /home/sos/js7.depdeploy/work/agents/agent_001/opt/sos-berlin.com/js7/agent-standalone/bin/agent_31445.service .. updating Agent Instance Start Script: /home/sos/js7.depdeploy/work/agents/agent_001/opt/sos-berlin.com/js7/agent-standalone/bin/agent_31445.sh .. updating Agent systemd service file: /home/sos/js7.depdeploy/work/agents/agent_001/opt/sos-berlin.com/js7/agent-standalone/bin/agent_31445.service -- end of log ---------------- .... creating installation deployment package file: tar -cf /home/sos/js7.depdeploy/archive/standalone-agent-http-2022-12-04/agents/agent_001/js7_deploy_agent_unix.agent_001.2.5.0.install.tar -C /home/sos/js7.depdeploy/work/agents/agent_001/opt/sos-berlin.com/js7 agent-standalone .... installation deployment package ready: /home/sos/js7.depdeploy/archive/standalone-agent-http-2022-12-04/agents/agent_001/js7_deploy_agent_unix.agent_001.2.5.0.install.tar.gz .... creating configuration deployment package file: tar -cf /home/sos/js7.depdeploy/archive/standalone-agent-http-2022-12-04/agents/agent_001/js7_deploy_agent_unix.agent_001.2.5.0.config.tar -C /home/sos/js7.depdeploy/work/agents/agent_001/var/sos-berlin.com/js7 agent-standalone .... configuration deployment package ready: /home/sos/js7.dep/archive/standalone-agent-http-2022-12-04/agents/agent_001/js7_deploy_agent_unix.agent_001.2.5.0.config.tar.gz .... install script for deployment package ready: /home/sos/js7.dep/archive/standalone-agent-http-2022-12-04/agents/agent_001/run_install_agent.sh .... job script for deployment package ready: /home/sos/js7.dep/archive/standalone-agent-http-2022-12-04/agents/agent_001/run_deploy_agent.sh .... creating JS7 import file: tar -cf /home/sos/js7.dep/archive/standalone-agent-http-2022-12-04/js7_import.tar * .... JS7 import file ready: /home/sos/js7.dep/archive/standalone-agent-http-2022-12-04/js7_import.tar.gz .. Deployment runScript file ready: /home/sos/js7.dep/archive/standalone-agent-http-2022-12-04/run_deploy.sh -- end of log ---------------- |
...
js7.deploy
archive
standalone-agent-http-2022-12-04
(directory name created from the Deployment Descriptor ID)agents
(sub-directory for Agent deployments)agent_001
(sub-directory for specific Agent identified by its Agent ID)js7_deploy_agent_unix.agent_001.2.5.0.config.tar.gz
(tarball of the Agent's configuration directory)js7_deploy_agent_unix.agent_001.2.5.0.install.tar.gz
(tarball of the Agent's installation directory)run_deploy_agent.sh
(Deployment Script for Agent)run_install_agent.sh
(Installer Wrapper Script for Agent)
js7_import.tar.gz
(tarball for import into JS7 JOC Cockpit, includes workflow and schedule for automated deployment)run_deploy.sh
(Deployment Wrapper Script, includes calls toagents/agent_001/run_deploy_agent.sh
and similar scripts per JS7 component included)
Basically the run_deploy.sh
script can be used to transfer the Agent's tarballs for configuration and installation directories to the target host.
Running Deployment Packages
...
- Use of the Deployment Script from the command line is applicable if a smaller number of JS7 components should be installed and if no JS7 scheduling environment is yet available.
- If a JS7 scheduling environment is set up then it is preferable to import the
js7_import.tar.gz
to JOC Cockpit that adds a workflow and schedule for parallel deployment of JS7 components. For details see JS7 - Deployment Workflow.
Performing Deployment
Deployment can be performed by executing the Deployment Script from the command line.
Code Block | ||||
---|---|---|---|---|
| ||||
${DEP_ARCHIVE}/standalone-agent-http-2022-12-04/run_deploy.sh |