diff --git a/Makefile b/Makefile index c5bf51b..72b98b3 100644 --- a/Makefile +++ b/Makefile @@ -40,9 +40,11 @@ push: $(addprefix push-,$(ACTIONS)) .PHONY: push-% push-%: ## Push a specific action image to the registry. This recipe assumes you are already authenticated with the registry. - IMAGE_NAME=$(CONTAINER_REPOSITORY)/$*:$(GIT_COMMIT) - docker tag $*:latest $$IMAGE_NAME - docker push $$IMAGE_NAME + IMAGE_NAME=$(CONTAINER_REPOSITORY)/$* + docker tag $*:latest $$IMAGE_NAME:$(GIT_COMMIT) + docker tag $*:latest $$IMAGE_NAME:latest + docker push $$IMAGE_NAME:$(GIT_COMMIT) + docker push $$IMAGE_NAME:latest formatters: ## Run all formatters. formatters: $(toolBins) diff --git a/README.md b/README.md index 2516028..28e35ba 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,32 @@ This repository is a suite of reusable Tinkerbell Actions that are used to compo | Name | Description | | --- | --- | -| [archive2disk](/archive2disk/) | Write archives to a block device | -| [cexec](/cexec/) | chroot and execute binaries | -| [grub2disk](/grub2disk/) | Write grub configs to a block device | -| [image2disk](/image2disk/) | Write images to a block device | -| [kexec](/kexec/) | kexec to a Linux Kernel | -| [oci2disk](/oci2disk/) | Stream OCI compliant images from a registry and write to a block device | -| [qemuimg2disk](/qemuimg2disk/) | Stream images and write to a block device | -| [rootio](/rootio/) | Manage disks (partition, format etc) | -| [slurp](/slurp/) | Stream a block device to a remote server | -| [syslinux](/syslinux/) | Install the syslinux bootloader to a block device | -| [writefile](/writefile/) | Write a file to a file system on a block device | +| [archive2disk](/archive2disk/) | Write archives to a block device | +| [cexec](/cexec/) | chroot and execute binaries | +| [grub2disk](/grub2disk/) | Write grub configs to a block device | +| [image2disk](/image2disk/) | Write images to a block device | +| [kexec](/kexec/) | kexec to a Linux Kernel | +| [oci2disk](/oci2disk/) | Stream OCI compliant images from a registry and write to a block device | +| [qemuimg2disk](/qemuimg2disk/) | Stream images and write to a block device | +| [rootio](/rootio/) | Manage disks (partition, format etc) +| [slurp](/slurp/) | Stream a block device to a remote server | +| [syslinux](/syslinux/) | Install the syslinux bootloader to a block device | +| [writefile](/writefile/) | Write a file to a file system on a block device | + +## Releases + +Actions are released on a per revision basis. With each PR merged, all actions are built and pushed +to quay.io tagged with the Git revision. The `latest` tag is updated to point to the new image. + +We try not to make changes that would break actions, but we do not provide a backward compatibility +guarantee. We recommend using the static Git revision tag for most deployments. + +Our release process may provide stronger compatibility guarantees in the future. + +## Community actions + +These actions are built and maintained by third parties. To add your own action to the list, raise +a PR. If you find an action that's no longer maintained, please raise an issue. + +| Name | Description | Repo | +| --- | --- | --- | diff --git a/archive2disk/README.md b/archive2disk/README.md index 5c3b763..ca044f9 100644 --- a/archive2disk/README.md +++ b/archive2disk/README.md @@ -1,3 +1,7 @@ +``` +quay.io/tinkerbell/actions/archive2disk:latest +``` + This action will stream a compressed filesystem archive into archive2disk where it will mount a block device and uncompress this archive to a destination path on it's filesystem. Usually the `DEST_PATH` should be `/` as we normally will be writing a @@ -25,41 +29,41 @@ Environment Variables: ```yaml actions: - - name: "expand-ubuntu-filesystem-to-root" - image: quay.io/tinkerbell-actions/archive2disk:v1.0.0 - timeout: 90 - environment: - ARCHIVE_URL: http://192.168.1.2/ubuntu.tar.gz - ARCHIVE_TYPE: targz - TARFILE_CHECKSUM: sha256:f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2 - DEST_DISK: /dev/sda3 - FS_TYPE: ext4 - DEST_PATH: / - HTTP_CLIENT_TIMEOUT_MINUTES: 1 +- name: "expand-ubuntu-filesystem-to-root" + image: quay.io/tinkerbell/actions/archive2disk:latest + timeout: 90 + environment: + ARCHIVE_URL: http://192.168.1.2/ubuntu.tar.gz + ARCHIVE_TYPE: targz + TARFILE_CHECKSUM: sha256:f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2 + DEST_DISK: /dev/sda3 + FS_TYPE: ext4 + DEST_PATH: / + HTTP_CLIENT_TIMEOUT_MINUTES: 1 ``` ```yaml actions: - - name: "expand-ubuntu-filesystem-to-root" - image: quay.io/tinkerbell-actions/archive2disk:v1.0.0 - timeout: 90 - environment: - ARCHIVE_URL: http://192.168.1.2/ubuntu.tar.gz - ARCHIVE_TYPE: targz - TARFILE_CHECKSUM: sha512:0e3e75234abc68f4378a86b3f4b32a198ba301845b0cd6e50106e874345700cc6663a86c1ea125dc5e92be17c98f9a0f85ca9d5f595db2012f7cc3571945c123 - DEST_DISK: /dev/sda3 - FS_TYPE: ext4 - DEST_PATH: / +- name: "expand-ubuntu-filesystem-to-root" + image: quay.io/tinkerbell/actions/archive2disk:latest + timeout: 90 + environment: + ARCHIVE_URL: http://192.168.1.2/ubuntu.tar.gz + ARCHIVE_TYPE: targz + TARFILE_CHECKSUM: sha512:0e3e75234abc68f4378a86b3f4b32a198ba301845b0cd6e50106e874345700cc6663a86c1ea125dc5e92be17c98f9a0f85ca9d5f595db2012f7cc3571945c123 + DEST_DISK: /dev/sda3 + FS_TYPE: ext4 + DEST_PATH: / ``` ```yaml actions: - - name: "expand-ubuntu-filesystem-to-root" - image: quay.io/tinkerbell-actions/archive2disk:v1.0.0 - timeout: 90 - environment: - ARCHIVE_URL: http://192.168.1.2/ubuntu.tar.gz - ARCHIVE_TYPE: targz - DEST_DISK: /dev/sda3 - FS_TYPE: ext4 - DEST_PATH: / - INSECURE_NO_TARFILE_CHECKSUM_VERIFICATION: true +- name: "expand-ubuntu-filesystem-to-root" + image: quay.io/tinkerbell/actions/archive2disk:latest + timeout: 90 + environment: + ARCHIVE_URL: http://192.168.1.2/ubuntu.tar.gz + ARCHIVE_TYPE: targz + DEST_DISK: /dev/sda3 + FS_TYPE: ext4 + DEST_PATH: / + INSECURE_NO_TARFILE_CHECKSUM_VERIFICATION: true ``` diff --git a/cexec/README.md b/cexec/README.md index c797127..68a4543 100644 --- a/cexec/README.md +++ b/cexec/README.md @@ -1,3 +1,7 @@ +``` +quay.io/tinkerbell/actions/cexec:latest +``` + The `cexec` action performs *execution* either within a [chroot](https://en.wikipedia.org/wiki/Chroot) environment or within the base filesystem. The primary use-case is being able to provision files/an Operating System to disk and then being able to execute something that @@ -5,14 +9,14 @@ perhaps resides within that filesystem. ```yaml actions: - - name: "Install Grub" - image: quay.io/tinkerbell-actions/cexec:v1.0.0 - timeout: 90 - environment: - BLOCK_DEVICE: /dev/sda3 - FS_TYPE: ext4 - CHROOT: y - CMD_LINE: "grub-install --root-directory=/boot /dev/sda" +- name: "Install Grub" + image: quay.io/tinkerbell/actions/cexec:latest + timeout: 90 + environment: + BLOCK_DEVICE: /dev/sda3 + FS_TYPE: ext4 + CHROOT: y + CMD_LINE: "grub-install --root-directory=/boot /dev/sda" ``` In order to execute multiple commands (seperated by a semi-colon) we will @@ -21,13 +25,13 @@ This interpreter will then parse your commands. ```yaml actions: - - name: "Update packages" - image: quay.io/tinkerbell-actions/cexec:v1.0.0 - timeout: 90 - environment: - BLOCK_DEVICE: /dev/sda3 - FS_TYPE: ext4 - CHROOT: y - DEFAULT_INTERPRETER: "/bin/sh -c" - CMD_LINE: "apt-get -y update; apt-get -y upgrade" +- name: "Update packages" + image: quay.io/tinkerbell/actions/cexec:latest + timeout: 90 + environment: + BLOCK_DEVICE: /dev/sda3 + FS_TYPE: ext4 + CHROOT: y + DEFAULT_INTERPRETER: "/bin/sh -c" + CMD_LINE: "apt-get -y update; apt-get -y upgrade" ``` diff --git a/grub2disk/README.md b/grub2disk/README.md index 406ed63..6d5858a 100644 --- a/grub2disk/README.md +++ b/grub2disk/README.md @@ -1,3 +1,7 @@ +``` +quay.io/tinkerbell/actions/grub2disk:latest +``` + The `grub2disk` mounts and writes a grub onto a block device. This lets you see a grub menu during the boot process and select OS of your choice and which is deployed in the system. As a part of the process, [chroot](https://en.wikipedia.org/wiki/Chroot) operation is also performed on `GRUB_INSTALL_PATH`. For this reason respective `volumes` as described in the below template is required. ```yaml @@ -23,7 +27,7 @@ tasks: - /boot:/boot actions: - name: "grub_2_disk" - image: grub2disk + image: quay.io/tinkerbell/actions/grub2disk:latest timeout: 180 environment: GRUB_INSTALL_PATH: /dev/sda diff --git a/image2disk/README.md b/image2disk/README.md index e473a3d..c49f9bf 100644 --- a/image2disk/README.md +++ b/image2disk/README.md @@ -1,3 +1,7 @@ +``` +quay.io/tinkerbell/actions/image2disk:latest +``` + This action will stream a remote disk image (raw) to a block device, and is mainly used to write cloud images to a disk. It is recommended to use the `qemu-img` tool to convert disk images into raw, it is also possible to compress the raw images @@ -8,13 +12,13 @@ it to the block storage disk `/dev/sda`. The raw image is uncompressed in this e ```yaml actions: - - name: "stream ubuntu" - image: quay.io/tinkerbell-actions/image2disk:v1.0.0 - timeout: 90 - environment: - IMG_URL: http://192.168.1.2/ubuntu.raw - DEST_DISK: /dev/sda - COMPRESSED: false +- name: "stream ubuntu" + image: quay.io/tinkerbell/actions/image2disk:latest + timeout: 90 + environment: + IMG_URL: http://192.168.1.2/ubuntu.raw + DEST_DISK: /dev/sda + COMPRESSED: false ``` The below example will stream a compressed raw ubuntu cloud image (converted by qemu-img) @@ -27,13 +31,13 @@ gzip ubuntu.raw ```yaml actions: - - name: "stream ubuntu" - image: quay.io/tinkerbell-actions/image2disk:v1.0.0 - timeout: 90 - environment: - IMG_URL: http://192.168.1.2/ubuntu.tar.gz - DEST_DISK: /dev/sda - COMPRESSED: true +- name: "stream ubuntu" + image: quay.io/tinkerbell/actions/image2disk:latest + timeout: 90 + environment: + IMG_URL: http://192.168.1.2/ubuntu.tar.gz + DEST_DISK: /dev/sda + COMPRESSED: true ``` ## Compression format supported: diff --git a/kexec/README.md b/kexec/README.md index 0a3d5bf..9c67786 100644 --- a/kexec/README.md +++ b/kexec/README.md @@ -1,3 +1,7 @@ +``` +quay.io/tinkerbell/actions/kexec:latest +``` + This action makes use of the kexec function that should be compiled into the tinkie kernel. This provides a faster alternative to rebooting, and allows an action to effectively jump straight into the newly provisioned Operating System @@ -13,16 +17,16 @@ understand the `CMD_LINE`. ```yaml actions: - - name: "kexec ubuntu" - image: quay.io/tinkerbell-actions/kexec:v1.0.0 - timeout: 90 - pid: host - environment: - BLOCK_DEVICE: /dev/sda3 - FS_TYPE: ext4 - KERNEL_PATH: /boot/vmlinuz - INITRD_PATH: /boot/initrd - CMD_LINE: "root=/dev/sda3 ro" +- name: "kexec ubuntu" + image: quay.io/tinkerbell/actions/kexec:latest + timeout: 90 + pid: host + environment: + BLOCK_DEVICE: /dev/sda3 + FS_TYPE: ext4 + KERNEL_PATH: /boot/vmlinuz + INITRD_PATH: /boot/initrd + CMD_LINE: "root=/dev/sda3 ro" ``` Troubleshooting: diff --git a/oci2disk/README.md b/oci2disk/README.md index bdfadfd..278421a 100644 --- a/oci2disk/README.md +++ b/oci2disk/README.md @@ -1,3 +1,7 @@ +``` +quay.io/tinkerbell/actions/oci2disk:latest +``` + This action provides the capability to stream a raw (compressed) disk image from an OCI compliant registry and write this to a block device on a server @@ -17,13 +21,13 @@ We can then use this image by referring too it with teh `IMG_URL` environment va ```yaml actions: - - name: "stream-debian-image" - image: oci2disk:v1.0.0 - timeout: 600 - environment: - DEST_DISK: /dev/nvme0n1 - IMG_URL: "192.168.0.173/test/debian:raw.gz" - COMPRESSED: true +- name: "stream-debian-image" + image: quay.io/tinkerbell/actions/oci2disk:latest + timeout: 600 + environment: + DEST_DISK: /dev/nvme0n1 + IMG_URL: "192.168.0.173/test/debian:raw.gz" + COMPRESSED: true ``` ## Compression format supported: diff --git a/qemuimg2disk/README.md b/qemuimg2disk/README.md index 2a931cf..3d7f207 100644 --- a/qemuimg2disk/README.md +++ b/qemuimg2disk/README.md @@ -1,3 +1,7 @@ +``` +quay.io/tinkerbell/actions/qemuimg2disk:latest +``` + This action will stream a remote disk image to a block device, and is mainly used to write cloud images to a disk. @@ -12,10 +16,10 @@ directly from Canonical onto block storage disk `/dev/sda` like so: ```yaml actions: - - name: "stream ubuntu" - image: quay.io/tinkerbell-actions/qemuimg2disk:v1.0.0 - timeout: 300 - environment: - IMG_URL: https://cloud-images.ubuntu.com/daily/server/focal/current/focal-server-cloudimg-amd64.img - DEST_DISK: /dev/sda +- name: "stream ubuntu" + image: quay.io/tinkerbell/actions/qemuimg2disk:latest + timeout: 300 + environment: + IMG_URL: https://cloud-images.ubuntu.com/daily/server/focal/current/focal-server-cloudimg-amd64.img + DEST_DISK: /dev/sda ``` diff --git a/rootio/README.md b/rootio/README.md index d3bfac3..041cf6b 100644 --- a/rootio/README.md +++ b/rootio/README.md @@ -1,3 +1,7 @@ +``` +quay.io/tinkerbell/actions/rootio:latest +``` + This action can be used in a variety of ways, however its core functionality is the management of disks. The action parses the metadata and will partition, format and mount disks @@ -9,24 +13,24 @@ have their actions determined by the contents of the storage section in the meta ```yaml actions: - - name: "disk-wipe-partition" - image: quay.io/tinkerbell-actions/rootio:v1.0.0 - timeout: 90 - command: ["partition"] - environment: - MIRROR_HOST: 192.168.1.2 - - name: "format" - image: quay.io/tinkerbell-actions/rootio:v1.0.0 - timeout: 90 - command: ["format"] - environment: - MIRROR_HOST: 192.168.1.2 - - name: "mount" - image: quay.io/tinkerbell-actions/rootio:v1.0.0 - timeout: 90 - command: ["mount"] - environment: - MIRROR_HOST: 192.168.1.2 +- name: "disk-wipe-partition" + image: quay.io/tinkerbell/actions/rootio:latest + timeout: 90 + command: ["partition"] + environment: + MIRROR_HOST: 192.168.1.2 +- name: "format" + image: quay.io/tinkerbell/actions/rootio:latest + timeout: 90 + command: ["format"] + environment: + MIRROR_HOST: 192.168.1.2 +- name: "mount" + image: quay.io/tinkerbell/actions/rootio:latest + timeout: 90 + command: ["mount"] + environment: + MIRROR_HOST: 192.168.1.2 ``` **Advanced** @@ -37,13 +41,13 @@ an environment variable to rootio for `partition` options. ```yaml actions: - - name: "disk-wipe-partition" - image: quay.io/tinkerbell-actions/rootio:v1.0.0 - timeout: 90 - command: ["partition"] - environment: - MIRROR_HOST: 192.168.1.2 - MBR: true +- name: "disk-wipe-partition" + image: quay.io/tinkerbell/actions/rootio:latest + timeout: 90 + command: ["partition"] + environment: + MIRROR_HOST: 192.168.1.2 + MBR: true ``` This also supports an extended version of CPR: diff --git a/slurp/README.md b/slurp/README.md index 785b8a3..96244a7 100644 --- a/slurp/README.md +++ b/slurp/README.md @@ -1,3 +1,7 @@ +``` +quay.io/tinkerbell/actions/slurp:latest +``` + This action will stream the contents of a block device to a remote server allowing a user to easily make a copy of a remote server. This newly created disk image can be replicated to easily provision other servers. @@ -12,14 +16,14 @@ a remote server. ```yaml actions: - - name: "slurp_ubuntu" - image: quay.io/tinkerbell-actions/slurp:v1.0.0 - timeout: 90 - environment: - DEST_URL: http://192.168.1.2:3000/image - SOURCE_DISK: /dev/sda - IMG_NAME: ubuntu_wordpress - COMPRESSED: false +- name: "slurp_ubuntu" + image: quay.io/tinkerbell/actions/slurp:latest + timeout: 90 + environment: + DEST_URL: http://192.168.1.2:3000/image + SOURCE_DISK: /dev/sda + IMG_NAME: ubuntu_wordpress + COMPRESSED: false ``` **Note** the `DEST_URL`, the slurp action has a server that can be used with this action. diff --git a/syslinux/README.md b/syslinux/README.md index daa83ff..70cd62f 100644 --- a/syslinux/README.md +++ b/syslinux/README.md @@ -1,3 +1,7 @@ +``` +quay.io/tinkerbell/actions/syslinux:latest +``` + This action can be used to install syslinux as a boot loader, in two parts it will install the MBR at `DEST_DISK` and install the boot loader on the specified partition at `DEST_PARTITION`. Currently the only version of syslinux available is @@ -10,11 +14,11 @@ filesystem (on the specified partition). ```yaml actions: - - name: "install syslinux to /dev/sda" - image: quay.io/tinkerbell-actions/syslinux:v1.0.0 - timeout: 90 - environment: - DEST_DISK: /dev/sdb - DEST_PARTITION: /dev/sdb1 - SYSLINUX_VERSION: 3.86 +- name: "install syslinux to /dev/sda" + image: quay.io/tinkerbell/actions/syslinux:latest + timeout: 90 + environment: + DEST_DISK: /dev/sdb + DEST_PARTITION: /dev/sdb1 + SYSLINUX_VERSION: 3.86 ``` diff --git a/writefile/README.md b/writefile/README.md index 212e573..b9b5fc9 100644 --- a/writefile/README.md +++ b/writefile/README.md @@ -1,3 +1,7 @@ +``` +quay.io/tinkerbell/actions/writefile:latest +``` + This action will mount a block device and write a file to a destination path on it's filesystem. @@ -5,16 +9,16 @@ The below example will write a file to the filesystem on the block device `/dev/ ```yaml actions: - - name: "expand ubuntu filesystem to root" - image: quay.io/tinkerbell-actions/writefile:v1.0.0 - timeout: 90 - environment: - DEST_DISK: /dev/sda3 - FS_TYPE: ext4 - DEST_PATH: /etc/myconfig/foo - CONTENTS: hello-world - UID: 0 - GID: 0 - MODE: 0600 - DIRMODE: 0700 +- name: "expand ubuntu filesystem to root" + image: quay.io/tinkerbell/actions/writefile:latest + timeout: 90 + environment: + DEST_DISK: /dev/sda3 + FS_TYPE: ext4 + DEST_PATH: /etc/myconfig/foo + CONTENTS: hello-world + UID: 0 + GID: 0 + MODE: 0600 + DIRMODE: 0700 ```