8000 Refactor roles that build EPICS Modules by ralphlange · Pull Request #74 · epics-training/training-vm · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions ansible/group_vars/README_distros.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ Here are the reasons for differences:
- the latest p4p released TODAY (2024-10-01 v4.2.0) does build with python 3.12 and now works with all 4 distros
- pvapy - downgrading from 5.4.1 to 5.3.1 makes it build on Rocky. The later version tries to check for boost 1.78.0 and fails. 5.3.1 won't build on distros with python 3.12 and also fails on Ubuntu for boost version reasons.
- areadetector uses a deprecated function in xmllib2 and Fedora's version is too new.
- areadetector also fails on debian because its version of ansible does not support 'search_string' in lineinfile which is used in adcore_prep.yml. Trying to get an new ansible from the ubuntu ppa (as per ansible docs) fails with dependecy conflicts.

In summary:

- Rocky is the only distro for which everything builds.
- Ubuntu builds everything except pvaPy.
- Ubuntu builds everything except pvaPy.
6 changes: 1 addition & 5 deletions ansible/group_vars/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@
# to local.yml and adjust as needed
initial_setup: false
docker: true # for rootful this needs to happen before first reboot
epics_modules_build: false
catrust: false
epics_tools: false
oac_tree: false
archiver_appliance: false
bluesky: false

# Default configuration for the EPICS modules to build
epics_modules_list:
- base
- pvxs
m_base: true

# Default: false proxy
proxy_env: {}
Expand Down
31 changes: 7 additions & 24 deletions ansible/group_vars/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#
# For use by CI running in containers

epics_modules_build: true
catrust: false
epics_tools: true
oac_tree: true
Expand All @@ -14,29 +13,13 @@ docker: true
# disable buesky build in CI
bluesky: false

# List the EPICS modules that will be built in this order (base is mandatory)
epics_modules_list:
- base
- pvxs
# Two alternative Python wrappers
- p4p
# pvapy does not like python 3.12, debian has boost version issues
- "{{ 'pvapy' if ansible_distribution == 'Rocky' else 'skip' }}"
- seq
- asyn
- opcua
# AreaDetector dependencies
- autosave
- busy
- sscan
- calc
# Fedora xmllib2 is too new for (ADCore missing XmlGetGlobal)
# debian has too early a version of ansible to accept search_string in lineinfile
- "{{ 'adcore' if ansible_distribution in ['Ubuntu', 'Rocky'] else 'skip' }}"
- "{{ 'adsimdetector' if ansible_distribution in ['Ubuntu', 'Rocky'] else 'skip' }}"
# only build if we built pvapy
- "{{ 'adpvadriver' if ansible_distribution == 'Rocky' else 'skip' }}"
- stream
m_base: true
m_p4p: true
m_pvaPy: true
m_seq: true
m_areadetector: true
m_opcua: true
m_stream: true

# tell ansible that we are in a container instead of VM
in_container: true
30 changes: 7 additions & 23 deletions ansible/group_vars/everything.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,17 @@
#
# For use in fully testing VMs

epics_modules_build: true
catrust: false
epics_tools: true
oac_tree: true
archiver_appliance: true
docker: true
bluesky: true

# List the EPICS modules that will be built in this order (base is mandatory)
epics_modules_list:
- base
- pvxs
# Two alternative Python wrappers
- p4p
# pvapy does not like python 3.12, debian has boost version issues
- "{{ 'pvapy' if ansible_distribution == 'Rocky' else 'skip' }}"
- seq
- asyn
- opcua
# AreaDetector dependencies
- autosave
- busy
- sscan
- calc
# Fedora xmllib2 is too new for (ADCore missing XmlGetGlobal)
# debian has too early a version of ansible to accept search_string in lineinfile
- "{{ 'adcore' if ansible_distribution in ['Ubuntu', 'Rocky'] else 'skip' }}"
- "{{ 'adsimdetector' if ansible_distribution in ['Ubuntu', 'Rocky'] else 'skip' }}"
# only build if we built pvapy
- "{{ 'adpvadriver' if ansible_distribution == 'Rocky' else 'skip' }}"
m_base: true
m_p4p: true
m_pvaPy: true
m_seq: true
m_areadetector: true
m_opcua: true
m_stream: true
29 changes: 8 additions & 21 deletions ansible/group_vars/local.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,20 @@
# (default settings are defined in all.yml)
#initial_setup: true # only used for Vagrant build
#docker: false # for rootful this needs to happen before first reboot
epics_modules_build: true
#catrust: true
#epics_tools: true
#oac_tree: true
#archiver_appliance: true
#bluesky: true

# List the EPICS modules that will be built in this order (base is mandatory)
epics_modules_list:
- base
- pvxs
# Two alternative Python wrappers
# - p4p
# - pvapy
# - seq
# - asyn
# - opcua
# AreaDetector dependencies
# - autosave
# - busy
# - sscan
# - calc
# - adcore
# - adsimdetector
# - adpvadriver
# StreamDevice (needs sscan, calc)
# - stream
# List the EPICS modules that will be built
m_base: true
#m_p4p: true
#m_pvaPy: true
#m_seq: true
#m_areadetector: true
#m_opcua: true
#m_stream: true

# Set proxies, if needed
#proxy_env:
Expand Down
46 changes: 35 additions & 11 deletions ansible/playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,63 @@
roles:
- role: initial_setup
tags: initial_setup
when: initial_setup | bool
when: initial_setup | default(false) | bool

- role: catrust
tags: catrust
when: catrust | bool
when: catrust | default(false) | bool

- role: common # <- mandatory
tags: common

- role: m-base
tags: m-base
when: m_base | default(false) | bool

- role: m-areadetector
tags: m-areadetector
when: m_areadetector | default(false) | bool

- role: m-opcua
tags: m-opcua
when: m_opcua | default(false) | bool

- role: m-p4p
tags: m-p4p
when: m_p4p | default(false) | bool

- role: m-pvaPy
tags: m-pvaPy
when: m_pvaPy | default(false) | bool

- role: m-seq
tags: m-seq
when: m_seq | default(false) | bool

- role: m-stream
tags: m-stream
when: m_stream | default(false) | bool

- role: docker
tags: docker
when: docker | bool
when: docker | default(false) | bool

- role: bluesky
tags: bluesky
when: bluesky | bool
when: bluesky | default(false) | bool
become: true
become_user: "{{ dev_user}}"

- role: epics-modules
tags: epics_modules
when: epics_modules_build | bool

- role: epics-tools
tags: epics_tools
when: epics_tools | bool
when: epics_tools | default(false) | bool

- role: oac-tree
tags: oac_tree
when: oac_tree | bool
when: oac_tree | default(false) | bool

- role: archiver-appliance
tags: archiver_appliance
when: archiver_appliance | bool
when: archiver_appliance | default(false) | bool

environment: "{{ proxy_env }}"
73 changes: 70 additions & 3 deletions ansible/roles/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,74 @@
# Available roles

## epics-modules
## EPICS Modules

Generic role to build and install a list of standard (C/C++) EPICS modules.
### m-areadetector
The AreaDetector image processing framework
(modules Core, SimDetector and PVADriver)
and their dependencies Busy, SScan and Calc.

Used to install EPICS Base, ASYN, the SNC-Sequencer, etc....
### m-base
EPICS Base C++ and PVXS.

### m-opcua
OPC UA Device Support and the open62541 low-level driver.

### m-p4p
Python wrapper for PVAccess (PVXS-based) and PVA Gateway.

### m-pvaPy
Python wrapper for PVAccess (based on the classical PVA stack).

### m-seq
State Notation language compiler and Sequencer.

### m-stream
StreamDevice Device Support.

## Phoebus and Services

### epics-tools
Control System Studio / Phoebus.

### archiver-appliance
Minimal install of the EPICS Archiver Appliance.

## Other Clients

### oac-tree
High-level sequencer for automation, operation and control.

## Bluesky Modules

### bluesky
Containerized training setup of Bluesky.

## System Level Roles

### catrust
Enterprise CA certificate install
(needed behind deep packet inspection firewalls).

## Internal Modules
Low-level stuff and dependencies of the above.

### m-asyn
The ASYN Driver framework.

### m-autosave
The AutoSaveRestore (EPICS Process Database persistence) module.

### common
Common tasks. (mandatory)

### docker
Installation of Docker or Podman to run containers.

### epics-module
Generic task called by the m-* roles to install EPICS C/C++ modules.

### initial_setup
One-off role called at the first run in a freshly provisioned VM.

### java
Java SDK needed for Phoebus and Services.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
- name: "Backup places.sqlite before making changes"
ansible.builtin.copy:
src: "{{ places_db_path }}"
dest: "{{ places_db_path }}.bak-{{ ansible_date_time.iso8601 }}"
dest: "{{ places_db_path }}.bak-{{ ansible_facts['date_time'].iso8601 }}"
remote_src: yes
when: check_bookmark.stdout == "0" # Only run if the bookmark doesn't exist

Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/archiver-appliance/templates/setenv.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,4 @@ export ARCHAPPL_MEDIUM_TERM_FOLDER="{{ archiver_appliance_storage }}/mts"
export ARCHAPPL_LONG_TERM_FOLDER="{{ archiver_appliance_storage }}/lts"

# EPICS variables
export EPICS_HOST_ARCH=linux-{{ ansible_architecture }}
export EPICS_HOST_ARCH=linux-{{ ansible_facts['architecture'] }}
8 changes: 4 additions & 4 deletions ansible/roles/bluesky/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,22 +76,22 @@
tag: "{{ bluesky_docker_image_tag }}"
source: pull
state: present
when: ansible_distribution in ["Ubuntu", "Debian"]
when: ansible_facts['distribution'] in ["Ubuntu", "Debian"]

- name: Pull specific container image version (Rocky/Fedora)
containers.podman.podman_image:
name: "{{ bluesky_docker_image }}"
tag: "{{ bluesky_docker_image_tag }}"
state: present
when: ansible_distribution in ["Rocky", "Fedora"]
when: ansible_facts['distribution'] in ["Rocky", "Fedora"]

- name: Restart Docker service (Ubuntu/Debian)
ansible.builtin.command: "sudo systemctl restart docker"
when: ansible_distribution in ["Ubuntu", "Debian"]
when: ansible_facts['distribution'] in ["Ubuntu", "Debian"]

- name: Restart Podman service (Rocky/Fedora)
ansible.builtin.command: "sudo systemctl restart podman"
when: ansible_distribution in ["Rocky", "Fedora"]
when: ansible_facts['distribution'] in ["Rocky", "Fedora"]

- name: Create tiled_data directory
ansible.builtin.file:
Expand Down
2 changes: 1 addition & 1 deletion ansible/roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
ansible.builtin.assert:
that:
- is_debian or is_redhat
fail_msg: "Unkown distro {{ ansible_distribution }}"
fail_msg: "Unkown distro {{ ansible_facts['distribution'] }}"

- name: Install common packages
dnf:
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/docker/tasks/docker.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
- name: Add Docker GPG key
apt_key:
url: https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg
url: https://download.docker.com/linux/{{ ansible_facts['distribution'] | lower }}/gpg
become: true

- name: Add Docker APT repository
apt_repository:
repo: deb [arch=amd64] https://download.docker.com/{{ ansible_system | lower }}/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable
repo: deb [arch=amd64] https://download.docker.com/{{ ansible_system | lower }}/{{ ansible_facts['distribution'] | lower }} {{ ansible_facts.distribution_release }} stable
become: true

- name: Install Docker
Expand Down
4 changes: 2 additions & 2 deletions ansible/roles/docker/tasks/podman.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
ansible.builtin.yum_repository:
name: docker-ce-stable
description: official docker stable rpm repo
baseurl: https://download.docker.com/linux/{{ 'centos' if ansible_distribution == 'Rocky' else ansible_distribution | lower }}/$releasever/$basearch/stable
gpgkey: https://download.docker.com/linux/{{ 'centos' if ansible_distribution == 'Rocky' else ansible_distribution | lower }}/gpg
baseurl: https://download.docker.com/linux/{{ 'centos' if ansible_facts['distribution'] == 'Rocky' else ansible_facts['distribution'] | lower }}/$releasever/$basearch/stable
gpgkey: https://download.docker.com/linux/{{ 'centos' if ansible_facts['distribution'] == 'Rocky' else ansible_facts['distribution'] | lower }}/gpg
become: true

- name: Install RPM prerequisites
Expand Down
Loading
0