|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +set -eux pipefail |
| 4 | + |
| 5 | +env |
| 6 | + |
| 7 | +ls -halF $RUN_DIR |
| 8 | + |
| 9 | +pushd $RUN_DIR |
| 10 | +git config --global --add safe.directory $RUN_DIR |
| 11 | +git checkout actions_unstable |
| 12 | + |
| 13 | +mkdir -p data/grid |
| 14 | +ln -s /Downloads/repeat_1rank data/grid/ |
| 15 | + |
| 16 | +# Install Redis |
| 17 | + |
| 18 | +./webserver/run-redis.sh & |
| 19 | + |
| 20 | +pushd /opt/spack-environment/ && \ |
| 21 | + source /spack/spack/share/spack/setup-env.sh && \ |
| 22 | + spack env activate . |
| 23 | +popd |
| 24 | + |
| 25 | +python -m pip install -r requirements.large.txt |
| 26 | +python -m pip install -r requirements.txt |
| 27 | + |
| 28 | +REDIS_CLI="./redis-stable/src/redis-cli" |
| 29 | +function hold_for_redis () { |
| 30 | + while [[ ! -x $REDIS_CLI ]]; do |
| 31 | + echo wait for redis-cli: hold on 10 s |
| 32 | + sleep 10 |
| 33 | + done |
| 34 | + OUTPUT=""; |
| 35 | + while [[ "$OUTPUT" != "PONG" ]]; do |
| 36 | + OUTPUT=`$REDIS_CLI PING`; |
| 37 | + echo wait for redis: hold on 1 sec |
| 38 | + sleep 1 |
| 39 | + done |
| 40 | +} |
| 41 | + |
| 42 | +set +e |
| 43 | + |
| 44 | +hold_for_redis |
| 45 | + |
| 46 | +set -e |
| 47 | + |
| 48 | +# Fix configuration |
| 49 | +CONF="./redis-stable/redis.conf" |
| 50 | +sed -i '422s/^/# /' $CONF |
| 51 | +sed -i '2017s/^/# /' $CONF |
| 52 | +sed -i '2018s/^/# /' $CONF |
| 53 | +sed -i "s/^protected-mode yes/protected-mode no/" $CONF |
| 54 | +sed -i "s/^bind 127.0.0.1/bind 0.0.0.0/" $CONF |
| 55 | +sed -i "s/^daemonize no/daemonize yes/" $CONF |
| 56 | +sed -i "s|^dir ./|dir $RUN_DIR/|" $CONF |
| 57 | +sed -i "s|^pidfile /var/run/redis_6379.pid|pidfile $RUN_DIR/redis.pid|" $CONF |
| 58 | +killall -r '.*redis.*' |
| 59 | + |
| 60 | +popd |
| 61 | + |
| 62 | +# Install ngrok |
| 63 | +curl -sSL https://ngrok-agent.s3.amazonaws.com/ngrok.asc \ |
| 64 | + | tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null \ |
| 65 | + && echo "deb https://ngrok-agent.s3.amazonaws.com bookworm main" \ |
| 66 | + | tee /etc/apt/sources.list.d/ngrok.list \ |
| 67 | + && apt update \ |
| 68 | + && apt install -y ngrok |
| 69 | +ngrok config add-authtoken $NGROK_TOKEN |
| 70 | + |
| 71 | +RUN_SCRIPT="./run.sh" |
| 72 | +sed -i "s/^cycles=200/cycles=100/" $RUN_SCRIPT |
| 73 | +sed -i "s/mpirun/mpirun --oversubscribe/" $RUN_SCRIPT |
| 74 | + |
| 75 | +ngrok http 5002 & |
| 76 | + |
| 77 | +CHIMBUKO_VIZ_ROOT=$RUN_DIR $RUN_SCRIPT |
| 78 | + |
| 79 | +set +ex |
0 commit comments