Fixing Environment building issues with buildlog

What is buildlog?

The buildlog is generated by the system whenever it builds the environment, whether the build is successful or failed. It will appear under /results folder once the run is complete. If the run is conducted in the cloud workstation, the buildlog will be shown as a link in the timeline.

It contains all the records and the docker commands during the environment build, from start to finish. Below is the screenshot highlighting some steps to demonstrate how the buildlog record the process. For example, step 1 always pulls the image with the docker command "FROM". It will print out the docker command and the results of the executions.

Checking errors in the buildlog

Environment Built Failed Error

The error is straightforward, indicating an error during the build phase. Since the environment is not built, the docker container is not created and the code is not run.

In this case, you will only see the buildlog appear in the timeline. Since it records all the steps and outcomes, you can use it to troubleshoot what went wrong while building the environment. Usually, the error occurs at the end of the record.

In the following screenshot, the error occurs at step 6, and the build phase exit due to receiving a non-zero code after this step. You can see the reason or the error message in the log. A good practice is to google the error message and see how others handle it. For this example, we need to add the channels to the conda configuration so the system can locate the package.

The environment built went through, but the package was not found in the runtime

This mainly happened for the R package because it doesn't return a non-zero error. This results in the environment build going through, but some packages are not installed. In this case, the package's version will still be "latest" since it never gets installed. For example, if you choose a R base image and add 'nloptr' to R(CRAN), the environment will run through, but the 'nloptr' package is not installed and no version gets pinned.

You can use the same way to figure out what goes wrong during the build phase. Sometimes the buildlog is long and good practice is to use Ctrl + f to find and check for the specific package. In this example, the feedback from the system is that the cmake is missing from the system package. So we can add that to the apt-get package manager.

This might take a few try-and-error to get all the system packages in place. Depends on the base image and the packages you install. Here is more detail in this tutorial guide.