Utilizes source code repository files, such as dependency manifests, to generate container image code like Dockerfile and entrypoint shell script using LangChain GenAI.
Project description
devops-container-image-code-generator
Utilizes source code repository files, such as dependency manifests, to generate container image code like Dockerfile and entrypoint shell script using LangChain GenAI.
Approach
- Developers write source code, unit test code, dependency manifests like pom.xml, package.json, requirements.txt and static assets on their machine and checkin to the source code repository
- devops-container-image-code-generator uses devops-code-generator package to checkout the source code repository and identify language, dependency manifest and dependency management tool from the dependency manifest checked into the source code repository
- It then uses langchain genai middleware chain to identify the middleware from the dependency manifest
- It then uses routing function to route to the langchain genai subchain corresponding to the identified middleware to generate container image code like Dockerfile and entrypoint shell script for the source code repository.
This approach shall be used to generate other DevOps code like pipeline code, infrastructure code, database code, deployment code, container deployment code, etc.
Constraints
Currently only works for below constraints
- language : java
- dependency management tool : apache_maven
- middleware : spring_boot_version_2.3.0_and_above middleware.
Future Work
- Add templates for other languages, dependency management tools and middlewares.
- Use other files in the source code repository like README.md, etc. to update the generated container image code.
- Use low level design document and images to update the generated container image code.
Environment Setup
It uses OpenAI gpt-4o Model. Set the OPENAI_API_KEY
environment variable to access the OpenAI models.
System Git should have access to the input git source code repository.
Usage
To use this package, you should first have the LangChain CLI installed:
pip install -U langchain-cli
Then spin up a LangServe instance directly by:
langchain serve
This will start the FastAPI app with a server is running locally at http://127.0.0.1:8000
We can see all templates at http://127.0.0.1:8000/docs We can access the playground at http://127.0.0.1:8000/playground
We can access the template from code with:
from langserve.client import RemoteRunnable
runnable = RemoteRunnable("http://127.0.0.1:8000/devops-container-image-code-generator")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file devops_container_image_code_generator-1.20240626.4.tar.gz
.
File metadata
- Download URL: devops_container_image_code_generator-1.20240626.4.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0da0bf06272aa4842bd8ced897c45901ddb4fa6d6f71754b44fa129662986a3e |
|
MD5 | b3ecfc5980df4b2883fcf6eb5819e075 |
|
BLAKE2b-256 | f6f06a183f0d2478be8c360ef5114910910821ca9730469fda66ab6c06c11fb4 |
File details
Details for the file devops_container_image_code_generator-1.20240626.4-py3-none-any.whl
.
File metadata
- Download URL: devops_container_image_code_generator-1.20240626.4-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98fbd9eff235f474b9d601e5d16fcb1898cdff66f0f7b5e821cf9b50b4e29438 |
|
MD5 | c4f08862c03c46d3140819dde7899cce |
|
BLAKE2b-256 | 4178564e8291bcc486a6ddcada5fa8b246920eecaa3be16f6aea7089a3420219 |