aboutsummaryrefslogtreecommitdiff
path: root/ldcg-python-manylinux-tensorflow/ansible/playbooks/build-tf-text-dual-abi.yml
blob: 03296d864598cf8684b7b3a10fc12163ca3b00a8 (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
---
- name: Build TensorFlow Text in Dual ABI container
  hosts: localhost
  vars_files:
    ../vars/vars-tf-text.yml

  tasks:
    - name: Remove previous build wheels
      ansible.builtin.file:
        path: "{{ wheels_dir }}"
        force: true
        state: absent

    - name: Create output wheels directory
      ansible.builtin.file:
        path: "{{ wheels_dir }}"
        state: directory
        mode: 0755

    - name: Go through each TensorFlow Text version
      ansible.builtin.include_role:
        name: tensorflow_text
        tasks_from: manylinux-build.yml
      loop: "{{ tf_text_versions | dict2items }}"
      loop_control:
        loop_var: tf_text_ver
      when: tf_text_ver.key in to_be_built

    - name: Remove file not needed to be published
      ansible.builtin.file:
        path: "{{ wheels_dir }}/upper-constraints.txt"
        state: absent

    - name: Prepare wheels for publishing  # noqa no-changed-when
      ansible.builtin.shell:
        cmd: |
          set -xe
          for pkg in *.whl
          do
            pkgdir=$(echo `basename $pkg`|cut -d'-' -f1 | tr '[:upper:]_' '[:lower:]-')
            mkdir -p "{{ wheels_dir }}/$pkgdir"
            mv $pkg  "{{ wheels_dir }}/$pkgdir"
          done
        chdir: "{{ wheels_dir }}"
        executable: "/bin/bash"