Skip to content

Commit 2e93d0c

Browse files
author
bootc-dev Bot
committed
Sync common files from infra repository
Synchronized from bootc-dev/infra@5e3335e. Signed-off-by: bootc-dev Bot <[email protected]>
1 parent 6919165 commit 2e93d0c

File tree

6 files changed

+179
-0
lines changed

6 files changed

+179
-0
lines changed

.bootc-dev-infra-commit.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5e3335e7f2c1618527b2286227bd25b17bc8a3f1

.claude/CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../AGENTS.md

.devcontainer/devcontainer.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "bootc-devenv-debian",
3+
// TODO override this back to prod image
4+
"image": "ghcr.io/bootc-dev/devenv-debian",
5+
"customizations": {
6+
"vscode": {
7+
// Abitrary, but most of our code is in one of these two
8+
"extensions": [
9+
"rust-lang.rust-analyzer",
10+
"golang.Go"
11+
]
12+
}
13+
},
14+
"features": {},
15+
"runArgs": [
16+
// Because we want to be able to run podman and also use e.g. /dev/kvm
17+
// among other things
18+
"--privileged"
19+
],
20+
"postCreateCommand": {
21+
// Our init script
22+
"devenv-init": "sudo /usr/local/bin/devenv-init.sh"
23+
},
24+
"remoteEnv": {
25+
"PATH": "${containerEnv:PATH}:/usr/local/cargo/bin"
26+
}
27+
}
28+

.gemini/config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# NOTE: This file is canonically maintained in
2+
# <https://github.com/bootc-dev/infra/tree/main/common>
3+
# DO NOT EDIT
4+
#
5+
# This config mainly overrides `summary: false` by default
6+
# as it's really noisy.
7+
have_fun: true
8+
code_review:
9+
disable: false
10+
# Even medium level can be quite noisy, I don't think
11+
# we need LOW. Anyone who wants that type of stuff should
12+
# be able to get it locally or before review.
13+
comment_severity_threshold: MEDIUM
14+
max_review_comments: -1
15+
pull_request_opened:
16+
help: false
17+
summary: false # turned off by default
18+
code_review: true
19+
ignore_patterns: []
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: 'Bootc Ubuntu Setup'
2+
description: 'Default host setup'
3+
inputs:
4+
libvirt:
5+
description: 'Install libvirt and virtualization stack'
6+
required: false
7+
default: 'false'
8+
runs:
9+
using: 'composite'
10+
steps:
11+
# The default runners have TONS of crud on them...
12+
- name: Free up disk space on runner
13+
shell: bash
14+
run: |
15+
set -xeuo pipefail
16+
sudo df -h
17+
unwanted_pkgs=('^aspnetcore-.*' '^dotnet-.*' '^llvm-.*' 'php.*' '^mongodb-.*' '^mysql-.*'
18+
azure-cli google-chrome-stable firefox mono-devel)
19+
unwanted_dirs=(/usr/share/dotnet /opt/ghc /usr/local/lib/android /opt/hostedtoolcache/CodeQL)
20+
# Start background removal operations as systemd units; if this causes
21+
# races in the future around disk space we can look at waiting for cleanup
22+
# before starting further jobs, but right now we spent a lot of time waiting
23+
# on the network and scripts and such below, giving these plenty of time to run.
24+
n=0
25+
runcleanup() {
26+
sudo systemd-run -r -u action-cleanup-${n} -- "$@"
27+
n=$(($n + 1))
28+
}
29+
runcleanup docker image prune --all --force
30+
for x in ${unwanted_dirs[@]}; do
31+
runcleanup rm -rf "$x"
32+
done
33+
# Apt removals in foreground, as we can't parallelize these
34+
for x in ${unwanted_pkgs[@]}; do
35+
/bin/time -f '%E %C' sudo apt-get remove -y $x
36+
done
37+
# We really want support for heredocs
38+
- name: Update podman and install just
39+
shell: bash
40+
run: |
41+
set -eux
42+
# Require the runner is ubuntu-24.04
43+
IDV=$(. /usr/lib/os-release && echo ${ID}-${VERSION_ID})
44+
test "${IDV}" = "ubuntu-24.04"
45+
# plucky is the next release
46+
echo 'deb http://azure.archive.ubuntu.com/ubuntu plucky universe main' | sudo tee /etc/apt/sources.list.d/plucky.list
47+
/bin/time -f '%E %C' sudo apt update
48+
# skopeo is currently older in plucky for some reason hence --allow-downgrades
49+
/bin/time -f '%E %C' sudo apt install -y --allow-downgrades crun/plucky podman/plucky skopeo/plucky just
50+
# This is the default on e.g. Fedora derivatives, but not Debian
51+
- name: Enable unprivileged /dev/kvm access
52+
shell: bash
53+
run: |
54+
set -xeuo pipefail
55+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
56+
sudo udevadm control --reload-rules
57+
sudo udevadm trigger --name-match=kvm
58+
ls -l /dev/kvm
59+
# Used by a few workflows, but generally useful
60+
- name: Set architecture variable
61+
id: set_arch
62+
shell: bash
63+
run: echo "ARCH=$(arch)" >> $GITHUB_ENV
64+
# We often use Rust, so set up opinionated default caching
65+
- name: Setup Rust cache
66+
uses: Swatinem/rust-cache@v2
67+
with:
68+
cache-all-crates: true
69+
# Only generate caches on push to git main
70+
save-if: ${{ github.ref == 'refs/heads/main' }}
71+
# Suppress actually using the cache for builds running from
72+
# git main so that we avoid incremental compilation bugs
73+
lookup-only: ${{ github.ref == 'refs/heads/main' }}
74+
# Install libvirt stack if requested
75+
- name: Install libvirt and virtualization stack
76+
if: ${{ inputs.libvirt == 'true' }}
77+
shell: bash
78+
run: |
79+
set -xeuo pipefail
80+
export BCVK_VERSION=0.5.3
81+
/bin/time -f '%E %C' sudo apt install -y libkrb5-dev pkg-config libvirt-dev genisoimage qemu-utils qemu-kvm virtiofsd libvirt-daemon-system
82+
# Something in the stack is overriding this, but we want session right now for bcvk
83+
echo LIBVIRT_DEFAULT_URI=qemu:///session >> $GITHUB_ENV
84+
td=$(mktemp -d)
85+
cd $td
86+
# Install bcvk
87+
target=bcvk-$(arch)-unknown-linux-gnu
88+
/bin/time -f '%E %C' curl -LO https://github.com/bootc-dev/bcvk/releases/download/v${BCVK_VERSION}/${target}.tar.gz
89+
tar xzf ${target}.tar.gz
90+
sudo install -T ${target} /usr/bin/bcvk
91+
cd -
92+
rm -rf "$td"
93+
94+
# Also bump the default fd limit as a workaround for https://github.com/bootc-dev/bcvk/issues/65
95+
sudo sed -i -e 's,^\* hard nofile 65536,* hard nofile 524288,' /etc/security/limits.conf
96+
- name: Cleanup status
97+
shell: bash
98+
run: |
99+
set -xeuo pipefail
100+
systemctl list-units 'action-cleanup*'
101+
df -h

AGENTS.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!-- This file is canonically maintained in <https://github.com/bootc-dev/infra/tree/main/common> -->
2+
3+
# Instructions for AI agents
4+
5+
## CRITICAL instructions for generating commits
6+
7+
### Signed-off-by
8+
9+
Human review is required for all code that is generated
10+
or assisted by a large language model. If you
11+
are a LLM, you MUST NOT include a `Signed-off-by`
12+
on any automatically generated git commits. Only explicit
13+
human action or request should include a Signed-off-by.
14+
If for example you automatically create a pull request
15+
and the DCO check fails, tell the human to review
16+
the code and give them instructions on how to add
17+
a signoff.
18+
19+
### Attribution
20+
21+
When generating substantial amounts of code, you SHOULD
22+
include an `Assisted-by: TOOLNAME (MODELNAME)`. For example,
23+
`Assisted-by: Goose (Sonnet 4.5)`.
24+
25+
## Follow other guidelines
26+
27+
Look at the project README.md and look for guidelines
28+
related to contribution, such as a CONTRIBUTING.md
29+
and follow those.

0 commit comments

Comments
 (0)