annotate service/wifi/tasks.py @ 712:d98c3ffe7144

new graph output for browsers, with autorefresh Ignore-this: e4ff4dbed311b238d90988a1891ef640
author drewp@bigasterisk.com
date Mon, 03 Feb 2020 23:47:23 -0800
parents 50d66febeeb0
children 632a88c27b11
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
564
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
1 from invoke import task
383
8f5a16a55f64 various docker setups and build fixes
drewp@bigasterisk.com
parents:
diff changeset
2
564
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
3 JOB = 'wifi'
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
4 PORT = 9070
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
5 TAG = f'bang6:5000/{JOB}_x86:latest'
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
6
683
50d66febeeb0 build cleanup and reformats
drewp@bigasterisk.com
parents: 672
diff changeset
7
564
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
8 @task
683
50d66febeeb0 build cleanup and reformats
drewp@bigasterisk.com
parents: 672
diff changeset
9 def build(ctx):
50d66febeeb0 build cleanup and reformats
drewp@bigasterisk.com
parents: 672
diff changeset
10 ctx.run(f'npm run build', pty=True)
50d66febeeb0 build cleanup and reformats
drewp@bigasterisk.com
parents: 672
diff changeset
11
50d66febeeb0 build cleanup and reformats
drewp@bigasterisk.com
parents: 672
diff changeset
12 @task(pre=[build])
564
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
13 def build_image(ctx):
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
14 ctx.run(f'docker build --network=host -t {TAG} .')
383
8f5a16a55f64 various docker setups and build fixes
drewp@bigasterisk.com
parents:
diff changeset
15
564
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
16 @task(pre=[build_image])
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
17 def push_image(ctx):
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
18 ctx.run(f'docker push {TAG}')
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
19
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
20 @task(pre=[build_image])
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
21 def shell(ctx):
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
22 ctx.run(f'docker run --name {JOB}_shell --rm -it --cap-add SYS_PTRACE --net=host {TAG} /bin/bash', pty=True)
383
8f5a16a55f64 various docker setups and build fixes
drewp@bigasterisk.com
parents:
diff changeset
23
564
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
24 @task(pre=[build_image])
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
25 def local_run(ctx):
662
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents: 564
diff changeset
26 ctx.run(f'docker run --name {JOB}_local --rm -it --net=host -v `pwd`:/opt {TAG} python3 wifi.py -v', pty=True)
421
47d7dd31bb2c port to py3
drewp@bigasterisk.com
parents: 420
diff changeset
27
564
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
28 @task(pre=[push_image])
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
29 def redeploy(ctx):
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
30 ctx.run(f'supervisorctl -s http://bang:9001/ restart {JOB}_{PORT}')
662
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents: 564
diff changeset
31
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents: 564
diff changeset
32
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents: 564
diff changeset
33 # one time:
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents: 564
diff changeset
34 # yarn policies set-version v2
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents: 564
diff changeset
35 # and for vscode:
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents: 564
diff changeset
36 # yarn pnpify --sdk
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents: 564
diff changeset
37 # then pick the pnp one on statusbar.
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents: 564
diff changeset
38
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents: 564
diff changeset
39 #yarn run webpack-cli --config webpack.config.js --mode production