changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > org > docs / infra/quickstart.org

changeset 44: b925807b50a6
parent: bc53e27c0163
child: 517e7b6fb42d
author: Richard Westhaver <ellis@rwest.io>
date: Sun, 18 Aug 2024 22:16:12 -0400
permissions: -rw-r--r--
description: weekend warrior
1 #+title: infra/quickstart
2 #+description: Infra Quickstart Guide
3 #+property: header-args :dir /home/ellis/comp/infra/
4 #+property: header-args:dot :dir /tmp/ :file bootstrap.svg
5 #+setupfile: ../../clean.theme
6 #+infojs_opt: toc:nil home:https://compiler.company up:./ view:overview
7 
8 * Overview
9 :PROPERTIES:
10 :ID: bbb86596-4be5-4f5e-8854-9ea28b077879
11 :END:
12 - *Host Requirements*
13  - x86_64 4 core CPU
14  - 8G RAM
15  - 32G Disk Space
16  - Linux kernel
17 - *Minimum Dependencies*
18  - mercurial
19  - git
20  - zstd
21 
22 
23 * bootstrap.sh
24 :PROPERTIES:
25 :ID: b906e6ea-71c2-41ae-9c29-c911582f054e
26 :END:
27 #+begin_src lisp :results none :exports none
28  (ql:quickload '(:dat :cli))
29  (in-package :dat/dot)
30  (let ((g (make-instance 'directed-graph)))
31  (add-node g :check)
32  (add-node g :bootstrap)
33  (add-node g :autogen)
34  (add-node g "profile.sxp")
35  (add-node g "host.sxp")
36  (add-edge g '(:check "host.sxp"))
37  (add-edge g '(:bootstrap :check))
38  (add-edge g '(:bootstrap :autogen))
39  (add-edge g '("profile.sxp" :autogen))
40  (add-edge g '("host.sxp" :autogen))
41  (to-dot-file g #p"/tmp/bootstrap.dot")
42  ;; (sb-ext:run-program (cli:find-exe "dot") (list "-Tsvg" "/tmp/bootstrap.dot" "-o" "/tmp/bootstrap.svg"))
43  )
44 #+end_src
45 
46 [[cdn:media/img/bootstrap.svg]]
47 
48 The easiest way to get started is to run the top-level script
49 =bootstrap.sh=. Running the script will:
50 
51 - run =check.sh=
52 - install the latest cores and lisp runtime from
53  https://packy.compiler.company to the stash
54 - load =autogen.lisp= and call the function =infra/autogen:autogen=
55  - check and apply the host config and profile
56  - build all features in parallel
57 
58 [[cdn:media/clip/infra-bootstrap.gif]]
59 
60 Upon completion a local =stash= directory is provisioned. At this
61 point we no longer need to depend on shell scripting as we have a
62 fully interactive Lisp environment to hack on our builds with.
63 
64 From here, you may run =skel inspect= to inspect the infra =skelfile=
65 and select a target to build on your machine or in a container. Use
66 =skel --help= for a list of other commands.
67 
68 ** check.sh
69 :PROPERTIES:
70 :ID: 6a7b9d91-b22b-4534-9ff4-7ef5b71aca5c
71 :END:
72 This script checks that the current host is qualified. It needs to be
73 ran once before the =autogen.lisp= file is loaded, usually via
74 =bootstrap.sh=.
75 
76 This will interrogate the system, checking for minimum
77 requirements. If any requirement isn't met an error is signaled. On
78 completion, the name of an SXP file is printed which contains the host
79 config.
80 
81 The minimum software dependencies above should be installed via your
82 system's package manager.
83 
84 #+begin_src shell
85 ./check.sh
86 #+end_src
87 
88 #+RESULTS:
89 : zor.sxp
90 
91 ** autogen.lisp
92 :PROPERTIES:
93 :ID: cd5c94d4-bb53-4b1b-9898-320711e62a85
94 :END:
95 Once a core and lisp runtime are available, we load =autogen.lisp= and
96 call =infra/autogen:autogen=. This will process the host configuration
97 (=zor.sxp= in the example above) and the profile (defaults to
98 =default.sxp=), update environment variables for the current shell and
99 take any additional actions needed.
100 
101 The order of operations are loosely as follows:
102 - initialize profile
103 - update host environment variables
104 - check features and ensure host dependencies
105 - initialize host
106 - initialize infra =skelfile=
107 - process all features
108 - quit
109 
110 * TODO deploy.lisp
111 :PROPERTIES:
112 :ID: 02b3701a-b969-473b-9dbd-ac4815f9d284
113 :END:
114 Deploy =infra= builds to a remote.
115 
116 Deployment involves 'packing' a target found in =stash=, archiving it,
117 compressing it, and sending it to a remote location possibly with a
118 signature, checksum, or other metadata, and possibly encrypted. A
119 'package' may also be a raw directory of plain-text files. It's a very
120 loose term. Where the package ends up and how it is packed depends on
121 the build-config and skelfile slots.
122 
123 Production deployments end up at https://packy.compiler.company.
124 
125 * TODO install.lisp
126 :PROPERTIES:
127 :ID: 26107fe5-6f4a-4fe5-9bdf-e35947bc7198
128 :END:
129 Install core packages locally.