submitr 0.1.0.9000
- Development version following initial release.
New features
htc_start()– start an HTC session by reading the project config and storing it for the duration of the R session. Subsequent calls tohtc_upload(),htc_submit(),htc_status(), andhtc_download()use the stored config automatically whenconfig = NULL, eliminating the need to passconfig = cfgon every call. Calloptions(submitr.config = NULL)to clear the session manually, or let it expire when R restarts..resolve_config()– internal helper that checks for an explicitconfigargument, falls back to the session option set byhtc_start(), and errors with instructions if neither is available. Used by all four system-facing functions.htc_upload()andhtc_download()now print a success confirmation message unconditionally after a successful transfer, rather than only whenverbose = TRUE.
Bug fixes
-
htc_gen_submit()now prependsdocker://tocontainer_imageif the prefix is missing. Previously, omitting the prefix caused HTCondor to treat the image path as a local file. -
htc_gen_submit()now includesshould_transfer_files = YESandwhen_to_transfer_output = ON_EXITin the transfer section. These directives are required by HTCondor for the file transfer mechanism to work. -
htc_gen_executable()now includesset -euo pipefailafter the shebang line, causing the script to exit immediately on errors instead of silently continuing. -
htc_gen_executable()now includescd /homebefore any file operations, ensuring the script runs from the container’s working directory wherecontainr::generate_dockerfile()placed the baked-in files.
submitr 0.1.0
Initial release
submitr is the third package in the From the Notebook to the Cluster family, alongside toolero and containr. It provides a workflow for submitting containerized R analyses to the UW-Madison Center for High Throughput Computing (CHTC) from inside R.
New functions
Connection management
-
htc_config()– create or read a project-levelhtc.cfgconfiguration file. On first use, prompts interactively for username and server, displays ControlMaster SSH setup guidance to reduce Duo MFA prompts, writeshtc.cfg, and adds it to.gitignore. Subsequent calls read the existing file and validate server reachability. Returns a named list withusernameandserver. Errors informatively whenusernameorserverare supplied as empty strings.
Job scaffolding
htc_gen_submit()– generate an HTCondor.subsubmit file from project parameters. Supports single-job and multiple-job modes. Multiple mode reads a manifest fromtoolero::write_by_group(manifest = TRUE), extracts filenames, writessubdatasets.csv, and emitsqueue file from subdatasets.csv. Resource presets (small,medium,large,custom) are loaded at runtime frominst/extdata/htc-resources.yaml; a local./htc-resources.yamltakes precedence over the package default. GPU support viagpu = TRUEandgpu_options.comments = TRUEannotates each section of the generated file with explanatory text.htc_gen_executable()– generate the.shexecutable script that HTCondor runs inside the container. Produces a four-element script: shebang,mkdir,Rscript, andtar. In multiple-job mode, passes${1}as a positional argument to the R script.r_scriptmust be supplied explicitly – there is no default.set_executable = TRUE(default) sets executable permissions viaSys.chmod().
File transfer and job control
htc_upload()– copy files to the CHTC submit node viascp. Accepts single files, vectors of files, directories (transferred recursively), and glob patterns.remote_pathdefaults to"~/".dry_run = TRUEpreviews the command without executing it.htc_submit()– runcondor_submiton the remote submit node via SSH from the remote directory where files were uploaded. Returns the cluster ID invisibly for use withhtc_status(). Supportsdry_run = TRUE.htc_status()– check job progress viacondor_q. Optionally filters by cluster ID.watch = TRUEpolls atintervalseconds (default 60) until the cluster ID leaves the queue. Returnscondor_qoutput invisibly as a character vector. Supportsdry_run = TRUE.htc_download()– copy result files back from the submit node viascp. Supports single filenames, vectors of filenames, and glob patterns ("*.tar.gz","job.*"). Glob patterns are single-quoted to prevent local shell expansion.local_pathdefaults to".". Supportsdry_run = TRUE.
Package infrastructure
inst/extdata/htc-resources.yamlships with the package and provides default resource presets forhtc_gen_submit().inst/extdata/hello-world.subandinst/extdata/hello-world.shincluded as test files for end-to-end workflow verification.inst/extdata/sample.Rincluded as a sample R script for use in examples.
Testing
The test suite uses a three-layer strategy to handle the fact that end-to-end testing requires a live HTCondor environment and SSH access. Layer 1 covers argument validation. Layer 2 covers command construction using dry_run = TRUE and mocked bindings. Layer 3 integration tests are opt-in via Sys.setenv(CHTC_USERNAME = "your.netid") and never run on CRAN or CI. 153 tests passing across seven test files.
