Skip to content

Commit

Permalink
Support running on CentOS 8
Browse files Browse the repository at this point in the history
  • Loading branch information
priteau committed May 2, 2020
1 parent e5c6a25 commit c6bffe6
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 25 deletions.
34 changes: 18 additions & 16 deletions a-seed-from-nothing.sh
Original file line number Diff line number Diff line change
@@ -1,23 +1,34 @@
#!/bin/bash

# Exit on error
set -e

# Reset SECONDS
SECONDS=0

# Registry IP
registry_ip=$1
echo "[INFO] Given docker registry IP: $registry_ip"

# Disable the firewall.
sudo systemctl is-enabled firewalld && sudo systemctl stop firewalld && sudo systemctl disable firewalld

This comment has been minimized.

Copy link
@oneswig

oneswig May 3, 2020

Member

you might want to add the transfer from NetworkManager to initscripts here:

sudo dnf -y install network-scripts
sudo systemctl is-enabled NetworkManager && (sudo systemctl disable NetworkManager ; sudo systemctl enable network ; sudo systemctl stop NetworkManager ; sudo systemctl start network)
# Disable SELinux.
sudo setenforce 0

# Exit on error
# NOTE(priteau): Need to be set here as setenforce can return a non-zero exit
# code
set -e

# Clone Kayobe.
[[ -d kayobe ]] || git clone https://git.openstack.org/openstack/kayobe.git -b stable/train
[[ -d kayobe ]] || git clone https://github.com/stackhpc/kayobe.git -b story/2007612-stable/train
cd kayobe

# Clone the Tenks repository.
[[ -d tenks ]] || git clone https://git.openstack.org/openstack/tenks.git

# Clone this Kayobe configuration.
mkdir -p config/src
cd config/src/
[[ -d kayobe-config ]] || git clone https://github.com/stackhpc/a-universe-from-nothing.git -b stable/train kayobe-config
[[ -d kayobe-config ]] || git clone https://github.com/stackhpc/a-universe-from-nothing.git -b stable/train-centos8 kayobe-config

# Set default registry name to the one we just created
sed -i.bak 's/^docker_registry.*/docker_registry: '$registry_ip':4000/' kayobe-config/etc/kayobe/docker.yml
Expand All @@ -27,7 +38,7 @@ sed -i.bak 's/^docker_registry.*/docker_registry: '$registry_ip':4000/' kayobe-c

# Install kayobe.
cd ~/kayobe
./dev/install.sh
./dev/install-dev.sh

# Deploy hypervisor services.
./dev/seed-hypervisor-deploy.sh
Expand All @@ -37,21 +48,12 @@ cd ~/kayobe
# custom docker registry.
if ! ./dev/seed-deploy.sh; then
# Pull, retag images, then push to our local registry.
./config/src/kayobe-config/pull-retag-push-images.sh train
./config/src/kayobe-config/pull-retag-push-images.sh train-centos8

# Deploy a seed VM. Should work this time.
./dev/seed-deploy.sh
fi

# Clone the Tenks repository.
[[ -d tenks ]] || git clone https://git.openstack.org/openstack/tenks.git -b stable/1.0

# Install Open vSwitch for Tenks.
sudo yum install -y centos-release-openstack-train
sudo yum install -y openvswitch
sudo systemctl enable openvswitch
sudo systemctl start openvswitch

# Duration
duration=$SECONDS
echo "[INFO] $(($duration / 60)) minutes and $(($duration % 60)) seconds elapsed."
2 changes: 1 addition & 1 deletion packet-device-alt.tf
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ resource "packet_device" "lab_alt" {
provisioner "remote-exec" {
inline = [
"usermod -p `echo ${self.id} | openssl passwd -1 -stdin` lab",
"yum install -y screen git",
"yum install -y git tmux",
"su -c 'bash a-seed-from-nothing.sh ${packet_device.registry_alt[0].access_public_ipv4} > a-seed-from-nothing.out' - lab",
]
}
Expand Down
2 changes: 1 addition & 1 deletion packet-device.tf
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ resource "packet_device" "lab" {
provisioner "remote-exec" {
inline = [
"usermod -p `echo ${self.id} | openssl passwd -1 -stdin` lab",
"yum install -y screen git",
"yum install -y git tmux",
"su -c 'bash a-seed-from-nothing.sh ${packet_device.registry[0].access_public_ipv4} > a-seed-from-nothing.out' - lab",
]
}
Expand Down
18 changes: 14 additions & 4 deletions pull-retag-push-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ set -e
SECONDS=0

# Install and start docker
sudo yum install docker -y
sudo dnf install -y 'dnf-command(config-manager)'
cat << "EOF" | sudo tee /etc/yum.repos.d/docker-ce.repo
[docker-ce-stable]
name=Docker CE Stable - $basearch
baseurl=https://download.docker.com/linux/centos/7/$basearch/stable
enabled=1
gpgcheck=1
gpgkey=https://download.docker.com/linux/centos/gpg
module_hotfixes = True
EOF
sudo dnf install -y docker-ce
sudo systemctl enable docker
sudo systemctl start docker

Expand All @@ -15,7 +25,7 @@ if [ ! "$(sudo docker ps -q -f name=registry)" ]; then
sudo docker run -d -p 4000:5000 --restart=always --name registry registry
fi

tag=${1:-train}
tag=${1:-train-centos8}
images="kolla/centos-binary-kolla-toolbox
kolla/centos-binary-haproxy
kolla/centos-binary-mariadb
Expand Down Expand Up @@ -48,8 +58,8 @@ kolla/centos-binary-heat-api
kolla/centos-binary-heat-api-cfn
kolla/centos-binary-heat-engine
kolla/centos-binary-horizon
kolla/centos-binary-kibana
kolla/centos-binary-elasticsearch
kolla/centos-binary-kibana6
kolla/centos-binary-elasticsearch6
kolla/centos-binary-barbican-base
kolla/centos-binary-barbican-api
kolla/centos-binary-barbican-worker
Expand Down
4 changes: 2 additions & 2 deletions setup-user.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ Immediately change the default password.
passwd
Optionally, attach to a screen session in case the connection drops:
Optionally, attach to a tmux session in case the connection drops:
screen -drR
tmux
To view the script that was used to deploy the seed in this instance:
Expand Down
2 changes: 1 addition & 1 deletion vars.tf
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ variable "lab_count_alt" {

variable "operating_system" {
description = "Operating System to install across nodes"
default = "centos_7"
default = "centos_8"
}

variable "deploy_prefix" {
Expand Down

0 comments on commit c6bffe6

Please sign in to comment.