Nicd

Nicd

I recently got an ARM laptop to replace my old amd64 one. This poses a problem for me. I run my production service on an amd64 VPS (Hetzner) that runs Ubuntu Server.

Thus far I’ve used a Vagrant box with Ubuntu to build a release in, and then uploaded that release to my production server, unpacked it, and restarted (it’s quite manual, yes, but I don’t release often). Now, of course, due to NIFs such as Comeonin and AppSignal, I cannot build on ARM.

How have you typically handled this? I found some earlier threads suggesting the use of Docker or building the release on GitHub (I use GitLab though):

Is this still the way to go? I have tried Burrito earlier, but I could not get it to build the release correctly (problem with NIFs).

I know nowadays I could run an ARM VM with amd64 binaries inside using Rosetta 2, but I don’t know how big of a hassle it would be.

One thought was GitLab CI, I guess I could use that to build a release out of every push to some branch? Could I get it to match the Ubuntu environment closely enough so that it would work? Though, I’m on a free account so I don’t know how much processing it allows me to do.

Showing Posts 1 to 10

l3nz

l3nz

I use an integration server that runs x86 and that does the build. But you could also buy a $4 x86 VM, rsync your project tree to it, and do a “mix release” - I also do that sometimes.

tcoopman

tcoopman

Building on an other server, gitlab or GitHub are definitely options, but what they’re probably doing is building on docker. That’s what I would suggest. Docker seems like a good option.

Nicd

Nicd OP

A $4 VM would increase my monthly costs by 20%. :sweat_smile: I guess I’ll look into doing it in GitLab CI. Thanks!

I thought Docker is just a virtualization environment, and thus I couldn’t run amd64 containers on ARM unless I went through something like QEMU which would be deadly slow, right?

tcoopman

tcoopman

I think it use QEMU in the back yes, if it’s dealy slow I have no idea. I think that’s something you need to test for yourself.
Anyway if it’s just for building the release, I can’t imagine that even a 2-5x times slowdown is a deal breaker?

l3nz

l3nz

We use Hetzner too. With their CLI tool, you can deploy a new VM, install OTP, rsync your program, release, download, shutdown and you’d incur in 15 minutes of usage total… so just a few € cents. :grinning_face:

mayel

mayel

Check out https://getutm.app (which builds on qemu) for running OSs with different architectures on Silicon. But really the easiest is using CI for that, especially if building x86 which those services tend to run on (I use CI for x86 builds but actually also build releases on my Mac to deploy to ARM servers since that takes minutes instead of 1+ hour on CI which uses qemu for it, tbf a lot of the slowness may be due to Rust NIFs rather than the elixir build though)…

c4710n

c4710n

From the tags of this post, I guess you are using Apple M1.

I’m using Apple M1, too. And I has the same requirement of deploying to x86_64 machines.

My solution:

  1. use GitHub - utmapp/UTM: Virtual machines for iOS and macOS · GitHub
  2. create an x86_64 emulator. (not a virtualizor)

One con:
Because it’s an emulator, the building process is very slow. Before building, prepare some drinks and drink slowly. :wink:

EDIT: After I wrote this, I found @mayel had already wrote something about it.

musialny.dev

musialny.dev

Use docker multi arch containers. Setup amd64 and build app inside it

mayel

mayel

@c4710n I’m curious how slow? I’ve seen how slow emulating ARM on x86 is (using github actions specifically) but haven’t actually tested building a release for x86 emulated on ARM.

c4710n

c4710n

In my case, I’m using:

  1. an x86_64 linux emulator
  2. a docker service running on above emulator

When building x86_64 docker image, I use above docker service.

On my MBP 2015, the build can be done in 4 min. But in the emulator on MBP 2021, the building process can slow 4 times, I think. (I didn’t measure it precisely. All I know is that my tea will be cold after the build. :wink: )

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Dmk
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews