changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > org > docs / infra/quickstart.org

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