Commit 66634fcb authored by Swann Perarnau's avatar Swann Perarnau
Browse files

Merge branch 'ci-support' into 'master'

Ci support

See merge request !4
parents e5141214 452252c5
---
- hosts: all
vars_files:
- vars/ci-tokens.yaml
roles:
- common
- { role: aml, ci: true, install: false}
- { role: ci-runner, become: yes }
- name: add aml CI dependencies
package:
name: "{{ item }}"
state: present
with_items:
- valgrind
- name: add aml dependencies
package:
name: "{{ item }}"
state: present
with_items:
- numactl-devel
- hwloc-devel
- name: fetch aml repository
git:
repo: https://xgitlab.cels.anl.gov/argo/aml.git
dest: /argo/aml.git
update: yes
- name: compile aml
shell: ./autogen.sh && ./configure --prefix=/usr && make && make install
args:
chdir: /argo/aml.git
- { include: dependencies.yaml, become: yes }
- { include: install.yaml, become: yes, when: install }
- { include: ci.yaml, become: yes, when: ci }
- name: Retrieve gitlab repo config
get_url:
url: https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh
dest: /root/script.rpm.sh
mode: 0744
- name: Add gitlab repo
command: bash /root/script.rpm.sh
- name: Add CI dependencies
package:
name: "{{ item }}"
state: present
with_items:
- gitlab-runner
- name: configure gitlab-runner
template:
src: config.gitlab.etc.j2
dest: /etc/gitlab-runner/config.toml
owner: root
group: root
mode: 0644
- name: restart the gitlab runner
service:
name: gitlab-runner
state: restarted
concurrent = 1
check_interval = 0
[[runners]]
name = "CHI/AUTO"
url = "https://xgitlab.cels.anl.gov/"
token = "{{ chi_ci_token }}"
executor = "shell"
[runners.cache]
- name: create argo root directory
file:
path: /argo
state: directory
owner: root
group: root
mode: 0777
- name: add common dev dependencies
package:
name: "{{ item }}"
state: present
with_items:
- python-pip
- gcc
- automake
- autoconf
- libtool
- make
- name: add pipenv for python packages
command: pip install pipenv
- name: update etc/hosts
lineinfile:
dest: /etc/hosts
line: "{{ hostvars[item].ansible_host }} {{ hostvars[item].inventory_hostname }} {{ hostvars[item].inventory_hostname_short }}"
state: present
with_items: "{{ groups.all }}"
become: yes
- name: create argo directory
file:
path: /argo
state: directory
owner: root
group: root
mode: 0755
become: yes
- name: update etc/hosts
lineinfile:
dest: /etc/hosts
line: "{{ hostvars[item].ansible_host }} {{ hostvars[item].inventory_hostname }} {{ hostvars[item].inventory_hostname_short }}"
state: present
with_items: "{{ groups.all }}"
become: yes
- { include: cluster-config.yaml, become: yes }
- { include: argo-dependencies.yaml, become: yes }
- name: add NRM CI dependencies
package:
name: "{{ item }}"
state: present
with_items:
flake8
- name: add nrm dependencies
package:
name: "{{ item }}"
state: present
with_items:
- hwloc
- name: fetch nrm repository
git:
repo: https://xgitlab.cels.anl.gov/argo/nrm.git
dest: /argo/nrm.git
update: yes
- name: install nrm pipenv
shell: PIPENV_VENV_IN_PROJECT=1 pipenv install
args:
chdir: /argo/nrm.git
- { include: dependencies.yaml, become: yes }
- { include: install.yaml, become: yes, when: install }
- { include: ci.yaml, become: yes, when: ci }
$ANSIBLE_VAULT;1.1;AES256
32336339333064346365613964663834306539303335323031313464303466663838376466346165
3562666138376238633935653239383464653538643134620a646337616566396661343733663733
37626439333962663662383330363937343966633036383465653532333431613238393062653330
3863393233373237390a373938366537616332343837336639663939646364666533363136383066
30376231396535376664616636333361306163636164373839383933656164313261346432393631
38623163656234343531343863626137653133386362323265636236613637373764353133653936
643236396435666334616335303238336465
......@@ -168,11 +168,6 @@ def do_configure(argv):
' synchronize:\n'
' src: ' + confpath + '\n'
' dest: ~/\n'
' - name: Generate ssh-key for appliance\n'
' user:\n'
' name: cc\n'
' state: present\n'
' generate_ssh_key: yes\n'
' - name: Execute ansible on frontend\n'
' shell: ANSIBLE_HOST_KEY_CHECKING=False'
' ansible-playbook -i inventory.yaml ' + playpath + '\n'
......
......@@ -63,7 +63,8 @@ def do_create(argv):
resp = client.lease.create(**args)
print(json.dumps(resp, indent=4))
except keystoneauth1.exceptions.http.InternalServerError as e:
print(e.message)
error_message = json.loads(e.response.text)['error_message']
print("error:", error_message)
def do_delete(argv):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment