Skip to main content

Symphony k8s deployment tools

Project description

Morgan Stanley makes this available to you under the Apache License, Version 2.0 (the "License"). You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Symphony on K8s Hostfactory Provider

This provider extends IBM Symphony hostfactory custom provider to provide the necessary functionality for hostfactory to provision Symphony compute nodes on Kubernetes.

Overview

IBM Symphony hostfactory is a service that runs as part of IBM Symphony Orchestrator. The hosfactory service manages compute host bursting to public cloud. Hostfactory provides custom provider extension to allow usecase specific implementation of the host provider. Hostfactory overview.

screenshot

Prerequisites

The plugin should be installed as part of an IBM Symphony deployment with the necessary credentials/capabilities to deploy pods on a Kubernetes cluster.

Provider installation

The provider scripts k8s-hf should be part of the ${HF_CONFDIR} under Symphony and hostProviderPlugins.json should add the plugin name:

{
    "version": 2,
    "providerplugins": [
        {
            "name": "k8s-hf",
            "enabled": 1,
            "scriptPath": "${HF_CONFDIR}/providers/k8s-hf/scripts/"
        }
    ]
}

as for the script files and hostProviders.json they should be copied under ${HF_CONFDIR} in the following tree structure

├── providers
│   ├── hostProviders.json
│   └── k8s-hf
│       └── scripts
│           ├── getAvailableTemplates.sh
│           ├── getRequestStatus.sh
│           ├── getReturnRequests.sh
│           ├── requestMachines.sh
│           └── requestReturnMachines.sh

built python binaries should be part of $PATH in the runtime environment.

Provider mechanism

The Symphony on K8s provider implements multiple processes to allow the interface to invoke Kubernetes API for Pod/Host management asynchronously. The process that should be running as part of the runtime environment:

  • hostfactory watch request-machines Watches hostfactory provider requests and creates the pods.
  • hostfactory watch request-return-machines Watches hostfactory provider return requests and deletes the pods.
  • hostfactory watch pods Watches the kubernetes event loop for new/modified/deleted pods and captures them on disk.

Installation

Today, the only supported python version is 3.12.

pip install hostfactory

Pod spec

An example pod spec can be found at example pod spec

Running the provider

Supposing you have a valid kubernetes config, the following commands will schedule a pod.

mkdir /tmp/hostfactory
hostfactory-admin request-machines | hostfactory --configdir config_example/ request-machines
hostfactory watch request-machines

Testing

Common Requirements

A python venv containing the necessary dependencies can be created using the following command:

./create_dev_venv.sh
source .venv/bin/activate

Unit tests

Running the tests

The unit tests are written using pytest and can be run using the following command:

pytest src/hostfactory/tests/unit

Integration tests

Requirements

In order to test the provider, a Kubernetes cluster should be available with a valid kube config in any of the standard directories or environment variables.

The workdir which default to /var/tmp/hostfactory also needs to be writable.

Running the tests

The unit tests are written using pytest and can be run using the following command:

pytest src/hostfactory/tests/regression

Feedback

Please contact hpc-symphony-k8s@morganstanley.com for any questions.

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

hostfactory-0.0.3.post2.tar.gz (123.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hostfactory-0.0.3.post2-py3-none-any.whl (62.3 kB view details)

Uploaded Python 3

File details

Details for the file hostfactory-0.0.3.post2.tar.gz.

File metadata

  • Download URL: hostfactory-0.0.3.post2.tar.gz
  • Upload date:
  • Size: 123.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for hostfactory-0.0.3.post2.tar.gz
Algorithm Hash digest
SHA256 4524765951aed83891149f5bed8ac5c62e5cb3b2fc617f3378c4e1234b42bdb0
MD5 e6a1f2426493bd8e9f09a6871b761ae2
BLAKE2b-256 bd7e5e878fbdbad3c9538ed3b34029f9440e8598fd9f06a691b7b7ec3ccc91b9

See more details on using hashes here.

File details

Details for the file hostfactory-0.0.3.post2-py3-none-any.whl.

File metadata

File hashes

Hashes for hostfactory-0.0.3.post2-py3-none-any.whl
Algorithm Hash digest
SHA256 ea3baa3c1f8fcd97f2b68a3cb73c93e029bccc06bffb75ee4653c6462237cccb
MD5 fb9b492478ec57cde014d27d6577de98
BLAKE2b-256 eb4161373f54a846a78296962a14139f3f24c017d2b8f1d4ee0bc84ced151a7c

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