Provide arm64 builds for shiny-server
andresrcs opened this issue ยท 7 comments
Can you consider providing arm64 builds for shiny-server the same way the RStudio IDE is providing experimental builds for arm64? If they already have the workflow in place I guess it would be simple to borrow from them?
I wrote down some notes a while back, they can still be valid https://github.com/lvalnegri/workshops-setup_cloud_analytics_machine/blob/master/raspberry-pi_jetson-nano.md
@lvalnegri Thanks but I know how to compile shiny-server for arm, I even have blog posts about it, the idea behind this request is to make the installation process easier and less time-consuming. I thought since other RStudio development team already has a workflow for compiling for arm, they could implement it as well.
It's a good idea, thank you for the suggestion.
I'm curious if there's been any further discussion about, or planning for, pre-built ARM64 Shiny Server binaries.
Apple silicon is popular (to say the least!) at this point and running via x86 emulation isn't the best.
Specifically, pre-built ARM64 binaries would unblock this.
@mmuurr can you please explain / point me in the direction of the emulation you mentioned?
@James-G-Hill AFAIK, only UTM allows to emulate x86_64 on macOS, though you're probably going to have very poor performance.
In my case, I'm running aarch64 Linux virtual machines on macOS to automate the deployment of Shiny Server in a production environment. The lack of packages makes it very difficult to mirror our x86_64 production environment.
A lot of cloud providers offer aarch64 VMs and it could be first step towards supporting them as well.
It's great to have aaarch64 builds for RStudio-Server - even if they're experimental - and I would love to see the same thing for Shiny-Server.
@James-G-Hill sorry for the super-late reply. If you haven't already figured it out, one solution is to use containers. And with containers there are effectively two steps required (assuming you want to build upon an image ... if you just want to run Shiny Server you may be able to skip to the second step, depending your needs).
Step 1: Cross-platform builds
Use the docker buildx build
command with the --platform
switch to build for an architecture that's (possibly) different than your builder host (e.g. your ARM64 Mac). So, for example, a possible build command might look like so:
docker buildx build --platform linux/amd64 -f Dockerfile .
The image produced will then run on a linux/amd64
-based host, but will not run (without emulation) on, e.g., your ARM64 Mac. If your Dockerfile's base image is only available with linux/amd64
, this is probably the best way to move forward (at the expense of emulation, described below). This is how I've dealt with Rocker's rocker/shiny-verse
not supporting arm64
archs.
You can also create images that are multi-arch, e.g. with docker buildx build --platform linux/arm64,linux/amd64 ...
. Then, when you want to run that image as a container, the container runtime will typically select whichever arch matches your host's native arch. (You can override this again with something like docker run --platform linux/amd64
to run a specific arch on-demand.)
Step 2: Runtime emulation
I don't know how this is managed on other hosts and other container runtimes (e.g. containerd or podman), but they'll all be similar to how it's done with Docker and the Apple-silicon ARM64 machines: emulation. If you go into Docker settings, you'll need to enable Rosetta emulation. Via the UI it'll look like so:
With that enabled, you'll be able to run containers targeting the amd64
(or x86_64
, which is an alias) platforms. Just a standard docker run ...
command should work (you won't need to specify the arch, unless, as mentioned above, you really want to run a specific arch, e.g. to test emulation, which I assume is not what you're seeking to do here :-)).
All of this feels pretty clunky, though, and I still have some hope ๐ค that there'll eventually (pretty please, with sugar on top?) be official ARM64 Shiny Server binaries, since the Apple's M-series silicon is now well-established (and very performant) and AWS's Graviton silicon is increasingly forming the backbone of AWS's own internal infrastructure. In short, ARM64 isn't niche.