Commit a3084dda authored by Maiken's avatar Maiken
Browse files

Push last snapshot

parent 7e9faee8
Pipeline #4976 canceled with stages
# Disclaimer
Not tested by other than Maiken Pedersen.
Not fully functional for Debian compatible systems.
### DISCLAIMER: Information here is necessarily up to date !!! ####
# Instructions
The run-sequence suggested below is based on elasticluster setting up the frontend and compute nodes first, with slurm, nfs and everything else needed.
http://elasticluster.readthedocs.io/en/latest/
The only change in elasticluster is the after_custom.yml file which I run. A copy of it is provided in the vars folder. The file needs to be copied into the <your-elasticluster-path>/elasticluster/src/elasticluster/share/playbooks
......@@ -63,7 +61,7 @@ elasticluster -v start slurm -n $clustername
### step2
cp $play_vars/after_custom.yml to <your-elasticluster-path>/elasticluster/src/elasticluster/share/playbooks
cp $play_vars/files-to-edit/after_custom.yml to <your-elasticluster-path>/elasticluster/src/elasticluster/share/playbooks
### step3
......
......@@ -15,10 +15,10 @@ machine_ip: "{{ hostvars[inventory_hostname].ansible_default_ipv4.address }}"
machine_name: "{{ ansible_hostname }}"
#for controldir, logs and software
grid_homedir: "/grid"
grid_homedir: "/gctrl"
#for sessiondir, runtime, cache
arc_frontend_griddir: "/wlcg"
arc_frontend_griddir: "/grid"
shared_scratch: "{{ arc_frontend_griddir }}"
......
arc_frontend_release: "15.03"
#must correspond to queue in arc.conf
queue: "main"
queue: "normal"
panda_queue: "UIO_CLOUD"
################ RHEL
......@@ -47,6 +47,7 @@ dependency_packages:
- perl-Inline-Python
- perl-JSON
- perl-JSON-XS
- python-isodate
...
\ No newline at end of file
......@@ -9,7 +9,61 @@
# - A hostname/ip can be a member of multiple groups
[cluster]
#ansible_user=centos
#ansible_user=debian
#old arc6, nigthly
#158.39.75.183
#158.39.75.142
#158.39.75.66
#158.39.75.131
#local_arc6
#158.39.75.134
#158.39.75.98
#158.39.75.170
#158.39.75.160
158.39.75.186
158.39.75.150
#arc6, nigthly
#158.39.75.142
#158.39.75.243
#158.39.75.82
#158.39.75.225
#158.39.75.42
#158.39.75.94
#158.37.63.21
#158.37.63.4
#158.39.75.224
#158.39.75.42
[frontend]
#ansible_user=debian
#158.39.75.183
#158.39.75.131
#158.39.75.142
#158.39.75.82
#158.39.75.94
#158.37.63.21
#158.39.75.224
#local_arc6
#158.39.75.134
#158.39.75.160
158.39.75.186
[compute]
#ansible_user=debian
#158.39.75.142
#158.39.75.66
#local_arc6
#158.39.75.98
#158.39.75.170
158.39.75.150
#arc6, nightly
#158.39.75.243
#158.39.75.225
#158.39.75.42
#158.37.63.4
#158.39.75.42
\ No newline at end of file
......@@ -9,23 +9,25 @@
path: /etc/grid-security
state: directory
mode: 0755
when: repotype != "arc6_nightlies"
- name: ensure grid-mapfile exists
file:
path: /etc/grid-security/grid-mapfile
state: touch
when: repotype != "arc6_nightlies"
- name: add maikenp to grid-mapfile as griduser
lineinfile:
path=/etc/grid-security/grid-mapfile
line='"/DC=org/DC=terena/DC=tcs/C=NO/O=Universitetet i Oslo/CN=Maiken Pedersen maikenp@uio.no" {{ user_name_grid }}'
when: repotype != "arc6_nightlies"
- name: add aCT to grid-mapfile as griduser
lineinfile:
path=/etc/grid-security/grid-mapfile
line="/DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=atlact1/CN=555105/CN=Robot{{':'}} ATLAS aCT 1 {{ user_name_grid }}"
when: repotype != "arc6_nightlies"
...
......
......@@ -43,7 +43,7 @@
##################
- name: Check if ARC is installed
stat:
path: "{{ install_dir }}/etc/rc.d/init.d/a-rex"
path: "{{ install_dir }}/etc/rc.d/init.d/arc-arex"
register: stat_result
......
# task for file installing ARC from nightlies
# this includes tasks to create a private repository with the downloaded nightlies rpms
......@@ -7,48 +6,35 @@
#########
#hack to ignore_erros get failures on htcondor packages
- name: update all the things (except nordugrid-arc packages)
yum:
name: "*"
state: latest
disablerepo:
- "myrepo"
- "nordugrid-arc*"
ignore_errors: yes
when: is_rhel_compatible
#hack to ignore_erros get failures on htcondor packages
- name: update all the things (except nordugrid-arc packages)
yum:
name: "*"
state: latest
disablerepo:
- "myrepo"
- "nordugrid-arc*"
ignore_errors: yes
when: is_rhel_compatible
#- name: update all the things (except nordugrid-arc packages)
# yum:
# name: "*"
# state: latest
# disablerepo:
# - "myrepo"
# - "nordugrid-arc*"
# ignore_errors: yes
# when: is_rhel_compatible
#hack to ignore_erros get failures on htcondor packages
- name: update all the things (except nordugrid-arc packages)
apt:
name: "*"
state: latest
disablerepo:
- "myrepo"
- "nordugrid-arc*"
ignore_errors: yes
when: is_debian_compatible
#- name: update all the things (except nordugrid-arc packages)
# apt:
# name: "*"
# state: latest
# disablerepo:
# - "myrepo"
# - "nordugrid-arc*"
# ignore_errors: yes
# when: is_debian_compatible
- name: Install wget
- name: Install wget, time, unzip
package:
name: "{{item}}"
with_items:
- wget
- time
- unzip
- name: Remove old ARC
package:
......@@ -61,66 +47,83 @@
file:
path: "{{ localpkg_dir }}"
state: directory
when: repotype == "local"
- name: Output some debug info
debug:
msg: " os {{ os }} os_v {{ os_v }} frontend_arch {{ frontend_arch }} pkg_ext {{ pkg_ext }} "
msg: " os {{ os }} os_v {{ os_v }} localpkg_dir: {{ localpkg_dir }}"
when: repotype == "local"
######## ARC nightlies from svn (rhel)
- name: NG download path for nightlies from svn
debug:
msg: "http://builds.nordugrid.org/nightlies/packages/nordugrid-arc/{{ arc_version }}/{{ ansible_date_time.date }}/{{ os }}/{{ os_v }}/{{ frontend_arch }}/"
when: is_rhel_compatible and arc_repo == "svn" and arc_repo != "git"
- name: Write date to nightlies file
lineinfile:
path: /etc/yum/vars/arcnightly
line: "{{ ansible_date_time.date }}"
create: yes
when: is_rhel_compatible and arc_repo == "git" and repotype == "arc6_nightlies"
- name: Get hold of nightly packages from svn (rhel)
command: "wget -r -A '*{{ item }}*.{{ pkg_ext }}' --level 1 --no-parent -nd http://builds.nordugrid.org/nightlies/packages/nordugrid-arc/{{ arc_version }}/{{ ansible_date_time.date }}/{{ os }}/{{ os_v }}/{{ frontend_arch }}/"
with_items: '{{ arc_frontend_packages }}'
args:
chdir: "{{ localpkg_dir }}"
when: is_rhel_compatible and arc_repo == "svn" and arc_repo != "git"
#########################################
- name: Create nordugrid-nightly.repo file
file:
path: /etc/yum.repos.d/nordugrid-nightly.repo
state: touch
when: repotype == "arc6_nightlies"
- name: Add nightlies repo to repo-file
blockinfile:
path: /etc/yum.repos.d/nordugrid-nightly.repo
block: |
[nordugrid-nightly]
name=Nordugrid ARC Master Nightly Builds - $basearch
baseurl=http://builds.nordugrid.org/nightlies/packages/nordugrid-arc/master/$arcnightly/centos/el7/$basearch
enabled=1
gpgcheck=0
when: is_rhel_compatible and arc_repo == "git" and repotype == "arc6_nightlies"
##hm this looks the same as above, might have not finished this
######## ARC nightlies from svn debian
- name: NG download path for nightlies from svn (debian)
debug:
msg: "http://builds.nordugrid.org/nightlies/packages/nordugrid-arc/{{ arc_version }}/{{ ansible_date_time.date }}/{{ os }}/{{ os_v }}/{{ frontend_arch }}/"
when: is_debian_compatible and arc_repo == "svn" and arc_repo != "git"
- name: Get hold of nightly packages from svn (debian)
command: "wget -r -A '*{{ item }}*.{{ pkg_ext }}' --level 1 --no-parent -nd http://builds.nordugrid.org/nightlies/packages/nordugrid-arc/{{ arc_version }}/{{ ansible_date_time.date }}/{{ os }}/{{ os_v }}/{{ frontend_arch }}/"
with_items: '{{ arc_frontend_packages }}'
args:
chdir: "{{ localpkg_dir }}"
when: is_debian_compatible and arc_repo == "svn" and arc_repo != "git"
######### ARC 6 build from git rpm (fetch from artifacts)
## TO-DO: Make more general specifying what arc to install for
## TO-DO: introduce when variable to switch this on
#- name: Get hold of nightly packages (git)
# command: "wget -r -nH --cut-dirs=1 --no-parent --reject='index.htm*' -nd 'https://source.coderefinery.org/nordugrid/arc/-/jobs/artifacts/master/download?job=packages_{{ os_v }}' -O rpms.zip"
# args:
# chdir: "{{ localpkg_dir }}"
# when: arc_major == "6" and is_rhel_compatible
#- name: Unzip the git-rpms
# command: "unzip -o {{ localpkg_dir }}/rpms.zip"
# args:
# chdir: "{{ localpkg_dir }}"
# when: arc_repo == "git" and arc_repo != "svn" and is_rhel_compatible
#########################################
######## ARC 6 build from git rpm
#Make more general specifying what arc to install for
- name: Get hold of nightly packages (git)
command: "wget -r -nH --cut-dirs=1 --no-parent --reject='index.htm*' -nd 'https://source.coderefinery.org/nordugrid/arc/-/jobs/artifacts/master/download?job=make_rpms_{{ os_v }}' -O rpms.zip"
args:
chdir: "{{ localpkg_dir }}"
when: arc_major == "6" and is_rhel_compatible
- name: Unzip the git-rpms
command: "unzip -o rpms.zip"
args:
######## ARC nightlies from svn (rhel)
- name: NG download path for nightlies from svn
debug:
msg: "http://builds.nordugrid.org/nightlies/packages/nordugrid-arc/{{ arc_version }}/{{ ansible_date_time.date }}/{{ os }}/{{ os_v }}/{{ ansible_architecture }}/"
when: is_rhel_compatible and arc_repo == "svn" and arc_repo != "git"
- name: Get hold of nightly packages from svn (rhel)
command: "wget -r -A '*{{ item }}*.{{ pkg_ext }}' --level 1 --no-parent -nd http://builds.nordugrid.org/nightlies/packages/nordugrid-arc/{{ arc_version }}/{{ ansible_date_time.date }}/{{ os }}/{{ os_v }}/{{ ansible_architecture }}/"
with_items: '{{ arc_frontend_packages }}'
args:
chdir: "{{ localpkg_dir }}"
when: arc_repo == "git" and arc_repo != "svn" and is_rhel_compatible
when: is_rhel_compatible and arc_repo == "svn" and arc_repo != "git"
#########################################
#for some reason kicking in although on centos7 machine..
######### ARC 6 build from git deb (debian 9)
##Make more general specifying what arc to install for
#- name: Get hold of nightly packages (git)
# command: wget -r -nH --cut-dirs=1 --no-parent --reject='index.htm*' -nd 'https://source.coderefinery.org/nordugrid/arc/-/jobs/artifacts/master/download?job=make_debs_deb9' -O debs.zip
# command: wget -r -nH --cut-dirs=1 --no-parent --reject='index.htm*' -nd 'https://source.coderefinery.org/nordugrid/arc/-/jobs/artifacts/master/download?job=packages_deb9' -O debs.zip
# args:
# chdir: "{{ localpkg_dir }}"
# when: is_debian_compatible and arc_major == "6"
......@@ -140,6 +143,7 @@
package:
name: createrepo
state: present
when: repotype == "local"
# Assumes /var/www/html/myrepo exists and apache server running
- name: Output localpkg_dir var
......@@ -148,6 +152,7 @@
- name: Initialize my local repo
command: "createrepo {{ localpkg_dir }}"
when: repotype == "local"
- name: Create myrepo.repo file
blockinfile:
......@@ -159,7 +164,7 @@
baseurl=http://{{ frontend_ip }}/{{ localreponame }}
enabled=1
gpgcheck=0
when: is_rhel_compatible
when: is_rhel_compatible and repotype == "local"
- name: Clean metadata from myrepo
command: yum --enablerepo=myrepo clean metadata
......@@ -176,7 +181,7 @@
disablerepo="*"
enablerepo="myrepo"
register: packages
when: is_rhel_compatible
when: is_rhel_compatible and repotype == "local"
......@@ -188,18 +193,29 @@
package:
name: "{{ item }}"
state: present
with_items: "{{ dependency_packages}}"
with_items: "{{ dependency_packages }}"
- debug:
var: is_rhel_compatible
- name: Nordugrid-arc dependencies
debug:
msg: "Get all dependencies on the nordugrid-packages, except the nordugrid packages themselves and skip the i686 versions which always show up in addition to the x86_64 versions. Also having problems with bdii.noarch which is expected to be just bdii package by yum"
- debug:
var: repotype
#shell: yum deplist "*nordugrid-arc*" | awk '/provider:/ && !/i686/ && !/bdii.noarch/ && !/nordugrid-arc/ {print $2}' | sort -u
- name: Register dependencies
shell: yum deplist "*nordugrid-arc*" --enablerepo=myrepo | awk '/provider:/ && !/nordugrid-arc/ {print $2}' | sort -u
- name: Get dependencies of nordugrid-arc for ARC 6
shell: yum deplist "nordugrid-arc-arex" --enablerepo=nordugrid-nightly | awk '/provider:/ && !/nordugrid-arc/ {print $2}' | sort -u
register: dependencies
when: is_rhel_compatible
##when: is_rhel_compatible and repotype == "arc6_nightlies"
#- name: Nordugrid-arc dependencies
# debug:
# msg: "Get all dependencies on the nordugrid-packages, except the nordugrid packages themselves and skip the i686 versions which always show #up in addition to the x86_64 versions. Also having problems with bdii.noarch which is expected to be just bdii package by yum"
##shell: yum deplist "*nordugrid-arc*" | awk '/provider:/ && !/i686/ && !/bdii.noarch/ && !/nordugrid-arc/ {print $2}' | sort -u
#- name: Register dependencies
# shell: yum deplist "*nordugrid-arc*" --enablerepo=myrepo | awk '/provider:/ && !/nordugrid-arc/ {print $2}' | sort -u
# register: dependencies
# when: is_rhel_compatible and repotype == "local"
- name: Show the dependency list
......@@ -220,11 +236,15 @@
yum:
name: bdii
state: latest
when: is_rhel_compatible
when: is_rhel_compatible and repotype != "arc6_nightlies"
########## INSTALL NORDUGRID PACKAGES FOR RHEL
########## INSTALL NORDUGRID PACKAGES FROM MYREPO FOR RHEL
#### Use LOCAL REPO
- name: Install Nordugrid packages from myrepo
yum:
name: "{{ item.name }}"
......@@ -233,7 +253,19 @@
state: present
disable_gpg_check: yes
with_items: "{{ packages.results }}"
when: is_rhel_compatible
when: is_rhel_compatible and repotype == "local"
### Use ARC 6 nightly repo
- name: Install Nordugrid packages from arc 6 nightly repo
yum:
name: nordugrid-arc-arex
#disablerepo: "*"
enablerepo: "nordugrid-nightly"
state: present
disable_gpg_check: yes
when: is_rhel_compatible and repotype == "arc6_nightlies"
###################################################
......@@ -253,13 +285,14 @@
apt:
name: reprepro
state: present
when: is_debian_compatible
when: is_debian_compatible and repotype == "local"
- name: Create myrepo/conf folder
file:
path: "{{ localpkg_dir }}/conf"
state: directory
when: is_debian_compatible and repotype == "local"
- name: Create myrepo.repo file
blockinfile:
......@@ -272,7 +305,7 @@
Architectures: i386 amd64 source
Components: main
Description: temp repo for nightly install
when: is_debian_compatible
when: is_debian_compatible and repotype == "local"
- name: Get list of nordugrid packages in myrepo
......@@ -280,7 +313,7 @@
paths: "{{ localpkg_dir }}"
patterns: '*.deb'
register: packages
when: is_debian_compatible
when: is_debian_compatible and repotype == "local"
#- name: output packages that will be installed
......@@ -294,7 +327,8 @@
name: "{{ item.path }}"
state: present
with_items: "{{ packages.files }}"
when: is_debian_compatible
when: is_debian_compatible and repotype == "local"
......@@ -305,11 +339,11 @@
################################
- name: Install nordugrid repo for CAs
yum: name=http://download.nordugrid.org/packages/nordugrid-release/releases/{{ arc_frontend_release }}/{{ os}}/{{ os_v }}/{{ frontend_arch}}/nordugrid-release-{{ arc_frontend_release }}-1.{{ os_v}}.noarch.{{ pkg_ext }}
yum: name=http://download.nordugrid.org/packages/nordugrid-release/releases/{{ arc_frontend_release }}/{{ os}}/{{ os_v }}/{{ ansible_architecture }}/nordugrid-release-{{ arc_frontend_release }}-1.{{ os_v}}.noarch.{{ pkg_ext }}
when: is_rhel6_compatible
- name: Install nordugrid repo for CAs
yum: name=http://download.nordugrid.org/packages/nordugrid-release/releases/{{ arc_frontend_release }}/{{ os}}/{{ os_v }}/{{ frontend_arch}}/nordugrid-release-{{ arc_frontend_release }}-1.{{ os_v}}.centos.noarch.{{ pkg_ext }}
yum: name=http://download.nordugrid.org/packages/nordugrid-release/releases/{{ arc_frontend_release }}/{{ os}}/{{ os_v }}/{{ ansible_architecture }}/nordugrid-release-{{ arc_frontend_release }}-1.{{ os_v}}.centos.noarch.{{ pkg_ext }}
when: is_rhel7_compatible
- name: Install nordugrid rpm key for CAs
......
# task for file installing ARC from nightlies
# this includes tasks to create a private repository with the downloaded nightlies rpms
## Cleanup
#########
#hack to ignore_erros get failures on htcondor packages
- name: update all the things (except nordugrid-arc packages)
yum:
name: "*"
state: latest
disablerepo:
- "myrepo"
- "nordugrid-arc*"
ignore_errors: yes
when: is_rhel_compatible
#hack to ignore_erros get failures on htcondor packages
- name: update all the things (except nordugrid-arc packages)
yum:
name: "*"
state: latest
disablerepo:
- "myrepo"
- "nordugrid-arc*"
ignore_errors: yes
when: is_rhel_compatible
#hack to ignore_erros get failures on htcondor packages
- name: update all the things (except nordugrid-arc packages)
apt:
name: "*"
state: latest
disablerepo:
- "myrepo"
- "nordugrid-arc*"
ignore_errors: yes
when: is_debian_compatible
- name: Install wget, time, unzip
package:
name: "{{item}}"
with_items:
- wget
- time
- unzip
- name: Remove old ARC
package:
name: "*nordugrid-arc*"
state: removed
######### Repo folder
- name: Create myrepo folder
file:
path: "{{ localpkg_dir }}"
state: directory
- name: Output some debug info
debug:
msg: " os {{ os }} os_v {{ os_v }} localpkg_dir: {{ localpkg_dir }}"
######## ARC nightlies from svn (rhel)
- name: NG download path for nightlies from svn
debug:
msg: "http://builds.nordugrid.org/nightlies/packages/nordugrid-arc/{{ arc_version }}/{{ ansible_date_time.date }}/{{ os }}/{{ os_v }}/{{ ansible_architecture }}/"
when: is_rhel_compatible and arc_repo == "svn" and arc_repo != "git"
- name: Get hold of nightly packages from svn (rhel)
command: "wget -r -A '*{{ item }}*.{{ pkg_ext }}' --level 1 --no-parent -nd http://builds.nordugrid.org/nightlies/packages/nordugrid-arc/{{ arc_version }}/{{ ansible_date_time.date }}/{{ os }}/{{ os_v }}/{{ ansible_architecture }}/"
with_items: '{{ arc_frontend_packages }}'
args:
chdir: "{{ localpkg_dir }}"
when: is_rhel_compatible and arc_repo == "svn" and arc_repo != "git"
#########################################
##hm this looks the same as above, might have not finished this
######## ARC nightlies from svn debian
- name: NG download path for nightlies from svn (debian)
debug:
msg: "http://builds.nordugrid.org/nightlies/packages/nordugrid-arc/{{ arc_version }}/{{ ansible_date_time.date }}/{{ os }}/{{ os_v }}/{{ ansible_architecture }}/"
when: is_debian_compatible and arc_repo == "svn" and arc_repo != "git"
- name: Get hold of nightly packages from svn (debian)
command: "wget -r -A '*{{ item }}*.{{ pkg_ext }}' --level 1 --no-parent -nd http://builds.nordugrid.org/nightlies/packages/nordugrid-arc/{{ arc_version }}/{{ ansible_date_time.date }}/{{ os }}/{{ os_v }}/{{ ansible_architecture }}/"