diff --git a/.github/workflows/training-e2e.yaml b/.github/workflows/training-e2e.yaml index 686c72617..19ac188f8 100644 --- a/.github/workflows/training-e2e.yaml +++ b/.github/workflows/training-e2e.yaml @@ -84,9 +84,7 @@ jobs: - name: Provision run: | - cp ./main/training/provision/ansible.cfg ./ && \ ansible-playbook ./main/training/provision/playbook.yml \ - -vvv \ -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 83de071aa..4b1cc0e82 100644 --- a/training/provision/playbook.yml +++ b/training/provision/playbook.yml @@ -18,6 +18,7 @@ - name: Required packages ansible.builtin.dnf: name: + - https://s3.eu-west-2.amazonaws.com/amazon-ssm-eu-west-2/latest/linux_amd64/amazon-ssm-agent.rpm - podman state: present disable_gpg_check: true @@ -34,7 +35,7 @@ registry: quay.io authfile: /etc/containers/auth.json - - name: Pull the parent image + - name: Pull the Parent Image async: 1000 poll: 0 register: pull_result @@ -45,7 +46,7 @@ arch: amd64 state: present - - name: Check on parent image pull + - name: Check on Parent Image Pull async_status: jid: "{{ pull_result.ansible_job_id }}" register: job_result @@ -53,24 +54,50 @@ retries: 100 delay: 10 - - name: Check the images was pulled - ansible.builtin.command: - cmd: | - podman images -a - - # - name: Simulate long running op (15 sec), wait for up to 45 sec, poll every 5 sec - # ansible.builtin.command: /bin/sleep 15 - # async: 45 - # poll: 5 - - # - name: Build Temp image - # containers.podman.podman_image: - # name: "quay.io/ai-lab/{{ image_name }}:latest" - # build: - # target: temp_image - # file: /tmp/Containerfile - # state: build - # auth_file: /etc/containers/auth.json + - name: Build Temp Image + async: 1000 + poll: 0 + register: build_result + containers.podman.podman_image: + name: "quay.io/ai-lab/{{ image_name }}:latest" + build: + target: temp_image + file: /tmp/Containerfile + state: build + auth_file: /etc/containers/auth.json + + - name: Check on Temp Image Build + async_status: + jid: "{{ build_result.ansible_job_id }}" + register: job_result + until: job_result.finished + retries: 100 + delay: 10 + + - name: Bootc install + ignore_unreachable: true + containers.podman.podman_container: + name: "{{ image_name }}" + image: localhost/temp_image:latest + state: started + auto_remove: yes + cap_add: + - sys_admin + security_opt: + - "label=type:unconfined_t" + volumes: + - "/:/target" + - "/var/lib/containers:/var/lib/containers" + privileged: yes + pid_mode: host + command: "bootc install to-filesystem --karg=console=ttyS0,115200n8 --replace=alongside /target" + + - name: Restart instance + ansible.builtin.reboot: + test_command: which ilab + + +# --------------------------- # - name: Pause for 5 minutes # ansible.builtin.pause: