Skip to content

Commit 34d8964

Browse files
committed
devenv: Add tmt and nushell
- Add tmt testing framework to CentOS Stream 10 (via EPEL) and Debian (via pip3) - Add nushell modern shell to both environments via binary installation - Configure renovate for nushell version management Addresses requirements from #55. Assisted-by: OpenCode (Sonnet 4.5)
1 parent ced7c59 commit 34d8964

9 files changed

Lines changed: 101 additions & 8 deletions

devenv/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
!devenv-init.sh
1515
!fetch-tools.sh
1616
!install-rust.sh
17+
!install-uv.sh
1718
!install-kani.sh
1819
!devenv-selftest.sh
1920
!userns-setup

devenv/Containerfile.c10s

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,13 @@ FROM base as tools
3030
ARG bcvkversion=v0.9.0
3131
# renovate: datasource=github-releases depName=ossf/scorecard
3232
ARG scorecardversion=v5.1.1
33-
COPY fetch-tools.sh /run/src/
34-
RUN bcvkversion=$bcvkversion scorecardversion=$scorecardversion /run/src/fetch-tools.sh
33+
# renovate: datasource=github-releases depName=nushell/nushell
34+
ARG nushellversion=0.110.0
35+
# renovate: datasource=github-releases depName=astral-sh/uv
36+
ARG uvversion=0.10.2
37+
COPY fetch-tools.sh install-uv.sh /run/src/
38+
RUN bcvkversion=$bcvkversion scorecardversion=$scorecardversion nushellversion=$nushellversion /run/src/fetch-tools.sh
39+
RUN uvversion=$uvversion /run/src/install-uv.sh
3540

3641
FROM base as rust
3742
COPY install-rust.sh /run/src/
@@ -73,6 +78,9 @@ COPY --from=kani /usr/local/kani /usr/local/kani
7378
ENV RUSTUP_HOME=/usr/local/rustup
7479
# Point Kani at the system-wide installation
7580
ENV KANI_HOME=/usr/local/kani
81+
# Configure uv for system-wide tool installation
82+
ENV UV_TOOL_DIR=/usr/local/uv-tools
83+
ENV UV_TOOL_BIN_DIR=/usr/local/bin
7684
# Setup for codespaces
7785
COPY devenv-init.sh /usr/local/bin/
7886
COPY userns-setup /usr/lib/devenv/userns-setup

devenv/Containerfile.debian

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@ FROM base as tools
3333
ARG bcvkversion=v0.9.0
3434
# renovate: datasource=github-releases depName=ossf/scorecard
3535
ARG scorecardversion=v5.1.1
36-
COPY fetch-tools.sh /run/src/
37-
RUN bcvkversion=$bcvkversion scorecardversion=$scorecardversion /run/src/fetch-tools.sh
36+
# renovate: datasource=github-releases depName=nushell/nushell
37+
ARG nushellversion=0.110.0
38+
# renovate: datasource=github-releases depName=astral-sh/uv
39+
ARG uvversion=0.10.2
40+
COPY fetch-tools.sh install-uv.sh /run/src/
41+
RUN bcvkversion=$bcvkversion scorecardversion=$scorecardversion nushellversion=$nushellversion /run/src/fetch-tools.sh
42+
RUN uvversion=$uvversion /run/src/install-uv.sh
3843

3944
FROM base as rust
4045
COPY install-rust.sh /run/src/
@@ -62,6 +67,14 @@ EORUN
6267
COPY npm.txt /run/src
6368
RUN grep -vEe '^#' npm.txt | /bin/time -f '%E %C' xargs npm i -g
6469

70+
# Install tmt via uv tool install for isolated environment
71+
# UV_TOOL_DIR and UV_TOOL_BIN_DIR set to system-wide locations like rustup
72+
COPY --from=tools /usr/local/bin/uv /usr/local/bin/uv
73+
COPY --from=tools /usr/local/bin/uvx /usr/local/bin/uvx
74+
ENV UV_TOOL_DIR=/usr/local/uv-tools
75+
ENV UV_TOOL_BIN_DIR=/usr/local/bin
76+
RUN uv tool install 'tmt[provision-virtual]'
77+
6578
# Copy in the binaries from our tools container image
6679
COPY --from=tools /usr/local/bin/* /usr/local/bin/
6780
COPY --from=kani /usr/local/bin/* /usr/local/bin/

devenv/README.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,16 @@ This container image is suitable for use on
44
developing projects in the bootc-dev organization,
55
especially bootc.
66

7-
It includes all tools used in the Justfile
8-
for relevant projects.
7+
The goal is to make this completely usable as a devcontainer
8+
with tools such as VSCode remote containers, Codespaces,
9+
[devpod](https://devpod.sh/) and others.
10+
11+
Specifically this includes e.g.:
12+
13+
- Rust and C/C++ toolchains
14+
- `nu`
15+
- [tmt](https://tmt.readthedocs.io/)
16+
- [Kani](https://model-checking.github.io/kani/usage.html) for system verification
917

1018
## Base image
1119

devenv/devenv-init.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
#!/bin/bash
2-
# Thin wrapper that calls the Python implementation
3-
exec python3 /usr/lib/devenv/userns-setup "$@"
2+
# Initialize development environment
3+
set -euo pipefail
4+
5+
# Set up podman for nested containers
6+
python3 /usr/lib/devenv/userns-setup "$@"

devenv/fetch-tools.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ set -xeuo pipefail
66
# Required environment variables (passed as build ARGs)
77
: "${bcvkversion:?bcvkversion is required}"
88
: "${scorecardversion:?scorecardversion is required}"
9+
: "${nushellversion:?nushellversion is required}"
910

1011
arch=$(arch)
1112

@@ -42,3 +43,22 @@ td=$(mktemp -d)
4243
mv scorecard /usr/local/bin/scorecard
4344
)
4445
rm -rf $td
46+
47+
# nushell - modern shell
48+
td=$(mktemp -d)
49+
(
50+
cd $td
51+
# Map arch to nushell naming convention
52+
case "${arch}" in
53+
x86_64) nuarch=x86_64 ;;
54+
aarch64) nuarch=aarch64 ;;
55+
*) echo "nushell unavailable for $arch"; return 0 ;;
56+
esac
57+
target=nu-${nushellversion}-${nuarch}-unknown-linux-gnu.tar.gz
58+
/bin/time -f '%E %C' curl -fLO https://github.com/nushell/nushell/releases/download/$nushellversion/$target
59+
tar xvzf $target
60+
# The extracted directory has the same name as the archive without .tar.gz
61+
extracted_dir=nu-${nushellversion}-${nuarch}-unknown-linux-gnu
62+
mv $extracted_dir/nu /usr/local/bin/nu
63+
)
64+
rm -rf $td

devenv/install-uv.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
# Install uv system-wide into /usr/local
3+
# This script is shared between c10s and debian container builds.
4+
# Similar to rustup, we install the binary to /usr/local/bin and configure
5+
# tools to be installed system-wide via environment variables.
6+
set -xeuo pipefail
7+
8+
: "${uvversion:?uvversion is required}"
9+
10+
arch=$(arch)
11+
12+
# Map arch to uv naming convention
13+
case "${arch}" in
14+
x86_64) uvarch=x86_64 ;;
15+
aarch64) uvarch=aarch64 ;;
16+
*) echo "uv unavailable for $arch"; exit 1 ;;
17+
esac
18+
19+
target=uv-${uvarch}-unknown-linux-gnu.tar.gz
20+
21+
td=$(mktemp -d)
22+
(
23+
cd $td
24+
/bin/time -f '%E %C' curl -fLO https://github.com/astral-sh/uv/releases/download/${uvversion}/$target
25+
tar xvzf $target
26+
# The extracted directory has the same name as the archive without .tar.gz
27+
extracted_dir=uv-${uvarch}-unknown-linux-gnu
28+
mv $extracted_dir/uv /usr/local/bin/uv
29+
mv $extracted_dir/uvx /usr/local/bin/uvx
30+
)
31+
rm -rf $td
32+
33+
# Verify installation
34+
/usr/local/bin/uv --version

devenv/packages-c10s.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@ xorriso
1212
qemu-img
1313
libvirt-daemon-kvm
1414

15+
# Testing framework
16+
tmt
17+
1518
# TUI editors
1619
vim-enhanced

devenv/packages-debian.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ libkrb5-dev
77
libvirt-dev
88
libostree-dev
99

10+
# Python dev headers (needed for uv to build libvirt-python from source for tmt)
11+
python3-dev
12+
1013
# Runtime virt
1114
genisoimage
1215
qemu-utils

0 commit comments

Comments
 (0)