Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add Introducing the Devfile AI Assistant blog post #55

Merged
merged 10 commits into from
Jun 21, 2024
334 changes: 334 additions & 0 deletions _posts/2024-06-26-devfile-ai-assistant.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,334 @@
---
title: Introducing the Devfile AI Assistant
layout: post
author: Anatolii Bazko
description: >-
The Devfile AI Assistant is an online tool that simplifies the creation of devfiles for developers.
categories: []
keywords: ['devfile', 'ChatGPT', 'AI']
slug: /@tolusha/devfile-ai-assistant
---

== Introducing the Devfile AI Assistant

In software development, it's important to be efficient. Whether you're an experienced developer or just starting, setting up your development environment can be complex and time-consuming. That's where the link:https://chatgpt.com/g/g-Bm20CP2Rp-devfile-assistant[Devfile AI Assistant] comes in. It's designed to help developers create devfiles easily without needing in-depth knowledge of the devfile syntax or structure. It uses a link:https://devfile.io[devfile knowledge base] to help you craft a devfile, making sure your development environment is set up right.

Another tool that simplifies creating devfile is the link:https://github.com/devfile/vscode-walkthrough-extension[VS Code Walkthrough Extension for Devfile]. It provides an interactive guide to help users understand and utilize devfiles within Visual Studio Code. Using a wizard, you can easily create a devfile to customize your Cloud Development Environment.
tolusha marked this conversation as resolved.
Show resolved Hide resolved


== What is a devfile?

Devfiles are configuration files that define development environments. They specify the components, commands, events etc. that make up a development workspace. They play a central role in the workflow of Eclipse Che.

In Eclipse Che, devfiles are used to automate the setup of development environments. By providing a devfile, developers can ensure a consistent environment across the team, getting rid of the "works on my machine" problems. When a devfile is applied, Eclipse Che provisions the specified containers, clones the necessary repositories, and sets up the workspace with all the tools and dependencies required for development. It makes them an essential tool for modern cloud-based development.
tolusha marked this conversation as resolved.
Show resolved Hide resolved

image::/assets/img/devfile-ai-assistant/devfile-eclipse-che-cde.png[Devfile->Eclipse-Che->CDE]
{nbsp} +

== Step-by-step example of how to create a devfile

Let's check out some real-life examples of how the Devfile AI Assistant can help you in creating devfiles for your projects."

. Start by providing a basic devfile.
+
**Request:**
+
[source]
----
Provide a basic devfile.
----
**Response:**
+
[source,yaml]
----
schemaVersion: 2.3.0
metadata:
name: basic-devfile
components:
- name: tools
container:
image: quay.io/devfile/universal-developer-image:latest
----

. Add a project to the devfile.
tolusha marked this conversation as resolved.
Show resolved Hide resolved
+
**Request:**
+
[source]
----
Add https://github.com/eclipse-che/che-server git project.
tolusha marked this conversation as resolved.
Show resolved Hide resolved
----
**Response:**
+
[source,yaml]
----
schemaVersion: 2.3.0
metadata:
name: basic-devfile
components:
- name: tools
container:
image: quay.io/devfile/universal-developer-image:latest
projects:
- name: che-server
git:
remotes:
origin: https://github.com/eclipse-che/che-server.git
----

. Add a new component to the devfile.
+
**Request:**
+
[source]
----
Add PostgreSQL component.
----
**Response:**
+
[source,yaml]
----
schemaVersion: 2.3.0
metadata:
name: devfile
components:
- name: tools
container:
image: quay.io/devfile/universal-developer-image:latest
- name: postgres
container:
image: postgres:latest
env:
- name: POSTGRES_DB
value: mydatabase
- name: POSTGRES_USER
value: user
- name: POSTGRES_PASSWORD
value: password
projects:
- name: che-server
git:
remotes:
origin: https://github.com/eclipse-che/che-server.git
----

. Add a volume to the devfile.
+
**Request:**
+
[source]
----
Add 2Gi volume in home user directory to store Maven artifacts.
----
**Response:**
+
[source,yaml]
----
schemaVersion: 2.3.0
metadata:
name: devfile
components:
- name: tools
container:
image: quay.io/devfile/universal-developer-image:latest
volumeMounts:
- name: maven-artifacts
path: /home/user/.m2
- name: postgres
container:
image: postgres:latest
env:
- name: POSTGRES_DB
value: mydatabase
- name: POSTGRES_USER
value: user
- name: POSTGRES_PASSWORD
value: password
- name: maven-artifacts
volume:
size: 2Gi
projects:
- name: che-server
git:
remotes:
origin: https://github.com/eclipse-che/che-server.git
----

. Add command to the devfile.
+
**Request:**
+
[source]
----
Add command to build a java project.
----
**Response:**
+
[source,yaml]
----
schemaVersion: 2.3.0
metadata:
name: devfile
components:
- name: tools
container:
image: quay.io/devfile/universal-developer-image:latest
volumeMounts:
- name: maven-artifacts
path: /home/user/.m2
- name: postgres
container:
image: postgres:latest
env:
- name: POSTGRES_DB
value: mydatabase
- name: POSTGRES_USER
value: user
- name: POSTGRES_PASSWORD
value: password
- name: maven-artifacts
volume:
size: 2Gi
projects:
- name: che-server
git:
remotes:
origin: https://github.com/eclipse-che/che-server.git
commands:
- id: build-java-project
exec:
commandLine: mvn clean install
component: tools
group:
kind: build
isDefault: true
label: Build Java Project
workingDir: /projects/che-server
----

. Add resource limits to the devfile.
+
**Request:**
+
[source]
----
Add resource limits to all components.
----
**Response:**
+
[source,yaml]
----
schemaVersion: 2.3.0
metadata:
name: devfile
components:
- name: tools
container:
image: quay.io/devfile/universal-developer-image:latest
volumeMounts:
- name: maven-artifacts
path: /home/user/.m2
cpuLimit: 2
memoryLimit: 4Gi
- name: postgres
container:
image: postgres:latest
env:
- name: POSTGRES_DB
value: mydatabase
- name: POSTGRES_USER
value: user
- name: POSTGRES_PASSWORD
value: password
cpuLimit: 1
memoryLimit: 2Gi
- name: maven-artifacts
volume:
size: 2Gi
projects:
- name: che-server
git:
remotes:
origin: https://github.com/eclipse-che/che-server.git
commands:
- id: build-java-project
exec:
commandLine: mvn clean install
component: tools
group:
kind: build
isDefault: true
label: Build Java Project
workingDir: /projects/che-server
----

. Add metadata to the devfile.
+
**Request:**
+
[source]
----
Add metadata based on the devfile.
----
**Response:**
+
[source,yaml]
----
schemaVersion: 2.3.0
metadata:
name: devfile
displayName: Java with PostgreSQL Dev Environment
description: A development environment for a Java project with PostgreSQL database support.
language: Java
projectType: Java Application
version: 1.0.0
provider: Eclipse Che
tags:
- java
- postgres
- maven
- database
components:
- name: tools
container:
image: quay.io/devfile/universal-developer-image:latest
volumeMounts:
- name: maven-artifacts
path: /home/user/.m2
cpuLimit: 2
memoryLimit: 4Gi
- name: postgres
container:
image: postgres:latest
env:
- name: POSTGRES_DB
value: mydatabase
- name: POSTGRES_USER
value: user
- name: POSTGRES_PASSWORD
value: password
cpuLimit: 1
memoryLimit: 2Gi
- name: maven-artifacts
volume:
size: 2Gi
projects:
- name: che-server
git:
remotes:
origin: https://github.com/eclipse-che/che-server.git
commands:
- id: build-java-project
exec:
commandLine: mvn clean install
component: tools
group:
kind: build
isDefault: true
label: Build Java Project
workingDir: /projects/che-server
----

== Conclusion

Are you a developer looking to simplify setting up your development environment? The Devfile AI Assistant is here to help! It provides clear and accurate configurations, taking the complexity out of the process. Give the Devfile AI Assistant a try today!
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading