Scripts and templates to build recommended images for the HyperOne platform and compatible with it.
Repository includes following category of recommended images:
- Recommended images with Linux software - Packer builded
- Recommended images with Microsoft software
- Recommended images with RedHat software - Packer builded
There are the following elements
render.js- script responsible for generating Packer templates files from spec inconfigdirectorybuildTestPublish.js- script responsible for build & test & publish Packer & Windows images according toconfigand templatesconfig- config and spec files for imagestemplates- Packer template settemplates/builder-*.json- Packer templates of image of the virtual machine used when building imagestemplates/qcow-render.js-managed Packer templates -templates/manual- manual-managed Packer templates non-generated viarender.jstemplates/autounattend-render.js
All Packer templates create Image by running builder VM with additional Disk and using a chroot environment to provision that Disk. Then attach that Disk to new Virtual Machine to create clean Image.
- build an Image with the operating system that is first run by the user
- introducing minimal changes to the systems
- full automation of the process to ensure the minimum cost of maintaining of update
- for operating systems that support SELinux - keep it enabled
- follow rules outlined in:
Prerequisites:
- current version of Packer is required which supports
hyperonebuilder - basic Packer knowledge
- HyperOne-specific Packer knowledge
Most of images require available in consumer-project builder image. To create one use following command:
packer build qcow/builder-fedora.jsonNext to build any other template eg.:
packer build templates/qcow/fedora-29.json.github/render_matrix.js- regenerate build matrix for GitHub Actionsrun_tests.sh- performs basic tests of the correct operation of the imagebuildTestPublish.js- build & test & publish image
First create SSH key-pair in resources/ssh/id_rsa:
ssh-keygen -f resources/ssh/id_rsaThen upload SSH keys available in project as builder-ssh:
h1 project credentials add --name builder-ssh --sshkey-file ./resources/ssh/id_rsa.pubFinally you can use run_tests.sh or buildTestPublish.js to manage images.
To build recommended images you need ISO with appropriate Autounattend.xml file
Autounattend.xml can be found in resources/autounattend
To prepare new ISO use any software for editing iso and place proper Autounattend.xml file in root of the standard MS Windows Installator iso. For example:
wine ./oscdimg.exe -lAIO_OS -u2 -m -bz:\\mnt\\iso\\boot\\etfsboot.com z:\\mnt\\iso z:\\mnt\\Win8.iso
For details of usage, see Oscdimg Command-Line Options.
Files is repo are named to know for which distro they are, ie. Autounattend-Datacenter-Core.xml, but file on iso has to be named Autounattend.xml only.
Autounattend.xml files use script found in resources/powershell .
Build container for builder using following command:
docker build -f Dockerfile.windows -t h1cr.io/h1-images-recommended-windows:2 .Build image using service account using following command:
docker run -e H1_TOKEN="..." h1cr.io/h1-images-recommended-windows:2 nodejs buildTestPublish.js --mode 'windows' --config ./config/windows/windows-server-2016-dc-core.yaml;- docker
- git
- jq