From c12f733b21f18357000cfa8f95682a34e0ea7212 Mon Sep 17 00:00:00 2001 From: HDYA Date: Fri, 26 Apr 2019 06:12:40 +0000 Subject: [PATCH 1/6] Pickup OMS Agent 1.9.0-0 --- config/blobs.yml | 56 ++++++++++++++++++------------------------ config/final.yml | 2 +- packages/omsagent/spec | 16 ++++++------ 3 files changed, 33 insertions(+), 41 deletions(-) diff --git a/config/blobs.yml b/config/blobs.yml index 50089ad..6bbf15d 100644 --- a/config/blobs.yml +++ b/config/blobs.yml @@ -1,32 +1,24 @@ -omsagent/omi-1.3.0-2.ulinux.x64.deb: - size: 1583696 - object_id: 73487392-6024-4cff-64fc-f2d02b0c1bda - sha: 32001c76f294698b3b3829e69204e40cc256623e -omsagent/omi-1.3.0-2.ulinux.x64.rpm: - size: 1472173 - object_id: b9c53f04-2a7e-40e5-7e55-858bba958f04 - sha: aae2c03c73d456a464cc5e32a967ebe906deb141 -omsagent/omsagent-1.4.2-125.universal.x64.deb: - size: 18663638 - object_id: 37da078c-8fbb-401a-41de-24768a947b15 - sha: eb56efe19e374d45fba82565924cc56b8141b6f5 -omsagent/omsagent-1.4.2-125.universal.x64.rpm: - size: 19560522 - object_id: 2ebc5e11-bc42-4045-6026-ddfff6d9f53b - sha: 28c89233d775d31e5799197f21205f4e5e5c5bdd -omsagent/omsconfig-1.1.1-563.x64.deb: - size: 1998468 - object_id: 4ff94ff0-1539-4b9b-5996-18f8f35ab6b2 - sha: 0629c90b6cb5906cfa1da9784469f35e57ff8513 -omsagent/omsconfig-1.1.1-563.x64.rpm: - size: 2015410 - object_id: 9f6e04a0-ce78-460d-655a-a37c737e0c8e - sha: e5dc583c899d1668de2f3a3f919cbec421028d8f -omsagent/scx-1.6.3-326.universal.x64.deb: - size: 2022684 - object_id: f8abaeaf-de24-4724-459d-088f76f48026 - sha: 27d795fddd455298b3304e20e49c4d55829a0ae8 -omsagent/scx-1.6.3-326.universal.x64.rpm: - size: 1829054 - object_id: f8e56906-abb7-4a37-4064-4e7059103e79 - sha: e43563fc3510e27d2650355e884483b0d4cfe1db +omsagent/omi-1.6.0-0.ulinux.x64.deb: + size: 1841460 + sha: 7aac5a77d2c443e9b8e4915a67c603ddbaa1b612 +omsagent/omi-1.6.0-0.ulinux.x64.rpm: + size: 1909556 + sha: 6bdd0aae8684914c91606876cd937f0d4c5882c9 +omsagent/omsagent-1.9.0-0.universal.x64.deb: + size: 19425008 + sha: d3f08a62ef6a3c9541cb4d9ca7ddf8ee2508e947 +omsagent/omsagent-1.9.0-0.universal.x64.rpm: + size: 20355592 + sha: c4df201cdeafa180a6e2006d71426e5aa77c7363 +omsagent/omsconfig-1.1.1-918.x64.deb: + size: 3801634 + sha: 9bcd814e325510afd71de327a2fa28223385dc93 +omsagent/omsconfig-1.1.1-918.x64.rpm: + size: 3829206 + sha: ad616b1b433b2fb1f28cc488fb8d2cc16ee03f25 +omsagent/scx-1.6.3-659.universal.x64.deb: + size: 2043724 + sha: 1b0deb843eb92c5e14f75362bb50a9a882d7a7fd +omsagent/scx-1.6.3-659.universal.x64.rpm: + size: 2078016 + sha: 8729add0a4f58b3e261cbb12e3ed6cc4a93702b6 diff --git a/config/final.yml b/config/final.yml index e5e73e2..4d78e10 100644 --- a/config/final.yml +++ b/config/final.yml @@ -3,4 +3,4 @@ blobstore: provider: s3 options: bucket_name: oms-agent-for-linux-boshrelease -final_name: oms-agent-for-linux \ No newline at end of file +final_name: oms-agent-for-linux diff --git a/packages/omsagent/spec b/packages/omsagent/spec index 173bc38..a3e79c1 100644 --- a/packages/omsagent/spec +++ b/packages/omsagent/spec @@ -3,14 +3,14 @@ name: omsagent files: - utils/utils.sh -- omsagent/omi-1.3.0-2.ulinux.x64.deb -- omsagent/omsagent-1.4.2-125.universal.x64.deb -- omsagent/omsconfig-1.1.1-563.x64.deb -- omsagent/scx-1.6.3-326.universal.x64.deb -- omsagent/omi-1.3.0-2.ulinux.x64.rpm -- omsagent/omsagent-1.4.2-125.universal.x64.rpm -- omsagent/omsconfig-1.1.1-563.x64.rpm -- omsagent/scx-1.6.3-326.universal.x64.rpm +- omsagent/omi-1.6.0-0.ulinux.x64.deb +- omsagent/omsagent-1.9.0-0.universal.x64.deb +- omsagent/omsconfig-1.1.1-918.x64.deb +- omsagent/scx-1.6.3-659.universal.x64.deb +- omsagent/omi-1.6.0-0.ulinux.x64.rpm +- omsagent/omsagent-1.9.0-0.universal.x64.rpm +- omsagent/omsconfig-1.1.1-918.x64.rpm +- omsagent/scx-1.6.3-659.universal.x64.rpm - conf/logrotate.scx.conf - conf/oms.uaa.conf From 4383eb4c087d31c013d924c1466fc68a0af82944 Mon Sep 17 00:00:00 2001 From: HDYA Date: Fri, 26 Apr 2019 10:00:25 +0000 Subject: [PATCH 2/6] Stop sxisting job instance before start --- jobs/omsagent/templates/omsagent-ctl.erb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jobs/omsagent/templates/omsagent-ctl.erb b/jobs/omsagent/templates/omsagent-ctl.erb index 407a6f6..2995355 100644 --- a/jobs/omsagent/templates/omsagent-ctl.erb +++ b/jobs/omsagent/templates/omsagent-ctl.erb @@ -6,6 +6,7 @@ RUN_DIR=/var/vcap/sys/run/omsagent LOG_DIR=/var/vcap/sys/log/omsagent PID_FILE=$RUN_DIR/omsagent.pid +PID_FILE_TEMP=$RUN_DIR/omsagent_tmp.pid LOG_FILE=$LOG_DIR/omsagent.log RUBY_BIN=/opt/microsoft/omsagent/ruby/bin/ruby @@ -19,6 +20,7 @@ OMSAGENT_CONF=/etc/opt/microsoft/omsagent/${WORKSPACE_ID}/conf/omsagent.conf case $1 in start) + $0 stop mkdir -p $RUN_DIR @@ -77,6 +79,13 @@ case $1 in kill -sigkill `cat $PID_FILE` wait_until_process_stops $PID_FILE 5 + + current_pids=$(sudo netstat -anop | grep ${rsyslog_port} | cut -c 81- | cut -d'/' -f 1 | cut -d'-' -f 1) + for current_pid in $current_pids; do + sudo kill -sigkill $current_pid + echo $curent_pid > $PID_FILE_TEMP + wait_until_process_stops $PID_FILE_TEMP 5 + done ;; # dsc might call restart, to avoid conflict with monit, only stop the omsagent process, and leave monit to start it again From 56f47d7d8997eb99c6587ebcba7c44b6fda3d18c Mon Sep 17 00:00:00 2001 From: HDYA Date: Fri, 26 Apr 2019 10:06:42 +0000 Subject: [PATCH 3/6] Use running processes to find existing omsagent too --- jobs/omsagent/templates/install.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jobs/omsagent/templates/install.erb b/jobs/omsagent/templates/install.erb index 6c208af..5b0f500 100644 --- a/jobs/omsagent/templates/install.erb +++ b/jobs/omsagent/templates/install.erb @@ -41,8 +41,9 @@ DPKG_FOUND=$? # Stop existing agent reg="omsagent-[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}" sev=$(service --status-all | grep -P $reg -o) +ins=$(top -b -n 1 | grep omsagent) -if [ ! -z "$sev" ]; then +if [ ! -z "$sev" ] | [ ! -z "$ins" ]; then echo "Existing oms agent found $sev" netstat -anop | grep ${rsyslog_port} | cut -c 81- | cut -d'/' -f 1 | cut -d'-' -f 1 | xargs kill -s 9 service "$sev" stop From 9dfadc243fb92144e4aad6aff4366b1b551295b9 Mon Sep 17 00:00:00 2001 From: HDYA Date: Thu, 2 May 2019 01:07:29 +0000 Subject: [PATCH 4/6] Try to terminiate existing oms agent instance when installing --- jobs/omsagent/templates/install.erb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/jobs/omsagent/templates/install.erb b/jobs/omsagent/templates/install.erb index 5b0f500..55d5ccb 100644 --- a/jobs/omsagent/templates/install.erb +++ b/jobs/omsagent/templates/install.erb @@ -45,10 +45,20 @@ ins=$(top -b -n 1 | grep omsagent) if [ ! -z "$sev" ] | [ ! -z "$ins" ]; then echo "Existing oms agent found $sev" - netstat -anop | grep ${rsyslog_port} | cut -c 81- | cut -d'/' -f 1 | cut -d'-' -f 1 | xargs kill -s 9 + sudo netstat -anop | grep ${rsyslog_port} | cut -c 81- | cut -d'/' -f 1 | cut -d'-' -f 1 | sudo xargs kill -s 9 service "$sev" stop rm -f /etc/init.d/omsagent* + echo -n "Terminating existing oms agent.. " + current_pids=$(sudo netstat -anop | grep ${rsyslog_port} | cut -c 81- | cut -d'/' -f 1 | cut -d'-' -f 1) + for current_pid in $current_pids; do + echo -n "$curent_pid " + sudo kill -sigkill $current_pid + echo $curent_pid > $PID_FILE_TEMP + wait_until_process_stops $PID_FILE_TEMP 5 + done + echo "" + if [ ${DPKG_FOUND} -eq 0 ]; then dpkg -r omsagent omsconfig else From ca44c5ba28b6a5ce8ee82cb509a5f928fb098b0b Mon Sep 17 00:00:00 2001 From: Chudi Huang Date: Wed, 22 May 2019 17:44:26 +0800 Subject: [PATCH 5/6] Update readme and sample runtime config --- README.md | 9 ++++++--- manifests/example-runtime-config.yml | 5 ++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5a5685f..07ab74b 100644 --- a/README.md +++ b/README.md @@ -18,10 +18,10 @@ To use this bosh release, first upload it to your BOSH Director: ``` # BOSH CLI v1 -bosh upload release https://github.com/Azure/oms-agent-for-linux-boshrelease/releases/download/v1.4.2-125/oms-agent-for-linux-1.4.2-125.tgz +bosh upload release https://github.com/Azure/oms-agent-for-linux-boshrelease/releases/download/v1.9.0-0/oms-agent-for-linux-1.9.0-0.tgz # BOSH CLI v2 -bosh2 upload-release https://github.com/Azure/oms-agent-for-linux-boshrelease/releases/download/v1.4.2-125/oms-agent-for-linux-1.4.2-125.tgz +bosh2 upload-release https://github.com/Azure/oms-agent-for-linux-boshrelease/releases/download/v1.9.0-0/oms-agent-for-linux-1.9.0-0.tgz ``` ### 2. Deploy as a BOSH addon @@ -35,7 +35,7 @@ First, create a new file `runtime.yml` and paste all the following content into --- releases: - name: oms-agent-for-linux - version: 1.4.2-125 + version: 1.9.0-0 addons: - name: omsagent jobs: @@ -44,6 +44,9 @@ addons: exclude: stemcell: - os: windows2012R2 + - os: windows2016 + - os: windows2019 + - os: windows1803 properties: # Get the OMS workspace ID and key from OMS Portal oms: diff --git a/manifests/example-runtime-config.yml b/manifests/example-runtime-config.yml index 7c3cf02..1b0b101 100644 --- a/manifests/example-runtime-config.yml +++ b/manifests/example-runtime-config.yml @@ -1,6 +1,6 @@ releases: - name: oms-agent-for-linux - version: 1.4.2-125 + version: 1.9.0-0 url: https://github.com/Azure/oms-agent-for-linux-boshrelease/releases/download/v1.4.2-125/oms-agent-for-linux-1.4.2-125.tgz addons: - name: omsagent @@ -10,6 +10,9 @@ addons: exclude: stemcell: - os: windows2012R2 + - os: windows2016 + - os: windows2019 + - os: windows1803 properties: # Get the OMS workspace ID and key from OMS Portal oms: From 04307f799b2269c1b978d68ac0f9482dc190ebc4 Mon Sep 17 00:00:00 2001 From: HDYA Date: Wed, 22 May 2019 10:27:01 +0000 Subject: [PATCH 6/6] Post final release of version 1.9.0-0 --- .final_builds/jobs/omsagent/index.yml | 4 ++++ .final_builds/packages/omsagent/index.yml | 4 ++++ releases/oms-agent-for-linux/index.yml | 2 ++ .../oms-agent-for-linux-1.9.0-0.yml | 19 +++++++++++++++++++ 4 files changed, 29 insertions(+) create mode 100644 releases/oms-agent-for-linux/oms-agent-for-linux-1.9.0-0.yml diff --git a/.final_builds/jobs/omsagent/index.yml b/.final_builds/jobs/omsagent/index.yml index 8e1b9de..1f2fb2f 100644 --- a/.final_builds/jobs/omsagent/index.yml +++ b/.final_builds/jobs/omsagent/index.yml @@ -1,4 +1,8 @@ builds: + 74c08cc7427223fcb97e6952df75bbd6e95a00a8: + version: 74c08cc7427223fcb97e6952df75bbd6e95a00a8 + blobstore_id: 90b84d0d-4d6e-416d-5d8f-ae2c39483e68 + sha1: dc9d8e1b6643d94cc11fc0beb0fb3bfe1a2cb239 c2015c6bcb8b15450cd6c0e2c44ea5bb4370ef1b: version: c2015c6bcb8b15450cd6c0e2c44ea5bb4370ef1b blobstore_id: 39c55118-7e64-496e-61f7-f0f81debe957 diff --git a/.final_builds/packages/omsagent/index.yml b/.final_builds/packages/omsagent/index.yml index 4d31458..e99a58e 100644 --- a/.final_builds/packages/omsagent/index.yml +++ b/.final_builds/packages/omsagent/index.yml @@ -1,4 +1,8 @@ builds: + 0399986a65232675693fd885ea1374b0f4a72720: + version: 0399986a65232675693fd885ea1374b0f4a72720 + blobstore_id: cea62c12-a110-4152-437a-b0ef77883c4d + sha1: f34c7d9b659c913d56b5722b2cac026c34cc6b14 a834d1253b5cbe793dc3bf227f2377b4068d0a71: version: a834d1253b5cbe793dc3bf227f2377b4068d0a71 blobstore_id: 205e8b10-58b3-4074-56f2-18afe4abfa6b diff --git a/releases/oms-agent-for-linux/index.yml b/releases/oms-agent-for-linux/index.yml index c837376..f5e4eb3 100644 --- a/releases/oms-agent-for-linux/index.yml +++ b/releases/oms-agent-for-linux/index.yml @@ -1,4 +1,6 @@ builds: + 5d37573c-6aa0-4e9d-483d-c36b1f0d37f1: + version: 1.9.0-0 600837c5-972b-4c82-85ca-d54073f20aa3: version: "1" 870d9710-5fa3-470a-4e3f-e13adf1ed96e: diff --git a/releases/oms-agent-for-linux/oms-agent-for-linux-1.9.0-0.yml b/releases/oms-agent-for-linux/oms-agent-for-linux-1.9.0-0.yml new file mode 100644 index 0000000..a4d5713 --- /dev/null +++ b/releases/oms-agent-for-linux/oms-agent-for-linux-1.9.0-0.yml @@ -0,0 +1,19 @@ +name: oms-agent-for-linux +version: 1.9.0-0 +commit_hash: 9dfadc2 +uncommitted_changes: false +jobs: +- name: omsagent + version: 74c08cc7427223fcb97e6952df75bbd6e95a00a8 + fingerprint: 74c08cc7427223fcb97e6952df75bbd6e95a00a8 + sha1: dc9d8e1b6643d94cc11fc0beb0fb3bfe1a2cb239 +packages: +- name: omsagent + version: 0399986a65232675693fd885ea1374b0f4a72720 + fingerprint: 0399986a65232675693fd885ea1374b0f4a72720 + sha1: f34c7d9b659c913d56b5722b2cac026c34cc6b14 + dependencies: [] +license: + version: e6c4ccc65c76e75e2338d1edabdcf264d37ee663 + fingerprint: e6c4ccc65c76e75e2338d1edabdcf264d37ee663 + sha1: 039ff715624729edd9f8d54ab97dd71fb9ef2eea