Setup | Shells | Git | Markdown and IDEs | Virtual Environments | Task Management
Creating computing and development environments will be an essential skill for software engineering. Unfortunately, consistently getting software installed on a your computer and correctly setting up the environments can take away weeks of your productive time.
Virtual machines/containers can provide a useful solution for automating the creation and management of your computing environment and development workflow. Unfortunately, when developers think about virtual machines, a common idea that comes to mind is a dedicated heavy-weight virtualized system with a full graphics Desktop. Alternatively, you may think of dual-booted systems. While these types of systems can be useful, the goal of this workshop is to introduce you to a different concept for software development.
Code that only runs on your machine is useful to no one else
With computing environments, we are able to automate the specification of our our environment for running our code, which makes it easier for us to recreate and share our computing environments with others on a new machine.
To use a computing environment, you can use your host operating system to write code, interact with the running program, and visualize its executions. But you avoid execution code on your own machine itself---that all happens inside the computing environment.
Computing environments are for running code, not writing code.
To accomplish this, we use a set of tools to enable you to map files and program between your host environment and computing environment.
VirtualBox is a lightweight virtualization provider. It is very effective for creating headless virtual machines that run without any GUI/Desktop interface.
Install VirtualBox.
Windows: If you're running Hyper-V and VirtualBox, and you're experiencing crashes when you try to start a VM, you may need to turn off Hyper-V (which exclusively locks use of CPU for virtualization).
While it is possible to use the VirtualBox GUI to manually install a virtual machine (and run through the OS installation script); this is not an effective automation approach!
With Baker, you can create a virtual machine with a simple configuration file.
For example, we could create a new baker.yml
file, with the following contents:
name: baker-example
vm:
memory: 1024
ip: 192.168.20.40
By running baker bake
, you can create this virtual machine in VirtualBox and interact with it through it baker ssh
. Your current directory on your computer will be accessible inside the virtual machine through a shared folder. This allows you to edit/code directly on your computer while still being able to run commands/services in a Baker environment.
Cool. But how do I get tools or programming languages installed in a Baker environment? Bakelets are modules that can be added to a baker environment. There are many modules available, and you can even add your own custom modules.
Here is an example Baker environment with the python bakelet.
name: baker-example
vm:
memory: 1024
ip: 192.168.20.40
lang:
- python2
But can we do more? Yes! See the baker-examples repo.