annotate service/wifi/tasks.py @ 673:f2215949c0c9

build adjustments. now seems to read streamedgraph correctly. Ignore-this: 2768ea249aefb81d4720607e815d77c1
author drewp@bigasterisk.com
date Tue, 31 Dec 2019 02:45:25 -0800
parents f424809cba8d
children 50d66febeeb0
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
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
7 @task
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
8 def build_image(ctx):
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
9 ctx.run(f'docker build --network=host -t {TAG} .')
383
8f5a16a55f64 various docker setups and build fixes
drewp@bigasterisk.com
parents:
diff changeset
10
564
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
11 @task(pre=[build_image])
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
12 def push_image(ctx):
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
13 ctx.run(f'docker push {TAG}')
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
14
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
15 @task(pre=[build_image])
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
16 def shell(ctx):
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
17 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
18
564
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
19 @task(pre=[build_image])
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
20 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
21 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
22
564
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
23 @task(pre=[push_image])
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
24 def redeploy(ctx):
d0830394bf7b update build on service/wifi
drewp@bigasterisk.com
parents: 424
diff changeset
25 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
26
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents: 564
diff changeset
27
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents: 564
diff changeset
28 # 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
29 # 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
30 # 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
31 # 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
32 # 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
33
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 run webpack-cli --config webpack.config.js --mode production
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents: 564
diff changeset
35
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents: 564
diff changeset
36
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents: 564
diff changeset
37 @task
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents: 564
diff changeset
38 def build(ctx):
672
f424809cba8d npm run build works now, accessing streamed-graph. But, s-g isn't in the output bundle yet.
drewp@bigasterisk.com
parents: 662
diff changeset
39 ctx.run(f'npm run webpack-build', pty=True)
662
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents: 564
diff changeset
40
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents: 564
diff changeset
41 @task
540dd68af9f2 start ts config files, but this doesn't share the streamed-graph code properly yet
drewp@bigasterisk.com
parents: 564
diff changeset
42 def serve_demo(ctx):
672
f424809cba8d npm run build works now, accessing streamed-graph. But, s-g isn't in the output bundle yet.
drewp@bigasterisk.com
parents: 662
diff changeset
43 ctx.run('npm run webpack-dev-server')