浏览代码

Issue #722: Adding slurm_telemetry role

Signed-off-by: blesson-james <blesson_james@Dellteam.com>
blesson-james 3 年之前
父节点
当前提交
16907bd8a6

+ 1 - 1
.github/workflows/ansible-lint.yml

@@ -39,7 +39,7 @@ jobs:
         # Must follow the example syntax.
         override-deps: |
           ansible==2.10
-          ansible-lint==5.1.2
+          ansible-lint==5.3.2
         # [optional]
         # Arguments to be passed to the ansible-lint
 

+ 20 - 0
telemetry/roles/slurm_telemetry/files/Dockerfile

@@ -0,0 +1,20 @@
+FROM rockylinux:8.5
+
+RUN yum install epel-release git gcc -y
+RUN yum -y install openssl-devel bzip2-devel libffi-devel xz-devel
+RUN yum install python3.8 -y
+RUN echo 1 | update-alternatives --config python3
+RUN dnf -y install https://download.postgresql.org/pub/repos/yum/reporpms/EL-8-x86_64/pgdg-redhat-repo-latest.noarch.rpm
+RUN dnf module disable postgresql -y
+RUN dnf install postgresql13-devel -y
+RUN yum install python38-devel libpq-devel -y
+
+COPY requirements.txt requirements.txt
+RUN ln -s /usr/pgsql-13/bin/pg_config /usr/bin/pg_config
+
+RUN pip3 install psycopg2-binary
+RUN pip3 install -r requirements.txt
+RUN mkdir /log/
+RUN touch /log/monster.log
+
+WORKDIR /MonSter/

+ 24 - 0
telemetry/roles/slurm_telemetry/tasks/main.yml

@@ -0,0 +1,24 @@
+# Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+#
+# Licensed 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.
+---
+
+- name: Include common variables
+  include_vars: ../../common/vars/main.yml
+
+- name: Include timescaledb variables
+  include_vars: ../../timescaledb/vars/main.yml
+
+- name: Prepare MonSter input file
+  include_tasks: update_timescaledb_details.yml
+  when: hostvars[groups['manager'][0]]['slurm_service']

+ 22 - 0
telemetry/roles/slurm_telemetry/vars/main.yml

@@ -0,0 +1,22 @@
+# Copyright 2022 Dell Inc. or its subsidiaries. All Rights Reserved.
+#
+# Licensed 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.
+---
+
+# usage: get_node_inventory.yml, update_timescaledb_details.yml
+slurm_telemetry_code_dir: "{{ mount_location }}slurm"
+slurm_telemetry_code_dir_mode: 0755
+awx_namespace: awx
+awx_username: admin
+awx_fail_msg: "AWX service not found. AWX needs to be installed"
+node_inventory_fail_msg: "AWX node inventory not found. Node inventory needs be created in AWX"