-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for otk-defined distributions (COMPOSER-2299) #797
base: main
Are you sure you want to change the base?
Commits on Jul 16, 2024
-
manifest: make distro field private
Make the distro field of the manifest.Manifest struct private and make sure it's set using the manifest.New() constructor. The intention is to make manifest.Manifest an interface and getting rid of private fields is the first step towards this.
Configuration menu - View commit details
-
Copy full SHA for 6bcc552 - Browse repository at this point
Copy the full SHA 6bcc552View commit details -
manifest: introduce the Manifest interface
manifest.Manifest is now an interface with one implementation called IntManifest (Internal Manifest), which is the previous Manifest type. All functions that interact with pointers to the old concrete Manifest type now interact with the interface instead.
Configuration menu - View commit details
-
Copy full SHA for 5606526 - Browse repository at this point
Copy the full SHA 5606526View commit details -
manifest: add OTKManifest type
The OTKManifest is a second implementation of the manifest.Manifest interface that will be used to generate manifests from otk yaml files. The type only implements the Serialize() method. None of the other methods are important (at least for now). The content spec methods in particular are not needed since otk will handle content resolution (depsolving, container and ostree commit resolves) itself.
Configuration menu - View commit details
-
Copy full SHA for 4fcdcd7 - Browse repository at this point
Copy the full SHA 4fcdcd7View commit details -
test: add some minimal otk yaml files for testing
The directory structure follows the assumptions of the test_otk_distro.
Configuration menu - View commit details
-
Copy full SHA for d026031 - Browse repository at this point
Copy the full SHA d026031View commit details -
New package that loads a distribution from otk yaml files. Distribution-level properties, like name, codename, versions, etc, are loaded from a file called 'properties.yaml' in the root of the distribution's directory. An error is returned if this file is missing or if any of the required properties are undefined/empty. The distro creates a distro->arch->imagetype hierarchy based on the contents of the filesystem tree. It assumes a directory structure `<distroid>/<archname>/<imagetypename>.yaml`. For example: fedora-40/ properties.yaml x86_64/ qcow2.yaml ami.yaml aarch64/ qcow2.yaml The top-level directory is used as the unique distro ID, whereas the name is defined in the properties.yaml. The distinction is useful for separating the on-disk, unique ID of a distro from the display name.
Configuration menu - View commit details
-
Copy full SHA for 7dbd510 - Browse repository at this point
Copy the full SHA 7dbd510View commit details -
otkdistro: add a basic distro load test
Test that the distro is loaded with the expected properties, arches, and image types.
Configuration menu - View commit details
-
Copy full SHA for db3ff83 - Browse repository at this point
Copy the full SHA db3ff83View commit details -
otkdistro: add DistroFactory()
Add the DistroFactory() function to otkdistro, which will enable loading distros defined using otk files alongside the internally defined ones using the same mechanism. The root of the otk path is hard-coded to "./otk", but we will have to make this configurable.
Configuration menu - View commit details
-
Copy full SHA for 74c07e8 - Browse repository at this point
Copy the full SHA 74c07e8View commit details -
distrofactory: add the otkdistro DistroFactory
With this addition, for every file found in the repository configuration path (for this project, "test/data/repositories/" by default), the distrofactory will try to load an otk distro at "otk/<distroid>/".
Configuration menu - View commit details
-
Copy full SHA for b8f887f - Browse repository at this point
Copy the full SHA b8f887fView commit details -
manifest: add Blueprint to OTKManifest
When initialising an OTKManifest, add the Blueprint to it as well, so we can create variables (defines, modifications) based on it before compiling.
Configuration menu - View commit details
-
Copy full SHA for ac0442a - Browse repository at this point
Copy the full SHA ac0442aView commit details -
pkg: add otk for handling otk-related things
New otk package for managing otk-related things. The otkCustomizationsFile type handles creating an otk file with defines for customizations and a single otk.include. The purpose is to use this to create a 'customizations.yaml' file that 'otk.define's all the variables represented by a blueprint then 'otk.include' the file we want to compile, effectively setting variables defined by the user in the compilation of the manifest. Currently it only writes a few simple customizations as a proof of concept, but it will grow to cover all potential customizations.
Configuration menu - View commit details
-
Copy full SHA for 7cee8d4 - Browse repository at this point
Copy the full SHA 7cee8d4View commit details -
manifest: create customizations file when serializing
When serializing an OTKManifest, create a customizations file that includes 'otk.define's to represent the options of a blueprint, then 'otk.include' the original entrypoint to generate a manifest with the user customizations included.
Configuration menu - View commit details
-
Copy full SHA for ffaa1a6 - Browse repository at this point
Copy the full SHA ffaa1a6View commit details -
otk: add test for customizations file creation
Define the expected file contents as a map[string]interface{} and deserialize the file contents before comparing for convenience and nicer error output (compared to strings).
Configuration menu - View commit details
-
Copy full SHA for 23c85bf - Browse repository at this point
Copy the full SHA 23c85bfView commit details -
manifest: test otk serialization
Add tests for otk serialization with some simple blueprint customizations. The entrypoint contents and expected serialized manifests are defined as map[string]interface for convenience and nicer error output (compared to strings).
Configuration menu - View commit details
-
Copy full SHA for 318c8eb - Browse repository at this point
Copy the full SHA 318c8ebView commit details -
otkdistro: create test distro dynamically
Remove test/otk/fakedistro and instead create it when running the unit test. This will make it easier to evolve the test to cover more features.
Configuration menu - View commit details
-
Copy full SHA for 9b1a67c - Browse repository at this point
Copy the full SHA 9b1a67cView commit details