livebook icon indicating copy to clipboard operation
livebook copied to clipboard

Automatically cluster with AWS execution environments

Open krainboltgreene opened this issue 1 year ago • 12 comments

This will pick out the parts needed to cluster for any livebook application deployed on the AWS execution platforms.

  • [ ] Write documentation describing cloud map setup
  • [ ] Write documentation describing port setup
  • [ ] Write documentation describing security groups
  • [ ] Write documentation for partial automation

krainboltgreene avatar Sep 22 '24 21:09 krainboltgreene

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Sep 22 '24 21:09 CLAassistant

Good news: There's like 5-6 different jq alternatives. Bad news: They're all focused on speed/language availability rather than size.

One option we have is to utilize a call to the Elixir shipped binary to parse/query?

krainboltgreene avatar Sep 23 '24 00:09 krainboltgreene

Oh, calling the Elixir binary is a good call. Let's do that. You can also call erl and use the new built-in json parser.

josevalim avatar Sep 23 '24 06:09 josevalim

@josevalim calling elixir and :json sounds best (otherwise we need to mix.install), but currently we only require OTP 25. That said, it should be fine to bump the requirement, since for Desktop and Docker we always use latest anyway.

jonatanklosko avatar Sep 23 '24 08:09 jonatanklosko

@jonatanklosko One of Livebook's deps is jason, so I used that instead to avoid bumping requirements.

krainboltgreene avatar Sep 28 '24 23:09 krainboltgreene

172.31.49.31root@ip-172-31-metadata=`curl --silent ${ECS_CONTAINER_METADATA_URI}`TADATA_URI}`
root@ip-172-31-49-31:/app# machine_ip=`echo $metadata | bin/core eval 'IO.read(:stdio, :eof) |> Jason.decode!() |> Map.get("Networks") |> Enum.at(0) |> Map.get("IPv4Addresses") |> Enum.at(0) |> IO.write()'`
root@ip-172-31-49-31:/app# image_id=`echo $metadata | bin/core eval 'IO.read(:stdio, :eof) |> Jason.decode!() |> Map.get("ImageID") |> IO.write()'`
root@ip-172-31-49-31:/app# deployment="$(echo $image_id | shasum | cut -c 1-10)"
root@ip-172-31-49-31:/app# echo "livebook-${deployment}@${machine_ip}"
[email protected]

Here it is working.

krainboltgreene avatar Sep 28 '24 23:09 krainboltgreene

Okay so the remaining work here is the documentation of Cloud Map and Security Groups. That said this is actually rather generic to Phoenix itself, or even Elixir, so should I suggest it as documentation to those projects?

krainboltgreene avatar Sep 28 '24 23:09 krainboltgreene

I'd document it on Livebook first, for two reasons:

  1. Elixir itself does not have a specific page for documenting per provider option. There are just too many possible scenarios for the language docs to cover.

  2. Phoenix has a section on deployment, which you could add this, but you would need to cover all of the aspects of deployment, which will be more work.

WDYT?

josevalim avatar Sep 29 '24 20:09 josevalim

Roger, will start today.

For the future I think maybe there's a signal here telling us that an elixir cookbook, community run like Bevy's but outside the scope any framework or the language, might be worth organizing.

krainboltgreene avatar Sep 29 '24 23:09 krainboltgreene

@krainboltgreene good call parsing with release eval!

jonatanklosko avatar Sep 30 '24 08:09 jonatanklosko

Uffizzi Preview deployment-63204 was deleted.

github-actions[bot] avatar Oct 01 '24 10:10 github-actions[bot]

Looks good to me, we just need the docs now. Ideally with some IaC snippets, I think either is fine, terraform, cloud formation or CLI, just so it's more standardised.

jonatanklosko avatar Oct 01 '24 10:10 jonatanklosko

Back from the dead I finally had the time to finish off this meager documentation describing as much as possible without getting too much into the weeds.

krainboltgreene avatar Apr 27 '25 01:04 krainboltgreene

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart:

josevalim avatar Apr 28 '25 07:04 josevalim