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

  • pip install vpc-img-inst
    Following installation, a directory containing various scripts will be created in ~/.vpc-img-inst.
    Note - the directory will not be created or overwritten if it already exists.

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-8 -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-22 (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.0b9.tar.gz (30.1 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: vpc-img-inst-1.0.0b9.tar.gz
  • Upload date:
  • Size: 30.1 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.0b9.tar.gz
Algorithm Hash digest
SHA256 e5e6ac2c89862ae302809c9f25ac1c5069851baba61be1d531e0f00b9df85763
MD5 a7f30273937b5a63fecad0e9bc8b3134
BLAKE2b-256 7ab1016e943d90607f0eef30382b98dbce5a9db7cf915f04e92ba338924d5a1c

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