Getting Started with Baker: Your All-in-One Development Environment Provisioner

Sep 20, 2023 | Programming

Welcome to the world of Baker! This simple yet powerful tool allows developers to streamline their workflow by quickly provisioning virtual machines and containers. With Baker, you can create development environments effortlessly while utilizing the features of Vagrant, Docker, Ansible, and task runners like Grunt—all in one place!

Overview of Baker

Baker stands out as a versatile tool, enabling developers to run code, configure environments, and share workloads efficiently. Imagine going to a bakery where you can find all the ingredients and tools you need to bake your favorite cake. Just as a baker prepares an assortment of cakes using a variety of ingredients, Baker lets you create diverse development environments using different technologies.

This analogy illustrates how Baker simplifies the process of development environment management, gathering everything you need into one cohesive workflow.

To see Baker in action, check out the demo below:

Baker Demo

Installation Guide

Installing Baker from the source is a breeze. Just follow these simple steps:

  1. Clone the repository:
  2. git clone https://github.com/ottomatica/Baker
  3. Change to the Baker directory:
  4. cd Baker
  5. Install the necessary dependencies:
  6. npm install
  7. Link the package:
  8. npm link

For more binary installation options, check out this link.

Using Baker

Using Baker is straightforward! To get started, create a baker.yml configuration file in the root directory of your project. Below is an example to illustrate how this works:

yaml
---
name: baker-test
vm:
  ip: 192.168.22.22
  ports: 8000
lang:
  - nodejs9
commands:
  serve: cd baker-test/deployment/express
           npm install
           node index.js

When you run the command baker bake, Baker provisions a VM with Node.js installed and configures the specified IP address and port forwarding rules. You can easily access the VM by running baker ssh or execute commands inside the VM with baker run Command Name. Your code is accessible in the VM via a shared folder, similar to how a baker shares their ingredients with an assistant.

Pointing to a Git Repository

If you need to provision an environment from a Git repository, Baker simplifies this too!

$ baker bake --repo https://github.com/ottomatica/baker-test.git

Creating Containerized Environments

Baker also supports creating environments inside containers without the need for a VM. Take a look at this example:

yaml
name: baker-docs
container:
  ports: 8000
lang:
  - python2
commands:
  build: mkdocs build
  serve: mkdocs serve -a 0.0.0.0:8000
  gh-deploy: mkdocs gh-deploy

Setting Up a Java Environment with MySQL

Baker makes it simple to set up complex environments. Here’s an example setup for a Java environment with MySQL:

yaml
name: onboard
vm:
  ip: 192.168.8.8
  ports: 8080
vars:
  - mysql_password:
      prompt: Type your password for mysql server
tools:
  - maven
services:
  - mysql:
      version: 8
      service_conf: env/templates/mysql.cfg
      client_conf: env/templates/my.cnf
lang:
  - java8
config:
  - template:
      src: env/templates/hibernate-template.cfg.xml
      dest: OnboardingCoffeeMaker/src/main/resources/hibernate.cfg.xml
commands:
  serve: cd CoffeeMaker && mvn spring-boot:run
  debug: cd CoffeeMaker && mvnDebug spring-boot:run
  test: cd CoffeeMaker && mvn test

In this example, Baker configures a Java environment and sets up a MySQL service with the necessary configurations, all through a clean and straightforward YAML specification.

Troubleshooting

If you run into any issues while using Baker, consider the following troubleshooting steps:

  • Ensure that your configuration file (baker.yml) is correctly set up according to the required specifications.
  • Double-check that the necessary dependencies are installed and linked properly.
  • If provisioning fails, review any error messages for missing components or misconfigurations.
  • Reach out to the Baker community on Slack for support.

For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.

Conclusion

At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.

Stay Informed with the Newest F(x) Insights and Blogs

Tech News and Blog Highlights, Straight to Your Inbox