Created
April 10, 2018 19:17
-
-
Save holdenk/8ecd61875974489269643a7af2ea1820 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export TESTBUCKET=boo-test-sketchy | |
gsutil rm gs://$TESTBUCKET/output.txt | |
set -x | |
echo "Starting job server" | |
java -cp runners/flink/build/libs/flink-deploy.jar org.apache.beam.runners.flink.FlinkJobServerDriver --job-host localhost:3000 &> logs & | |
echo $! &> jobserver.pid | |
echo "Making the output bucket world writeable, because fuck credentials are hard" | |
gsutil acl ch -u AllUsers:W gs://$TESTBUCKET | |
pushd ./sdks/go/examples/build/bin/linux_amd64/ | |
./wordcount --input gs://apache-beam-samples/shakespeare/kinglear.txt --output gs://$TESTBUCKET/output.txt --runner=flink --endpoint=localhost:3000 --worker_binary ./wordcount | |
popd | |
gsutil acl ch -d AllUsers gs://$TESTBUCKET | |
echo "Stopping job server" | |
kill `cat jobserver.pid` | |
echo "Reading word count" | |
gsutil cat gs://$TESTBUCKET/output.txt | |
echo "Re-starting the job server for Python" | |
java -cp runners/flink/build/libs/flink-deploy.jar org.apache.beam.runners.flink.FlinkJobServerDriver --job-host localhost:3000 &> logs & | |
pushd sdks/python | |
python flink-example.py | |
echo "Stopping job server" | |
kill `cat jobserver.pid` | |
echo "Loading logs" | |
less logs | |
set +x | |
sudo service docker restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment