# HG changeset patch # User ellis # Date 1703985076 18000 # Node ID 2a87ac5a25ebae9eaa83bfe8b0925cdd94d14057 # Parent 0be8229292a9fd174605bcb9086c521d88ea22cb arch->alpine for workers diff -r 0be8229292a9 -r 2a87ac5a25eb makefile --- a/makefile Sat Dec 30 02:27:16 2023 -0500 +++ b/makefile Sat Dec 30 20:11:16 2023 -0500 @@ -25,6 +25,7 @@ clean:;rm -rf $(B) $(D) $(B):;mkdir -pv $@/src $(D):;mkdir -pv $@ + ### Linux LINUX_TARGET:=linux-$(LINUX_VERSION) linux:$(LINUX_TARGET) linux-config; @@ -61,6 +62,7 @@ rocksdb-install:$(ROCKSDB_TARGET) cd $< && cp -rf $(ROCKSDB_TARGET)/include/* /usr/local/include/ && \ cp -f $(ROCKSDB_TARGET)/librocksdb.so* /usr/local/include/ + ### SBCL SBCL_TARGET:=build/src/sbcl $(SBCL_TARGET):scripts/get-sbcl.sh $(B); @@ -73,17 +75,18 @@ --with-core-compression \ --with-sb-xref-for-internals \ --dynamic-space-size=8Gb \ - --fancy && \ - cd doc/manual && make + --fancy sbcl:$(SBCL_TARGET) +sbcl-docs:sbcl;## REQURES TEXLIVE + cd $(SBCL_TARGET)/doc/manual && make sbcl-install:sbcl;cd $(SBCL_TARGET) && ./install.sh clean-sbcl:$(SBCL_TARGET);cd $(SBCL_TARGET) && ./clean.sh ### Rust RUST_TARGET:=build/src/rust -rust:scripts/get-rust.sh $(B); - $< -rust-x:rust; +$(RUST_TARGET):scripts/get-rust.sh $(B);$< +rust:$(RUST_TARGET) +rust-install-x:rust; cargo install --path $(RUST_TARGET)/src/tools/x rust-build:rust rust-install-x; cd $(RUST_TARGET) && x build library diff -r 0be8229292a9 -r 2a87ac5a25eb scripts/install-cargo-tools.sh --- a/scripts/install-cargo-tools.sh Sat Dec 30 02:27:16 2023 -0500 +++ b/scripts/install-cargo-tools.sh Sat Dec 30 20:11:16 2023 -0500 @@ -1,5 +1,5 @@ #!/bin/sh -cargo install carg-add +cargo install cargo-add cargo install cbindgen cargo install cargo-asm cargo install t-rec diff -r 0be8229292a9 -r 2a87ac5a25eb virt/build-alpine-base.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/virt/build-alpine-base.sh Sat Dec 30 20:11:16 2023 -0500 @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +id=$(buildah from --pull alpine:latest) +buildah run --net host $id apk add --no-cache gnupg openssh mercurial wireguard-tools +buildah config --annotation alpine $id +buildah config --author='Richard Westhaver' $id +buildah commit $id alpine-base diff -r 0be8229292a9 -r 2a87ac5a25eb virt/build-box-base.sh --- a/virt/build-box-base.sh Sat Dec 30 02:27:16 2023 -0500 +++ b/virt/build-box-base.sh Sat Dec 30 20:11:16 2023 -0500 @@ -4,7 +4,7 @@ buildah run $id useradd -ms /bin/bash $USER buildah run $id mkdir -p /home/$USER/lab /var/local/data buildah run --net host $id pacman -Syu make git sbcl base-devel zstd texlive llvm curl --noconfirm -buildah run --net host $id hg clone https://vc.compiler.company/comp/core /usr/src/core -buildah run --net host $id hg clone https://vc.compiler.company/comp/infra /usr/src/infra buildah config --workingdir /home/$USER $id +buildah run --net host $id hg clone https://vc.compiler.company/comp/core +buildah run --net host $id hg clone https://vc.compiler.company/comp/infra buildah commit $id box-base diff -r 0be8229292a9 -r 2a87ac5a25eb virt/build-ci-worker.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/virt/build-ci-worker.sh Sat Dec 30 20:11:16 2023 -0500 @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +# these should be spawned as needed by a ci-leader box within a +# dedicated pod named 'ci'. diff -r 0be8229292a9 -r 2a87ac5a25eb virt/build-demo.sh --- a/virt/build-demo.sh Sat Dec 30 02:27:16 2023 -0500 +++ b/virt/build-demo.sh Sat Dec 30 20:11:16 2023 -0500 @@ -1,7 +1,16 @@ #!/usr/bin/env bash -id=$(buildah from box-base) -buildah run --net host $id hg clone https://vc.compiler.company/comp/demo /usr/src/demo -buildah run --net host $id /bin/sh -c 'cd /usr/src/infra && make sbcl-install && make rocksdb-install && make ts-langs && make dist/fasl' -buildah run $id cp /usr/src/infra/dist/fasl/* /usr/local/lib/sbcl/ -buildah run $id hg clone /usr/src/demo # to /home/$USER +DIST=dist +id=$(buildah from alpine-base) +buildah run $id adduser demo +buildah run $id addgroup demo +buildah config --workingdir /home/demo --user demo -l=demo +buildah copy $id dist/sbcl +buildah copy $id dist/fasl/* sbcl +buildah copy $id dist/rocksdb/include/* /usr/local/include/ +buildah copy $id dist/rocksdb/librocksdb.so* /usr/local/lib/ +# buildah copy $id dist/tree-sitter/grammar/* /usr/local/share/tree-sitter/ +buildah run --net host $id /bin/sh -c 'cd infra && make sbcl-install && make rocksdb-install && make ts-langs && make dist/fasl' +buildah run $id /bin/sh -c 'cp infra/dist/fasl/* /usr/local/lib/sbcl/' +# cleanup +buildah config --entrypoint buildah commit $id demo diff -r 0be8229292a9 -r 2a87ac5a25eb virt/build-packy.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/virt/build-packy.sh Sat Dec 30 20:11:16 2023 -0500 @@ -0,0 +1,1 @@ +#!/usr/bin/env bash diff -r 0be8229292a9 -r 2a87ac5a25eb virt/build-pod.sh --- a/virt/build-pod.sh Sat Dec 30 02:27:16 2023 -0500 +++ b/virt/build-pod.sh Sat Dec 30 20:11:16 2023 -0500 @@ -1,2 +1,8 @@ #!/bin/sh -podman pod create --name comp.lab --infra --publish 8080:80 --network bridge + +# to run a container in the pod: +# podman run -dt --pod comp box-base top +# podman container attach --latest +# sudo podman ps -ap +NAME=${1:-comp} +podman pod create --name $NAME diff -r 0be8229292a9 -r 2a87ac5a25eb virt/run.sh --- a/virt/run.sh Sat Dec 30 02:27:16 2023 -0500 +++ b/virt/run.sh Sat Dec 30 20:11:16 2023 -0500 @@ -1,4 +1,4 @@ #!/bin/sh -box="$1:-demo" -ports="${2:-8080:80/tcp 9090:9090/udp}" -podman run -dt -p $ports localhost/$box +BOX="${1:-demo}" +NAME="${2:-demo0}" +podman run --name $NAME -dt localhost/$BOX