© Copyright 2023, Intel Corporation
Intel® Optimized Cloud Modules for Ansible are:
- A combination of documentation(markdown) and scripted automation.
- Developed to enable/optimize technologies on Intel® Architecture (IA).
- Scripts that depend on existing Intel® Tuning Guides that were generated from testing and benchmarking exercises.
- Currently focused on enabling Infrastructure-as-a-Service (IaaS) Virtual Machines (VMs) on public cloud providers (today, on-prem hardware configuration is not supported).
- Written in Ansible or PowerShell, meant to automate operating system and above configuration.
- Ready to be Integrated into Intel® Cloud Optimization Modules for HashiCorp Terraform using Cloud Cloud-Init integration. See GCP Module example).
- Can also be used directly on their own(see usage on each recipe).
Currently out-of-scope:
- Benchmarking is not always executed for each recipe.
Note: Intel Cloud Optimized Modules for Ansible focus on the enablement of Intel Technologies and often will include a demo but are not meant to be a benchmarking tool.
Intel is working on a separate benchmarking repository called Workload Services Framework that will consume these recipes and provide benchmarking capabilities.
The primary goal of Intel Cloud Optimized Modules for Ansible is to simplify and accelerate the enablement of Intel® Technologies on public cloud VMs.
Some examples of technologies that can be enabled and optimized are:
- OPEA - Open Platform for Enterprise AI
- RAG - Retrieval Augmented Generation
- Intel Gaudi AI Accelerator
- OneAPI AI Training and Inference with Intel® Advanced Matrix Extensions (Intel® AMX)
- Intel AMX - Advanced Matrix Extensions
- Intel SGX - Software Guard Extensions
- GenAI Stable Diffusion
Intel® Cloud Optimization Modules for HashiCorp, the Intel Cloud Optimized Modules for Ansible companion
The Intel® Cloud Optimization Modules for HashiCorp Terraform enable the deployment of optimized instances on public cloud. The modules are available on the Terraform Registry.
The Modules can be easily integrated with these Intel Cloud Optimized Modules for Ansible, see Usage below.
Intel Cloud Optimized Modules for Ansible are located in the ./recipes folder. Each recipe has its own folder and contains a README.md file with instructions on how to use it.
There are two primary ways to use these Intel Cloud Optimized Modules for Ansible:
- Via a Cloud-init Integration with Intel® Cloud Optimization Modules for HashiCorp Terraform
- By running Ansible via the command line
Option 1 - Integration with Intel® Cloud Optimization Modules for HashiCorp Terraform via Cloud-Init
Overview:
- The following demonstrates how to use the
ai-pytorch-amx-ubunturecipe with the Intel GCP module for Terraform. - It uses the Terraform
user_dataargument that enables the execution on thecloud_init.ymlfile. - The
cloud_init.ymlfile calls the Ansible playbook that installs the recipe by calling therecipe.ymlfile directly from Github.
Example:
# main.tf Terraform file that deploys GCP VM via the GCP VM Module# Cloud-init file that calls Ansible playbook, see 'user_data' belowdata"template_file""user_data"{template=file("./cloud_init.yml") } # GCP VM Modulemodule"linux_vm"{source="intel/gcp-vm/intel"project="123456789"boot_image_project="ubuntu-os-cloud"boot_image_family="ubuntu-2204-lts"name="gcp-linux-with-aikit"zone="us-central1-a"access_config=[{nat_ip =null public_ptr_domain_name =null network_tier ="PREMIUM" }, ] # Integration between Terraform and Cloud-inituser_data=data.template_file.user_data.rendered }# Cloud-init file that calls Ansible playbookpackage_update: truepackage_upgrade: truepackage: - gitansible: install_method: distropackage_name: ansiblepull: url: "https://github.com/intel/optimized-cloud-recipes.git"playbook_name: "recipes/ai-pytorch-amx-ubuntu/recipe.yml"Follow Ansible installation procedures for your operating system
https://docs.ansible.com/ansible/latest/installation_guide/installation_distros.html
For example, on Ubuntu by using ansible-pull, Ansible can run directly on the host:
# Install Git sudo apt install git -y # Install Ansible Key (Ubuntu), see ansible installation guide above for other distros. sudo apt update sudo apt install software-properties-common sudo add-apt-repository --yes --update ppa:ansible/ansible # Install Ansible sudo apt install ansible -y #Run ansible-pull sudo ansible-pull -vv -U https://github.com/intel/optimized-cloud-recipes.git recipes/ai-pytorch-amx-ubuntu/recipe.yml # Logs at 'tail -f 10 /var/ansible-log' & 'tail -f 10 /var/log/dpkg.log'The repository structure is very simple. All recipes will be located under the ./recipes folder.
The recipes folders are structured as <category>-<workload name>-<intel tech enabled>-<OS>
Categories are: ai, compute, data, media, ml, networking
Examples:
- ai-pytorch-amx-ubuntu
- networking-java-qat-ubuntu
- database-mysql-avx512-ubuntu
- database-mssql-qat-windows
See Usage -> Option 1 above
A diagram showcasing the integration is coming!
We recommend using a Linux environment. If on Windows, we recommend using WSL2.
You will only need git and Ansible installed on your development environment. Follow Ansible installation procedures for your operating system. https://docs.ansible.com/ansible/latest/installation_guide/installation_distros.html
For example, on Ubuntu:
sudo apt install git -y sudo apt update sudo apt install software-properties-common sudo add-apt-repository --yes --update ppa:ansible/ansible sudo apt install ansible -yNote: If you are an Intel® employee, reach out to the Repository Owners. We have additional environment configuration information that can help you.
Please see CONTRIBUTING.md
We are glad to review and accept contributions.
Many times these Modules will need to be enhanced for additional use cases. We are open to contributions and suggestions.
