sweedworks

← all sources

build.sh

The whole build, every step

76 lines. This is the file the build actually runs, copied verbatim at build time.

  1. 1#!/bin/bash
  2. 2# Full rebuild. Refuses to leave a broken site behind: if any check fails,
  3. 3# it exits non-zero and you should not deploy.
  4. 4set -euo pipefail
  5. 5cd "$(dirname "$0")"
  6. 6 
  7. 7n=0
  8. 8total=21
  9. 9step() { n=$((n + 1)); echo; echo "== $n/$total $1 =="; }
  10. 10 
  11. 11step "build cl100k browser bundle from source"
  12. 12python3 makebundle.py cl100k_base
  13. 13 
  14. 14step "verify every shipped bundle against the reference"
  15. 15python3 verify.py
  16. 16 
  17. 17step "browser BPE trainer vs Python reference"
  18. 18python3 checkbpe.py
  19. 19 
  20. 20step "browser sampler vs Python reference"
  21. 21python3 checkngram.py
  22. 22 
  23. 23step "chat billing rule vs the tokenizer's chat encoder"
  24. 24python3 chatcost.py
  25. 25 
  26. 26step "neural model: gradient checks and browser/Python agreement"
  27. 27python3 checkmlp.py
  28. 28 
  29. 29step "attention head: gradient checks and browser/Python agreement"
  30. 30python3 checkattn.py
  31. 31 
  32. 32step "precompute tokens figures"
  33. 33python3 precompute.py
  34. 34 
  35. 35step "precompute vocabulary figures"
  36. 36python3 precompute_merges.py
  37. 37 
  38. 38step "precompute sampling figures"
  39. 39python3 precompute_predict.py
  40. 40 
  41. 41step "precompute cost figures"
  42. 42python3 precompute_chat.py
  43. 43 
  44. 44step "precompute learning figures"
  45. 45python3 precompute_learn.py
  46. 46 
  47. 47step "precompute attention figures (cached)"
  48. 48python3 precompute_attn.py
  49. 49 
  50. 50step "precompute verification figures"
  51. 51python3 precompute_checking.py
  52. 52 
  53. 53step "generate Open Graph cards"
  54. 54python3 ogimage.py
  55. 55 
  56. 56step "render pages"
  57. 57python3 render.py
  58. 58 
  59. 59step "colour contrast, both themes"
  60. 60python3 checka11y.py
  61. 61 
  62. 62step "headings, labels and landmarks"
  63. 63python3 checkstructure.py
  64. 64 
  65. 65step "validate HTML, feed and sitemap"
  66. 66python3 checkhtml.py
  67. 67 
  68. 68step "syntax-check JavaScript"
  69. 69python3 checkjs.py
  70. 70 
  71. 71step "permalink round trip"
  72. 72python3 checkpermalink.py
  73. 73 
  74. 74echo
  75. 75echo "Build OK."