tools/import-stx.README
Luis Sampaio 52ef35d1bf Update Debian build system to support Kubernetes
Extends the build tools to add support to Kubernetes. For kubernetes,
it supports single node cluster and host path for the volumes.

New environment variables:
- PROJECT: build project name
- STX_PLATFORM:  minikube or kubernetes
- STX_BUILD_CPUS: replaces MINIKUBECPUS
- STX_K8S_NAMESPACE: kubernetes namespace name
* Default values are set to minikube, more details added in
import-stx.README.

To deploy stx on k8s you need to follow the below steps:

- create k8s namespace
- export PROJECT, included to support multiproject environments it is
used by the new default build home and also for docker tagging.
- export STX_BUILD_HOME, e.g: /localdisk/user/$PROJECT
- export STX_K8S_NAMESPACE="namespace_name"
- export STX_PLATFORM="kubernetes"
- export KUBECONFIG to your kubernetes config file
- STX_BUILD_CPUS replaces MINIKUBECPUS, this variable is used
by build-pkgs parallel jobs ($MAX_CPUS)
- Create your build home $STX_BUILD_HOME
- Init repo & repo sync
- source import-stx, check the env variables
- stx-init-env
- stx control status/start/stop/enter

Test Plan:

Pass: Create env on minikube
Pass: Create env on Kubernetes
Pass: Apply patch on current minikube env and continue to work on the
environment without issues
Pass: build package on Debian
Pass: build Debian image

Story: 2009812
Task: 44391

Signed-off-by: Luis Sampaio <luis.sampaio@windriver.com>
Change-Id: I7b760fbf1454f6aa90dd93dd9ff3a61d5fbd1b5c
2022-02-11 11:05:12 -08:00

70 lines
1.8 KiB
Plaintext

import-stx: Import StarlingX build environment and stx tool
For more information: https://wiki.openstack.org/wiki/StarlingX/DebianBuildEnvironment
###############################################
# STX Environment variables
###############################################
$PROJECT
* Required
* Project name, used by docker image tagging for multiuser/multiproject environments. It is also used on the
default STX_BUILD_HOME path.
$STX_PLATFORM
* Required for Kubernetes.
* Platforms supported: "minikube" and "kubernetes"
* Default value: "minikube"
$STX_BUILD_HOME
* Optional
* Default value: "/localdisk/designer/$USER/$PROJECT"
* Working directory for the build.
$STX_BUILD_CPUS
* Optional
* Default value: 6
* Number of cpus that build-pkgs can use for parallel jobs, in a minikube environment this option is also used
to set the minikube cluster cpus.
###############################################
# Minikube only
###############################################
$MINIKUBENAME
* Optional
* Default value: minikube-$USER-upstream
* Sets the minikube cluster profile name.
$MINIKUBE_HOME
* Optional
* Default value: $HOME
* Sets the path for the .minikube and .kube directories that minikube uses for state/configuration.
$MINIKUBEMEMORY
* Optional
* Default value: 16000
* Amount of memory available for the minikube cluster.
###############################################
# Kubernetes only
###############################################
$STX_K8S_NAMESPACE
* Required
* Kubernetes namespace name for your project, currently each namespace can host 1 stx deployment. Namespace must
be created and access setup prior to sourcing import-stx and starting your build environment.
$KUBECONFIG
* Optional
* Default value: $STX_BUILD_HOME/.kube/config
* Path to your Kubernetes config file.