Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 92 additions & 4 deletions .github/workflows/verify_and_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ jobs:
- qemu.build
- qemu.guest_aarch64
- qemu.guest_x86_64
- system_imaging.aarch64
- system_imaging.x86_64
- system_imaging.debian
python-version: ['3.12']

steps:
Expand All @@ -138,7 +137,7 @@ jobs:
make deps info build install
echo "$HOME/.local/bin" >> $GITHUB_PATH

# This is necessary for running pytest, which is invoked in
# This is necessary for running pytest, which is invoked in
# the testrunner example
- name: Inject pytest
if: matrix.usage_example == 'core.testrunner'
Expand Down Expand Up @@ -183,6 +182,95 @@ jobs:
if-no-files-found: error


test_config_images:
needs: format
runs-on: ubuntu-22.04

# This is needed for 'guestmount' / 'libguestfs'
env:
LIBGUESTFS_BACKEND: direct

container:
image: ghcr.io/refenv/cijoe-docker:latest
options: >
--device=/dev/kvm
--device=/dev/fuse
--cap-add=SYS_ADMIN
--security-opt apparmor=unconfined

strategy:
fail-fast: false
matrix:
image:
- debian-12
- fedora-41
- ubuntu-2404
- freebsd-14
architecture:
- x86_64
include:
- image: debian-12
architecture: aarch64

steps:
- name: Grab source
uses: actions/checkout@v4.2.2
- name: Set up Python
uses: actions/setup-python@v5.3.0
with:
python-version: 3.12

- name: tmp install deps
run: |
apt-get update -y
apt-get install libdw-dev -y

- name: Build and install cijoe from source
run: |
pipx uninstall cijoe
make deps info build install
echo "$HOME/.local/bin" >> $GITHUB_PATH

- name: Get config file
run: |
cp \
$(cijoe -r | grep "system_imaging.example_config_debian" -A 1 | tail -n1 | sed -n -e 's/^.*path: //p') \
cijoe-config.toml

- name: Run system_imaging.diskimage_from_cloudimage
run: |
$(which cijoe) \
system_imaging.diskimage_from_cloudimage \
--monitor -l \
--config cijoe-config.toml \
--output report-${{ matrix.image }}-${{ matrix.architecture }}-diskimage_from_cloudimage \
--pattern ${{ matrix.image }}-${{ matrix.architecture }}

- name: Run system_imaging.dockerimage_from_diskimage
if: contains(matrix.image, 'freebsd') == false
run: |
$(which cijoe) \
system_imaging.dockerimage_from_diskimage \
--monitor -l \
--config cijoe-config.toml \
--output report-${{ matrix.image }}-${{ matrix.architecture }}-dockerimage_from_diskimage \
--pattern ${{ matrix.image }}-${{ matrix.architecture }}

- name: Archive reports
if: always()
run: |
tar czf report-config_img-${{ matrix.image }}_${{ matrix.architecture }}.tar.gz \
report-${{ matrix.image }}-${{ matrix.architecture }}-*

- name: Upload reports
uses: actions/upload-artifact@v4.3.0
if: always()
with:
name: report-config_img-${{ matrix.image }}_${{ matrix.architecture }}
path: report-config_img-${{ matrix.image }}_${{ matrix.architecture }}.tar.gz
if-no-files-found: error


test_cli:
needs: format
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -287,7 +375,7 @@ jobs:

publish-coverage:
runs-on: ${{ matrix.os }}
needs: [examples, test_cli, unittest]
needs: [examples, test_config_images, test_cli, unittest]

strategy:
fail-fast: false
Expand Down
35 changes: 22 additions & 13 deletions src/cijoe/system_imaging/auxiliary/cloudinit-freebsd-userdata.user
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
#cloud-config
disable_root: False
ssh_pwauth: True
disable_root: false
ssh_pwauth: true

chpasswd:
expire: false
users:
- name: root
password: root
type: text

package_update: true
package_upgrade: true
packages:
- fio
- htop
- nvme-cli
- pciutils
write_files:
- path: /etc/ssh/sshd_config
content: |
PermitRootLogin yes
PermitEmptyPasswords yes
- fio
- htop
- nvme-cli
- pciutils

runcmd:
- [pw, usermod, root, -w, none]
- [sed, -E, -i.bak, 's/auth[[:space:]]+required[[:space:]]+pam_unix\.so[[:space:]]+no_warn[[:space:]]+try_first_pass/& nullok/', /etc/pam.d/sshd]
- echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
- echo "PermitEmptyPasswords yes" >> /etc/ssh/sshd_config
- echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
- service sshd restart

final_message: "The system is finally up, after $UPTIME seconds"

power_state:
mode: poweroff
message: So long and thanks for all the fish
timeout: 30
condition: True
condition: true
Original file line number Diff line number Diff line change
Expand Up @@ -154,16 +154,15 @@ docker.url = "ghcr.io/refenv/ubuntu-2404-x86_64:main"
docker.name = "ubuntu-2404-x86_64"
docker.tag = "example"

# [system-imaging.images.freebsd-x86_64]
# system_label = "x86_64"
[system-imaging.images.freebsd-14-x86_64]
system_label = "x86_64"

# cloud.url ="https://download.freebsd.org/releases/VM-IMAGES/14.2-RELEASE/amd64/Latest/FreeBSD-14.2-RELEASE-amd64-BASIC-CLOUDINIT.zfs.qcow2.xz"
# cloud.path = "{{ local.env.HOME }}/system_imaging/cloud/FreeBSD-14.2-RELEASE-amd64-BASIC-CLOUDINIT.zfs.qcow2.xz"
# cloud.decompressed_path = "{{ local.env.HOME }}/system_imaging/cloud/FreeBSD-14.2-RELEASE-amd64-BASIC-CLOUDINIT.zfs.qcow2"
# cloud.metadata_path = "{{ resources.auxiliary['system_imaging.cloudinit-freebsd-metadata'] }}"
# cloud.userdata_path = "{{ resources.auxiliary['system_imaging.cloudinit-freebsd-userdata'] }}"
cloud.url = "https://u489897-sub1:PublicAccess1!@u489897-sub1.your-storagebox.de/freebsd_14.2_x86_64.qcow2"
cloud.path = "{{ local.env.HOME }}/system_imaging/cloud/freebsd_14.2_x86_64.qcow2"
cloud.metadata_path = "{{ resources.auxiliary['system_imaging.cloudinit-freebsd-metadata'] }}"
cloud.userdata_path = "{{ resources.auxiliary['system_imaging.cloudinit-freebsd-userdata'] }}"

# disk.path = "{{ local.env.HOME }}/system_imaging/disk/FreeBSD-14.2-RELEASE-amd64-BASIC-CLOUDINIT.ufs.qcow2"
disk.path = "{{ local.env.HOME }}/system_imaging/disk/freebsd_14.2_x86_64.qcow2"

[system-imaging.images.debian-12-aarch64]
system_label = "aarch64"
Expand Down
180 changes: 0 additions & 180 deletions src/cijoe/system_imaging/configs/example_config_x86_64.toml

This file was deleted.

Loading
Loading