changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > org > docs / infra/quickstart.org

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