kubernetes: remove all support
These scripts have been untouched for 3 years and not known
to be used by anyone. The scripts are a mess w.r.t. shellcheck
warning and do not seem worth fixing. Deleteing the entire
tree.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I0fbb1805e9da624bd35ef56aac80fdab68080088
diff --git a/build-jenkins.sh b/build-jenkins.sh
index 3c134cc..d234a16 100755
--- a/build-jenkins.sh
+++ b/build-jenkins.sh
@@ -260,8 +260,4 @@
--env JENKINS_OPTS=\""${jenkins_options}"\" \
"${img_name}"
-elif [[ ${launch} == "k8s" ]]; then
- # launch using the k8s template
- # shellcheck source=kubernetes/kubernetes-launch.sh
- source "${build_scripts_dir}/kubernetes/kubernetes-launch.sh" Build-Jenkins false false
fi
diff --git a/kubernetes/Jenkins-JNLP-Slave-Agent/Dockerfile b/kubernetes/Jenkins-JNLP-Slave-Agent/Dockerfile
deleted file mode 100644
index 46c6818..0000000
--- a/kubernetes/Jenkins-JNLP-Slave-Agent/Dockerfile
+++ /dev/null
@@ -1,28 +0,0 @@
-# Dockerfile for x86_64 Jenkins JNLP Slave Agent Container with Kubectl and Docker Installed
-
-FROM jenkinsci/jnlp-slave
-
-USER root
-
-# Download and install Kubectl
-RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s \
- https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \
- && chmod +x ./kubectl \
- && mv ./kubectl /usr/local/bin/kubectl
-
-# install Docker and grant access to Jenkins user
-RUN apt-get update && apt-get install -yy \
- apt-transport-https \
- ca-certificates \
- software-properties-common
-
-RUN add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable" \
- && apt-get update \
- && apt-get install -yy --allow-unauthenticated docker-ce \
- && groupmod --gid 999 docker
-
-RUN usermod -a -G docker jenkins
-
-USER jenkins
-
-ENTRYPOINT ["jenkins-slave"]
diff --git a/kubernetes/README.md b/kubernetes/README.md
deleted file mode 100644
index a409f84..0000000
--- a/kubernetes/README.md
+++ /dev/null
@@ -1,54 +0,0 @@
-Running Builds Script with Kubernetes
-=====================================
-
-The following are required to run scripts with Kubernetes integration:
-- Access to a Kubernetes cluster.
-- External storage that is mountable to the Kubernetes cluster.
-- Kubectl installed and configured on the machine running the scripts.
-
-All the scripts use a similar formula to launch to Kubernetes:
-1. The script is run with a valid launch variable in the environment.
-2. The script then invokes the [kubernetes-launch.sh](https://github.com/openbmc/openbmc-build-scripts/tree/master/kubernetes/kubernetes-launch.sh)
- script by sourcing it.
-3. The launch script then uses the template to generate the appropriate YAML file.
-4. The generated YAML is then used to launch the object into the specified Kubernetes cluster.
-5. Once the object is launched the script will end or will do optional tailing of the logs or
- deletion of the object from the API once Docker container run completes.
-
-The steps to run the script with Kubernetes integration are also similar for all scripts:
-1. Look at the variables used by the script and by the templates.
-2. Export the variables that you would like to be different from the defaults in the script,
- kubernetes-launch-script, and template. Alternatively, you can edit the defaults in the files
- locally.
-3. Run the script.
-
-## OpenBMC Build
-- Script: [build-setup.sh](https://github.com/openbmc/openbmc-build-scripts/blob/master/build-setup.sh)
-- Templates: [OpenBMC-build-job.yaml](https://github.com/openbmc/openbmc-build-scripts/tree/master/kubernetes/Templates/OpenBMC-build-job.yaml)
- or [OpenBMC-build-pod.yaml](https://github.com/openbmc/openbmc-build-scripts/tree/master/kubernetes/Templates/OpenBMC-build-pod.yaml)
-
-## QEMU build
-- Script: [qemu-build.sh](https://github.com/openbmc/openbmc-build-scripts/blob/master/qemu-build.sh)
-- Templates: [QEMU-build-job.yaml](https://github.com/openbmc/openbmc-build-scripts/tree/master/kubernetes/Templates/QEMU-build-job.yaml)
- or [QEMU-build-pod.yaml](https://github.com/openbmc/openbmc-build-scripts/tree/master/kubernetes/Templates/QEMU-build-pod.yaml)
-
-## Useful links:
-Kubernetes (K8s) is an open source container orchestration system.
-- [Kubernetes Repo](https://github.com/kubernetes/kubernetes)
-
-If you would like to know more regarding Kubernetes look over these:
-- [Concepts](https://kubernetes.io/docs/concepts/)
-- [API Documentation v1.5](https://kubernetes.io/docs/api-reference/v1.5/)
-- [API Documentation v1.6](https://kubernetes.io/docs/api-reference/v1.6/)
-
-## Persistent Data Storage
-Since Kubernetes works using various nodes to run the builds it is best to use NFS or GlusterFS
-storage so that data will not be bound to one machine directly. This lets us not care about what
-node is currently running the container while maintaining access to the data we want.
-
-PVs and PVCs are the way Kubernetes Mounts directories to containers. A script used to launch an NFS
-mount PV and PVC pair can be found [here](https://github.com/openbmc/openbmc-build-scripts/kubernetes/storage-setup.sh "Storage Setup Script").
-There is one caveat to using external storage mounts, the folders used to do the actual build cannot
-be mounted to an external file system.
-- [Persitent Volume (pv)](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistent-volumes)
-- [Persistent Volume Claim (pvc)](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims)
diff --git a/kubernetes/Templates/Build-Jenkins-k8s.yaml b/kubernetes/Templates/Build-Jenkins-k8s.yaml
deleted file mode 100644
index 44b52e7..0000000
--- a/kubernetes/Templates/Build-Jenkins-k8s.yaml
+++ /dev/null
@@ -1,65 +0,0 @@
-apiVersion: extensions/v1beta1
-kind: Deployment
-metadata:
- name: ${deploy_name}
- namespace: openbmc
- labels:
- app: ${deploy_name}
-spec:
- replicas: 1
- selector:
- matchLabels:
- app: ${deploy_name}
- template:
- metadata:
- labels:
- app: ${deploy_name}
- spec:
- volumes:
- - name: config
- persistentVolumeClaim:
- claimName: ${h_claim}
- containers:
- - env:
- - name: JAVA_OPTS
- value: ${java_options}
- - name: JENKINS_OPTS
- value: ${jenkins_options}
- name: ${pod_name}
- image: ${img_name}
- ports:
- - containerPort: ${http_port}
- protocol: TCP
- name: ui
- - containerPort: ${agent_port}
- protocol: TCP
- name: slave-listener
- resources: {}
- volumeMounts:
- - name: config
- mountPath: ${j_home}
- nodeSelector:
- beta.kubernetes.io/arch: ${ARCH}
----
-apiVersion: v1
-kind: Service
-metadata:
- labels:
- app: jenkins-master
- name: jenkins-master
- namespace: openbmc
-spec:
- clusterIP: ${cluster_ip}
- ports:
- - name: ui
- port: ${http_port}
- nodePort: ${http_nodeport}
- protocol: TCP
- - name: slave-listener
- port: ${agent_port}
- nodePort: ${agent_nodeport}
- protocol: TCP
- selector:
- app: jenkins-master
- sessionAffinity: None
- type: NodePort
diff --git a/kubernetes/Templates/OpenBMC-build-job-v2.yaml b/kubernetes/Templates/OpenBMC-build-job-v2.yaml
deleted file mode 100644
index a6719c7..0000000
--- a/kubernetes/Templates/OpenBMC-build-job-v2.yaml
+++ /dev/null
@@ -1,48 +0,0 @@
-apiVersion: batch/v1
-kind: Job
-metadata:
- name: openbmc${BUILD_ID}-${target}
- namespace: ${namespace}
- labels:
- app: openbmc
- stage: build
-spec:
- template:
- metadata:
- name: ${pod_name}
- labels:
- target: ${target}
- spec:
- nodeSelector:
- beta.kubernetes.io/arch: ${ARCH}
- volumes:
- - name: workspace
- persistentVolumeClaim:
- claimName: ${w_claim}
- - name: ssc-dir
- persistentVolumeClaim:
- claimName: ${s_claim}
- restartPolicy: Never
- hostNetwork: True
- containers:
- - image: ${img_name}
- name: builder
- command: ["/bin/bash","-c"]
- args: ["sleep 2h"]
- workingDir: ${HOME}
- env:
- - name: WORKSPACE
- value: ${WORKSPACE}
- - name: build-dir
- value: ${build_dir}
- securityContext:
- capabilities:
- add:
- - SYS_ADMIN
- volumeMounts:
- - name: workspace
- mountPath: ${HOME}/workspace
- - name: ssc-dir
- mountPath: ${ssc_dir}
- imagePullSecrets:
- - name: ${img_pl_sec}
diff --git a/kubernetes/Templates/OpenBMC-build-job.yaml b/kubernetes/Templates/OpenBMC-build-job.yaml
deleted file mode 100644
index 7f9c017..0000000
--- a/kubernetes/Templates/OpenBMC-build-job.yaml
+++ /dev/null
@@ -1,47 +0,0 @@
-apiVersion: batch/v1
-kind: Job
-metadata:
- name: openbmc${BUILD_ID}-${target}
- namespace: ${namespace}
- labels:
- app: openbmc
- stage: build
-spec:
- template:
- metadata:
- name: ${pod_name}
- labels:
- target: ${target}
- spec:
- nodeSelector:
- beta.kubernetes.io/arch: ${ARCH}
- volumes:
- - name: workspace
- persistentVolumeClaim:
- claimName: ${w_claim}
- - name: ssc-dir
- persistentVolumeClaim:
- claimName: ${s_claim}
- restartPolicy: Never
- hostNetwork: True
- containers:
- - image: ${img_name}
- name: builder
- command: [\"${WORKSPACE}/build.sh\"]
- workingDir: ${HOME}
- env:
- - name: WORKSPACE
- value: ${WORKSPACE}
- - name: build-dir
- value: ${build_dir}
- securityContext:
- capabilities:
- add:
- - SYS_ADMIN
- volumeMounts:
- - name: workspace
- mountPath: ${HOME}/workspace
- - name: ssc-dir
- mountPath: ${ssc_dir}
- imagePullSecrets:
- - name: ${img_pl_sec}
diff --git a/kubernetes/Templates/OpenBMC-build-pod-v2.yaml b/kubernetes/Templates/OpenBMC-build-pod-v2.yaml
deleted file mode 100644
index 11c4419..0000000
--- a/kubernetes/Templates/OpenBMC-build-pod-v2.yaml
+++ /dev/null
@@ -1,39 +0,0 @@
-apiVersion: v1
-kind: Pod
-metadata:
- name: ${pod_name}
- namespace: ${namespace}
-spec:
- nodeSelector:
- beta.kubernetes.io/arch: ${ARCH}
- volumes:
- - name: workspace
- persistentVolumeClaim:
- claimName: ${w_claim}
- - name: ssc-dir
- persistentVolumeClaim:
- claimName: ${s_claim}
- hostNetwork: True
- containers:
- - image: ${img_name}
- name: builder
- command: ["/bin/bash","-c"]
- args: ["sleep 2h"]
- workingDir: ${HOME}
- env:
- - name: WORKSPACE
- value: ${WORKSPACE}
- - name: build-dir
- value: ${build_dir}
- securityContext:
- capabilities:
- add:
- - SYS_ADMIN
- volumeMounts:
- - name: workspace
- mountPath: ${HOME}/workspace
- - name: ssc-dir
- mountPath: ${ssc_dir}
- restartPolicy: Never
- imagePullSecrets:
- - name: ${img_pl_sec}
diff --git a/kubernetes/Templates/OpenBMC-build-pod.yaml b/kubernetes/Templates/OpenBMC-build-pod.yaml
deleted file mode 100644
index a383367..0000000
--- a/kubernetes/Templates/OpenBMC-build-pod.yaml
+++ /dev/null
@@ -1,38 +0,0 @@
-apiVersion: v1
-kind: Pod
-metadata:
- name: ${pod_name}
- namespace: ${namespace}
-spec:
- nodeSelector:
- beta.kubernetes.io/arch: ${ARCH}
- volumes:
- - name: workspace
- persistentVolumeClaim:
- claimName: ${w_claim}
- - name: ssc-dir
- persistentVolumeClaim:
- claimName: ${s_claim}
- hostNetwork: True
- containers:
- - image: ${img_name}
- name: builder
- command: [\"${WORKSPACE}/build.sh\"]
- workingDir: ${HOME}
- env:
- - name: WORKSPACE
- value: ${WORKSPACE}
- - name: build-dir
- value: ${build_dir}
- securityContext:
- capabilities:
- add:
- - SYS_ADMIN
- volumeMounts:
- - name: workspace
- mountPath: ${HOME}/workspace
- - name: ssc-dir
- mountPath: ${ssc_dir}
- restartPolicy: Never
- imagePullSecrets:
- - name: ${img_pl_sec}
diff --git a/kubernetes/Templates/QEMU-build-job.yaml b/kubernetes/Templates/QEMU-build-job.yaml
deleted file mode 100644
index 1fe635f..0000000
--- a/kubernetes/Templates/QEMU-build-job.yaml
+++ /dev/null
@@ -1,41 +0,0 @@
-apiVersion: batch/v1
-kind: Job
-metadata:
- name: qemubuild${BUILD_ID}
- namespace: ${namespace}
- labels:
- app: qemu
- stage: build
-spec:
- template:
- metadata:
- name: ${pod_name}
- spec:
- nodeSelector:
- beta.kubernetes.io/arch: ${ARCH}
- volumes:
- - name: workspace
- persistentVolumeClaim:
- claimName: ${w_claim}
- - name: qemu-dir
- persistentVolumeClaim:
- claimName: ${q_claim}
- restartPolicy: Never
- hostNetwork: True
- containers:
- - image: ${img_name}
- name: builder
- command: [\"${WORKSPACE}/build.sh\"]
- workingDir: ${HOME}
- env:
- - name: WORKSPACE
- value: ${WORKSPACE}
- - name: qemu-dir
- value: ${qemu_dir}
- volumeMounts:
- - name: workspace
- mountPath: ${HOME}/workspace
- - name: qemu-dir
- mountPath: ${qemu_dir}
- imagePullSecrets:
- - name: ${img_pl_sec}
diff --git a/kubernetes/Templates/QEMU-build-pod.yaml b/kubernetes/Templates/QEMU-build-pod.yaml
deleted file mode 100644
index eb3088d..0000000
--- a/kubernetes/Templates/QEMU-build-pod.yaml
+++ /dev/null
@@ -1,34 +0,0 @@
-apiVersion: v1
-kind: Pod
-metadata:
- name: ${pod_name}
- namespace: ${namespace}
-spec:
- nodeSelector:
- beta.kubernetes.io/arch: ${ARCH}
- volumes:
- - name: workspace
- persistentVolumeClaim:
- claimName: ${w_claim}
- - name: qemu-dir
- persistentVolumeClaim:
- claimName: ${q_claim}
- restartPolicy: Never
- hostNetwork: True
- containers:
- - image: ${img_name}
- name: builder
- command: [\"${WORKSPACE}/build.sh\"]
- workingDir: ${HOME}
- env:
- - name: WORKSPACE
- value: ${WORKSPACE}
- - name: qemu-dir
- value: ${qemu_dir}
- volumeMounts:
- - name: workspace
- mountPath: ${HOME}/workspace
- - name: qemu-dir
- mountPath: ${qemu_dir}
- imagePullSecrets:
- - name: ${img_pl_sec}
diff --git a/kubernetes/Templates/QEMU-launch-deployment.yaml b/kubernetes/Templates/QEMU-launch-deployment.yaml
deleted file mode 100644
index c8bdc9f..0000000
--- a/kubernetes/Templates/QEMU-launch-deployment.yaml
+++ /dev/null
@@ -1,62 +0,0 @@
-apiVersion: extensions/v1beta1
-kind: Deployment
-metadata:
- name: ${deploy_name}
- namespace: ${namespace}
-spec:
- replicas: ${replicas}
- selector:
- matchLabels:
- app: ${deploy_name}
- template:
- metadata:
- labels:
- app: ${deploy_name}
- spec:
- volumes:
- - name: workspace
- persistentVolumeClaim:
- claimName: ${w_claim}
- nodeSelector:
- beta.kubernetes.io/arch: ${ARCH}
- securityContext:
- runAsUser: 0
- containers:
- - image: ${img_name}
- name: ${pod_name}
- command: [\"${OBMC_BUILD_DIR}/boot-qemu.sh\"]
- tty: true
- workingDir: ${OBMC_BUILD_DIR}
- env:
- - name: QEMU_RUN_TIME
- value: \"${QEMU_RUN_TIMER}\"
- - name: QEMU_ARCH
- value: \"${QEMU_ARCH}\"
- - name: HOME
- value: \"${OBMC_BUILD_DIR}\"
- ports:
- - containerPort: 443
- name: https
- protocol: TCP
- - containerPort: 80
- name: http
- protocol: TCP
- - containerPort: 4000
- name: rest-api
- protocol: TCP
- - containerPort: 22
- name: ssh
- protocol: TCP
- resources:
- requests:
- memory: "600Mi"
- cpu: "400m"
- limits:
- memory: "1Gi"
- cpu: "1000m"
- volumeMounts:
- - name: workspace
- subPath: ${jenkins_subpath}
- mountPath: ${OBMC_BUILD_DIR}
- imagePullSecrets:
- - name: ${img_pl_sec}
diff --git a/kubernetes/Templates/README.md b/kubernetes/Templates/README.md
deleted file mode 100644
index f96abb3..0000000
--- a/kubernetes/Templates/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-Kubernetes YAML Templates for OpenBMC
-=====================================
-
-This directory holds the templates that are used by the [kubernetes-launch.sh](https://github.com/openbmc/openbmc-build-scripts/tree/master/kubernetes/kubernetes-launch.sh)
-to launch objects into the Kubernetes API. Certain templates have different types such as job and
-pod. To understand the difference between the different types of objects please refer to the
-[Kubernetes Documentation](https://kubernetes.io/docs/concepts/).
-
-The templates within this directory all have variables that the kubernetes-launch.sh script fills
-in. Below is a listing of all the variables that each template uses and where its expected defaults
-come from. However there are some variables that are not template specific, those will be addressed
-first. Below, "initial script" refers to whatever script from the parent [openbmc-build-scripts](https://github.com/openbmc/openbmc-build-scripts)
-repo was used and "launch script" refers to the kubernetes-launch.sh.
-
-##Non-Template Specific Variables
-- **ARCH**: The desired architecture for the machine the container is expected to run on. This is
- defined in the initial script. Since the initial script will build the container.
-- **namespace**: The namespaces the container will be launched within Kubernetes, defined in the
- launch script.
-- **WORKSPACE**: The workspace, this stems from our use of Jenkins, defined in the initial script.
-- **HOME**: The home directory path of the user that ran the initial script.
-- **imgname**: Name of the image used to launch the container, carried from the initial script and
- updated in the launch script so that it also includes the registry in the front.
-- **BUILD\_ID**: This is a variable that is carried by our Jenkins integration. Can be ignored.
- Normally exported before the initial script.
-- **imgplsec**: The image pull secret used to access the registry the images are stored in. This is
- defined in the launch script.
-- **podname**: The name of the pod, as will be seen in the Kubernetes API. Defined in the launch
- script.
-
-##OpenBMC-Build
-- **target**: The build target for the OpenBMC-Build. Defined in the build-setup.sh script.
-- **hclaim**: The "home" PVC, the external mount for the home directory. Defined in the launch
- script.
-- **sclaim**: The "shared-state" PVC, the external mount for the shared state cache directory used
- to reduce the time it takes to do the build using cache. Defined in the launch script.
-- **oclaim**: The "openbmc-cache" PVC, the external mount for the OpenBMC directory that is used for
- the build. This is done to allow for us to use this for testing were we use a specific checkout of
- a git repo. Defined in the launch script.
-- **obmcdir**: The OpenBMC directory path that is used internally in the container to do the build.
- Defined in the build-setup.sh script.
-- **sscdir**: The shared state cache directory used to speed up build times. Defined in the
- build-setup.sh script. This is where the container will mount the sclaim.
-- **obmcext**: The OpenBMC directory path that is used to create the internal copy. This is the path
- to which the oclaim will be mounted to. Defined in the build-setup.sh script.
-
-##QEMU-Build
-- **hclaim**: The "home" PVC, the external mount for the home directory. Defined in the launch
- script.
-- **qclaim**: The "qemu" PVC, external mount that holds the QEMU repository used to create the
- image. Defined in the launch script.
-- **qemudir**: The qemu directory path to which the qclaim will be mounted to. Defined in the
- qemu-build.sh script.
diff --git a/kubernetes/XCAT-Kubernetes-Container/Dockerfile b/kubernetes/XCAT-Kubernetes-Container/Dockerfile
deleted file mode 100644
index c649f54..0000000
--- a/kubernetes/XCAT-Kubernetes-Container/Dockerfile
+++ /dev/null
@@ -1,25 +0,0 @@
-FROM ubuntu:14.04
-
-RUN apt-get update && apt-get install -yy \
- bzip2 \
- locales \
- openssh-server \
- wget
-
-# Set the locale
-RUN locale-gen en_US.UTF-8
-ENV LANG en_US.UTF-8
-ENV LANGUAGE en_US:en
-ENV LC_ALL en_US.UTF-8
-
-RUN mkdir /var/run/sshd
-RUN echo 'root:0penBMC' | chpasswd
-RUN sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
-RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
-expose 22
-
-COPY setup_xcat.sh /
-RUN /setup_xcat.sh
-
-COPY entrypoint.sh /
-CMD ["/entrypoint.sh"]
diff --git a/kubernetes/XCAT-Kubernetes-Container/entrypoint.sh b/kubernetes/XCAT-Kubernetes-Container/entrypoint.sh
deleted file mode 100755
index 985319b..0000000
--- a/kubernetes/XCAT-Kubernetes-Container/entrypoint.sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-
-# Starting Xcat Daemon Service
-service xcatd start
-
-# Starting SSH Daemon
-echo "SSH Daemon listening on port 22"
-/usr/sbin/sshd -D
diff --git a/kubernetes/XCAT-Kubernetes-Container/setup_xcat.sh b/kubernetes/XCAT-Kubernetes-Container/setup_xcat.sh
deleted file mode 100755
index fb27e86..0000000
--- a/kubernetes/XCAT-Kubernetes-Container/setup_xcat.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-mkdir /root/xcat2
-cd /root/xcat2
-wget https://downloads.sourceforge.net/project/xcat/xcat-dep/2.x_Ubuntu/xcat-dep-ubuntu-snap20150611.tar.bz
-wget https://github.com/xcat2/xcat-core/releases/download/2.10_release/xcat-core-2.10-ubuntu.tar.bz2
-ls
-tar jxvf xcat-dep-ubuntu-snap20150611.tar.bz
-tar jxvf xcat-core-2.10-ubuntu.tar.bz2
-./xcat-dep/mklocalrepo.sh
-./xcat-core/mklocalrepo.sh
-apt-get update && apt-get install -y --force-yes xcat
-rm /root/xcat2/*.tar*
-apt-get autoremove
diff --git a/kubernetes/init-openbmc-k8s-env.sh b/kubernetes/init-openbmc-k8s-env.sh
deleted file mode 100755
index aff49f6..0000000
--- a/kubernetes/init-openbmc-k8s-env.sh
+++ /dev/null
@@ -1,149 +0,0 @@
-#!/bin/bash
-###############################################################################
-#
-# This script is for initializing the Kubernetes environment needed to run all
-# the kubernetes integrated scripts in Kubernetes.
-# - Provisions the PV's and PVC's for:
-# * The Kubernetes JNLP Jenkins slave's shared workspace
-# * Shared state cache
-# * Openbmc/openbmc git reference repository
-# * Openbmc/qemu git reference repository
-# - Create docker-registry secret for pulling from the internal repo
-# - Create the config.json used to mount docker configuration to Kubernetes
-# Jenkins slaves that build and push docker images via shell scripts.
-# Optionally:
-# - Launch a Jenkins Master deployment into Kubernetes.
-# - Provision the PV and PVC for the Jenkin Master home directory
-#
-# Instructions:
-# Suggested way to run is to create a separate script that will export all the
-# necessary variables and then source in this script. But editing this one
-# works as well.
-#
-###############################################################################
-#
-# Requirements:
-# - NFS server with directory to use as path for mount
-# - Access to an existing Kubernetes Cluster
-# - Kubectl installed and configured on machine running script
-#
-###############################################################################
-#
-# Variables used to initialize environment:
-# build_scripts_dir The path for the openbmc-build-scripts directory.
-# Default: The parent directory containing this script
-# email The email that will be used to login to the regserver.
-# Default: "email@place.holder", placeholder.
-# k8s_master Set to True if you want to deploy a Jenkins Master into
-# the Kubernetes deployment.
-# Default: True
-# nfs_ip IP address of the NFS server we will be using for mounting
-# a Persistent Volume (PV) to. This should be replaced with
-# an actual IP address of an NFS server.
-# Default: "10.0.0.0", placeholder
-# ns Name of namespace the components will be deployed into.
-# Default:"openbmc"
-# pass The password that will be used to login to the regserver.
-# Default: "password", placeholder
-# path_prefix The prefix we will add to the nfspath of the directories
-# we intend to mount. This is used to place all the
-# different directories into the same parent folder on the
-# NFS server.
-# Default: "/san_mount/openbmc_k8s", placeholder
-# reclaim The reclaim policy that will be used when creating the PV
-# look at k8s docs for more info on this.
-# Default: "Retain"
-# reg_server The docker registry which will be used when pushing and
-# pulling images. For internal use, it will be the internal
-# registry created by ICP.
-# Default: "master.icp:8500", placeholder
-# username The username that will be used to login to the regserver.
-# Default: "admin", placeholder
-###############################################################################
-
-# Variables used to initialize environment:
-build_scripts_dir=${build_scripts_dir:-"$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.."}
-email=${email:-email\@place.holder}
-k8s_master=${k8s_master:-True}
-nfs_ip=${nfs_ip:-10.0.0.0}
-ns=${ns:-openbmc}
-pass=${pass:-password}
-path_prefix=${path_prefix:-/san_mount/openbmc_k8s}
-reclaim=${reclaim:-Retain}
-reg_server=${reg_server:-master.icp:8500}
-username=${username:-admin}
-
-echo "Create the Jenkins Slave Workspace PVC"
-name="jenkins-slave-space"
-size="100Gi"
-mode="ReadWriteMany"
-nfs_path="${path_prefix}/jenkins-slave-space"
-source ${build_scripts_dir}/kubernetes/storage-setup.sh
-
-echo "Create the Shared State Cache PVC"
-name="shared-state-cache"
-size="100Gi"
-mode="ReadWriteMany"
-nfs_path="${path_prefix}/sstate-cache"
-source ${build_scripts_dir}/kubernetes/storage-setup.sh
-
-echo "Create the Openbmc Reference PVC"
-name="openbmc-reference-repo"
-size="1Gi"
-mode="ReadWriteMany"
-nfs_path="${path_prefix}/openbmc"
-source ${build_scripts_dir}/kubernetes/storage-setup.sh
-
-echo "Create the QEMU Reference PVC"
-name="qemu-repo"
-size="1Gi"
-mode="ReadWriteMany"
-nfs_path="${path_prefix}/qemu"
-source ${build_scripts_dir}/kubernetes/storage-setup.sh
-
-# Create the regkey secret for the internal docker registry
-kubectl create secret docker-registry regkey -n $ns \
---docker-username=${username} \
---docker-password=${pass} \
---docker-email=${email} \
---docker-server=${reg_server}
-
-# Create the docker config.json secret using the base64 encode of
-# '${username}:${pass}'
-
-base64up=$( echo -n "${username}:${pass}" | base64 )
-cat >> config.json << EOF
-{
- "auths": {
- "${regserver}": {
- "auth": "${base64up}"
- }
- }
-}
-EOF
-
-chmod ugo+rw config.json
-kubectl create secret generic docker-config -n $ns --from-file=./config.json
-rm -f ./config.json
-
-if [[ "${k8s_master}" == "True" ]]; then
- # Create the Jenkins Master Home PVC
- echo "Create the Jenkins Master Home PVC"
- name="jenkins-home"
- size="2Gi"
- mode="ReadWriteOnce"
- nfspath="${path_prefix}/jenkins-master-home"
- source ${build_scripts_dir}/kubernetes/storage-setup.sh
-
- # Launch the Jenkins Master
- launch="k8s"
- # Clean up variables before sourcing the build-jenkins.sh
- unset ns \
- nfsip \
- regserver \
- reclaim \
- path_prefix \
- username \
- pass email
- source ${build_scripts_dir}/build-jenkins.sh
-fi
diff --git a/kubernetes/kubernetes-launch.sh b/kubernetes/kubernetes-launch.sh
deleted file mode 100755
index 8ddfe2c..0000000
--- a/kubernetes/kubernetes-launch.sh
+++ /dev/null
@@ -1,195 +0,0 @@
-#!/bin/bash
-###############################################################################
-#
-# Script used to assist in launching Kubernetes jobs/pods. Expects to be used
-# as an supplemental script to the scripts that want to launch their containers
-# on a Kubernetes cluster.
-#
-###############################################################################
-#
-# Requirements:
-# - Docker login credentials defined inside ~/.docker/config.json
-# - Kubectl installed and configured on machine running the script
-# - Access to a Kubernetes Cluster using v1.5.2 or newer
-# - NFS directories for OpenBMC repo cache, BitBake shared state cache, and
-# shared Jenkins home directory that holds workspaces.
-# - All NFS directories should have RWX permissions for user being used to run
-# the build-setup.sh script
-# - Persistent Volume and Claims created and mounted to NFS directories
-# - Image pull secret exists for image pulls in Kubernetes cluster namespace
-#
-###############################################################################
-# Script Variables:
-# build_scripts_dir The path for the openbmc-build-scripts directory.
-# Default: The parent directory containing this script
-#
-# Kubernetes Variables:
-# img_pl_sec The image pull secret used to access registry if needed
-# Default: "regkey"
-# job_timeout The amount of time in seconds that the build will wait for
-# the job to be created in the api of the cluster.
-# Default: "60"
-# namespace The namespace to be used within the Kubernetes cluster
-# Default: "openbmc"
-# pod_timeout The amount of time in seconds that the build will wait for
-# the pod to start running on the cluster.
-# Default: "600"
-# registry The registry to use to pull and push images
-# Default: "master.cfc:8500/openbmc/""
-#
-# YAML File Variables (No Defaults):
-# img_name The name the image that will be passed to the kubernetes
-# api to build the containers. The image with the tag
-# img_name will be built in the invoker script. This script
-# will then tag it to include the registry in the name, push
-# it, and update the img_name to be what was pushed to the
-# registry. Users should not include the registry in the
-# original img_name.
-# pod_name The name of the pod, needed to trace down the logs.
-#
-# Deployment Option Variables (No Defaults):
-# invoker Name of what this script is being called by or for, used
-# to determine the template to use for YAML file.
-# launch Used to determine the template used for the YAML file,
-# normally carried in by sourcing this script in another
-# script that has declared it.
-# log If set to true the script will tail the container logs
-# as part of the bash script.
-# purge If set to true it will delete the created object once this
-# script ends.
-# workaround Used to enable the logging workaround, when set will
-# launch a modified template that waits for a command. In
-# most cases it will be waiting to have a script run via
-# kubectl exec. Required when using a version of Kubernetes
-# that has known issues that impact the retrieval of
-# container logs when using kubectl. Defaulting to be true
-# whenever logging is enabled until ICP upgrades their
-# Kubernetes version to a version that doesn't need this.
-#
-###############################################################################
-
-# Script Variables
-build_scripts_dir=${build_scripts_dir:-"$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )/.."}
-
-# Kubernetes Variables
-img_pl_sec=${img_pl_sec:-regkey}
-job_timeout=${job_timeout:-60}
-namespace=${namespace:-openbmc}
-pod_timeout=${pod_timeout:-600}
-registry=${registry:-master.cfc:8500/openbmc/}
-
-# Deployment Option Variables:
-invoker=${invoker:-${1}}
-launch=${launch:-${4}}
-log=${log:-${2}}
-purge=${purge:-${3}}
-workaround=${workaround:-${log}}
-
-# Set the variables for the specific invoker to fill in the YAML template
-# Other variables in the template not declared here are declared by invoker
-case ${invoker} in
- Build-Jenkins)
- deploy_name=${deploy_name:-jenkins-master}
- pod_name=${pod_name:-jenkins-master-pod}
- new_img_name="${img_repo}jenkins-master-${ARCH}:${j_vrsn}"
- h_claim=${h_claim:-jenkins-home}
- cluster_ip=${cluster_ip:-10.0.0.175}
- http_nodeport=${http_nodeport:-32222}
- agent_nodeport=${agent_nodeport:-32223}
- ;;
- OpenBMC-build)
- w_claim=${w_claim:-jenkins-slave-space}
- s_claim=${s_claim:-shared-state-cache}
- o_claim=${o_claim:-openbmc-reference-repo}
- new_img_name=${new_img_name:-${registry}${distro}:${img_tag}-${ARCH}}
- pod_name=${pod_name:-openbmc${BUILD_ID}-${target}-builder}
- ;;
- QEMU-build)
- pod_name=${pod_name:-qemubuild${BUILD_ID}}
- w_claim=${w_claim:-jenkins-slave-space}
- q_claim=${q_claim:-qemu-repo}
- new_img_name="${registry}${img_name}"
- ;;
- QEMU-launch)
- deploy_name=${deploy_name:-qemu-launch-deployment}
- pod_name=${pod_name:-qemu-instance}
- replicas=${replicas:-5}
- w_claim=${w_claim:-jenkins-slave-space}
- jenkins_subpath=${jenkins_subpath:-Openbmc-Build/openbmc/build}
- new_img_name="${registry}qemu-instance"
- ;;
- XCAT-launch)
- ;;
- generic)
- ;;
- *)
- exit 1
- ;;
-esac
-
-# Tag the image created by the invoker with a name that includes the registry
-docker tag ${img_name} ${new_img_name}
-img_name=${new_img_name}
-
-# Push the image that was built to the image repository
-docker push ${img_name}
-
-if [[ "$ARCH" == x86_64 ]]; then
- ARCH=amd64
-fi
-
-extras=""
-if [[ "${workaround}" == "true" ]]; then
- extras+="-v2"
-fi
-
-yaml_file=$(eval "echo \"$(<${build_scripts_dir}/kubernetes/Templates/${invoker}-${launch}${extras}.yaml)\"")
-kubectl create -f - <<< "${yaml_file}"
-
-# If launch is a job we have to find the pod_name with identifiers
-if [[ "${launch}" == "job" ]]; then
- while [ -z ${replace} ]
- do
- if [ ${job_timeout} -lt 0 ]; then
- kubectl delete -f - <<< "${yaml_file}"
- echo "Timeout occurred before job was present in the API"
- exit 1
- else
- sleep 1
- let job_timeout-=1
- fi
- replace=$(kubectl get pods -n ${namespace} | grep ${pod_name} | awk 'print $1')
- done
- pod_name=${replace}
-fi
-
-
-# Once pod is running track logs
-if [[ "${log}" == true ]]; then
- # Wait for Pod to be running
- check_status="kubectl describe pod ${pod_name} -n ${namespace}"
- status=$( ${check_status} | grep Status: )
- while [ -z "$( echo ${status} | grep Running)" ]
- do
- if [ ${pod_timeout} -lt 0 ]; then
- kubectl delete -f - <<< "${yaml_file}"
- echo "Timeout occurred before pod was Running"
- exit 1
- else
- sleep 1
- let pod_timeout-=1
- fi
- status=$( ${check_status} | grep Status: )
- done
- # Tail the logs of the pod, if workaround enabled start executing build script instead.
- if [[ "${workaround}" == "true" ]]; then
- kubectl exec -it ${pod_name} -n ${namespace} ${WORKSPACE}/build.sh
- else
- kubectl logs -f ${pod_name} -n ${namespace}
- fi
-fi
-
-# Delete the object if purge is true
-if [[ "${purge}" == true ]]; then
- kubectl delete -f - <<< "${yaml_file}"
-fi
diff --git a/kubernetes/storage-setup.sh b/kubernetes/storage-setup.sh
deleted file mode 100755
index fa5cc46..0000000
--- a/kubernetes/storage-setup.sh
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/bin/bash
-###############################################################################
-#
-# This script creates an NFS Persistent Volumes(PV) and also claims that PV
-# with a PVC of the same size.
-# Note: PVs can be claimed by one PVC at a time
-#
-###############################################################################
-#
-# Requirements:
-# - NFS server with directory to use as path for mount
-# - Access to an existing Kubernetes Cluster
-# - Kubectl installed and configured on machine running script
-#
-###############################################################################
-#
-# The script expects a few variables which are needed to define PV's and PVC's
-# mode ReadWriteOnce|ReadOnlyMany|ReadWriteMany
-# Access Mode used by NFS normally uses ReadWriteMany
-# Default: ReadWriteMany
-# name The name of the PV and PVC that will be used by the Kubernetes
-# system to refer to PV/PVC
-# Default: "placeholder"
-# nfs_ip Server IP for NFS server that will be used
-# Default: "NFS-Server"
-# nfs_path Path of the directory that will be mounted from NFS server
-# Default: "/san/dir"
-# ns Namespace under which to create the mounts on the cluster
-# Default: "openbmc"
-# reclaim recycle|delete|retain
-# The policy, defines what occurs when claim on PV is released, can
-# be either: recycle, delete, or retain.
-# Default: "Retain"
-# size The size of the volume, numeric value followed by Gi or Mi
-# Default: "10Gi"
-#
-# Note: Kubernetes Systems permissions vary by implementation
-# some will require permissions to create PV's or PVC's
-#
-###############################################################################
-
-mode=${mode:-ReadWriteMany}
-name=${name:-placeholder}
-nfs_ip=${nfs_ip:-NFS-Server}
-nfs_path=${nfs_path:-/san/dir}
-ns=${ns:-openbmc}
-reclaim=${reclaim:-Retain}
-size=${size:-10Gi}
-
-# Generate the PV
-pv=$(cat << EOF
-apiVersion: v1
-kind: PersistentVolume
-metadata:
- labels:
- app: ${name}
- name: ${name}
- namespace: ${ns}
-spec:
- accessModes:
- - ${mode}
- capacity:
- storage: ${size}
- nfs:
- path: ${nfs_path}
- server: ${nfs_ip}
- persistentVolumeReclaimPolicy: ${reclaim}
-EOF
-)
-
-# create the volume
-if [ -z $(kubectl get pv --namespace=${ns} | grep '^'${name}' ' | cut -d " " -f1) ];then
- echo "Creating Persistent Volume ${name}"
- kubectl create -f - <<< "${pv}"
-else
- echo "Persistent Volume already Exists"
-fi
-
-
-# Generate the PVC
-pvc=$(cat << EOF
-apiVersion: v1
-kind: PersistentVolumeClaim
-metadata:
- name: ${name}
- namespace: ${ns}
-spec:
- accessModes:
- - ${mode}
- resources:
- requests:
- storage: ${size}
- selector:
- matchLabels:
- app: ${name}
-EOF
-)
-
-# create PVC's to bind the PV's
-if [ -z $(kubectl get pvc --namespace=${ns} | grep '^'${name}' ' | cut -d " " -f1) ];then
- echo "Creating Persistent Volume Claim ${name}"
- kubectl create -f - <<< "${pvc}"
-else
- echo "Persistent volume claim already exists."
-fi
diff --git a/run-qemu-robot-test.sh b/run-qemu-robot-test.sh
index 870ae87..93dfa33 100755
--- a/run-qemu-robot-test.sh
+++ b/run-qemu-robot-test.sh
@@ -178,18 +178,6 @@
# Now stop the QEMU Docker image
docker stop "$obmc_qemu_docker"
-elif [[ ${LAUNCH} == "k8s" ]]; then
- # Package the Upstream into an image based off the one created by the build-qemu-robot.sh
- # Dockerfile = $( cat << EOF
- # shellcheck disable=SC2034
- imgname="$DOCKER_IMG_NAME"
- cd "$DIR"
- source ./kubernetes/kubernetes-launch.sh QEMU-launch false false deployment
-
- # Xcat Launch (NYI)
-
- # source ./kubernetes/kubernetes-launch.sh XCAT-launch true true
-
else
echo "LAUNCH variable invalid, Exiting"
exit 1