Skip to main content

vpc-img-inst is a lightweight script for quick-and-dirty generation of custom VSI images by installing features (software bundles) on base images.

Project description

Image Installer For IBM-VPC

vpc-img-inst is a lightweight script for quick-and-dirty generation of custom VSI images by installing features (software bundles) on base images.

Setup

Mostly tested with Fedora 35/37 and Ubuntu 20/22, but should work with most Linux and Mac systems.

Requirements

  • ssh-keygen utility - available as part of the Open SSH client.
  • Python3.

Installation

Run: pip install vpc-img-inst
Following installation, a directory containing various scripts will be created in ~/.vpc-img-inst.

Upgrading

When 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, whl files can't be used, instead opting to use the downloaded tar instead.

Usage

  • Create 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 --help

Examples

  • vpc-img-inst -a <API_KEY> -y -f cuda -it rhel -im ibm-redhat-8-6
    Create a custom image of CUDA on RHEL 8.6
  • vpc-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 --help
    Get a short description of the available flags via
  • vpc-img-inst -c <PATH_TO_FILE>
    Clean-up a previously failed execution (see Cleanup)

Flags Detailed Description

Note - Flag values are case sensitive.
For example --feature cuda != --feature CUDA.

Key Default Mandatory Additional info
iam-api-key NA yes IBM Cloud API key. To generate a new API Key adhere to the following guide
output-folder /temp//logs/ no Path to folder storing IDs of resources created by this program and installation logs
version NA no Returns vpc-img-inst's package version
region eu-de no Geographical location for deployment and scope for available resources by the IBM-VPC service. Regions are listed here.
base-image-name ibm-ubuntu-22-04-4-minimal-amd64-2 no Prefix of an image name from your account, on which the produced image will be based. Could be either an IBM stock image as explained here or a custom image.
installation-type ubuntu no type of installation to use, e.g. for feature cuda the currently supported types are: ubuntu and rhel.
feature cuda no Feature to install on the produced image. Currently supporting: cuda and docker.
cleanup NA no Path to a resources file, that will be submitted for deletion. Program will be terminated subsequently.
compute_iam_endpoint https://iam.cloud.ibm.com no Alternative IAM endpoint url for the cloud provider, e.g. https://iam.test.cloud.ibm.com

Extendability

To extend the features/installation types this program support, please follow the next steps:

  1. To add a new feature, inside ~/.vpc-img-inst, create a folder named after the feature in camel case format, e.g nodeJS.
  2. 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-up

All 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-up

To 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vpc-img-inst-1.0.0b12.tar.gz (30.8 kB view details)

Uploaded Source

File details

Details for the file vpc-img-inst-1.0.0b12.tar.gz.

File metadata

  • Download URL: vpc-img-inst-1.0.0b12.tar.gz
  • Upload date:
  • Size: 30.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for vpc-img-inst-1.0.0b12.tar.gz
Algorithm Hash digest
SHA256 5d9ead74bc20d0046551001f4b72a7b26e937e69308d0dff71f17cb432169068
MD5 c95f0f88e80a8fae516c08ff0d4ad755
BLAKE2b-256 bc5cd50e56141521e5394dcd888d4ac68b9956ab37de290b164f880d106b0dfb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page