diff --git a/.github/workflows/training-e2e.yaml b/.github/workflows/training-e2e.yaml index aab9c52d1..4ae2f09d4 100644 --- a/.github/workflows/training-e2e.yaml +++ b/.github/workflows/training-e2e.yaml @@ -74,6 +74,7 @@ jobs: run: | echo "id=$(terraform output id | xargs)" >> $GITHUB_OUTPUT echo "url=$(terraform output host | xargs)" >> $GITHUB_OUTPUT + echo "ssh_public_key=$(terraform output ssh_public_key | xargs)" >> $GITHUB_OUTPUT echo "pem_filename=$(terraform output pem_filename | xargs)" >> $GITHUB_OUTPUT working-directory: terraform-test-environment-module @@ -83,16 +84,20 @@ jobs: - name: Provision run: | + ssh_public_key=$(printf '%s\n' "${{ steps.terraform-output.outputs.ssh_public_key }}" | sed -e 's/[\/&]/\\&/g') ansible-playbook ./main/training/provision/playbook.yml \ -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 }}" + --extra-vars "image_name=${{ matrix.image_name }}" \ + --extra-vars "ssh_public_key=$ssh_public_key" env: ANSIBLE_HOST_KEY_CHECKING: false - - name: log some networking information + - name: run the e2e tests run: | - ifconfig + ssh -i terraform-test-environment-module/${{ steps.terraform-output.outputs.pem_filename }} \ + ${{ steps.terraform-output.outputs.url }} \ + curl -sLO /tmp https://raw.githubusercontent.com/stefwalter/instructlab/container-testing/scripts/basic-workflow-tests.sh - name: Destroy Test Environment id: down diff --git a/training/Makefile b/training/Makefile index ae4a7715f..69fa0d876 100644 --- a/training/Makefile +++ b/training/Makefile @@ -81,6 +81,7 @@ cloud-nvidia: .PHONY: cloud: cloud-amd cloud-intel cloud +<<<<<<< HEAD # # We often see users running out of space. These commands are useful for freeing wasted space. # Note becarful to not run this target if a podman build is in progress. @@ -90,5 +91,8 @@ prune: buildah rm --all podman image prune -f +======= +.PHONY: clean +>>>>>>> 360f280 (check access to ilab) clean: rm -rf build diff --git a/training/provision/playbook.yml b/training/provision/playbook.yml index 566afc6df..27ee31754 100644 --- a/training/provision/playbook.yml +++ b/training/provision/playbook.yml @@ -20,11 +20,23 @@ name: podman state: present + - name: Building an image with ssh key + containers.podman.podman_container: + name: localhost/temp_image + image: "quay.io/ai-lab/{{ image_name }}:latest" + command: + - mkdir /usr/etc-system + - test -n "{{ ssh_public_key }}" + - echo 'AuthorizedKeysFile /usr/etc-system/%u.keys' >> /etc/ssh/sshd_config.d/30-auth-system.conf + - "echo {{ ssh_public_key }} > /usr/etc-system/fedora.keys && chmod 0600 /usr/etc-system/fedora.keys" + state: present + recreate: true + - name: Bootc install ignore_unreachable: true containers.podman.podman_container: name: "{{ image_name }}" - image: "quay.io/ai-lab/{{ image_name }}:latest" + image: localhost/temp_image state: started auto_remove: yes cap_add: @@ -40,4 +52,4 @@ - name: Restart instance ansible.builtin.reboot: - test_command: pwd + test_command: which ilab