install: bmh_all
bmh_preinstall:
+ source user_config.sh && env && \
pushd $(BMDIR) && ./01_install_package.sh && ./02_configure.sh && \
./03_launch_prereq.sh && popd
pushd $(BMDIR) && ./06_host_cleanup.sh && popd
bmh_install:
+ source user_config.sh && env && \
pushd $(METAL3DIR) && ./01_metal3.sh launch && \
./01_metal3.sh provision && ./02_verify.sh && popd
## What to do next
1. Add the gerrit ssh key as jenkins credential, so that our jobs can pull code from the gerrit.
-The credential ID field must be `jenkins-ssh`. As this is hard coded in the jobs.
+The credential ID field must be `jenkins-ssh`, as this is hard coded in the jobs. The type should
+be private key. The user name is the gerrit account name.
2. To push the logs to Akraino Nexus server, we need to create the authentication file for lftools.
-The file path is `/var/lib/jenkins/.netrc` and the content should be one line
-`machine nexus.akraino.org login the_name password the_pass`
+The file should be owned by jenkins user. The file path is `/var/lib/jenkins/.netrc` and
+the content should be one line `machine nexus.akraino.org login the_name password the_pass`
3. The last step is to deploy our CD jobs by jenkins-job-builder tool.
```
-git clone "https://gerrit.akraino.org/r/ci-management"
+git clone --recursive "https://gerrit.akraino.org/r/ci-management"
git clone "https://gerrit.akraino.org/r/icn"
# create the jjb config file before moving on
# https://docs.releng.linuxfoundation.org/en/latest/jenkins-sandbox.html
jenkins-jobs test ci-management/jjb:icn/ci/jjb icn-master-verify
jenkins-jobs update ci-management/jjb:icn/ci/jjb icn-master-verify
```
+
+A sample of jjb config file
+```
+[job_builder]
+ignore_cache=True
+keep_descriptions=False
+recursive=True
+retain_anchors=True
+update=jobs
+
+[jenkins]
+user=admin
+password=admin
+url=http://localhost:8080
+```
---
- job-template:
- id: icn-stream-verify-target
- name: 'icn-{stream}-verify-{target}'
+ id: icn-stream-vagrant-verify-target
+ name: 'icn-{stream}-vagrant-verify-{target}'
defaults: icn
archive-artifacts: >
**/*.log
builders:
- shell: !include-raw:
- - shell/verify.sh
+ - shell/vagrant-verify.sh
+
+ publishers:
+ - icn-infra-publish
+# - email:
+# recipients: icn.jenkins@intel.com
+
+- job-template:
+ id: icn-stream-bm-verify-target
+ name: 'icn-{stream}-bm-verify-{target}'
+ defaults: icn
+ archive-artifacts: >
+ **/*.log
+ build-days-to-keep: 30
+ build-timeout: 60
+ stream: master
+ target: verifier
+ project-type: freestyle
+ submodule-recursive: true
+ #node: '{build-node}'
+
+ properties:
+ - lf-infra-properties:
+ build-days-to-keep: '{build-days-to-keep}'
+
+ parameters:
+ - lf-infra-parameters:
+ project: '{project}'
+ stream: '{stream}'
+ branch: '{branch}'
+ lftools-version: '{lftools-version}'
+
+ - string:
+ name: ARCHIVE_ARTIFACTS
+ default: '{archive-artifacts}'
+ description: Artifacts to archive to the logs server.
+
+ - string:
+ name: NEXUS_LOG_SUBDIR
+ default: '{nexus_log_subdir}'
+ description: Organization sub dir on Akraino Nexus server.
+
+ wrappers:
+ - lf-infra-wrappers:
+ build-timeout: '{build-timeout}'
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+ scm:
+ - lf-infra-gerrit-scm:
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+ git-url: '{git-url}/{project}.git'
+ refspec: '$GERRIT_REFSPEC'
+ branch: '$GERRIT_BRANCH'
+ submodule-recursive: '{submodule-recursive}'
+ submodule-timeout: '{submodule-timeout}'
+ submodule-disable: false
+ choosing-strategy: 'gerrit'
+
+ triggers:
+ - timed: "@midnight"
+
+ builders:
+ - shell: !include-raw:
+ - shell/bm-verify.sh
publishers:
- icn-infra-publish
---
- project:
- name: icn-private
+ name: icn-vagrant
project: icn
project-name: icn
nexus_log_subdir: intel/ICN_CD_logs
- master:
branch: master
jobs:
- - icn-stream-verify-target
+ - icn-stream-vagrant-verify-target
+
+- project:
+ name: icn-bm
+ project: icn
+ project-name: icn
+ nexus_log_subdir: intel/ICN_CD_logs
+ target:
+ - bm_verifer
+ stream:
+ - master:
+ branch: master
+ jobs:
+ - icn-stream-bm-verify-target
--- /dev/null
+#!/bin/bash -l
+echo "---> bm-verify.sh"
+
+# Ensure we fail the job if any steps fail
+# Disable 'globbing'
+set -exuf -o pipefail
+
+sudo apt update
+sudo apt install -y make
+sudo su -c 'make {target}'
# Disable 'globbing'
set -euf -o pipefail
-JENKINS_HOSTNAME=pod14-node2
+JENKINS_HOSTNAME=`hostname`
NEXUS_URL=https://nexus.akraino.org
LOGS_SERVER=https://logs.akraino.org
#!/bin/bash -l
-echo "---> verify.sh"
+echo "---> vagrant-verify.sh"
# Ensure we fail the job if any steps fail
# Disable 'globbing'
sudo ifconfig `basename $intf` up
sudo dhclient -nw `basename $intf`
done
+EOF
+cat << EOF
+- path: /opt/user_net.sh
+ owner: root:root
+ permissions: '0777'
+ content: |
+ #!/usr/bin/env bash
+ set -xe
+ route add default gw $PROVIDER_NETWORK_GATEWAY
+ sed -i -e 's/^#DNS=.*/DNS=$PROVIDER_NETWORK_DNS/g' /etc/systemd/resolved.conf
+ systemctl daemon-reload
+ systemctl restart systemd-resolved
runcmd:
- [ /opt/ironic_net.sh ]
+ - [ /opt/user_net.sh ]
EOF
}
#!/bin/bash
-ICNDIR="$(dirname "$(dirname "$PWD")")"
-echo $ICNDIR
-source $ICNDIR/user_config.sh
-
#supported OS version
UBUNTU_BIONIC=${UBUNTU_BIONIC:-Ubuntu 18.04.2 LTS}
BS_DHCP_INTERFACE_IP=${BS_DHCP_INTERFACE_IP:-}
BS_DHCP_DIR=${BS_DHCP_DIR:-$DOWNLOAD_PATH/dhcp}
+#User Provider Network configuration
+PROVIDER_NETWORK_GATEWAY=${PROVIDER_NETWORK_GATEWAY:-}
+PROVIDER_NETWORK_DNS=${PROVIDER_NETWORK_DNS:-}
+
#Ironic variables
IRONIC_IMAGE=${IRONIC_IMAGE:-"quay.io/metal3-io/ironic:master"}
IRONIC_INSPECTOR_IMAGE=${IRONIC_INSPECTOR_IMAGE:-"quay.io/metal3-io/ironic-inspector"}
install() {
install_essential_packages
install_ironic_packages $1
- install_docker_packages $1
- install_podman_packages $1
- install_kubernetes_packages $1
+
+ #install_docker_packages $1
+ #install_podman_packages $1
+ #install_kubernetes_packages $1
}
if ["$1" == "-o"]; then
return
fi
- podman pull $IRONIC_IMAGE
- podman pull $IRONIC_INSPECTOR_IMAGE
+ #Podman usage is deprecated for v1.0.0 release
+ #podman pull $IRONIC_IMAGE
+ docker pull $IRONIC_IMAGE
+ #podman pull $IRONIC_INSPECTOR_IMAGE
+ docker pull $IRONIC_INSPECTOR_IMAGE
mkdir -p "$IRONIC_DATA_DIR/html/images"
pushd $IRONIC_DATA_DIR/html/images
}
function configure {
- configure_kubeadm $1
- configure_kubelet
+ #Kubeadm usage deprecated for v1.0.0 release
+ #configure_kubeadm $1
+ #configure_kubelet
configure_ironic $1
configure_dhcp_bridge
configure_ironic_bridge
fi
}
-function install_podman {
+function install_ironic_container {
# set password for mariadb
mariadb_password=$(echo $(date;hostname)|sha256sum |cut -c-20)
- # Create pod
- podman pod create -n ironic-pod
-
# Start dnsmasq, http, mariadb, and ironic containers using same image
- podman run -d --net host --privileged --name dnsmasq --pod ironic-pod \
+ docker run -d --net host --privileged --name dnsmasq \
-v $IRONIC_DATA_DIR:/shared --entrypoint /bin/rundnsmasq ${IRONIC_IMAGE}
- podman run -d --net host --privileged --name httpd --pod ironic-pod \
+ docker run -d --net host --privileged --name httpd \
-v $IRONIC_DATA_DIR:/shared --entrypoint /bin/runhttpd ${IRONIC_IMAGE}
- podman run -d --net host --privileged --name mariadb --pod ironic-pod \
+ docker run -d --net host --privileged --name mariadb \
-v $IRONIC_DATA_DIR:/shared --entrypoint /bin/runmariadb \
--env MARIADB_PASSWORD=$mariadb_password ${IRONIC_IMAGE}
- podman run -d --net host --privileged --name ironic --pod ironic-pod \
+ docker run -d --net host --privileged --name ironic \
--env MARIADB_PASSWORD=$mariadb_password \
-v $IRONIC_DATA_DIR:/shared ${IRONIC_IMAGE}
# Start Ironic Inspector
- podman run -d --net host --privileged --name ironic-inspector \
- --pod ironic-pod "${IRONIC_INSPECTOR_IMAGE}"
+ docker run -d --net host --privileged --name ironic-inspector \
+ "${IRONIC_INSPECTOR_IMAGE}"
}
function remove_k8s_noschedule_taint {
}
function install {
+ #Kubeadm usage is deprecated in v1,0,0 version
#install_kubernetes
- install_k8s_single_node
- check_cni_network $1
- create_k8s_regular_user
- check_k8s_node_status
- remove_k8s_noschedule_taint
+ #install_k8s_single_node
+ #check_cni_network $1
+ #create_k8s_regular_user
+ #check_k8s_node_status
+ #remove_k8s_noschedule_taint
#install_podman
#Todo - error handling mechanism
- install_podman
+ install_ironic_container
install_dhcp
}
# Kill and remove the running ironic containers
for name in ironic ironic-inspector dnsmasq httpd mariadb; do
- sudo podman ps | grep -w "$name$" && sudo podman kill $name
- sudo podman ps --all | grep -w "$name$" && sudo podman rm $name -f
+ sudo docker ps | grep -w "$name$" && sudo docker kill $name
+ sudo docker ps --all | grep -w "$name$" && sudo docker rm $name -f
done
-# Remove existing pod
-if sudo podman pod exists ironic-pod ; then
- sudo podman pod rm ironic-pod -f
-fi
-
ip link set provisioning down
brctl delbr provisioning
rm -rf ${BS_DHCP_DIR}
rm -rf ${IRONIC_DATA_DIR}
-kubeadm reset -f
-iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X
-rm -rf $HOME/.kube/config
-rm -rf /var/lib/etcd
+#Kubeadm usage is deprecated in v1.0.0
+#kubeadm reset -f
+#iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X
+#rm -rf $HOME/.kube/config
+#rm -rf /var/lib/etcd
#!/bin/bash
#Local controller - Bootstrap cluster DHCP connection
-BS_DHCP_INTERFACE=${BS_DHCP_INTERFACE:-"ens513f0"}
-BS_DHCP_INTERFACE_IP=${BS_DHCP_INTERFACE_IP:-"172.31.1.1/24"}
+export BS_DHCP_INTERFACE="ens513f0"
+export BS_DHCP_INTERFACE_IP="172.31.1.1/24"
#Ironic Metal3 settings for provisioning network
-IRONIC_INTERFACE=${IRONIC_INTERFACE:-"enp4s0f1"}
+export IRONIC_INTERFACE="enp4s0f1"
#Ironic Metal3 setting for IPMI LAN Network
-IRONIC_IPMI_INTERFACE=${IRONIC_IPMI_INTERFACE:-"enp4s0f0"}
-IRONIC_IPMI_INTERFACE_IP=${IRONIC_IPMI_INTERFACE_IP:-"10.10.110.20"}
+export IRONIC_IPMI_INTERFACE="enp4s0f0"
+export IRONIC_IPMI_INTERFACE_IP="10.10.110.20"
+
+#User Network configuration
+export PROVIDER_NETWORK_GATEWAY="10.10.110.1"
+export PROVIDER_NETWORK_DNS="8.8.8.8"