Skip to content

Commit e11ee2a

Browse files
authored
Merge branch 'main' into cel/fixes
2 parents 8f85fa6 + 5de0d0c commit e11ee2a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+8362
-25
lines changed

.rustfmt.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
edition = "2021"
2+
newline_style = "Unix"
3+
4+
# Unstable options that help catching some mistakes in formatting and that we may want to enable
5+
# when they become stable.
6+
#
7+
# They are kept here since they are useful to run from time to time.
8+
#format_code_in_doc_comments = true
9+
#reorder_impl_items = true
10+
#comment_width = 100
11+
#wrap_comments = true
12+
#normalize_comments = true

CLAUDE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,28 @@ The style checker will identify:
481481
Fix all reported issues before submitting your work. The `make style` command
482482
checks both file whitespace and the most recent commit message format.
483483
484+
### Rust Code Quality
485+
486+
For Rust code in kdevops (workflows/rcloud, etc.), ALWAYS run both:
487+
488+
```bash
489+
# Format code using Linux kernel rustfmt standards
490+
cargo fmt
491+
492+
# Check for common mistakes and idioms
493+
cargo clippy --all-targets --all-features -- -D warnings
494+
```
495+
496+
**Rust Quality Checklist**:
497+
- ✅ Run `cargo fmt` to auto-format code according to .rustfmt.toml
498+
- ✅ Run `cargo clippy` with `-D warnings` (treat warnings as errors)
499+
- ✅ Fix ALL clippy warnings before committing
500+
- ✅ Common clippy fixes: remove unnecessary casts, use `.flatten()` instead of manual `if let Ok`, remove unused imports
501+
502+
The install-rust-deps role provides both cargo/rustc and the .rustfmt.toml
503+
configuration from the Linux kernel, ensuring consistent Rust code quality
504+
across all kdevops workflows.
505+
484506
### Automatic Whitespace Fixing
485507

486508
For convenience, you can automatically fix whitespace issues using:

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ endif # WORKFLOW_KOTD_ENABLE
179179
DEFAULT_DEPS += $(DEFAULT_DEPS_REQS_EXTRA_VARS)
180180

181181
include scripts/install-menuconfig-deps.Makefile
182+
include scripts/install-rcloud-deps.Makefile
182183

183184
include Makefile.btrfs_progs
184185

@@ -197,6 +198,10 @@ endif # CONFIG_HYPERVISOR_TUNING
197198
include Makefile.linux-mirror
198199
include Makefile.docker-mirror
199200

201+
ifeq (y,$(CONFIG_RCLOUD))
202+
include workflows/rcloud/Makefile
203+
endif
204+
200205
ifeq (y,$(CONFIG_KDEVOPS_DISTRO_REG_METHOD_TWOLINE))
201206
DEFAULT_DEPS += playbooks/secret.yml
202207
endif

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ want to just use the kernel that comes with your Linux distribution.
377377
* [kdevops CXL docs](docs/cxl.md)
378378
* [kdevops NFS docs](docs/nfs.md)
379379
* [kdevops selftests docs](docs/selftests.md)
380+
* [kdevops rcloud docs](workflows/rcloud/docs/TESTING.md)
380381
* [kdevops reboot-limit docs](docs/reboot-limit.md)
381382
* [kdevops AI workflow docs](docs/ai/README.md)
382383
* [kdevops vLLM workflow docs](workflows/vllm/)

defconfigs/rcloud

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# rcloud server-only configuration
2+
#
3+
# PURPOSE: Production deployment of rcloud REST API server
4+
#
5+
# Use this when:
6+
# - Deploying rcloud to a dedicated server
7+
# - Base images already exist (created elsewhere or separately)
8+
# - You only need the rcloud server component
9+
#
10+
# For testing/development, use 'defconfig-rcloud-guest-test' instead,
11+
# which includes both base image creation AND rcloud server setup.
12+
#
13+
# This defconfig:
14+
# - Installs the rcloud REST API server
15+
# - Enables the Terraform provider
16+
# - Configures the systemd service
17+
# - Does NOT create base images (assumes they exist)
18+
# - Does NOT create test VMs (rcloud creates them on demand via API)
19+
#
20+
# After 'make rcloud', the API will be available at:
21+
# http://localhost:8765/api/v1/health
22+
#
23+
# Test with:
24+
# make rcloud-status # Check health
25+
# curl http://localhost:8765/api/v1/vms # List VMs
26+
# terraform apply # Use Terraform provider
27+
28+
# Skip interactive bringup (rcloud server doesn't need test VMs)
29+
CONFIG_SKIP_BRINGUP=y
30+
31+
# Disable test workflows (this is a cloud infrastructure server)
32+
CONFIG_WORKFLOWS=n
33+
34+
# Enable guestfs for base image management
35+
CONFIG_GUESTFS=y
36+
37+
# Use Debian nocloud variant for local VM testing
38+
# The nocloud variant doesn't have cloud-init and is designed for bare metal/local use
39+
# The generic variant requires cloud-init which virt-builder removes, breaking networking
40+
CONFIG_GUESTFS_DEBIAN_TRIXIE_NOCLOUD_AMD64=y
41+
42+
# Don't copy host APT sources to guest base images
43+
# Base images should use standard Debian repositories for reliability
44+
# Custom repositories can be added during per-user VM customization
45+
# Note: Must disable GUESTFS_DEBIAN_COPY_HOST_SOURCES (not COPY_SOURCES directly)
46+
# because Kconfig 'select' cannot be overridden
47+
CONFIG_GUESTFS_DEBIAN_COPY_HOST_SOURCES=n
48+
49+
# Enable rcloud REST API server
50+
CONFIG_RCLOUD=y
51+
CONFIG_RCLOUD_SERVER_BIND="127.0.0.1:8765"
52+
CONFIG_RCLOUD_WORKERS=4
53+
CONFIG_RCLOUD_ENABLE_TERRAFORM_PROVIDER=y

defconfigs/rcloud-guest-test

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# rcloud user/client configuration
2+
#
3+
# PURPOSE: Provision VMs through rcloud REST API using Terraform
4+
#
5+
# This defconfig is for USERS who want to provision VMs through an existing
6+
# rcloud server. The admin must have already set up the rcloud server using
7+
# defconfig-rcloud.
8+
#
9+
# Typical workflow:
10+
# # Admin setup (one time):
11+
# make defconfig-rcloud
12+
# make
13+
# make rcloud # Sets up rcloud server and base images
14+
#
15+
# # User workflow (on same system or remotely):
16+
# make defconfig-rcloud-guest-test
17+
# make
18+
# make bringup # Provisions VMs through rcloud API using Terraform
19+
#
20+
# This treats rcloud as a local cloud provider, just like AWS or Azure.
21+
# Users provision VMs through the standard Terraform workflow.
22+
23+
# Basic system configuration
24+
CONFIG_KDEVOPS_HOSTS_PREFIX="rcloud-test"
25+
26+
# Number of VMs to create
27+
CONFIG_KDEVOPS_NODES=1
28+
29+
# VM resources (requested from rcloud)
30+
CONFIG_LIBVIRT_MACHINE_TYPE_Q35=y
31+
CONFIG_LIBVIRT_HOST_PASSTHROUGH=y
32+
CONFIG_LIBVIRT_MEMORY_MB=4096
33+
CONFIG_LIBVIRT_VCPUS=2
34+
35+
# Disk configuration
36+
CONFIG_LIBVIRT_EXTRA_STORAGE_DRIVE_NVME=y
37+
CONFIG_LIBVIRT_NVME_DISK_SIZE_GIB=50
38+
39+
# Disable test workflows (rcloud provides the infrastructure)
40+
CONFIG_WORKFLOWS=n
41+
42+
# Use Terraform to provision VMs through rcloud API
43+
# This treats rcloud as a local cloud provider, similar to AWS/Azure
44+
CONFIG_TERRAFORM=y
45+
CONFIG_TERRAFORM_RCLOUD=y
46+
CONFIG_TERRAFORM_RCLOUD_API_URL="http://localhost:8765"
47+
# Use nocloud variant to match the base image created by defconfig-rcloud
48+
# The nocloud variant doesn't have cloud-init and works better for local testing
49+
CONFIG_TERRAFORM_RCLOUD_BASE_IMAGE="debian-13-nocloud-amd64-daily.raw"
50+
51+
# IMPORTANT: SSH key configuration for rcloud service
52+
# The rcloud service cannot access files in ~/.ssh/ due to directory permissions.
53+
# You MUST configure the SSH key path to a location accessible by the rcloud service.
54+
# Recommended: Store keys in your kdevops directory, for example:
55+
# CONFIG_TERRAFORM_SSH_CONFIG_PUBKEY_FILE="/path/to/kdevops/kdevops_terraform.pub"
56+
# The private key path will automatically derive from the public key path (removes .pub suffix).
57+
# After loading this defconfig, run 'make menuconfig' and update the SSH paths under:
58+
# "Bring up methods" -> "Terraform ssh configuration" -> "SSH public key file"

kconfigs/Kconfig.guestfs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ config GUESTFS_DISTRO_SOURCE_AND_DEST_FILE
6464
string
6565
depends on GUESTFS_COPY_SOURCES_FROM_HOST_TO_GUEST
6666
output yaml
67+
default "/etc/apt/sources.list.d/debian.sources" if GUESTFS_DEBIAN_TRIXIE
6768
default "/etc/apt/sources.list" if GUESTFS_DEBIAN
6869

6970
endif

kconfigs/workflows/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,3 +614,5 @@ config KDEVOPS_WORKFLOW_NAME
614614
endif
615615

616616
endif # WORKFLOWS
617+
618+
source "workflows/rcloud/Kconfig"

playbooks/devconfig.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- name: Configure developer environment on target systems
3-
hosts: baseline:dev:service
3+
hosts: all:!localhost
44
gather_facts: false
55
roles:
66
- role: devconfig

playbooks/install-rcloud-deps.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
- name: Install rcloud build dependencies
3+
hosts: localhost
4+
roles:
5+
- role: install-rcloud-deps

0 commit comments

Comments
 (0)