forked from milvus-io/milvus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: greg pereira <grpereir@redhat.com>
- Loading branch information
1 parent
9e16418
commit 531028d
Showing
3 changed files
with
165 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
--- | ||
- name: Test Environment Provisioning | ||
hosts: test_environments | ||
remote_user: ec2-user | ||
become: true | ||
gather_facts: false | ||
|
||
tasks: | ||
|
||
- name: Wait until the instance is ready | ||
ansible.builtin.wait_for_connection: | ||
delay: 15 | ||
timeout: 180 | ||
|
||
- name: Gather facts for first time | ||
ansible.builtin.setup: | ||
|
||
- name: Required packages | ||
ansible.builtin.dnf: | ||
name: | ||
- docker | ||
state: present | ||
disable_gpg_check: true | ||
|
||
- name: Derived Image Containerfile | ||
ansible.builtin.template: | ||
src: ./templates/Containerfile.j2 | ||
dest: /tmp/Containerfile | ||
|
||
- name: Login to default registry | ||
containers.podman.podman_login: | ||
username: "{{ registry_user }}" | ||
password: "{{ registry_password }}" | ||
registry: quay.io | ||
authfile: /etc/containers/auth.json | ||
|
||
- name: Pull the Parent Image | ||
async: 1000 | ||
poll: 0 | ||
register: pull_result | ||
ansible.builtin.shell: | | ||
podman pull "quay.io/ai-lab/{{ image_name }}:latest" \ | ||
--authfile=/etc/containers/auth.json \ | ||
--arch amd64 | ||
# --retry=3 \ | ||
# --retry-delay=15 \ | ||
- name: Check on Pulling the parent image | ||
async_status: | ||
jid: "{{ pull_result.ansible_job_id }}" | ||
register: job_result | ||
until: job_result.finished | ||
retries: 100 | ||
delay: 10 | ||
|
||
- name: Build the Bootc Image | ||
async: 1000 | ||
poll: 0 | ||
register: build_result | ||
ansible.builtin.shell: | | ||
podman build . \ | ||
-f /tmp/Containerfile \ | ||
-t quay.io/ai-lab/derived_image:latest \ | ||
--build-arg "sshpubkey={{ ssh_public_key }}" \ | ||
--authfile=/etc/containers/auth.json \ | ||
--pull=never > /tmp/build.log 2>&1 | ||
# --retry=5 \ | ||
# --retry-delay=15 | ||
- name: Check on Build Bootc Image | ||
async_status: | ||
jid: "{{ build_result.ansible_job_id }}" | ||
register: job_result | ||
until: job_result.finished | ||
retries: 100 | ||
delay: 10 | ||
|
||
- name: Install the Bootc Image | ||
async: 1000 | ||
poll: 0 | ||
register: install_result | ||
ansible.builtin.shell: | | ||
podman run \ | ||
--authfile=/etc/containers/auth.json \ | ||
--privileged \ | ||
--pid=host \ | ||
--pull=never \ | ||
--rm \ | ||
--security-opt label=type:unconfined_t \ | ||
-v /:/target \ | ||
-v /var/lib/containers:/var/lib/containers quay.io/ai-lab/derived_image:latest \ | ||
bootc install to-existing-root --karg=console=ttyS0,115200n8 --karg=systemd.journald.forward_to_console=1 | ||
# --retry=5 \ | ||
# --retry-delay=15 \ | ||
- name: Check on Install Bootc Image | ||
async_status: | ||
jid: "{{ install_result.ansible_job_id }}" | ||
register: job_result | ||
until: job_result.finished | ||
retries: 100 | ||
delay: 10 | ||
|
||
- name: Remove the host from the known_host file | ||
ansible.builtin.known_hosts: | ||
name: "{{ inventory_hostname }}" | ||
state: absent | ||
delegate_to: localhost | ||
|
||
- name: Reboot | ||
ansible.builtin.shell: systemctl reboot | ||
ignore_errors: true | ||
ignore_unreachable: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
collections: | ||
- name: community.docker |