"It works on my machine" explained

author avatar
Mark Milligan
 on February 16th, 2023
3 min read

Defining "It works on my machine"

This is a typical conversation with a new prospective customer: they share that they want to solve the "it works on my machine" problem.

Simply put, "It works on my machine" means that a developer or data scientist has written some code that works perfectly fine on their local machine but breaks in a downstream CI pipeline or worse in production. The break or bug is because the development environment had dependencies that didn't match those downstream. The costs of "it works on my machine" issues are the bug has to be reported back to the developer, who makes the fix to their environment and dependencies and re-pushes the change. Worse, an end customer has a bad experience due to this bug, which can be costly in terms of revenue and brand management. All of this means lost time, costly re-work, and ultimately delay in delivering software to meet the enterprise's strategic and competitive goals.

What is Coder?

Coder is a self-hosted remote development platform that eliminates "it works on my machine" problems because DevOps and Platform Engineering teams can centrally govern and control what images and workspace build configurations are used by developers and data scientists.

Example: Updating a Go version

Let me show an example of how to centrally update the Go language version for your developers.

Update the Go version in the container image's Dockerfile

Update the container image

First, update the Dockerfile or VM image with the new Golang version. In this example, the Dockerfile specifies the Go version in the curl install string, so a one line change is needed.

Then docker build and docker push the new container image with a tag designating the Go version to the container registry.

Building the container image with a new tag for the Go version
Push the new container image to the container registry

Update the Coder Terraform template

Next, update the Coder template with the new image tag. A Coder template is a Terraform file that specifies how the workspace will be built including the compute and container image to use. Then use the Coder CLI to push the new template version to your Coder deployment. Again, a one line change only to the Coder template.

If DevOps uses the same image tag when they update the Go version, setting the pod spec image pull policy to Always in the template will ensure the image is updated in the workspace.

Change the Coder Terraform template and push the new template version to your Coder deployment
The Coder template's Kubernetes pod spec is configured to always check if the image has changed, in case the updated Go image used the same tag

Notify the Coder user

Within the Coder deployment, any user with a workspace based on the updated template will be notified in the Coder UI that their workspace is out of date.

If the same image tag is used, no change to the template is needed, and the workspace will grab the new image on the next workspace build.

The developer is notified that their Go workspace is out of date

Summary

One of the benefits of deploying Coder in your enterprise is eliminating the "it works on my machine" problem. When your enterprise has hundreds and thousands of developers and data scientists, there are significant cost savings in terms of eliminating re-work and potentially monetary damage to revenue and your enterprise's brand.

As an aside, other benefits to justify an enterprise's investment in Coder include removing of source code and data from insecure desktops, getting access to more compute in cloud infrastructure, and eliminating development setup and thus shortening time to code contribution and increasing developer productivity.

Subscribe to our Newsletter

Want to stay up to date on all things Coder? Subscribe to our monthly newsletter and be the first to know when we release new things!