spark-connector
aien-dev/spark-connector
Brought by drakestapleton
spark-connector / dist.sh
| 1 | #!/bin/sh |
| 2 | # Make the files the hub serves under /community/ (copy them to <community store>/dist/ to deploy): |
| 3 | # interplane-runner-<sha256>, omc-<sha256> (the job compiler, the salvage pin), join.sh (written by |
| 4 | # runner/joingen.om for HUB), SHA256SUMS. |
| 5 | # OMEGA_SRC=... JOB_OMC=/path/to/omc(3ad9f10f...) ./dist.sh HUB OUTDIR |
| 6 | # Build glue only: compose, compile, copy, hash. |
| 7 | set -eu |
| 8 | cd "$(dirname "$0")" |
| 9 | hub=${1:?usage: dist.sh HUB OUTDIR}; out=${2:?usage: dist.sh HUB OUTDIR} |
| 10 | JPIN=3ad9f10f64309e7acf8a725082b28e23a2a4aeb07e98322fb4dc0fcd8fc93194 |
| 11 | OMEGA_SRC=${OMEGA_SRC:-../omega-mv} |
| 12 | JOB_OMC=${JOB_OMC:-$HOME/work/flux/omega-mv/seed/out/omc} |
| 13 | [ "$(sha256sum < "$JOB_OMC" | cut -d' ' -f1)" = "$JPIN" ] || { echo "dist.sh: $JOB_OMC is not the job compiler pin $JPIN" >&2; exit 2; } |
| 14 | ./build.sh > /dev/null |
| 15 | OMC=$OMEGA_SRC/seed/out/omc |
| 16 | { printf 'om2\n'; cat runner/joingen.om; } | "$OMC" > build/joingen |
| 17 | chmod +x build/joingen |
| 18 | mkdir -p "$out" |
| 19 | rs=$(sha256sum < build/interplane-runner | cut -d' ' -f1) |
| 20 | cp build/interplane-runner "$out/interplane-runner-$rs" |
| 21 | cp "$JOB_OMC" "$out/omc-$JPIN" |
| 22 | build/joingen "$hub" "$rs" "$JPIN" > "$out/join.sh" |
| 23 | ( cd "$out" && sha256sum "interplane-runner-$rs" "omc-$JPIN" join.sh > SHA256SUMS ) |
| 24 | cat "$out/SHA256SUMS" |