<commit_before>- builder:
    name: 'tripleo-upstream-setup-roles'
    builders:
        - shell: |
            WORKSPACE="${WORKSPACE:-/tmp}"

            # Place roles for the tripleo-ci container build playbooks in the proper directory
            mkdir ${WORKSPACE}/roles
            cp -r ${WORKSPACE}/tripleo-ci/roles/* ${WORKSPACE}/roles
            git clone https://github.com/openstack/ansible-role-bindep \
                ${WORKSPACE}/roles/bindep

            # Mock prerequisite zuul vars so the playbooks can run on jenkins
            cat <<EOF >> ${WORKSPACE}/roles/build-containers/vars/common.yaml

            zuul:
              projects:
                opendev.org/openstack/tripleo-repos:
                  src_dir: "src/opendev.org/openstack/tripleo-repos"
                opendev.org/openstack/python-tripleoclient:
                  src_dir: "src/opendev.org/openstack/python-tripleoclient"
              branch: "master"
              pipeline: "periodic"

            use_buildah: "true"
            EOF

            cat <<EOF >> ${WORKSPACE}/roles/tripleo-repos/vars/main.yml

            zuul:
              branch: master
              projects:
                opendev.org/openstack/tripleo-repos:
                  src_dir: "src/opendev.org/openstack/tripleo-repos"
                opendev.org/openstack/python-tripleoclient:
                  src_dir: "src/opendev.org/openstack/python-tripleoclient"
            EOF

- builder:
    name: 'tripleo-upstream-build-containers'
    builders:
         - shell: |
            WORKSPACE="${WORKSPACE:-/tmp}"
            CICO_USER_DIR="${CICO_USER_DIR:-/root}"
            VENV="${WORKSPACE}/venv"
            OPENSTACK_GIT_URL="https://opendev.org/openstack"

            [[ ! -d "${VENV}" ]] && virtualenv "${VENV}"
            source "${VENV}/bin/activate"

            # Install requirements.
            # Pin to version used by tripleo-quickstart as of this commit.
            pip install ansible==2.5.8

            # We keep connecting onto the same hosts that are continuously reinstalled
            export ANSIBLE_HOST_KEY_CHECKING=False

            # cat the playbook for building containers to the workspace
            cat << EOF > ${WORKSPACE}/containers-build.yml
            ---
            - name: 'Setup CICO node for container builds'
              hosts: openstack_nodes
              become: yes
              become_user: root
              tasks:
                - shell: |
                    iptables -N openstack-INPUT
                    yum install -y gcc git python-devel python-setuptools libffi libffi-devel openssl openssl-devel
                    easy_install pip
                    pip install ansible==2.5.8

                    # Deliberately clobber decorator system site package with working version
                    pip install -I decorator

            - name: 'Clone git dependencies'
              hosts: openstack_nodes
              tasks:
                - name: 'Clone git dependency'
                  git:
                    repo: '${OPENSTACK_GIT_URL}/{{ item }}.git'
                    dest: '${CICO_USER_DIR}/src/opendev.org/openstack/{{ item }}'
                  with_items:
                    - 'ansible-role-container-registry'
                    - 'tripleo-repos'
                    - 'kolla'
                    - 'python-tripleoclient'
                    - 'tripleo-common'

            - name: 'Setup TripleO Container Registry and repos mirror'
              hosts: openstack_nodes
              roles:
                - role: tripleo-repos
                  override_repos: "{{ buildcontainers_override_repos | default('') }}"
                  tripleo_repos_repository: "${CICO_USER_DIR}/{{ zuul.projects['opendev.org/openstack/tripleo-repos'].src_dir }}"
                - role: bindep
                  bindep_dir: "${CICO_USER_DIR}/{{ zuul.projects['opendev.org/openstack/python-tripleoclient'].src_dir }}"
              tasks:
                - name: Run build containers pre tasks
                  include_role:
                    name: build-containers
                    tasks_from: pre

            - name: 'Build TripleO Containers'
              hosts: openstack_nodes
              tasks:
                - name: Run build containers tasks
                  include_role:
                    name: build-containers
            EOF

            # cico-get-node requests a duffy node and generates an ansible-compatible
            # inventory at $WORKSPACE/hosts
            ansible-playbook -vvv -i "${WORKSPACE}/hosts" "${WORKSPACE}/containers-build.yml"<commit_msg>Enable pushing to rdo registry in tripleo-ppc64le-containers-build job<commit_after>- builder:
    name: 'tripleo-upstream-setup-roles'
    builders:
        - shell: |
            WORKSPACE="${WORKSPACE:-/tmp}"

            # Place roles for the tripleo-ci container build playbooks in the proper directory
            mkdir ${WORKSPACE}/roles
            cp -r ${WORKSPACE}/tripleo-ci/roles/* ${WORKSPACE}/roles
            git clone https://github.com/openstack/ansible-role-bindep \
                ${WORKSPACE}/roles/bindep

            # Mock prerequisite zuul vars so the playbooks can run on jenkins
            cat <<EOF >> ${WORKSPACE}/roles/build-containers/vars/common.yaml

            zuul:
              projects:
                opendev.org/openstack/tripleo-repos:
                  src_dir: "src/opendev.org/openstack/tripleo-repos"
                opendev.org/openstack/python-tripleoclient:
                  src_dir: "src/opendev.org/openstack/python-tripleoclient"
              branch: "master"
              pipeline: "periodic"

            use_buildah: "true"
            push_containers: true
            push_registry: trunk.registry.rdoproject.org
            EOF

            cat <<EOF >> ${WORKSPACE}/roles/tripleo-repos/vars/main.yml

            zuul:
              branch: master
              projects:
                opendev.org/openstack/tripleo-repos:
                  src_dir: "src/opendev.org/openstack/tripleo-repos"
                opendev.org/openstack/python-tripleoclient:
                  src_dir: "src/opendev.org/openstack/python-tripleoclient"
            EOF

- builder:
    name: 'tripleo-upstream-build-containers'
    builders:
         - shell: |
            WORKSPACE="${WORKSPACE:-/tmp}"
            CICO_USER_DIR="${CICO_USER_DIR:-/root}"
            VENV="${WORKSPACE}/venv"
            OPENSTACK_GIT_URL="https://opendev.org/openstack"

            [[ ! -d "${VENV}" ]] && virtualenv "${VENV}"
            source "${VENV}/bin/activate"

            # Install requirements.
            # Pin to version used by tripleo-quickstart as of this commit.
            pip install ansible==2.5.8

            # We keep connecting onto the same hosts that are continuously reinstalled
            export ANSIBLE_HOST_KEY_CHECKING=False

            # cat the playbook for building containers to the workspace
            cat << EOF > ${WORKSPACE}/containers-build.yml
            ---
            - name: 'Setup CICO node for container builds'
              hosts: openstack_nodes
              become: yes
              become_user: root
              tasks:
                - shell: |
                    iptables -N openstack-INPUT
                    yum install -y gcc git python-devel python-setuptools python-docker libffi libffi-devel openssl openssl-devel
                    easy_install pip
                    pip install ansible==2.5.8

                    # Deliberately clobber decorator system site package with working version
                    pip install -I decorator

            - name: 'Clone git dependencies'
              hosts: openstack_nodes
              tasks:
                - name: 'Clone git dependency'
                  git:
                    repo: '${OPENSTACK_GIT_URL}/{{ item }}.git'
                    dest: '${CICO_USER_DIR}/src/opendev.org/openstack/{{ item }}'
                  with_items:
                    - 'ansible-role-container-registry'
                    - 'tripleo-repos'
                    - 'kolla'
                    - 'python-tripleoclient'
                    - 'tripleo-common'

            - name: Login to RDO registry
              hosts: openstack_nodes
              become: "{{ item }}"
              docker_login:
                registry_url: "https://trunk.registry.rdoproject.org"
                username: "tripleo.service"
                password: <PASSWORD>}"
                reauthorize: true
              when: push_containers|default(true)|bool
              with_items:
                - true
                - false

            - name: 'Setup TripleO Container Registry and repos mirror'
              hosts: openstack_nodes
              roles:
                - role: tripleo-repos
                  override_repos: "{{ buildcontainers_override_repos | default('') }}"
                  tripleo_repos_repository: "${CICO_USER_DIR}/{{ zuul.projects['opendev.org/openstack/tripleo-repos'].src_dir }}"
                - role: bindep
                  bindep_dir: "${CICO_USER_DIR}/{{ zuul.projects['opendev.org/openstack/python-tripleoclient'].src_dir }}"
              tasks:
                - name: Run build containers pre tasks
                  include_role:
                    name: build-containers
                    tasks_from: pre

            - name: 'Build TripleO Containers'
              hosts: openstack_nodes
              tasks:
                - name: Run build containers tasks
                  include_role:
                    name: build-containers
            EOF

            # cico-get-node requests a duffy node and generates an ansible-compatible
            # inventory at $WORKSPACE/hosts
            ansible-playbook -vvv -i "${WORKSPACE}/hosts" "${WORKSPACE}/containers-build.yml"
{'fraction_non_alphanumeric': 0.09271991911021234, 'fraction_numerical': 0.0014155712841253793, 'mean_word_length': 1.4764646970455684, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 14, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6804162', 'n_tokens_mistral': 2796, 'n_tokens_neox': 2614, 'n_words': 570}