| umxCloud | R Documentation |
umxCloud provisions an on-demand Linux server on Hetzner Cloud, transfers a model
over SSH, runs optimization inside a Docker container, returns the fitted model, and
(by default) destroys the server so billing stops when idle.
umxCloud(
model,
apiToken = Sys.getenv("HETZNER_API_TOKEN"),
serverType = "cpx31",
dockerImage = "rocker/r-ver:4.4.2",
location = "fsn1",
autoDestroy = TRUE,
tryHard = c("no", "yes", "ordinal", "search"),
maxBootMinutes = 15,
keepOnError = FALSE,
verbose = TRUE
)
model |
An |
apiToken |
Hetzner API token. Default |
serverType |
Hetzner server type. Default |
dockerImage |
Docker image with R. Default public |
location |
Datacenter: |
autoDestroy |
Destroy server and Hetzner SSH key on exit? Default |
tryHard |
Passed to remote |
maxBootMinutes |
Max minutes to wait for SSH + Docker readiness. Default 15. |
keepOnError |
If |
verbose |
Print progress messages? Default |
Designed for small labs that need more cores than a laptop for heavy OpenMx/umx fits
(long tryHard, large raw FIML, bootstrap grids), without keeping a permanent server.
First smoke test: use a cheap shared type such as serverType = "cpx31".
First run often takes 8-20 minutes (VM boot, Docker install, image pull, install
OpenMx/umx from binaries). After plumbing works, switch to dedicated ccx* types
for real multicore jobs.
The model must already contain its data (mxData / umx builders with data attached).
There is no remote data= argument.
Fitted MxModel from the remote run.
Create a Hetzner Cloud account at https://console.hetzner.com/ (complete verification; avoid VPN during signup if fraud checks fail).
Project -> Security -> API Tokens -> Generate (Read & Write). Copy the token.
Store it in .Renviron (never commit the token):
usethis::edit_r_environ()
# HETZNER_API_TOKEN="..."
Restart R. Confirm with nzchar(Sys.getenv("HETZNER_API_TOKEN")).
Install optional packages once: install.packages(c("httr2", "ssh")).
Smoke test: cpx31 / similar shared – a few cents per short trial.
ccx33 (8 dedicated cores): ~EUR0.22 / hour.
ccx53 (32 dedicated cores): ~EUR0.86 / hour.
ccx63 (64 dedicated cores): ~EUR1.60 / hour.
Default autoDestroy = TRUE deletes the server and temporary SSH key on exit
(including errors), unless keepOnError = TRUE leaves the box for debugging.
umxRun, umxACE
Other Twin Modeling Functions:
power.ACE.test(),
umx,
umxACE(),
umxACE_DE(),
umxACE_GLM(),
umxACEcov(),
umxACEv(),
umxCP(),
umxDiffMZ(),
umxDiscTwin(),
umxDoC(),
umxDoCp(),
umxGxE(),
umxGxE_window(),
umxGxEbiv(),
umxIP(),
umxMRDoC(),
umxReduce(),
umxReduceACE(),
umxReduceGxE(),
umxRotate.MxModelCP(),
umxSexLim(),
umxSimplex(),
umxSummarizeTwinData(),
umxSummaryACE(),
umxSummaryACE_GLM(),
umxSummaryACEv(),
umxSummaryDoC(),
umxSummaryGxEbiv(),
umxSummarySexLim(),
umxSummarySimplex(),
umxTwinMaker(),
umx_make_double_entry_data()
## Not run:
# Requires HETZNER_API_TOKEN in .Renviron and packages httr2, ssh
library(umx)
data(twinData)
mz = twinData[twinData$zygosity == "MZFF", ][1:200, ]
dz = twinData[twinData$zygosity == "DZFF", ][1:200, ]
m0 = umxACE(
selDVs = c("bmi1", "bmi2"),
mzData = mz, dzData = dz, sep = "",
autoRun = FALSE
)
# Cheap first try (~cents). Watch Hetzner console: server should appear then vanish.
m1 = umxCloud(m0, serverType = "cpx31", tryHard = "no")
summary(m1)
# After plumbing works, use dedicated cores for heavy jobs:
# m1 = umxCloud(m0, serverType = "ccx53", tryHard = "yes")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.