SlideShare a Scribd company logo
1 of 28
ARGUS - THE OMNISCIENT
CI
Cosmi
n
Poiean
ă
Co-Founder @
RoPython
Cloud Engineer @
Cloudbase
Student @ UAIC
cmin@ropython.org
Contents
1. Clouds
2. Cloudbase-Init
3. Testing Cloudbase-Init
4. Argus
5. Components
6. Argus configuration file
7. Advanced concepts
8. Using Argus
9. Create a comprehensive test
Clouds
- Cloud computing
- InfrastructureAsAService
- OpenStack
- OpenNebula
- CloudStack
Clouds
- VM creation & initialize
- Metadata providers
- Cloud initialization services
- Cloud-Init
- Cloudbase-Init
Cloudbase-Init
- Portable customization
- For NT systems
- OSS & written in Python
- Supports popular clouds
- Independent of the hypervisor
- Merge with Cloud-Init
Cloudbase-Init
- Runs as a service at startup
- Services (different metadata providers)
- Plugins:
- Host name
- Networking
- Local scripts
- SSH public keys
- Userdata
- Configuration file
Cloudbase-Init
[DEFAULT]
# What user to create and in which group(s) to be put.
username=Admin
groups=Administrators
inject_user_password=true # Use password from the metadata (not random).
# Where to store logs.
logdir=C:Program Files (x86)Cloudbase SolutionsCloudbase-Initlog
# Where are located the user supplied scripts for execution.
local_scripts_path=C:Program Files (x86)Cloudbase SolutionsCloudbase-InitLocalScripts
# Services that will be tested for loading until one of them succeeds.
metadata_services=cloudbaseinit.metadata.services.configdrive.ConfigDriveService,
cloudbaseinit.metadata.services.httpservice.HttpService
# What plugins to execute.
plugins=cloudbaseinit.plugins.common.mtu.MTUPlugin,
cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin
Testing Cloudbase-Init
- Unit testing (local & Jenkins)
- Windows VM
- Installer & Service
- OpenStack instance
- OpenNebula, CloudStack etc. instance
- Automation?
Testing Cloudbase-Init
Argus
- Integration tests
- More than a CI framework
- General use
- Written in Python
Argus
- Uses tempest
- Scenario based
- Unittest-like reports
- Conf level tests
2015-06-28 02:35:31,720 - argus - INFO - Cleaning up...
======================================
===
FAIL: test_any_exception_occurred
(argus.tests.cloud.smoke.TestNoError)
----------------------------------------------------
------------------
Traceback (most recent call last):
File "/home/devstack/argus-
ci/argus/tests/cloud/smoke.py", line 257, in
test_any_exception_occurred
self.assertEqual('', instance_traceback)
FAIL: test_any_exception_occurred
(argus.tests.cloud.windows.test_smoke.TestSmoke)
----------------------------------------------------
------------------
Ran 19 tests in 704.051s
FAILED (failures=2, skipped=1)
Argus components
- Scenarios
- Recipes
- Tests
- Introspection
- The Runner
- Configuration file (actual tests & settings)
Scenarios
@six.add_metaclass(abc.ABCMeta)
class BaseArgusScenario(object):
...
def instance_output(self, limit=OUTPUT_SIZE):
"""Get the console output, sent from the instance."""
while True:
resp, content = self._instance_output(limit)
if resp.status not in OUTPUT_STATUS_OK:
LOG.error("Couldn't get console output <%d>.", resp.status)
return
if len(content.splitlines()) >= (limit - OUTPUT_EPSILON):
limit *= 2
else:
break
return content
def instance_server(self):
"""Get the instance server object."""
return self._servers_client.get_server(self._server['id'])
def public_key(self):
return self._keypair['public_key']
def private_key(self):
return self._keypair['private_key']
def get_image_by_ref(self):
return self._images_client.show_image(self._image.image_ref)
def get_metadata(self):
return self._metadata
Recipes
@six.add_metaclass(abc.ABCMeta)
class BaseCloudbaseinitRecipe(base.BaseRecipe):
def __init__(self, *args, **kwargs):
super(BaseCloudbaseinitRecipe, self).__init__(*args, **kwargs)
self.build = None
self.arch = None
@abc.abstractmethod
def wait_for_boot_completion(self):
"""Wait for the instance to finish up booting."""
@abc.abstractmethod
def get_installation_script(self):
"""Get the installation script for cloudbaseinit."""
@abc.abstractmethod
def install_cbinit(self):
"""Install the cloudbaseinit code."""
@abc.abstractmethod
def wait_cbinit_finalization(self):
"""Wait for the finalization of cloudbaseinit."""
@abc.abstractmethod
def install_git(self):
"""Install git in the instance.""“
…
Introspection
@six.add_metaclass(abc.ABCMeta)
class BaseInstanceIntrospection(object):
"""Generic utility class for introspecting an instance."""
def __init__(self, remote_client, instance, image):
self.remote_client = remote_client
self.instance = instance
self.image = image
@abc.abstractmethod
def get_plugins_count(self):
"""Return the plugins count from the instance."""
@abc.abstractmethod
def get_disk_size(self):
"""Return the disk size from the instance."""
@abc.abstractmethod
def username_exists(self, username):
"""Check if the given username exists in the instance."""
@abc.abstractmethod
def get_instance_hostname(self):
"""Get the hostname of the instance."""
@abc.abstractmethod
def get_instance_ntp_peers(self):
"""Get the NTP peers from the instance."""
@abc.abstractmethod
def get_instance_keys_path(self):
"""Return the authorized_keys file path from the instance."""
Tests
class TestsBaseSmoke(TestCreatedUser,
TestPasswordPostedSmoke,
TestPasswordMetadataSmoke,
TestNoError,
base.TestBaseArgus):
"""Various smoke tests for testing cloudbaseinit."""
def test_plugins_count(self):
# Test that we have the expected numbers of plugins.
plugins_count = self.introspection.get_plugins_count()
self.assertEqual(CONF.cloudbaseinit.expected_plugins_count,
plugins_count)
def test_disk_expanded(self):
# Test the disk expanded properly.
image = self.manager.get_image_by_ref()
datastore_size = image['OS-EXT-IMG-SIZE:size']
disk_size = self.introspection.get_disk_size()
self.assertGreater(disk_size, datastore_size)
def test_hostname_set(self):
# Test that the hostname was properly set.
instance_hostname = self.introspection.get_instance_hostname()
server = self.manager.instance_server()
self.assertEqual(instance_hostname,
str(server['name'][:15]).lower())
Components’ relationship
- Scenario defines a “test suite”
- Recipe configures the scenario
- Test does the checks
- Introspection retrieves instance data
Argus config file
- Basic settings (argus, cloudbaseinit)
- Image (credentials, ID, flavor)
- Base scenario (common defaults)
- Group inheritance
Argus config file
[image_windows_2012_r2]
default_ci_username = CiAdmin
default_ci_password = Passw0rd
image_ref = 9d56607b-88f2-405e-838b-6aefc037fb46
[base_smoke_windows]
type = smoke
scenario = argus.scenarios.cloud:BaseWindowsScenario
recipe = argus.recipes.cloud.windows:CloudbaseinitRecipe
introspection = argus.introspection.cloud.windows:InstanceIntrospection
images = windows_2012_r2
Advanced concepts
- Metadata
- Userdata
- Environments (start/stop, settings)
- Preparers
- Volatile IaaS config options
Mock metadata
- Web server (custom port)
- Drive attach
- Explicit configuration
- Custom data
- Result: behave as a different cloud
Using Argus
devstack@devstack:~/argus-ci$ argus cloud --help
usage: argus cloud [-h] [--failfast] --conf CONF [-p]
[--test-os-types [TEST_OS_TYPES [TEST_OS_TYPES ...]]]
[--test-scenario-type TEST_SCENARIO_TYPE] [-o
DIRECTORY]
[-b {beta,stable}] [-a {x64,x86}] [--patch-install URL]
[--git-command GIT_COMMAND]
Using Argus
devstack@devstack:~/argus-ci$ argus cloud --help
…
optional arguments:
-h, --help show this help message and exit
--failfast Fail the tests on the first failure.
--conf CONF Give a path to the argus conf. It should be an .ini
file format with a section called [argus].
-p, --pause Pause argus before doing any test.
Using Argus
devstack@devstack:~/argus-ci$ argus cloud --help
…
--test-os-types [TEST_OS_TYPES [TEST_OS_TYPES ...]]
Test only those scenarios with these OS types. By
default, all scenarios are executed. For instance, to
run only the Windows and FreeBSD scenarios, use
`--test-os-types Windows,FreeBSD`
--test-scenario-type TEST_SCENARIO_TYPE
Test only the scenarios with this type. The type can
be `smoke` or `deep`. By default, all scenarios types
are executed.
Using Argus
devstack@devstack:~/argus-ci$ argus cloud --help
…
-o DIRECTORY, --instance-output DIRECTORY
Save the instance console output content in this path.
If this is given, it can be reused for other files as
well.
-b {beta,stable}, --builds {beta,stable}
Choose what installer builds to test.
-a {x64,x86}, --arches {x64,x86}
Choose what installer architectures to test.
Using Argus
devstack@devstack:~/argus-ci$ argus cloud --help
…
--patch-install URL Pass a link that points *directly* to a zip file
containing the installed version. The content will
just replace the files.
--git-command GIT_COMMAND
Pass a git command which should be interpreted by a
recipe.
Example: argus cloud --conf argus.conf -p -o cblogs -a x64 --git-command “git fetch …
&& git checkout …”
Develop a test
- Cloudbase-Init patch (not merged)
- Custom new one or use already created (class):
- Scenario
- Recipe
- Test(s)
- Introspection
- New “scenario_” group in config file
- Run argus & inspect logs
Q & A
- Cloudbase-Init:
- http://cloudbase.it/
- https://github.com/stackforge/cloudbase-init
- Argus:
- https://github.com/PCManticore/argus-ci
ropython.org

More Related Content

What's hot

Managing themes and server environments with extensible configuration arrays
Managing themes and server environments with extensible configuration arraysManaging themes and server environments with extensible configuration arrays
Managing themes and server environments with extensible configuration arrays
Chris Olbekson
 
Stack kicker devopsdays-london-2013
Stack kicker devopsdays-london-2013Stack kicker devopsdays-london-2013
Stack kicker devopsdays-london-2013
Simon McCartney
 
Viktor Tsykunov "Microsoft AI platform for every Developer"
Viktor Tsykunov "Microsoft AI platform for every Developer"Viktor Tsykunov "Microsoft AI platform for every Developer"
Viktor Tsykunov "Microsoft AI platform for every Developer"
Lviv Startup Club
 
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
Wesley Beary
 

What's hot (20)

Managing themes and server environments with extensible configuration arrays
Managing themes and server environments with extensible configuration arraysManaging themes and server environments with extensible configuration arrays
Managing themes and server environments with extensible configuration arrays
 
Amazon aurora 1
Amazon aurora 1Amazon aurora 1
Amazon aurora 1
 
Stack kicker devopsdays-london-2013
Stack kicker devopsdays-london-2013Stack kicker devopsdays-london-2013
Stack kicker devopsdays-london-2013
 
Ansible : what's ansible & use case by REX
Ansible :  what's ansible & use case by REXAnsible :  what's ansible & use case by REX
Ansible : what's ansible & use case by REX
 
Viktor Tsykunov "Microsoft AI platform for every Developer"
Viktor Tsykunov "Microsoft AI platform for every Developer"Viktor Tsykunov "Microsoft AI platform for every Developer"
Viktor Tsykunov "Microsoft AI platform for every Developer"
 
SCasia 2018 MSFT hands on session for Azure Batch AI
SCasia 2018 MSFT hands on session for Azure Batch AISCasia 2018 MSFT hands on session for Azure Batch AI
SCasia 2018 MSFT hands on session for Azure Batch AI
 
A Little Backbone For Your App
A Little Backbone For Your AppA Little Backbone For Your App
A Little Backbone For Your App
 
Manage Add-on Services in Apache Ambari
Manage Add-on Services in Apache AmbariManage Add-on Services in Apache Ambari
Manage Add-on Services in Apache Ambari
 
Introduction To Terraform
Introduction To TerraformIntroduction To Terraform
Introduction To Terraform
 
DevOps Enabling Your Team
DevOps Enabling Your TeamDevOps Enabling Your Team
DevOps Enabling Your Team
 
Terraform Introduction
Terraform IntroductionTerraform Introduction
Terraform Introduction
 
SenchaCon 2016: Modernizing the Ext JS Class System - Don Griffin
SenchaCon 2016: Modernizing the Ext JS Class System - Don GriffinSenchaCon 2016: Modernizing the Ext JS Class System - Don Griffin
SenchaCon 2016: Modernizing the Ext JS Class System - Don Griffin
 
Chef 0.10 Overview
Chef 0.10 OverviewChef 0.10 Overview
Chef 0.10 Overview
 
How to create a multi tenancy for an interactive data analysis with jupyter h...
How to create a multi tenancy for an interactive data analysis with jupyter h...How to create a multi tenancy for an interactive data analysis with jupyter h...
How to create a multi tenancy for an interactive data analysis with jupyter h...
 
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
fog or: How I Learned to Stop Worrying and Love the Cloud (OpenStack Edition)
 
CCF #1: Taking the reins of your data with Hiera 5
CCF #1: Taking the reins of your data with Hiera 5CCF #1: Taking the reins of your data with Hiera 5
CCF #1: Taking the reins of your data with Hiera 5
 
Datagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and BackgridDatagrids with Symfony 2, Backbone and Backgrid
Datagrids with Symfony 2, Backbone and Backgrid
 
Puppet for Developers
Puppet for DevelopersPuppet for Developers
Puppet for Developers
 
Ant_quick_guide
Ant_quick_guideAnt_quick_guide
Ant_quick_guide
 
ember-socket-guru - common api for websockets providers
ember-socket-guru - common api for websockets providersember-socket-guru - common api for websockets providers
ember-socket-guru - common api for websockets providers
 

Viewers also liked

Airport In Construction
Airport In ConstructionAirport In Construction
Airport In Construction
Stelarosa .
 
Old Ivy Vs Ort 2008
Old Ivy Vs Ort 2008Old Ivy Vs Ort 2008
Old Ivy Vs Ort 2008
paobazzi
 
Chase Oaks VBX - Monday - Greatness of the Journey
Chase Oaks VBX - Monday - Greatness of the JourneyChase Oaks VBX - Monday - Greatness of the Journey
Chase Oaks VBX - Monday - Greatness of the Journey
Jason Loveless
 
Peace - Binh yen
Peace - Binh yenPeace - Binh yen
Peace - Binh yen
bichdung
 
Chase Oaks VBX - Thursday - The Summit &amp; Goal Of The Journey
Chase Oaks VBX - Thursday - The  Summit &amp;  Goal Of The  JourneyChase Oaks VBX - Thursday - The  Summit &amp;  Goal Of The  Journey
Chase Oaks VBX - Thursday - The Summit &amp; Goal Of The Journey
Jason Loveless
 
What Is Literary Criticism[1]2
What Is Literary Criticism[1]2What Is Literary Criticism[1]2
What Is Literary Criticism[1]2
makeefer
 
Global Head's Power Point Presentation
Global Head's Power Point PresentationGlobal Head's Power Point Presentation
Global Head's Power Point Presentation
guestfd2c12f2
 
Almost Vs San Juan 2009
Almost Vs San Juan 2009Almost Vs San Juan 2009
Almost Vs San Juan 2009
paobazzi
 
Monday A Wild Battle God Is Undefeatable
Monday    A  Wild  Battle    God  Is  UndefeatableMonday    A  Wild  Battle    God  Is  Undefeatable
Monday A Wild Battle God Is Undefeatable
Jason Loveless
 

Viewers also liked (20)

Project
ProjectProject
Project
 
Power Point 802.3
Power Point 802.3Power Point 802.3
Power Point 802.3
 
Airport In Construction
Airport In ConstructionAirport In Construction
Airport In Construction
 
Furniture and Accessories Catalog
Furniture and Accessories CatalogFurniture and Accessories Catalog
Furniture and Accessories Catalog
 
Old Ivy Vs Ort 2008
Old Ivy Vs Ort 2008Old Ivy Vs Ort 2008
Old Ivy Vs Ort 2008
 
USART
USARTUSART
USART
 
Chase Oaks VBX - Monday - Greatness of the Journey
Chase Oaks VBX - Monday - Greatness of the JourneyChase Oaks VBX - Monday - Greatness of the Journey
Chase Oaks VBX - Monday - Greatness of the Journey
 
User Accounts in Drupal
User Accounts in DrupalUser Accounts in Drupal
User Accounts in Drupal
 
Peace - Binh yen
Peace - Binh yenPeace - Binh yen
Peace - Binh yen
 
Alphabet bookmark
Alphabet bookmarkAlphabet bookmark
Alphabet bookmark
 
Annual Report: What's happening @ the Wadleigh 2009-2010
Annual Report: What's happening @ the Wadleigh 2009-2010Annual Report: What's happening @ the Wadleigh 2009-2010
Annual Report: What's happening @ the Wadleigh 2009-2010
 
Chase Oaks VBX - Thursday - The Summit &amp; Goal Of The Journey
Chase Oaks VBX - Thursday - The  Summit &amp;  Goal Of The  JourneyChase Oaks VBX - Thursday - The  Summit &amp;  Goal Of The  Journey
Chase Oaks VBX - Thursday - The Summit &amp; Goal Of The Journey
 
What Is Literary Criticism[1]2
What Is Literary Criticism[1]2What Is Literary Criticism[1]2
What Is Literary Criticism[1]2
 
Global Head's Power Point Presentation
Global Head's Power Point PresentationGlobal Head's Power Point Presentation
Global Head's Power Point Presentation
 
Almost Vs San Juan 2009
Almost Vs San Juan 2009Almost Vs San Juan 2009
Almost Vs San Juan 2009
 
About Thrift
About ThriftAbout Thrift
About Thrift
 
Social Media Basics
Social Media BasicsSocial Media Basics
Social Media Basics
 
PPT母版_简约_v0.1
PPT母版_简约_v0.1PPT母版_简约_v0.1
PPT母版_简约_v0.1
 
Monday A Wild Battle God Is Undefeatable
Monday    A  Wild  Battle    God  Is  UndefeatableMonday    A  Wild  Battle    God  Is  Undefeatable
Monday A Wild Battle God Is Undefeatable
 
Fundraising Day - New York: Taking Leadership Online
Fundraising Day - New York: Taking Leadership OnlineFundraising Day - New York: Taking Leadership Online
Fundraising Day - New York: Taking Leadership Online
 

Similar to ARGUS - THE OMNISCIENT CI

Puppetpreso
PuppetpresoPuppetpreso
Puppetpreso
ke4qqq
 
10 Cool Facts about Gradle
10 Cool Facts about Gradle10 Cool Facts about Gradle
10 Cool Facts about Gradle
Evgeny Goldin
 
Dance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech TalkDance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech Talk
Michael Peacock
 
Infrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackInfrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStack
ke4qqq
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
andymccurdy
 
Puppet and CloudStack
Puppet and CloudStackPuppet and CloudStack
Puppet and CloudStack
ke4qqq
 

Similar to ARGUS - THE OMNISCIENT CI (20)

Kolla project onboarding - OpenStack Summit Berlin 2018
Kolla project onboarding - OpenStack Summit Berlin 2018Kolla project onboarding - OpenStack Summit Berlin 2018
Kolla project onboarding - OpenStack Summit Berlin 2018
 
Cloud Meetup - Automation in the Cloud
Cloud Meetup - Automation in the CloudCloud Meetup - Automation in the Cloud
Cloud Meetup - Automation in the Cloud
 
Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013Puppet: Eclipsecon ALM 2013
Puppet: Eclipsecon ALM 2013
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013
 
Generators
GeneratorsGenerators
Generators
 
Ansible fest Presentation slides
Ansible fest Presentation slidesAnsible fest Presentation slides
Ansible fest Presentation slides
 
Puppetpreso
PuppetpresoPuppetpreso
Puppetpreso
 
10 Cool Facts about Gradle
10 Cool Facts about Gradle10 Cool Facts about Gradle
10 Cool Facts about Gradle
 
Automation with Ansible and Containers
Automation with Ansible and ContainersAutomation with Ansible and Containers
Automation with Ansible and Containers
 
Crafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in RubyCrafting Beautiful CLI Applications in Ruby
Crafting Beautiful CLI Applications in Ruby
 
Dance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech TalkDance for the puppet master: G6 Tech Talk
Dance for the puppet master: G6 Tech Talk
 
Puppet and Apache CloudStack
Puppet and Apache CloudStackPuppet and Apache CloudStack
Puppet and Apache CloudStack
 
Infrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStackInfrastructure as code with Puppet and Apache CloudStack
Infrastructure as code with Puppet and Apache CloudStack
 
Python Deployment with Fabric
Python Deployment with FabricPython Deployment with Fabric
Python Deployment with Fabric
 
Puppet and CloudStack
Puppet and CloudStackPuppet and CloudStack
Puppet and CloudStack
 
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled InfrastructureCloud meets Fog & Puppet A Story of Version Controlled Infrastructure
Cloud meets Fog & Puppet A Story of Version Controlled Infrastructure
 
Introduction to JumpStart
Introduction to JumpStartIntroduction to JumpStart
Introduction to JumpStart
 
fog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloudfog or: How I Learned to Stop Worrying and Love the Cloud
fog or: How I Learned to Stop Worrying and Love the Cloud
 
Custom deployments with sbt-native-packager
Custom deployments with sbt-native-packagerCustom deployments with sbt-native-packager
Custom deployments with sbt-native-packager
 
Just one-shade-of-openstack
Just one-shade-of-openstackJust one-shade-of-openstack
Just one-shade-of-openstack
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 

ARGUS - THE OMNISCIENT CI

  • 1. ARGUS - THE OMNISCIENT CI Cosmi n Poiean ă Co-Founder @ RoPython Cloud Engineer @ Cloudbase Student @ UAIC cmin@ropython.org
  • 2. Contents 1. Clouds 2. Cloudbase-Init 3. Testing Cloudbase-Init 4. Argus 5. Components 6. Argus configuration file 7. Advanced concepts 8. Using Argus 9. Create a comprehensive test
  • 3. Clouds - Cloud computing - InfrastructureAsAService - OpenStack - OpenNebula - CloudStack
  • 4. Clouds - VM creation & initialize - Metadata providers - Cloud initialization services - Cloud-Init - Cloudbase-Init
  • 5. Cloudbase-Init - Portable customization - For NT systems - OSS & written in Python - Supports popular clouds - Independent of the hypervisor - Merge with Cloud-Init
  • 6. Cloudbase-Init - Runs as a service at startup - Services (different metadata providers) - Plugins: - Host name - Networking - Local scripts - SSH public keys - Userdata - Configuration file
  • 7. Cloudbase-Init [DEFAULT] # What user to create and in which group(s) to be put. username=Admin groups=Administrators inject_user_password=true # Use password from the metadata (not random). # Where to store logs. logdir=C:Program Files (x86)Cloudbase SolutionsCloudbase-Initlog # Where are located the user supplied scripts for execution. local_scripts_path=C:Program Files (x86)Cloudbase SolutionsCloudbase-InitLocalScripts # Services that will be tested for loading until one of them succeeds. metadata_services=cloudbaseinit.metadata.services.configdrive.ConfigDriveService, cloudbaseinit.metadata.services.httpservice.HttpService # What plugins to execute. plugins=cloudbaseinit.plugins.common.mtu.MTUPlugin, cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin
  • 8. Testing Cloudbase-Init - Unit testing (local & Jenkins) - Windows VM - Installer & Service - OpenStack instance - OpenNebula, CloudStack etc. instance - Automation?
  • 10. Argus - Integration tests - More than a CI framework - General use - Written in Python
  • 11. Argus - Uses tempest - Scenario based - Unittest-like reports - Conf level tests 2015-06-28 02:35:31,720 - argus - INFO - Cleaning up... ====================================== === FAIL: test_any_exception_occurred (argus.tests.cloud.smoke.TestNoError) ---------------------------------------------------- ------------------ Traceback (most recent call last): File "/home/devstack/argus- ci/argus/tests/cloud/smoke.py", line 257, in test_any_exception_occurred self.assertEqual('', instance_traceback) FAIL: test_any_exception_occurred (argus.tests.cloud.windows.test_smoke.TestSmoke) ---------------------------------------------------- ------------------ Ran 19 tests in 704.051s FAILED (failures=2, skipped=1)
  • 12. Argus components - Scenarios - Recipes - Tests - Introspection - The Runner - Configuration file (actual tests & settings)
  • 13. Scenarios @six.add_metaclass(abc.ABCMeta) class BaseArgusScenario(object): ... def instance_output(self, limit=OUTPUT_SIZE): """Get the console output, sent from the instance.""" while True: resp, content = self._instance_output(limit) if resp.status not in OUTPUT_STATUS_OK: LOG.error("Couldn't get console output <%d>.", resp.status) return if len(content.splitlines()) >= (limit - OUTPUT_EPSILON): limit *= 2 else: break return content def instance_server(self): """Get the instance server object.""" return self._servers_client.get_server(self._server['id']) def public_key(self): return self._keypair['public_key'] def private_key(self): return self._keypair['private_key'] def get_image_by_ref(self): return self._images_client.show_image(self._image.image_ref) def get_metadata(self): return self._metadata
  • 14. Recipes @six.add_metaclass(abc.ABCMeta) class BaseCloudbaseinitRecipe(base.BaseRecipe): def __init__(self, *args, **kwargs): super(BaseCloudbaseinitRecipe, self).__init__(*args, **kwargs) self.build = None self.arch = None @abc.abstractmethod def wait_for_boot_completion(self): """Wait for the instance to finish up booting.""" @abc.abstractmethod def get_installation_script(self): """Get the installation script for cloudbaseinit.""" @abc.abstractmethod def install_cbinit(self): """Install the cloudbaseinit code.""" @abc.abstractmethod def wait_cbinit_finalization(self): """Wait for the finalization of cloudbaseinit.""" @abc.abstractmethod def install_git(self): """Install git in the instance.""“ …
  • 15. Introspection @six.add_metaclass(abc.ABCMeta) class BaseInstanceIntrospection(object): """Generic utility class for introspecting an instance.""" def __init__(self, remote_client, instance, image): self.remote_client = remote_client self.instance = instance self.image = image @abc.abstractmethod def get_plugins_count(self): """Return the plugins count from the instance.""" @abc.abstractmethod def get_disk_size(self): """Return the disk size from the instance.""" @abc.abstractmethod def username_exists(self, username): """Check if the given username exists in the instance.""" @abc.abstractmethod def get_instance_hostname(self): """Get the hostname of the instance.""" @abc.abstractmethod def get_instance_ntp_peers(self): """Get the NTP peers from the instance.""" @abc.abstractmethod def get_instance_keys_path(self): """Return the authorized_keys file path from the instance."""
  • 16. Tests class TestsBaseSmoke(TestCreatedUser, TestPasswordPostedSmoke, TestPasswordMetadataSmoke, TestNoError, base.TestBaseArgus): """Various smoke tests for testing cloudbaseinit.""" def test_plugins_count(self): # Test that we have the expected numbers of plugins. plugins_count = self.introspection.get_plugins_count() self.assertEqual(CONF.cloudbaseinit.expected_plugins_count, plugins_count) def test_disk_expanded(self): # Test the disk expanded properly. image = self.manager.get_image_by_ref() datastore_size = image['OS-EXT-IMG-SIZE:size'] disk_size = self.introspection.get_disk_size() self.assertGreater(disk_size, datastore_size) def test_hostname_set(self): # Test that the hostname was properly set. instance_hostname = self.introspection.get_instance_hostname() server = self.manager.instance_server() self.assertEqual(instance_hostname, str(server['name'][:15]).lower())
  • 17. Components’ relationship - Scenario defines a “test suite” - Recipe configures the scenario - Test does the checks - Introspection retrieves instance data
  • 18. Argus config file - Basic settings (argus, cloudbaseinit) - Image (credentials, ID, flavor) - Base scenario (common defaults) - Group inheritance
  • 19. Argus config file [image_windows_2012_r2] default_ci_username = CiAdmin default_ci_password = Passw0rd image_ref = 9d56607b-88f2-405e-838b-6aefc037fb46 [base_smoke_windows] type = smoke scenario = argus.scenarios.cloud:BaseWindowsScenario recipe = argus.recipes.cloud.windows:CloudbaseinitRecipe introspection = argus.introspection.cloud.windows:InstanceIntrospection images = windows_2012_r2
  • 20. Advanced concepts - Metadata - Userdata - Environments (start/stop, settings) - Preparers - Volatile IaaS config options
  • 21. Mock metadata - Web server (custom port) - Drive attach - Explicit configuration - Custom data - Result: behave as a different cloud
  • 22. Using Argus devstack@devstack:~/argus-ci$ argus cloud --help usage: argus cloud [-h] [--failfast] --conf CONF [-p] [--test-os-types [TEST_OS_TYPES [TEST_OS_TYPES ...]]] [--test-scenario-type TEST_SCENARIO_TYPE] [-o DIRECTORY] [-b {beta,stable}] [-a {x64,x86}] [--patch-install URL] [--git-command GIT_COMMAND]
  • 23. Using Argus devstack@devstack:~/argus-ci$ argus cloud --help … optional arguments: -h, --help show this help message and exit --failfast Fail the tests on the first failure. --conf CONF Give a path to the argus conf. It should be an .ini file format with a section called [argus]. -p, --pause Pause argus before doing any test.
  • 24. Using Argus devstack@devstack:~/argus-ci$ argus cloud --help … --test-os-types [TEST_OS_TYPES [TEST_OS_TYPES ...]] Test only those scenarios with these OS types. By default, all scenarios are executed. For instance, to run only the Windows and FreeBSD scenarios, use `--test-os-types Windows,FreeBSD` --test-scenario-type TEST_SCENARIO_TYPE Test only the scenarios with this type. The type can be `smoke` or `deep`. By default, all scenarios types are executed.
  • 25. Using Argus devstack@devstack:~/argus-ci$ argus cloud --help … -o DIRECTORY, --instance-output DIRECTORY Save the instance console output content in this path. If this is given, it can be reused for other files as well. -b {beta,stable}, --builds {beta,stable} Choose what installer builds to test. -a {x64,x86}, --arches {x64,x86} Choose what installer architectures to test.
  • 26. Using Argus devstack@devstack:~/argus-ci$ argus cloud --help … --patch-install URL Pass a link that points *directly* to a zip file containing the installed version. The content will just replace the files. --git-command GIT_COMMAND Pass a git command which should be interpreted by a recipe. Example: argus cloud --conf argus.conf -p -o cblogs -a x64 --git-command “git fetch … && git checkout …”
  • 27. Develop a test - Cloudbase-Init patch (not merged) - Custom new one or use already created (class): - Scenario - Recipe - Test(s) - Introspection - New “scenario_” group in config file - Run argus & inspect logs
  • 28. Q & A - Cloudbase-Init: - http://cloudbase.it/ - https://github.com/stackforge/cloudbase-init - Argus: - https://github.com/PCManticore/argus-ci ropython.org

Editor's Notes

  1. Hi, my name is Cosmin Poieana and in this talk I’ll show you the true power of Argus, an open source continuous integration framework, mainly used to test Cloudbase-Init and not only. Together with some friends (and coworkers) we created RoPython, the Romanian community which stands for anything that involves Python and open-source software, by organizing workshops, trainings and conferences. In my full time, I’m working at a cool startup named Cloudbase Solutions and also following to obtain the Bachelor degree at Cuza university. In case of future questions, regarding my involvement in these things, you can contact me using the E-mail address shown below my name, C-M-I-N at ropython dot O-R-G.
  2. As a fast reference, today I will talk about clouds in general, closed to our current approach, about cloud initialization services and in particular, Cloudbase-Init and how we test it. For the testing part, we use Argus, which is made by some cool components working together, all specified and bundled in the most important part of the project, the configuration file. I will also talk about some in-depth and pretty advanced concepts and capabilities handled by Argus, how to customize your tests starting from the command line interface and finally, I’ll show you how to actually create a test for your patch or for some aspect already implemented in your tested project and a demo demonstrating how this works in real life.
  3. Before starting talking about anything related to initialization services, I will briefly go through the essence of cloud computing. So, what is a cloud at all (by IT meaning)? In simple words, is a place over multiple hosts in a network, where many types of data are stored, processed and served to the user, rather than using a local computer. Usually, clouds stacks services like Platform As A Service, Infrastructure As A Service and Software As A Service, but we will focus on IaaS and handling virtual machine instances created through it. Such popular deploys, mainly used in the world, starts with noisy names like OpenStack, the biggest open-source project mostly written in Python, OpenNebula, which is something similar but lighter than OpenStack and resource friendly and another cloud even more simpler to handle, called CloudStack.
  4. These infrastructures are mainly used to create and handle with ease many instances which are basically virtual machines emulated by a hypervisor. There are some important things which we should know about the Clouds, like…