kairos-io / osbuilder

:building_construction: Kubernetes Native Extension to build Linux distributions artifacts from container images
16 stars 8 forks source link

Artifact is missing despite logs saying it was successfully created #89

Closed ndlanier closed 1 year ago

ndlanier commented 1 year ago

Logs from os image pods say the raw image artifact has been created however I can not find it on the nginx server. A lost+found directory gets created but it's empty.

OS Image pod logs

Defaulted container "build-cloud-image" out of: build-cloud-image, create-image, pull-image-baseimage (init)
+ /raw-images.sh /rootfs /artifacts/hello-kairos.raw
Output: /artifacts/hello-kairos.raw
Generating squashfs from /rootfs
Parallel mksquashfs: Using 4 processors
Creating 4.0 filesystem on recovery.squashfs, block size 1048576.
[===========================================================|] 20416/20416 100%

Exportable Squashfs 4.0 filesystem, xz compressed, data block size 1048576
    compressed data, compressed metadata, compressed fragments,
    compressed xattrs, compressed ids
    duplicates are removed
Filesystem size 773724.23 Kbytes (755.59 Mbytes)
    60.50% of uncompressed filesystem size (1278910.38 Kbytes)
Inode table size 213260 bytes (208.26 Kbytes)
    23.34% of uncompressed inode table size (913850 bytes)
Directory table size 249632 bytes (243.78 Kbytes)
    37.46% of uncompressed directory table size (666483 bytes)
Number of duplicate files found 260
Number of inodes 26173
Number of files 19765
Number of fragments 568
Number of symbolic links  3023
Number of device nodes 0
Number of fifo nodes 0
Number of socket nodes 0
Number of directories 3385
Number of ids (unique uids + gids) 13
Number of uids 5
    root (0)
    unknown (479)
    systemd-timesync (483)
    unknown (478)
    unknown (65534)
Number of gids 10
    root (0)
    shadow (15)
    lock (498)
    systemd-timesync (483)
    trusted (42)
    kvm (36)
    tty (5)
    messagebus (486)
    utmp (497)
    unknown (65533)
mke2fs 1.46.4 (18-Aug-2021)
Discarding device blocks: done
Creating filesystem with 524288 4k blocks and 131072 inodes
Filesystem UUID: 918b9bbb-c1fe-46dc-b128-da138f1bc7f6
Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912

Allocating group tables: done
Writing inode tables: done
Copying files into the device: done
Writing superblocks and filesystem accounting information: done

mkfs.fat 4.1 (2017-01-24)
mke2fs 1.46.4 (18-Aug-2021)
Discarding device blocks: done
Creating filesystem with 65536 1k blocks and 16384 inodes
Filesystem UUID: c180aac3-a963-4c1a-b79f-3f17f3265600
Superblock backups stored on blocks:
    8193, 24577, 40961, 57345

Allocating group tables: done
Writing inode tables: done
Copying files into the device: done
Writing superblocks and filesystem accounting information: done

Generating image /artifacts/hello-kairos.raw
Creating new GPT entries in memory.
Setting name!
partNum is 0
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 1
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 2
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
Setting name!
partNum is 3
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.

OS Artifact Yaml:

apiVersion: build.kairos.io/v1alpha2
kind: OSArtifact
metadata:
  name: hello-kairos
spec:
  imageName: "quay.io/kairos/core-opensuse-leap:latest"
  cloudImage: true
ndlanier commented 1 year ago

Needed to add the exporter to my OSArtifact manifest. Should have read the note in the helm chart

apiVersion: build.kairos.io/v1alpha2
kind: OSArtifact
metadata:
  name: hello-kairos
spec:
  imageName: "quay.io/kairos/core-opensuse-leap:latest"
  cloudImage: true
  exporters:
    - template:
        spec:
          restartPolicy: Never
          containers:
          - name: upload
            image: REDACTED
            command:
                - bash
            args:
                - -c
                - |
                    for f in $(ls /artifacts)
                    do
                        curl -T /artifacts/$f http://osartifactbuilder-operator-osbuilder-nginx/upload/$f
                    done
            volumeMounts:
                - name: artifacts
                  mountPath: /artifacts