aboutsummaryrefslogtreecommitdiff
path: root/ldcg-python-tensorflow/tensorflow/playbooks/build_python.yml
blob: fc5d7788156179c359de1bcacb15bb92e8c06aa7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
- block:
  - name: enable EPEL
    become: yes
    dnf:
      name:
        - epel-release

  - name: install h5py build requirements
    become: yes
    dnf:
      name:
        - hdf5-devel
      enablerepo: powertools
      state: present

  - name: provide xlocale.h (symlink to locale.h)
    become: yes
    file:
      src: /usr/include/locale.h
      dest: /usr/include/xlocale.h
      state: link

  - name: install numpy build requirements
    become: yes
    dnf:
      name:
        - gcc-gfortran
        - openblas-devel
        - lapack-devel
        - python3-devel
      enablerepo: powertools
      state: present

  - name: install required Python packages
    become: yes
    dnf:
      name:
        - python3-pip
        - python3-setuptools
        - python3-virtualenv
        - python3-wheel
        - python3-zipp
  when: ansible_os_family == 'RedHat'

- block:
  - name: install h5py build requirements
    become: yes
    apt:
      name:
        - libhdf5-dev
        - pkg-config
      state: present

  - name: install numpy build requirements
    become: yes
    apt:
      name:
        - gfortran
        - libblas-dev
        - liblapack-dev
        - python3-dev
      state: present

  - name: install required Python packages
    become: yes
    apt:
      name:
        - python3-pip
        - python3-setuptools
        - python3-venv
        - python3-wheel
        - python3-zipp
  when: ansible_os_family == 'Debian'

- name: upgrade pip
  become: yes
  pip:
    name:
      - pip
    state: latest

- name: install Cython
  become: yes
  pip:
    name:
      - "Cython>=0.29"

- name: create directory to build wheels
  file:
    path: "{{ wheels_dir }}"
    state: directory

- name: copy upper constraints
  template:
    src: "files/upper-constraints.txt"
    dest: "{{ wheels_dir }}/upper-constraints.txt"
    mode: 0400
    force: yes

- name: build and install wheels of binary Python packages
  include_tasks: build_python_wheel.yml
  loop:
    - grpcio
    - "numpy{{ numpy_version }}"
    - "h5py{{ h5py_version }}"
    - Keras_Preprocessing
    - Keras_Applications

- name: remove upper constraints
  file:
    path: "{{ wheels_dir }}/upper-constraints.txt"
    state: absent