Skip to content

Commit 7c6ffc9

Browse files
authored
fix(docs): Add stable versioned graphviz and other tools needed to generate specs using Earthly. (#435)
* fix(python): add cue to python builder to support doc generation * fix(python): make debian install non interactive * fix(python): add graphviz to python so the docs can use it. * fix(docs): Add cue and debian base blueprints so they are checked in CI. * fix(cat-ci): Fix base debian container check * fix(docs): spelling * fix(bash): remove unused empty script * fix(docs): Dependency install broken * Update earthly/debian/Earthfile
1 parent 064075f commit 7c6ffc9

File tree

8 files changed

+163
-9
lines changed

8 files changed

+163
-9
lines changed

.config/dictionaries/project.dic

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
aarch
2+
autogen
23
bindgen
34
binstall
45
bkioshn
@@ -11,6 +12,7 @@ chtml
1112
codegen
1213
colordiff
1314
cowsay
15+
cuelang
1416
cytopia
1517
depgraph
1618
devenv
@@ -24,6 +26,7 @@ doublecircle
2426
Earthfile
2527
Earthfiles
2628
Edgedriver
29+
EPREFIX
2730
errchkjson
2831
extldflags
2932
findutils
@@ -67,9 +70,13 @@ libasound
6770
libatk
6871
libatspi
6972
libdrm
73+
libexpat
74+
libfreetype
7075
libgbm
7176
libgcc
77+
liblasi
7278
libnss
79+
librsvg
7380
libsqlite
7481
libxkbcommon
7582
libxshmfence
@@ -89,6 +96,8 @@ nextest
8996
nilnil
9097
nixos
9198
nixpkgs
99+
noninteractive
100+
nproc
92101
onsi
93102
penwidth
94103
pkeyopt
@@ -127,6 +136,7 @@ testunit
127136
Timoni
128137
toolsets
129138
transpiling
139+
trixie
130140
UDCs
131141
unarchiving
132142
uniseg

earthly/cue/Earthfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
VERSION 0.8
2+
3+
IMPORT ../debian AS debian
4+
5+
# Define a constant name for the container and its version.
6+
ARG --global CUE_IMAGE="cuelang/cue:0.14.1"
7+
8+
9+
INSTALL:
10+
FUNCTION
11+
12+
COPY +cue-bin/cue /usr/bin/cue
13+
14+
15+
# Get cue binary
16+
cue-bin:
17+
FROM $CUE_IMAGE
18+
SAVE ARTIFACT /usr/bin/cue
19+
20+
# Just check that Cue can be properly installed, and runs.
21+
check-cue:
22+
FROM debian+common
23+
24+
DO +INSTALL
25+
26+
RUN cue version

earthly/cue/blueprint.cue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
project: name: "ci-cue"

earthly/debian/Earthfile

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
VERSION 0.8
2+
3+
# Define a constant name for the container and its version.
4+
ARG --global DEBIAN_IMAGE="debian:13.0-slim"
5+
6+
# Optimally install packages for debian
7+
INSTALL:
8+
FUNCTION
9+
10+
ARG packages
11+
12+
# Install the packages and leave no garbage behind
13+
# Also don't install anything not explicitly asked for.
14+
ENV DEBIAN_FRONTEND=noninteractive
15+
RUN set -eux; \
16+
apt-get update --fix-missing \
17+
&& apt-get install -y --no-install-recommends $packages \
18+
&& apt-get dist-clean \
19+
&& rm -rf /var/lib/apt/lists/*
20+
21+
# The current version of our base Debian Container.
22+
# Clean with nothing added.
23+
debian-clean:
24+
FROM $DEBIAN_IMAGE
25+
26+
27+
# The current version of our base Debian Container.
28+
# Normally you want this because it has all the common tools
29+
# one would expect inside CI.
30+
common:
31+
FROM +debian-clean
32+
33+
LET PACKAGES= \
34+
ca-certificates \
35+
apt-utils \
36+
git \
37+
curl \
38+
gzip \
39+
unzip \
40+
bzip2 \
41+
bash \
42+
jq \
43+
gpg \
44+
lcov \
45+
tar \
46+
wget \
47+
xz-utils
48+
DO +INSTALL --packages=$PACKAGES
49+
50+
# Checks our debian container is basically usable, and nothing more.
51+
check-debian:
52+
FROM +common
53+
54+
RUN cat /etc/os-release
55+
56+
version-check-debian:
57+
FROM +debian
58+
59+
# The idea here is the version check will check if the image its using is the latest image in docker hub.
60+
# This would need to be run without cache, and should be a special target.
61+
# We need a general solution to help us track our containers and make sure we are aware when they are out of date.
62+
RUN exit 1

earthly/debian/blueprint.cue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
project: name: "ci-debian"

earthly/docs/Earthfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
VERSION 0.8
22

33
IMPORT ../python AS python-ci
4+
IMPORT ../debian AS debian
45
IMPORT ../../utilities/scripts AS scripts
56

67
# cspell: words libfreetype liblcms libopenjp etag
@@ -14,21 +15,21 @@ deps:
1415
# This is all the tooling needed to build the docs.
1516

1617
# Install extra packages we will need to support plugins.
17-
RUN apt-get install -y \
18-
graphviz \
18+
LET PACKAGES= \
1919
fontconfig \
20-
fonts-liberation \
2120
libxml2-dev \
22-
libxslt1-dev \
2321
libffi-dev \
24-
libssl-dev \
2522
libfreetype6-dev \
23+
libtiff-dev \
24+
libssl-dev \
25+
fonts-liberation \
26+
libxslt1-dev \
2627
liblcms2-dev \
2728
libopenjp2-7-dev \
28-
libtiff-dev \
2929
tk-dev \
3030
tcl-dev \
3131
make
32+
DO debian+INSTALL --packages=$PACKAGES
3233

3334
# Fix up font cache
3435
RUN fc-cache -f

earthly/graphviz/Earthfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
VERSION 0.8
2+
3+
IMPORT ../debian AS debian
4+
5+
# Define a constant name for the container and its version.
6+
ARG --global VERSION=13.1.0
7+
ARG --global SHA256=13339b83ee5467001a035cfacd175702ac4b14f5d390f0d34e89437b29881278
8+
ARG --global URL=https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/${VERSION}/graphviz-${VERSION}.tar.xz
9+
10+
# Sadly this is the only way to reliably pin a version of graphviz in debian.
11+
INSTALL:
12+
FUNCTION
13+
14+
LET PACKAGES= \
15+
build-essential \
16+
pkg-config \
17+
libexpat1-dev \
18+
zlib1g-dev \
19+
libpng-dev \
20+
libfreetype-dev \
21+
librsvg2-dev \
22+
liblasi-dev \
23+
wget
24+
DO debian+INSTALL --packages=$PACKAGES
25+
26+
RUN mkdir build; \
27+
cd build; \
28+
wget -nv -O graphviz-${VERSION}.tar.xz "$URL" \
29+
&& echo "${SHA256} graphviz-${VERSION}.tar.xz" | sha256sum -c - \
30+
&& tar -xf graphviz-${VERSION}.tar.xz \
31+
&& cd graphviz-${VERSION} \
32+
&& echo "Building Graphviz ${VERSION}" \
33+
&& ./configure > /dev/null 2>&1 \
34+
&& make -j"$(nproc)" > /dev/null 2>&1 \
35+
&& make install > /dev/null 2>&1 \
36+
&& cd ../.. \
37+
&& rm -rf build \
38+
&& echo "Graphviz built and installed OK"

earthly/python/Earthfile

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,37 @@ VERSION 0.8
33

44
IMPORT ../../utilities/scripts AS scripts
55
IMPORT ../../ AS cat-ci
6+
IMPORT ../debian AS debian
7+
IMPORT ../cue AS cue
8+
IMPORT ../graphviz AS graphviz
9+
10+
11+
# Define a constant name for the container and its version.
12+
ARG --global PYTHON_IMAGE="python:3.13-slim-trixie"
613

714
# cspell: words libjpeg ruff
815

916
python-base:
10-
FROM python:3.13-slim-bookworm
17+
FROM $PYTHON_IMAGE
1118

1219
# Install necessary packages
13-
RUN apt-get update && apt-get install -y \
20+
LET PACKAGES= \
1421
bash \
1522
curl \
1623
libffi-dev \
1724
gcc \
1825
musl-dev \
1926
zlib1g-dev \
2027
libjpeg-dev \
21-
git
28+
git \
29+
jq
30+
DO debian+INSTALL --packages=$PACKAGES
31+
32+
# Install CUE
33+
DO cue+INSTALL
34+
35+
# Install Graphviz
36+
DO graphviz+INSTALL
2237

2338
# Poetry Installation directory.
2439
# Gives poetry and our poetry project a reliable location.

0 commit comments

Comments
 (0)