#!/bin/sh # First, if we're on a worker node, just run our pip installs # They might get overwritten - we'll need to validate later if grep isMaster /mnt/var/lib/info/instance.json | grep false; then sudo python3 -m pip install -U ray[all]==2.0.0 RAY_HEAD_IP=$(grep "\"masterHost\":" /emr/instance-controller/lib/info/extraInstanceData.json | cut -f2 -d: | cut -f2 -d\") sudo mkdir -p /tmp/ray/ sudo chmod a+rwx -R /tmp/ray/ # Wait for ray to be available on the leader node in the background cat >/tmp/start_ray.sh </tmp/install_ray.sh <