Package: vpc-img-inst
Image Installer For IBM-VPCvpc-img-instis a lightweight script for quick-and-dirty generation of custom VSI images by installing features (software bundles) on base images.For an overview and a quick start consider reading ourblog.SetupMostly tested with Fedora 35/37 and Ubuntu 20/22, but should work with most Linux and Mac systems.Requirementsssh-keygenutility - available as part of the Open SSH client.Python3.InstallationRun:pip install vpc-img-instFollowing installation, a directory containing various scripts will be created in~/.vpc-img-inst.UpgradingWhen upgrading to a newer version, to get an updated version of the scripts, it's important the keep the following points in mind:Delete~/.vpc-img-inst, as existing directories won't be replaced to avoid overwriting user scripts.Upgrade using the following flags:pip install --no-cache-dir -U vpc-img-inst.Technical reasoning: for the tool to execute commands post the pip install phase,whlfiles can't be used, instead opting to use the downloadedtarinstead.UsageCreate a new custom image:vpc-img-inst [--iam-api-key IAM_API_KEY] [--region REGION] [-o OUTPUT_FOLDER] [-f FEATURE] [-im BASE_IMAGE_NAME] [-it INSTALLATION_TYPE] [--compute-iam-endpoint IAM_ENDPOINT] [-y] 
[--cleanup PATH_TO_RESOURCES_FILE][--version] [--help]vpc-img-inst --helpExamplesvpc-img-inst -a <API_KEY> -y -f cuda -it rhel -im ibm-redhat-8-6Create a custom image of CUDA on RHEL 8.6vpc-img-inst -a <API_KEY> -y -f docker -f cuda -it ubuntu(using default base image)Create a custom image of Docker and CUDA on Ubuntu (default 22.4)vpc-img-inst --helpGet a short description of the available flags viavpc-img-inst -c <PATH_TO_FILE>Clean-up a previously failed execution (seeCleanup)Flags Detailed DescriptionNote - Flag values are case sensitive.For example--feature cuda!=--feature CUDA.KeyDefaultMandatoryAdditional infoiam-api-keyNAyesIBM Cloud API key. To generate a new API Key adhere to the followingguideoutput-folder/temp//logs/noPath to folder storing IDs of resources created by this program and installation logsversionNAnoReturns vpc-img-inst's package versionregioneu-denoGeographical location for deployment and scope for available resources by the IBM-VPC service. Regions are listedhere.base-image-nameibm-ubuntu-22-04-4-minimal-amd64-2noPrefix of an image name from your account, on which the produced image will be based. Could be either an IBM stock image as explainedhereor a custom image.installation-typeubuntunotype of installation to use, e.g. for feature cuda the currently supported types are: ubuntu and rhel.featurecudanoFeature to install on the produced image. Currently supporting: cuda and docker.cleanupNAnoPath to a resources file, that will be submitted for deletion. Program will be terminated subsequently.compute_iam_endpointhttps://iam.cloud.ibm.comnoAlternative IAM endpoint url for the cloud provider, e.g.https://iam.test.cloud.ibm.comExtendabilityTo extend the features/installation types this program support, please follow the next steps:To add a new feature, inside~/.vpc-img-inst, create a folder named after the feature in camel case format, e.g nodeJS.to add new installation type, inside a feature's folder add a new installation type by adding a script with the following naming format:install_<FeatureName>_<installation_type>.sh, e.g. "install_cuda_ubuntu.sh".Clean-upAll resources created during the execution of the program will be automatically removed and unregistered from the IBM-VPC (apart from the created image). This process also takes place upon a failed run.Manual clean-upTo manually remove byproduct resources run:vpc-img-inst -c <path_to_resources_file>.Users may have to resort to running this command in the odd occasion where this program fails to remove its byproducts.The path to the resources file is printed at the start of the execution.Execution Example