Skip to content

Commit

Permalink
Autorefresh of live.html, changed file name in server to solve cachin…
Browse files Browse the repository at this point in the history
…g issues
  • Loading branch information
luisbelloch committed Feb 13, 2020
1 parent 08e3efa commit 63e61ef
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion spark/_template_rdd
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ no_header = txt.filter(lambda s: not s.startswith(item_fields[0]))
parsed = no_header.map(lambda s: parse_item(s)).cache()

print(parsed.take(1))
print(parsed.toDebugString())
print(parsed.toDebugString().decode('utf-8'))

2 changes: 1 addition & 1 deletion spark/hello1.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
print(rdd.count())

# Also spark-submit hello1.py --conf spark.logLineage=true
print(rdd.toDebugString())
print(rdd.toDebugString().decode('utf-8'))

2 changes: 1 addition & 1 deletion spark/hello2.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

solo_en_euros = rdd.filter(lambda fila: 'EUR' in fila)

print(solo_en_euros.toDebugString())
print(solo_en_euros.toDebugString().decode('utf-8'))
print(solo_en_euros.count())
print(solo_en_euros.take(10))

3 changes: 2 additions & 1 deletion spark/live/live.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ fswatch ../live.py | while read -r fpath; do \
echo -e "\033[0;36mRELOAD\033[0m $fpath $(date +"%H%M%S")"
echo -e "# $(date +"%H:%M:%S")\n" | cat - ../live.py > live_mod.py
sed -e '/-python">/r./live_mod.py' live_template.html > live.html
gsutil cp live.html gs://bigdata.luisbelloch.es/live.html
gsutil -h "Cache-Control:no-cache,max-age=0" \
cp live.html gs://bigdata.luisbelloch.es/en_directo.html

# echo -e "# $(date +"%H:%M:%S")\n" | cat - live.py | pygmentize -f html -O full,linenos=1 -o live.html
# scp live.html [email protected]:/var/www/html/index.html
Expand Down
1 change: 1 addition & 0 deletions spark/live/live_template.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<meta http-equiv="Refresh" content="5">
<title>#bidataupv - live</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Fira+Mono:400,500,700|Roboto:300,400,500,700,900" />
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.14.2/styles/dracula.min.css" />
Expand Down

0 comments on commit 63e61ef

Please sign in to comment.