airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dimuthu...@apache.org
Subject [airavata] branch staging updated: Creating distribution and ansibles for platform monitor
Date Mon, 19 Nov 2018 20:19:15 GMT
This is an automated email from the ASF dual-hosted git repository.

dimuthuupe pushed a commit to branch staging
in repository https://gitbox.apache.org/repos/asf/airavata.git


The following commit(s) were added to refs/heads/staging by this push:
     new 0758b75  Creating distribution and ansibles for platform monitor
0758b75 is described below

commit 0758b75be73c7d689fcd2e3d6ac048c6f4e78592
Author: Dimuthu Wannipurage <dimuthu.wannipurage@datasprouts.com>
AuthorDate: Mon Nov 19 15:19:06 2018 -0500

    Creating distribution and ansibles for platform monitor
---
 .../scigap/staging/group_vars/all/vars.yml         | 12 ++-
 .../scigap/staging/group_vars/all/vault.yml        | 65 ++++++++--------
 .../scigap/testing/group_vars/all/vars.yml         | 12 ++-
 .../scigap/testing/group_vars/all/vault.yml        | 67 ++++++++--------
 dev-tools/ansible/platform-monitor.yml             | 31 ++++++++
 .../roles/platform_monitor/defaults/main.yml       | 26 +++++++
 .../ansible/roles/platform_monitor/tasks/main.yml  | 70 +++++++++++++++++
 .../templates/airavata-server.properties.j2        | 11 +++
 .../platform_monitor/templates/logback.xml.j2      | 53 +++++++++++++
 modules/airavata-helix/helix-distribution/pom.xml  | 16 ++++
 .../assembly/platform-monitor-bin-assembly.xml     | 86 ++++++++++++++++++++
 .../bin/platform-monitor-daemon.sh                 | 91 ++++++++++++++++++++++
 .../platform-monitor/bin/platform-monitor.sh       | 71 +++++++++++++++++
 .../main/resources/platform-monitor/bin/setenv.sh  | 46 +++++++++++
 .../conf/airavata-server.properties                | 33 ++++++++
 .../resources/platform-monitor/conf/logback.xml    | 53 +++++++++++++
 .../src/main/resources/airavata-server.properties  |  4 +-
 17 files changed, 680 insertions(+), 67 deletions(-)

diff --git a/dev-tools/ansible/inventories/scigap/staging/group_vars/all/vars.yml b/dev-tools/ansible/inventories/scigap/staging/group_vars/all/vars.yml
index 7a66efc..ce9c1d2 100644
--- a/dev-tools/ansible/inventories/scigap/staging/group_vars/all/vars.yml
+++ b/dev-tools/ansible/inventories/scigap/staging/group_vars/all/vars.yml
@@ -145,6 +145,10 @@ helix_url: http://www-us.apache.org/dist//helix/{{helix_version}}/binaries/helix
 helix_dir: "{{ deployment_dir }}/airavata-helix"
 helix_cluster_name: "AiravataDemoCluster"
 snapshot_version: "0.17-SNAPSHOT"
+helix_controller_name: "helixcontroller"
+helix_participant_name: "helixparticipant"
+helix_pre_wm_name: "prewm"
+helix_post_wm_name: "postwm"
 
 # Listening port for kafka installations
 kafka_listener_port: 9092
@@ -159,4 +163,10 @@ realtime_monitor_broker_topic: "helix-airavata-mq"
 # Variables related to the broker in which parsed job statuses are published
 job_monitor_broker_url: "{{ groups['kafka'][0] }}:{{ kafka_listener_port }}"
 job_monitor_broker_topic: "parsed-data"
-job_monitor_broker_consumer_group: "MonitoringConsumer"
\ No newline at end of file
+job_monitor_broker_consumer_group: "MonitoringConsumer"
+
+# Variables related to platform monitor
+platform_name: "Staging Environment"
+platform_monitor_email_address: "airavataplatformmonitor@gmail.com"
+platform_monitor_email_password: "{{ vault_platform_monitor_email_password }}"
+platform_monitor_target_email_addresses: "dimuthu.upeksha2@gmail.com,dwannipu@iu.edu"
\ No newline at end of file
diff --git a/dev-tools/ansible/inventories/scigap/staging/group_vars/all/vault.yml b/dev-tools/ansible/inventories/scigap/staging/group_vars/all/vault.yml
index e5d7671..b66a4e4 100644
--- a/dev-tools/ansible/inventories/scigap/staging/group_vars/all/vault.yml
+++ b/dev-tools/ansible/inventories/scigap/staging/group_vars/all/vault.yml
@@ -1,32 +1,35 @@
 $ANSIBLE_VAULT;1.1;AES256
-36656438643034386437333735643963306462343964333131646432353464333663656462623261
-6537633832376334666261346438346466363263373135390a313962303637396532366231376336
-65636236353137383061636664386133363838316230376664333265633564343633653333623736
-6536363430653439650a633431393961333438363462356434333735646566353263366565336533
-31633462353766356562616236363964656265363537636166613931366130303135386330383939
-65613230363762326164643432323661636639653763373130373433356666323466353361333338
-61336331646139323033613037643839353430343737363234386233353936646264386538396164
-63303435373266653137383238356136333962323130663766616465313537663333663130653066
-64313838623634643632323862316437333764366364656266353232643036393262363130616465
-33383465383838643561653035336563383366623737336235336266393134636332666561356536
-39623961613966333130613936656332353331653863363138666338363064633130343936393134
-65613132653934313632626261316663646266636237666437613739383965653531343862313538
-66313130613862623435666665393363383638313962633938353064386633346266623264373561
-66336430323361366131613163323861373563656133323335636237306332356637353766636164
-37343639346533616462303234303930343938323537346537663938336531623034373335313061
-65376636653834626364356536383666333337656163323235613332396638636365643363666239
-64333434656130646533306330626635313132633536616363333139643866396136373132646239
-65386232353139366338356130653831623539393263343137313739643430616566363232366661
-66383731393931326432636231366434343364336264643436633639373134373565643466663933
-39383835363635623461313365666562383365313339363766313638656238623139363833643638
-66653732613035303365646137643333653061643263396266396639626633386536663462373663
-64633331383161313337343063373461623534373630353239633930366165633931663462303234
-62666662393234633034313732646436326562336637336136623766616634386439313937346363
-66613730376531663833646133633736326633656538383966326232336633316662313235653063
-61386365353266613665333935343165356263663164383635313632613935636333386538303934
-61323733636263623439656339316139313163376565363032353236313738626261643064316364
-38643937323136386233303566376462663836626538386261356333323637353861613836666663
-34396137636561333738663035653939656230633838343766343432366466383537653334326462
-33366431346465333562306164353934316261643330376565336364373231363335303733653439
-37376639326335323137306161366439333465393432396638343837343930313635333433346263
-306562646366333162653131396234633362
+31616262346333646135653763653234353332343934396131363737336261663538626161613733
+6337616532666333376131396636336333653633643564610a363735613964343835326539643062
+63653630633334653564356532653631383532623064303166303639656230643461643034373566
+3638656561323365370a646361306533333838333836303662393639376532326664303865666433
+33373166646135353032333039626461666433326333353531653930373964373361333164666431
+31373165393939393633363736346661666262636433333330316430663063613864383732303764
+65376534313665386530373237613165663132616665316135303765393737393866316430356130
+30616364333036633161353636616434326138346337333062616333363264306438636435393430
+65383261633936633261396661613338373437653337316531363962326261316166313233646462
+31356136666562633130313466383330383736666566366134303234653736386335643533653632
+61633136376562303335383465313335393066623739323930626162613366336332653437343533
+63316135333735376132303139396331393934373462613430616563636332396134343262326630
+61663530646465333665366364623639323931313838346463383836316138346663663832616534
+66303136643831306530653837613435393937326139323266393337623730393435376666666235
+31613263663434313935376435313035633639626431333935313632306337623861393036613334
+35363864656665343934303934323564313734393765303639646638636635653737656430393762
+31376532353939343037303434653962333762343032636363623661333035366262373936646432
+64663239373261326239653837646531333237626335333663613766343335663435323835646136
+39636230326533663565646538333635366338653334346665326330396664363632393839343330
+61353235373234393366393064373164663730653634333562333234613239643064666562636231
+66326130383332386262373765323937313164396432333235636561353666303936656336643361
+39643831616564636239626539353333386165653465666666366434656436356234336166633637
+35306130323030363762366237643734343263343732316665336132303535323863326438376435
+37383664663861356335303231633838393261623730346566323661306332663565323331613634
+34633732666562653333626663303862633732386537623934333433346234653239643864653834
+32343535633065346563383130646133643331363231306331313834663562343538623366386532
+38396536343935633639633938353337366132373431643936343538366135343338623062633336
+39393061326365313461633961623033623865313736356634313535313239653732383234363261
+61393563353638373735353836303333616563363532323661383730326562353637626539633538
+31316531363663613339663739373331356139303339393232616631386430396236316666653539
+37346462353131326233383932373934393235333139313263316334666565666561666439623162
+32366634633335616339366235633033336531663766323939633261383836373033636332633634
+39663034643632616137333663393362343665383139616565393234656663336465633030323134
+3366386538626165623566383966323231386364313737663461
diff --git a/dev-tools/ansible/inventories/scigap/testing/group_vars/all/vars.yml b/dev-tools/ansible/inventories/scigap/testing/group_vars/all/vars.yml
index 7c26d5c..c7c6536 100644
--- a/dev-tools/ansible/inventories/scigap/testing/group_vars/all/vars.yml
+++ b/dev-tools/ansible/inventories/scigap/testing/group_vars/all/vars.yml
@@ -145,6 +145,10 @@ helix_url: http://www-us.apache.org/dist//helix/{{helix_version}}/binaries/helix
 helix_dir: "{{ deployment_dir }}/airavata-helix"
 helix_cluster_name: "AiravataDemoCluster"
 snapshot_version: "0.17-SNAPSHOT"
+helix_controller_name: "helixcontroller"
+helix_participant_name: "helixparticipant"
+helix_pre_wm_name: "prewm"
+helix_post_wm_name: "postwm"
 
 # Listening port for kafka installations
 kafka_listener_port: 9092
@@ -159,4 +163,10 @@ realtime_monitor_broker_topic: "helix-airavata-mq"
 # Variables related to the broker in which parsed job statuses are published
 job_monitor_broker_url: "{{ groups['kafka'][0] }}:{{ kafka_listener_port }}"
 job_monitor_broker_topic: "parsed-data"
-job_monitor_broker_consumer_group: "MonitoringConsumer"
\ No newline at end of file
+job_monitor_broker_consumer_group: "MonitoringConsumer"
+
+# Variables related to platform monitor
+platform_name: "Testing Environment"
+platform_monitor_email_address: "airavataplatformmonitor@gmail.com"
+platform_monitor_email_password: "{{ vault_platform_monitor_email_password }}"
+platform_monitor_target_email_addresses: "dimuthu.upeksha2@gmail.com,dwannipu@iu.edu"
\ No newline at end of file
diff --git a/dev-tools/ansible/inventories/scigap/testing/group_vars/all/vault.yml b/dev-tools/ansible/inventories/scigap/testing/group_vars/all/vault.yml
index d97e220..df494a2 100644
--- a/dev-tools/ansible/inventories/scigap/testing/group_vars/all/vault.yml
+++ b/dev-tools/ansible/inventories/scigap/testing/group_vars/all/vault.yml
@@ -1,33 +1,36 @@
 $ANSIBLE_VAULT;1.1;AES256
-34333132336261396333343336386135666664326335393938306435306534396564623537323031
-3535393966393238383634633630643662633939373538320a626132363836653833663038656633
-33363836383465636266656338633164646231366233316265376431366439393761623737623139
-6366373232633837380a616134383363346633333663353539383537613237663861356639303031
-65386533376362653762353261363763383537653265623564643661373030336535616264346433
-61303730383830313661386461626637356436643933306564303338366532623731333234303264
-37303636396433386166643463663530633966323130626664626231653435386131303639356134
-34303738313064313961346330363635623733656131626361666461656634653234636335356666
-38313936323566343466613535646632653134613162633436316233646361653939656435663362
-65336633626233396264643532366561383266623962303164636134626361363965346161653935
-65653533353933613839393465626361376665636434346664623165326662373665323738626664
-33333038643936326439623538393832663437643636323330623431613734393662626130613461
-38333732636138323135393037643233633839663134636665626635633138333931653238393836
-63313934383236393734366264313431313236326136326537623666366466306535313462326666
-34386533343734393437646630656435616164326363623034633837616266333436663163386136
-35306134323031346565663839303937316266306235376632306130653161356339373938613737
-64666166373362373331636661336534626665646433383831383465626137326262663438356335
-39303038353736653831323962373632613232623234313135663339613137316230316265326431
-30633439643232353338373435376533303938623834366631363231373639666532393130353732
-66303132643065373431646337306631636232323666623039663365386163363064383861303663
-38663539646237363833393365303337633731623534396463623139636130313962346232346566
-65343539656264323962666634373131353433333364633638313530613335376232393962626339
-66646562313436356530643365633637663239366561363630363232323662363431343530393736
-63393362363063663838623162656166346236313530376638656562666663366163666136383633
-34363736633237353336383437303038316362373566656461326631323638383039336263656662
-64333263323334366230653731643564633239333565616662633931303961306435643535656362
-32666638383562383464616462653164306632663036356435643431633538633532303033323661
-65333538663330316263663734383132353462666238643037613962626563363063396263326165
-64663362316565333737613065636165313565383035623336323536333638333939353139663263
-36366133613965333361323836343038626339303834663866656263393638636236643930386465
-64386431326639316364313233343665306537326234326330366433366530323935323363323263
-35343361306436623965
+64353130323432656234373234323330663634653639333262353635323934333030633263343931
+3632616633383062356161643737386563326132306633370a393866343564383761353762346130
+61643331653535616330353235663538646632663365353638356162643430653963623230613363
+3034663435663266620a373933386531343633353636376330643063643666656232376464333232
+61626531333535363864373938356134373730396566613733613363353331323764346564336132
+34323432383739326534633131366530623137653032386332656634643465616236313963336638
+38303331366636316634626461653566643966336438336534393163643032613139333461653931
+64323465343032386631663161336330343430653861396639353364353763393636623133663564
+61336537396434623231363638306561633631663438353263396532336662666364613137353335
+64643336653435643961313062303638333037393233316566336231666461663966636566393166
+35636536623731643038333263623933326332373263306433663261643130633937656437343335
+35383831343862626430393233356566656438393265666666623762383733333833646334396439
+30623132666239333061613031383365323261653634393161366631366532303030366634633335
+65643963393339346231663636653264393834333239646433393534343834393664383631343231
+30336534316361373630306638656366623766356536326535306536656133363264663063346134
+34386334386165333439323930633133346165343039616632306533623162643736316236663333
+64353132623332376262333831613133333835383730613063366330336231303464333132303634
+63613864383733613466653230386534333932623765346430303165643338653236373538376636
+66663239633265633263326534653534306533623561336336363533326663303961396438336361
+39373233393338383332346665646238646633663738656436353139306235616265376363326232
+64316233353338373332636661623330633661663462656664636564323432346438343934376230
+39333964323966363162333062313530356161616364613963336163326635346133383366353233
+61636431376232613835656661376161393230346631366635373339356666393538383130336335
+33313261303162666639336631393238316233323833356161383433363363626263643964353439
+36643639666638623064623839363865373931373063393234613361663661323435643365396334
+63303833343337356133376337346439343331663034643066373638366134633766393232333737
+63623736633463343164626130366565356632366331653732373763663534366532633037663036
+37396632326436363661633165343564353636316139333138393836396633326261636661336630
+39653139393539326630323631313530306232633030656364633337363733386165323432653030
+66656562616566343037653564383964353036626638326435336462643135343262393934363666
+37343039653334633235653762383938316530343132393466363566316436363631373964643938
+37363936383061346563646538653433306136376362366165333966383430376639396664396139
+65303334356663663335626331313865386165346466386137363165626665393562393139353930
+37313930313036333363333530366131343761376332623939356134623561393563366565623039
+353166643162643737323331663438373437
diff --git a/dev-tools/ansible/platform-monitor.yml b/dev-tools/ansible/platform-monitor.yml
new file mode 100644
index 0000000..510c034
--- /dev/null
+++ b/dev-tools/ansible/platform-monitor.yml
@@ -0,0 +1,31 @@
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+---
+- hosts: helix
+  tags: helix, airavata
+  roles:
+    - role: common
+      become: yes
+      become_user: "{{user}}"
+    - role: platform_monitor
+      become: yes
+      become_user: "{{user}}"
+...
diff --git a/dev-tools/ansible/roles/platform_monitor/defaults/main.yml b/dev-tools/ansible/roles/platform_monitor/defaults/main.yml
new file mode 100644
index 0000000..0f247e2
--- /dev/null
+++ b/dev-tools/ansible/roles/platform_monitor/defaults/main.yml
@@ -0,0 +1,26 @@
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+---
+platform_monitor_name: "platform-monitor"
+platform_monitor_version: "platform-monitor-{{ snapshot_version }}"
+platform_monitor_dist_name: "{{ platform_monitor_version }}-bin.tar.gz"
+platform_monitor_log_dir: "{{ helix_dir }}/{{ platform_monitor_version }}/logs"
+...
diff --git a/dev-tools/ansible/roles/platform_monitor/tasks/main.yml b/dev-tools/ansible/roles/platform_monitor/tasks/main.yml
new file mode 100644
index 0000000..0926493
--- /dev/null
+++ b/dev-tools/ansible/roles/platform_monitor/tasks/main.yml
@@ -0,0 +1,70 @@
+#
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+---
+
+# Create the directory for Helix deployment
+- name: Create helix deployment directory
+  file: path="{{ helix_dir }}" state=directory owner={{ user }} group={{ group }} recurse=yes
+
+- name: Stop daemons if running
+  command: "{{ item.command }} chdir={{ helix_dir }}/{{ item.dir }}/"
+  with_items:
+  - { command: ./bin/platform-monitor-daemon.sh stop, dir: "{{ platform_monitor_version }}"
}
+  ignore_errors: yes
+
+# Copy required distributions to the deployment directory
+- name: Copy platform monitor distribution to airavata-helix deployment directory
+  unarchive: "src={{ airavata_source_dir }}/modules/airavata-helix/helix-distribution/target/{{
item }}
+              dest={{ helix_dir }}/ copy=no"
+  with_items:
+  - "{{ platform_monitor_dist_name }}"
+
+# Copy properties files & logback.xml files
+
+- name: Copy Airavata server properties files
+  template: "src={{ item.name }}/airavata-server.properties.j2
+            dest={{ helix_dir }}/{{ item.dir }}/conf/airavata-server.properties
+            owner={{ user }}
+            group={{ group }}
+            mode=\"u=rw,g=r,o=r\""
+  with_items:
+  - { name: platform_monitor, dir: "{{ platform_monitor_version }}" }
+
+- name: Copy logback configuration file
+  template: "src={{ item.name }}/logback.xml.j2
+            dest={{ helix_dir }}/{{ item.dir }}/conf/logback.xml
+            owner={{ user }}
+            group={{ group }}
+            mode=\"u=rw,g=r,o=r\""
+  with_items:
+  - { name: platform_monitor, dir: "{{ platform_monitor_version }}" }
+
+- name: Create logs directory
+  file: "path={{ item }} state=directory owner={{ user }} group={{ group }}"
+  with_items:
+  - "{{ platform_monitor_log_dir }}"
+
+# Run bash-scripts
+- name: Start daemons
+  command: "{{ item.command }} chdir={{ helix_dir }}/{{ item.dir }}/"
+  with_items:
+  - { command: ./bin/platform-monitor-daemon.sh start, dir: "{{ platform_monitor_version
}}" }
+...
diff --git a/dev-tools/ansible/roles/platform_monitor/templates/airavata-server.properties.j2
b/dev-tools/ansible/roles/platform_monitor/templates/airavata-server.properties.j2
new file mode 100644
index 0000000..6805de2
--- /dev/null
+++ b/dev-tools/ansible/roles/platform_monitor/templates/airavata-server.properties.j2
@@ -0,0 +1,11 @@
+api.server.host={{ api_server_host }}
+api.server.port={{ api_server_tls_port }}
+database.host={{ db_server }}
+database.port={{ db_server_port }}
+helix.cluster.name={{ helix_cluster_name }}
+helix.participant.name={{ helix_participant_name }}
+zookeeper.server.connection={{ zookeeper_connection_url }}
+sender.email.account={{ platform_monitor_email_address }}
+sender.email.password={{ platform_monitor_email_password }}
+target.email.accounts={{ platform_monitor_target_email_addresses }}
+platform.name={{ platform_name }}
\ No newline at end of file
diff --git a/dev-tools/ansible/roles/platform_monitor/templates/logback.xml.j2 b/dev-tools/ansible/roles/platform_monitor/templates/logback.xml.j2
new file mode 100644
index 0000000..5968256
--- /dev/null
+++ b/dev-tools/ansible/roles/platform_monitor/templates/logback.xml.j2
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<configuration>
+
+    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%d [%t] %-5p %c{30} %m [%X]%n</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="LOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <File>{{ platform_monitor_log_dir }}/airavata.log</File>
+        <Append>true</Append>
+        <encoder>
+            <pattern>%d [%t] %-5p %c{30} %m [%X]%n</pattern>
+        </encoder>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>{{ platform_monitor_log_dir }}/airavata.log.%d{yyyy-MM-dd}</fileNamePattern>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>1GB</totalSizeCap>
+        </rollingPolicy>
+    </appender>
+
+    <logger name="ch.qos.logback" level="WARN"/>
+    <logger name="org.apache.helix" level="WARN"/>
+    <logger name="org.apache.zookeeper" level="ERROR"/>
+    <logger name="org.apache.airavata" level="INFO"/>
+    <logger name="org.hibernate" level="ERROR"/>
+    <root level="INFO">
+        <appender-ref ref="CONSOLE"/>
+        <appender-ref ref="LOGFILE"/>
+    </root>
+</configuration>
\ No newline at end of file
diff --git a/modules/airavata-helix/helix-distribution/pom.xml b/modules/airavata-helix/helix-distribution/pom.xml
index 15459ab..7ba848c 100644
--- a/modules/airavata-helix/helix-distribution/pom.xml
+++ b/modules/airavata-helix/helix-distribution/pom.xml
@@ -121,6 +121,21 @@
                             <attach>false</attach>
                         </configuration>
                     </execution>
+                    <execution>
+                        <id>platform-monitor-distribution-package</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                        <configuration>
+                            <tarLongFileMode>posix</tarLongFileMode>
+                            <finalName>${platform.monitor.archive.name}-${project.version}</finalName>
+                            <descriptors>
+                                <descriptor>src/main/assembly/platform-monitor-bin-assembly.xml</descriptor>
+                            </descriptors>
+                            <attach>false</attach>
+                        </configuration>
+                    </execution>
                 </executions>
             </plugin>
         </plugins>
@@ -132,5 +147,6 @@
         <pre.wm.archieve.name>helix-pre-wm</pre.wm.archieve.name>
         <post.wm.archieve.name>helix-post-wm</post.wm.archieve.name>
         <parser.wm.archive.name>helix-parser-wm</parser.wm.archive.name>
+        <platform.monitor.archive.name>platform-monitor</platform.monitor.archive.name>
     </properties>
 </project>
\ No newline at end of file
diff --git a/modules/airavata-helix/helix-distribution/src/main/assembly/platform-monitor-bin-assembly.xml
b/modules/airavata-helix/helix-distribution/src/main/assembly/platform-monitor-bin-assembly.xml
new file mode 100644
index 0000000..08dfcb0
--- /dev/null
+++ b/modules/airavata-helix/helix-distribution/src/main/assembly/platform-monitor-bin-assembly.xml
@@ -0,0 +1,86 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<!DOCTYPE assembly [
+        <!ELEMENT assembly (id|includeBaseDirectory|baseDirectory|formats|fileSets|dependencySets)*>
+        <!ELEMENT id (#PCDATA)>
+        <!ELEMENT includeBaseDirectory (#PCDATA)>
+        <!ELEMENT baseDirectory (#PCDATA)>
+        <!ELEMENT formats (format)*>
+        <!ELEMENT format (#PCDATA)>
+        <!ELEMENT fileSets (fileSet)*>
+        <!ELEMENT fileSet (directory|outputDirectory|fileMode|includes)*>
+        <!ELEMENT directory (#PCDATA)>
+        <!ELEMENT outputDirectory (#PCDATA)>
+        <!ELEMENT includes (include)*>
+        <!ELEMENT include (#PCDATA)>
+        <!ELEMENT dependencySets (dependencySet)*>
+        <!ELEMENT dependencySet (outputDirectory|outputFileNameMapping|includes)*>
+        ]>
+<assembly>
+    <id>bin</id>
+    <includeBaseDirectory>true</includeBaseDirectory>
+    <baseDirectory>${platform.monitor.archive.name}-${version}</baseDirectory>
+    <formats>
+        <format>tar.gz</format>
+        <format>zip</format>
+    </formats>
+
+    <fileSets>
+        <fileSet>
+            <directory>src/main/resources/platform-monitor/bin</directory>
+            <outputDirectory>bin</outputDirectory>
+            <fileMode>777</fileMode>
+            <includes>
+                <include>*.sh</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>src/main/resources/platform-monitor/conf</directory>
+            <outputDirectory>conf</outputDirectory>
+            <includes>
+                <include>airavata-server.properties</include>
+                <include>logback.xml</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>./</directory>
+            <outputDirectory>logs</outputDirectory>
+            <excludes>
+                <exclude>*/**</exclude>
+            </excludes>
+        </fileSet>
+    </fileSets>
+
+    <dependencySets>
+        <dependencySet>
+            <useProjectArtifact>false</useProjectArtifact>
+            <outputDirectory>lib</outputDirectory>
+            <includes>
+                <include>*:*:jar</include>
+            </includes>
+            <excludes>
+                <exclude>mysql:mysql-connector-java:jar</exclude>
+                <exclude>log4j:log4j:jar</exclude>
+            </excludes>
+        </dependencySet>
+    </dependencySets>
+
+</assembly>
diff --git a/modules/airavata-helix/helix-distribution/src/main/resources/platform-monitor/bin/platform-monitor-daemon.sh
b/modules/airavata-helix/helix-distribution/src/main/resources/platform-monitor/bin/platform-monitor-daemon.sh
new file mode 100644
index 0000000..684132c
--- /dev/null
+++ b/modules/airavata-helix/helix-distribution/src/main/resources/platform-monitor/bin/platform-monitor-daemon.sh
@@ -0,0 +1,91 @@
+#!/usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+. `dirname $0`/setenv.sh
+# Capture user's working dir before changing directory
+CWD="$PWD"
+cd ${AIRAVATA_HOME}/bin
+LOGO_FILE="logo.txt"
+
+JAVA_OPTS="-Dairavata.config.dir=${AIRAVATA_HOME}/conf -Dairavata.home=${AIRAVATA_HOME} -Dlogback.configurationFile=file:${AIRAVATA_HOME}/conf/logback.xml"
+AIRAVATA_COMMAND=""
+EXTRA_ARGS=""
+SERVERS=""
+LOGO=true
+IS_SUBSET=false
+SUBSET=""
+DEFAULT_LOG_FILE="${AIRAVATA_HOME}/logs/airavata-daemon.out"
+LOG_FILE=$DEFAULT_LOG_FILE
+
+SERVICE_NAME="Platform Monitor"
+PID_PATH_NAME="${AIRAVATA_HOME}/bin/service-pid"
+
+case $1 in
+    start)
+        echo "Starting $SERVICE_NAME ..."
+        if [ ! -f $PID_PATH_NAME ]; then
+            nohup java ${JAVA_OPTS} -classpath "${AIRAVATA_CLASSPATH}" \
+            org.apache.airavata.helix.cluster.monitoring.MainMonitor ${AIRAVATA_COMMAND}
$* > $LOG_FILE 2>&1 &
+            echo $! > $PID_PATH_NAME
+            echo "$SERVICE_NAME started ..."
+        else
+            echo "$SERVICE_NAME is already running ..."
+        fi
+    ;;
+    stop)
+        if [ -f $PID_PATH_NAME ]; then
+            PID=$(cat $PID_PATH_NAME);
+            echo "$SERVICE_NAME stoping ..."
+            kill $PID;
+            echo "$SERVICE_NAME stopped ..."
+            rm $PID_PATH_NAME
+        else
+            echo "$SERVICE_NAME is not running ..."
+        fi
+    ;;
+    restart)
+        if [ -f $PID_PATH_NAME ]; then
+            PID=$(cat $PID_PATH_NAME);
+            echo "$SERVICE_NAME stopping ...";
+            kill $PID;
+            echo "$SERVICE_NAME stopped ...";
+            rm $PID_PATH_NAME
+            echo "$SERVICE_NAME starting ..."
+            nohup java ${JAVA_OPTS} -classpath "${AIRAVATA_CLASSPATH}" \
+            org.apache.airavata.helix.cluster.monitoring.MainMonitor ${AIRAVATA_COMMAND}
$* > $LOG_FILE 2>&1 &
+            echo $! > $PID_PATH_NAME
+            echo "$SERVICE_NAME started ..."
+        else
+            echo "$SERVICE_NAME is not running ..."
+        fi
+    ;;
+    -h)
+        echo "Usage: platform-monitor-daemon.sh"
+
+        echo "command options:"
+        echo "  start               Start server in daemon mode"
+        echo "  stop                Stop server running in daemon mode"
+        echo "  restart             Restart server in daemon mode"
+	    echo "  -log <LOG_FILE>     Where to redirect stdout/stderr (defaults to $DEFAULT_LOG_FILE)"
+        echo "  -h                  Display this help and exit"
+        shift
+        exit 0
+    ;;
+esac
+
diff --git a/modules/airavata-helix/helix-distribution/src/main/resources/platform-monitor/bin/platform-monitor.sh
b/modules/airavata-helix/helix-distribution/src/main/resources/platform-monitor/bin/platform-monitor.sh
new file mode 100644
index 0000000..2aa3546
--- /dev/null
+++ b/modules/airavata-helix/helix-distribution/src/main/resources/platform-monitor/bin/platform-monitor.sh
@@ -0,0 +1,71 @@
+#!/usr/bin/env bash
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+. `dirname $0`/setenv.sh
+# Capture user's working dir before changing directory
+CWD="$PWD"
+cd ${AIRAVATA_HOME}/bin
+LOGO_FILE="logo.txt"
+
+JAVA_OPTS="-Dairavata.config.dir=${AIRAVATA_HOME}/conf -Dairavata.home=${AIRAVATA_HOME} -Dlogback.configurationFile=file:${AIRAVATA_HOME}/conf/logback.xml"
+AIRAVATA_COMMAND=""
+EXTRA_ARGS=""
+SERVERS=""
+IS_SUBSET=false
+SUBSET=""
+DEFAULT_LOG_FILE="${AIRAVATA_HOME}/logs/airavata.out"
+LOG_FILE=$DEFAULT_LOG_FILE
+
+# parse command arguments
+for var in "$@"
+do
+    case ${var} in
+        -xdebug)
+        	AIRAVATA_COMMAND="${AIRAVATA_COMMAND}"
+            JAVA_OPTS="$JAVA_OPTS -Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8000"
+            shift
+	    ;;
+        -log)
+            shift
+            LOG_FILE="$1"
+            shift
+            # If relative path, expand to absolute path using the user's $CWD
+            if [ -z "`echo "$LOG_FILE" | egrep "^/"`" ]; then
+                LOG_FILE="${CWD}/${LOG_FILE}"
+            fi
+        ;;
+        -h)
+            echo "Usage: platform-monitor.sh"
+
+            echo "command options:"
+            echo "  -xdebug             Start Platform Monitor JPDA debugger"
+            echo "  -h                  Display this help and exit"
+            shift
+            exit 0
+        ;;
+	    *)
+	        EXTRA_ARGS="${EXTRA_ARGS} ${var}"
+            shift
+        ;;
+    esac
+done
+
+java ${JAVA_OPTS} -classpath "${AIRAVATA_CLASSPATH}" \
+    org.apache.airavata.helix.cluster.monitoring.MainMonitor ${AIRAVATA_COMMAND} $*
+
diff --git a/modules/airavata-helix/helix-distribution/src/main/resources/platform-monitor/bin/setenv.sh
b/modules/airavata-helix/helix-distribution/src/main/resources/platform-monitor/bin/setenv.sh
new file mode 100755
index 0000000..9e894e1
--- /dev/null
+++ b/modules/airavata-helix/helix-distribution/src/main/resources/platform-monitor/bin/setenv.sh
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+# 
+# http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# resolve links - $0 may be a softlink
+PRG="$0"
+
+while [ -h "$PRG" ]; do
+  ls=`ls -ld "$PRG"`
+  link=`expr "$ls" : '.*-> \(.*\)$'`
+  if expr "$link" : '.*/.*' > /dev/null; then
+    PRG="$link"
+  else
+    PRG=`dirname "$PRG"`/"$link"
+  fi
+done
+
+PRGDIR=`dirname "$PRG"`
+
+# Only set AIRAVATA_HOME if not already set
+[ -z "$AIRAVATA_HOME" ] && AIRAVATA_HOME=`cd "$PRGDIR/.." ; pwd`
+
+AIRAVATA_CLASSPATH=""
+
+for f in "$AIRAVATA_HOME"/lib/*.jar
+do
+  AIRAVATA_CLASSPATH="$AIRAVATA_CLASSPATH":$f
+done
+
+export AIRAVATA_HOME
+export AIRAVATA_CLASSPATH
diff --git a/modules/airavata-helix/helix-distribution/src/main/resources/platform-monitor/conf/airavata-server.properties
b/modules/airavata-helix/helix-distribution/src/main/resources/platform-monitor/conf/airavata-server.properties
new file mode 100644
index 0000000..194a0d0
--- /dev/null
+++ b/modules/airavata-helix/helix-distribution/src/main/resources/platform-monitor/conf/airavata-server.properties
@@ -0,0 +1,33 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+
+###########################################################################
+# Platform Monitor configurations
+###########################################################################
+
+api.server.host=CHANGE_ME
+api.server.port=CHANGE_ME
+database.host=CHANGE_ME
+database.port=CHANGE_ME
+helix.cluster.name=CHANGE_ME
+helix.participant.name=CHANGE_ME
+zookeeper.server.connection=CHANGE_ME
+sender.email.account=CHANGE_ME
+sender.email.password=CHANGE_ME
+target.email.accounts=CHANGE_ME
+platform.name=CHANGE_ME
\ No newline at end of file
diff --git a/modules/airavata-helix/helix-distribution/src/main/resources/platform-monitor/conf/logback.xml
b/modules/airavata-helix/helix-distribution/src/main/resources/platform-monitor/conf/logback.xml
new file mode 100644
index 0000000..ef38b65
--- /dev/null
+++ b/modules/airavata-helix/helix-distribution/src/main/resources/platform-monitor/conf/logback.xml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+<configuration>
+
+    <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
+        <encoder>
+            <pattern>%d [%t] %-5p %c{30} %X - %m%n</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="LOGFILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <File>../logs/airavata.log</File>
+        <Append>true</Append>
+        <encoder>
+            <pattern>%d [%t] %-5p %c{30} %X - %m%n</pattern>
+        </encoder>
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <fileNamePattern>../logs/airavata.log.%d{yyyy-MM-dd}</fileNamePattern>
+            <maxHistory>30</maxHistory>
+            <totalSizeCap>1GB</totalSizeCap>
+        </rollingPolicy>
+    </appender>
+
+    <logger name="ch.qos.logback" level="WARN"/>
+    <logger name="org.apache.helix" level="WARN"/>
+    <logger name="org.apache.zookeeper" level="ERROR"/>
+    <logger name="org.apache.airavata" level="INFO"/>
+    <logger name="org.hibernate" level="ERROR"/>
+    <root level="INFO">
+        <appender-ref ref="CONSOLE"/>
+        <appender-ref ref="LOGFILE"/>
+    </root>
+</configuration>
diff --git a/modules/airavata-helix/platform-monitor/src/main/resources/airavata-server.properties
b/modules/airavata-helix/platform-monitor/src/main/resources/airavata-server.properties
index 6aecc09..11ac6df 100644
--- a/modules/airavata-helix/platform-monitor/src/main/resources/airavata-server.properties
+++ b/modules/airavata-helix/platform-monitor/src/main/resources/airavata-server.properties
@@ -5,7 +5,7 @@ database.port=3306
 helix.cluster.name=AiravataDemoCluster
 helix.participant.name=helixparticipant
 zookeeper.server.connection=149.165.170.103:2181
-sender.email.account=testingjobsairavata@gmail.com
-sender.email.password=XseDe2015
+sender.email.account=CHANGE_ME
+sender.email.password=CHANGE_ME
 target.email.accounts=dimuthu.upeksha2@gmail.com,dwannipu@iu.edu
 platform.name=Testing Environment
\ No newline at end of file


Mime
View raw message