Utilising Artificial Intelligence Chatbots for IaC Services
Kääriäinen, Jaakko (2024)
Kääriäinen, Jaakko
2024
Tietotekniikan DI-ohjelma - Master's Programme in Information Technology
Informaatioteknologian ja viestinnän tiedekunta - Faculty of Information Technology and Communication Sciences
This publication is copyrighted. You may download, display and print it for Your own personal use. Commercial use is prohibited.
Hyväksymispäivämäärä
2024-04-24
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:tuni-202404063341
https://urn.fi/URN:NBN:fi:tuni-202404063341
Tiivistelmä
The advancements in generative artificial intelligence technology have sparked interest in both software industry and development operations culture. The most common form of generative artificial intelligence is an AI chatbot that responds to a user prompt in the form of text. Infrastructure as code process is a practice of automating the provisioning process of resources in a cloud platform based on the properties presented in plain-text format in a file. This makes AI chatbots seem ideal for generating IaC scripts by using natural language to describe properties of a desired infrastructure.
This thesis investigates the capabilities of different AI chatbot services in generating IaC templates for different IaC services by examining how close the properties on the generated template match the provided prompt and whether the template follows proper syntax. These IaC services include AWS CloudFormation, Terraform, and Pulumi. The AI chatbots applied in this study include ChatGPT, Bing Chat, Bard, and Pulumi AI with default settings. An example infrastructure was described as a text prompt for AI chatbot services from which they generate an IaC template based on the information provided. The templates were collected from the initial responses of the AI chatbot services and were used to deploy the infrastucture in AWS cloud platform.
The results of the case study revealed adequate capability in generating IaC templates. Most of the templates contained either errors in syntax or semantic errors that occur when the template is run through an IaC service. Some of the errors in the templates were obvious and some of them required consulting documentation. Almost all of the templates also contained all of the properties with correct relations in correct places as described in the text prompt.
Despite the errors made by AI chatbots during template generation, they provide a good starting point for refining the generated template. The AI chatbots at this point understand the basic structure of the IaC templates used by IaC services. As the generative artificial intelligence technology develops further, the more sophisticated the AI chatbots will become at IaC template generation. Generatiivisen tekoälyteknologian kehitys on herättänyt kiinnostusta ohjelmistoteollisuudessa ja DevOps-kulttuurin piirissä. Generatiivisen tekoälyn yleisin muoto on keskusteleva tekoäly, joka vastaa käyttäjän lähettämiin kyselyihin tekstipohjaisesti. Infrastruktuuri koodina on prosessi, jossa pilvialustan resursseja provisioidaan automaattisesti konfiguraatiotiedoston esittämien ominaisuuksien perusteella. Koska konfiguraatiotiedostossa ominaisuudet kuvataan selkokielellä, tekoälyyn perustuvat keskustelubotit sopivat hyvin luomaan IaC-konfiguraatioita luonnollista kieltä hyödyntäen.
Opinnäytetyössä tarkasteltiin joidenkin keskustelevien tekoälypalvelujen kykyä tuottaa IaC-konfiguraatioita erilaisille IaC-palveluille. Tavoitteena oli tutkia, kuinka hyvin palvelujen tuottamat IaC-mallit vastaavat kyselyssä mainittuja ominaisuuksia ja ovatko ne kelvollisia syntaksin ja infrastruktuurin määrittelyn perusteella. Työssä käytettiin seuraavia IaC-palveluita: AWS CloudFormation, Terraform ja Pulumi. Tutkimuksen kohteena olivat seuraavat keskustelevat tekoälypalvelut: ChatGPT, Bing Chat, Bard ja Pulumi AI. Kysely muotoiltiin esimerkkipilvi-infrastruktuurin perusteella, joka sitten syötettiin näille palveluille oletusasetuksilla. Generoidut IaC-konfiguraatiot kerättiin tekoälypalveluiden ensimmäisistä vastauksista ja niitä käytettiin infrastruktuurin käyttöönottamiseksi AWS-pilvialustalla.
Tutkimuksen tulokset osoittivat, että keskustelevat tekoälypalvelut pystyvät tuottamaan riittävän hyviä IaC-konfiguraatioita. Suurin osa konfiguraatioista sisälsi joko virheitä syntaksissa tai semanttisia virheitä, jotka huomattiin infrastruktuurin käyttöönottovaiheessa IaC-palvelun tuottamana virheilmoituksena. Osa virheistä oli helposti korjattavissa, osa vaati syvällisempää dokumentoinnin selaamista. Lähes kaikki konfiguraatiot sisälsivät kyselyssä mainitut infrastruktuurin ominaisuudet, jotka oli määritelty oikeisiin paikkoihin oikeilla yhteyksillä.
Tekemistään virheistä huolimatta keskustelevat tekoälypalvelut tarjoavat hyvän pohjan luodun konfiguraation jatkokehitykselle. Tutkimuksen perusteella keskustelevat tekoälypalvelut ymmärtävät eri IaC-palveluiden konfiguraatiotiedostojen perusrakenteen. Todennäköisesti generatiivisen tekoälyn kehittyessä keskustelevat tekoälypalvelut tulevat olemaan nykyistä sofistikoituneempia IaC-konfiguraatioiden tuottamisessa.
This thesis investigates the capabilities of different AI chatbot services in generating IaC templates for different IaC services by examining how close the properties on the generated template match the provided prompt and whether the template follows proper syntax. These IaC services include AWS CloudFormation, Terraform, and Pulumi. The AI chatbots applied in this study include ChatGPT, Bing Chat, Bard, and Pulumi AI with default settings. An example infrastructure was described as a text prompt for AI chatbot services from which they generate an IaC template based on the information provided. The templates were collected from the initial responses of the AI chatbot services and were used to deploy the infrastucture in AWS cloud platform.
The results of the case study revealed adequate capability in generating IaC templates. Most of the templates contained either errors in syntax or semantic errors that occur when the template is run through an IaC service. Some of the errors in the templates were obvious and some of them required consulting documentation. Almost all of the templates also contained all of the properties with correct relations in correct places as described in the text prompt.
Despite the errors made by AI chatbots during template generation, they provide a good starting point for refining the generated template. The AI chatbots at this point understand the basic structure of the IaC templates used by IaC services. As the generative artificial intelligence technology develops further, the more sophisticated the AI chatbots will become at IaC template generation.
Opinnäytetyössä tarkasteltiin joidenkin keskustelevien tekoälypalvelujen kykyä tuottaa IaC-konfiguraatioita erilaisille IaC-palveluille. Tavoitteena oli tutkia, kuinka hyvin palvelujen tuottamat IaC-mallit vastaavat kyselyssä mainittuja ominaisuuksia ja ovatko ne kelvollisia syntaksin ja infrastruktuurin määrittelyn perusteella. Työssä käytettiin seuraavia IaC-palveluita: AWS CloudFormation, Terraform ja Pulumi. Tutkimuksen kohteena olivat seuraavat keskustelevat tekoälypalvelut: ChatGPT, Bing Chat, Bard ja Pulumi AI. Kysely muotoiltiin esimerkkipilvi-infrastruktuurin perusteella, joka sitten syötettiin näille palveluille oletusasetuksilla. Generoidut IaC-konfiguraatiot kerättiin tekoälypalveluiden ensimmäisistä vastauksista ja niitä käytettiin infrastruktuurin käyttöönottamiseksi AWS-pilvialustalla.
Tutkimuksen tulokset osoittivat, että keskustelevat tekoälypalvelut pystyvät tuottamaan riittävän hyviä IaC-konfiguraatioita. Suurin osa konfiguraatioista sisälsi joko virheitä syntaksissa tai semanttisia virheitä, jotka huomattiin infrastruktuurin käyttöönottovaiheessa IaC-palvelun tuottamana virheilmoituksena. Osa virheistä oli helposti korjattavissa, osa vaati syvällisempää dokumentoinnin selaamista. Lähes kaikki konfiguraatiot sisälsivät kyselyssä mainitut infrastruktuurin ominaisuudet, jotka oli määritelty oikeisiin paikkoihin oikeilla yhteyksillä.
Tekemistään virheistä huolimatta keskustelevat tekoälypalvelut tarjoavat hyvän pohjan luodun konfiguraation jatkokehitykselle. Tutkimuksen perusteella keskustelevat tekoälypalvelut ymmärtävät eri IaC-palveluiden konfiguraatiotiedostojen perusrakenteen. Todennäköisesti generatiivisen tekoälyn kehittyessä keskustelevat tekoälypalvelut tulevat olemaan nykyistä sofistikoituneempia IaC-konfiguraatioiden tuottamisessa.