Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support a command like kerl deploy to copy an OTP installation to other machines? #253

Open
tatsuya6502 opened this issue Jun 8, 2022 · 1 comment

Comments

@tatsuya6502
Copy link

tatsuya6502 commented Jun 8, 2022

Hi. Thank you for working on asdf-erlang!

We have some dev/testing Linux PCs/VMs and Macs (Apple silicon and Intel chips). We want to avoid to build Erlang/OTP on every machine at every time a new Erlang/OTP version is released. #165 can be a solution for this, but I would propose a different solution because we are using CentOS 7 on some of our Linux machines, and I am not sure if it is covered by #165.

kerl has a deploy command to copy an OTP installation to other machine.

https://github.com/kerl/kerl#deploy

deploy

kerl deploy <[user@]host> [directory] [remote_directory]

Deploys the specified installation to the given host and location.

$ kerl deploy anotherhost /path/to/install/dir

If remote_directory is omitted the specified directory will be used.

If directory and remote_directory is omitted the current working directory will be used.

NOTE: kerl assumes the specified host is accessible via ssh and rsync.

So it would be nice if asdf-erlang provides a similar command to kerl deploy. I am not sure if we can add a sub-command to asdf from a plugin, but if it is possible, it could be the followings:

asdf deploy erlang version [user@]host

To use deploy command, we still need to build Erlang/OTP once per OS/architecture, so the entire workflow will be the followings:

## On a CentOS 7 PC (for example).
## Build an OTP installation.
$ asdf install erlang 25.0

## Copy the installation to other CentOS 7 PCs.
$ asdf deploy erlang 25.0 user1@centos7-host1
$ asdf deploy erlang 25.0 user2@centos7-host2
$ ...

## On an Apple silicon Mac.
## Build the OTP installation.
$ asdf install erlang 25.0

## Copy the installation to other Apple silicon Macs.
$ asdf deploy erlang 25.0 user1@mac1
$ asdf deploy erlang 25.0 user2@mac2
$ ...

Is this feasible?

@tatsuya6502 tatsuya6502 changed the title Support a command like kerl deploy to copy an OTP installation to other machines Support a command like kerl deploy to copy an OTP installation to other machines? Jun 8, 2022
@Stratus3D
Copy link
Member

I'm not opposed to support for this being added to asdf-erlang. But it's not a high priority feature for me right now, so I don't have any plans to work on it myself.

I'd suggest we use https://asdf-vm.com/plugins/create.html#extension-commands-for-asdf-cli and expose a deploy command for asdf-erlang. If we took this approach we have a command like this:

$ asdf erlang deploy <version>

One difficulty we might encounter with this is that kerl keeps track of it's own installs in a file it manages, and I think we delete that kerl file currently. It may be necessary for kerl to understand what version it is deploying in order to deploy it correctly.

Contributions welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants