Sometimes you might be faced with the fact that your exec.R file isn’t working properly. This may be due to problems in the file itself, in the way your script tries to upload the results to a bucket or on how the pods are handling arguments.

This vignette tries to show you how to debug your deployment on these three scenarios while at the same time giving you an example of how to write your exec.R.

Something’s fishy

Suppose you’ve just been through the deployment workflow for your task:

But now, when you run kub_list_pods(), the STATUS column says “Error” or some other equivalent undesirable message. First you must check whether

Your script isn’t working

The first debug strategy should be lightly editing your exec.R file in order for it to run in your local machine. For instance, replace every instance of save_rds() with saveRDS() and run the script locally:

If the expected RDS files aren’t written to disk, then your problem might be in the code. You can also run the script step by step by also replacing the command line arguments at the top of the file:

In case none of this works, then consider whether

Your upload isn’t working

Now you should see what’s happening to the pods themselves. Run kub_list_pods() and copy the name of the pod you want to examine:

This command will show you the output of your script, which could inform your debugging process. If this isn’t enough, try running the docker container manually:

This will execute your exec.R inside the container environment and is the closest you will get to your pod without getting inside it. Speaking of which, if nothing has worked up until now, then you should see whether

Your pods aren’t working

To do this, you must open two terminal windows. In the first one, run your container:

In the second one, get your container’s ID in order to access it:

With this last command, you’ll essentially be ssh-ing into your pod. This allows you to run any shell command you want, run R scripts in the local environment or even edit any files that might not be setup properly.

If even this doesn’t help you debug your deployment, please create an issue on Github.