From 2ed39cbee85d935a8d2ba5b7b2789cd42616fd4b Mon Sep 17 00:00:00 2001 From: greg pereira Date: Fri, 3 May 2024 15:39:00 -0700 Subject: [PATCH] split build and run Signed-off-by: greg pereira --- .github/workflows/training-e2e.yaml | 1 + training/provision/playbook.yml | 36 +++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/.github/workflows/training-e2e.yaml b/.github/workflows/training-e2e.yaml index 6f0038725..3c7d37cb9 100644 --- a/.github/workflows/training-e2e.yaml +++ b/.github/workflows/training-e2e.yaml @@ -85,6 +85,7 @@ jobs: - name: Provision run: | ansible-playbook ./main/training/provision/playbook.yml \ + -vv \ -i terraform-test-environment-module/hosts.ini \ --private-key=terraform-test-environment-module/${{ steps.terraform-output.outputs.pem_filename }} \ --extra-vars "image_name=${{ matrix.image_name }}" \ diff --git a/training/provision/playbook.yml b/training/provision/playbook.yml index c40be8e62..42bad4162 100644 --- a/training/provision/playbook.yml +++ b/training/provision/playbook.yml @@ -35,22 +35,40 @@ registry: quay.io authfile: /etc/containers/auth.json - - name: Build and Install the Bootc Image + - name: Build and the Derived Image async: 1000 poll: 0 register: build_result ansible.builtin.shell: | podman build -t derived_image:latest -f /tmp/Containerfile --authfile=/etc/containers/auth.json . - podman run --rm --privileged --pid=host --security-opt label=type:unconfined_t -v /:/target -v /var/lib/containers:/var/lib/containers derived_image:latest bootc install to-filesystem --karg=console=ttyS0,115200n8 --replace=alongside /target - - - name: Check on Build and Install Bootc Image + + - name: Check on Derived Image Build async_status: jid: "{{ build_result.ansible_job_id }}" register: job_result until: job_result.finished - retries: 100 - delay: 10 + retries: 33 + delay: 30 + + - name: Check images + ansible.builtin.shell: | + podman images --format='{{ '{{' }} .Repository {{ '}}' }} {{ '{{' }} .ID {{ '{{' }}' | grep "derived_images" | awk '{print $2}' + + # - name: Bootc Install + # async: 1000 + # poll: 0 + # register: build_result + # ansible.builtin.shell: | + # podman run --rm --privileged --pid=host --security-opt label=type:unconfined_t -v /:/target -v /var/lib/containers:/var/lib/containers derived_image:latest bootc install to-filesystem --karg=console=ttyS0,115200n8 --replace=alongside /target + + # - name: Check on Bootc Install + # async_status: + # jid: "{{ build_result.ansible_job_id }}" + # register: job_result + # until: job_result.finished + # retries: 100 + # delay: 10 - - name: Restart instance - ansible.builtin.reboot: - test_command: which ilab + # - name: Restart instance + # ansible.builtin.reboot: + # test_command: which ilab