-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deploy tinkerbell stack in a single step #62
Conversation
db9ff67
to
26eac6c
Compare
6239ea1
to
05a1627
Compare
|
||
1. ### Setup git and git lfs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it worth retaining the manual instructions for local development? cc @nathangoulding
ip -o link show | awk -F': ' '{print $2}' | grep '^[e]' | ||
} | ||
|
||
get_tinkerbell_network_interface() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be ideal if you could first try to read an ENV-var for this value and then only use read
if nothing was given.
This is so that the script can be run on CI non-interactively.
setup.sh
Outdated
read -p 'Create a Docker registry username [default admin]? ' username | ||
username=${username:-"admin"} | ||
|
||
read -sp 'Registry password [default admin]? ' password |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to generate this instead, see how we do this in openfaas -> https://github.com/openfaas/faas-netes/tree/master/chart/openfaas#generate-basic-auth-credentials
The read
statements ideally should read from env-vars or a similar mechanism that doesn't require user interaction.
piping or cat
-ing a file is probably not going to be a robust option because it depends on the ordering of the file and is hard to document. It is also sensitive to timing bugs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example:
if [ $TB_PASSWORD == "" ];
read -sp 'Registry password [default admin]? ' TB_PASSWORD
fi
echo The password is $TB_PASSWORD
Then use it via:
# Interactive
curl https:// | bash
# inline value
curl https:// | TB_PASSWORD="test1234" bash
# or
# Set on separate lines
export TB_PASSWORD="test1234"
curl https:// | bash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to see a one click install, however using read
is problematic for CI and automation, I've made some other suggestions.
Quick test run: On fresh CentOS 7.6 it fails on:
there is no "NetworkManager" in the system by default (and BTW there is no wget either - better use curl). I installed it (so you either have to check first if it's installed, install it yourself or use network package) and then it failed on:
Turns out interface wasn't saved to envrc file as here:
I just hit enter assuming it will use eth0. It didn't, so I run again specifying it myself and then I ended up with:
I checked CentOS 8 as well and it, of course, failed on Docker installation. |
@DavidZisky , I would like to inform you that NetworkManger is required ( atleast for now ) to setup a private network on CentOS. So either we need to add it in the pre-requisite for CentOS 7 or install it thourght the script itself. But in that case as well we need to inform user that these are the things which will be installed on your machines. |
I'd prefer to detect whether NM is enabled, and use if if so but not require it to be in place since NM is not universally used or loved (including at Packet). |
as far as I remember NM is definitely not required to set up a private network on CentOS 7. You should be able to do it by generating proper ifcfg-[interface] file in /etc/sysconfig/network-scripts/ and then bringing that interface up with:
But maybe I'm missing something - I didn't read the whole script yet. Regarding CentOS8 - no worries. There is a known "bug" which makes the normal installation of docker impossible (at least for now) so it's expected that it fails. There is a workaround for it but since you are not supporting it officially then not worth the hassle. |
@nathangoulding if the NM is not installed on a machine we need to find another way to configure the network which we are still trying to figure out. I tried few ways like changing the ifcfg- file as well but it didn't work. I also think that we should not have the dependancy on NM but since we need to get this setup things done asap this was the only way working so we went for it. This will be changed soon. |
Yep, for sure. Let's create a couple issues for NM-less install, as well as CentOS 8 support. |
Just did a quick test and it works fine without NM (I just modified bit of your script which checks for NM, added generating the file and restarting interface):
would have to be battle-tested in a more realistic scenario and if that interface actually works but that was just to check my idea |
05a1627
to
690910a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm testing it on Ubuntu 18.04 via Vagrant right now:
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/bionic64"
# config.disksize.size = '30GB'
config.vm.provider :virtualbox do |v|
v.check_guest_additions = false
v.functional_vboxsf = false
v.cpus = 2
v.memory = 2048
v.customize ['modifyvm', :id, '--paravirtprovider', 'kvm']
end
config.vm.network "private_network", ip: "192.168.50.2", auto_config: false
end
Couple of suggestions, I wasn't sure where they should land in the script:
-
After selecting the interface, it would be cool if ecosystem CIDR and IP address would pick the default values from selected interface
-
It should be noted somewhere, that script should be run as root, otherwise I get:
Warning: Failed to create the file /usr/local/bin/docker-compose: Permission Warning: denied
I see that
sudo
is being used in some places, perhaps this should be settled on either running as root and checking it or usingsudo
everywhere. Also the description of the PR use$
suggesting it should be run as non-root user. -
Ubuntu 18.04 run fails with
./setup.sh: line 209: ifdown: command not found
. Solution:apt install ifupdown
. -
Answers to the read needs to be provided every time to the script, a bit annoying
-
ifdown enp0s8 fails for me:
# ifdown enp0s8 Unknown interface enp0s8
IIRC
write_iface_config
replaces interface config, but does not handle the case where the interface was never configured via/etc/network/interfaces
. I worked around it by executing:echo "iface enp0s8" >> /etc/network/interfaces
-
‘deploy.tar.gz` file is being downloaded multiple times on subsequent runs
-
maybe mention, that the script downloads 1.3GB of assets and also how much disk space is needed to set it up? Default Vagrant disk size is 10G, I almost run out of space, had to do
sudo rm /tmp/osie.tar.gz
after it has been unpacked.
Other than the mentioned issues, the script succeeded and it seems everything is running. I need to figure out how to get CLI tool and configure it now.
Hey there, On the first run of |
690910a
to
9df90b4
Compare
50833eb
to
419d702
Compare
This reverts commit 2d9469b.
1. Organized all compose related files under single directory 2. Refactored and organized setup_docker_compose.sh 3. User need to explicity source inputenv before running docker compose script 4. Removed redundant setups from setup.md
Signed-off-by: Gaurav Gahlot <[email protected]>
Signed-off-by: Gaurav Gahlot <[email protected]>
Signed-off-by: Gaurav Gahlot <[email protected]>
- reading tinkerbell interface, network, host-ip and registry user from ENV - generating registry password - not using NetworkManager for network configuration on CentOS - removing bond0 as master for interface Signed-off-by: Gaurav Gahlot <[email protected]>
Signed-off-by: Gaurav Gahlot <[email protected]>
- adds NGINX IP permanently to network interface - removes downloaded .tar.gz files after untar Signed-off-by: Gaurav Gahlot <[email protected]>
Signed-off-by: Gaurav Gahlot <[email protected]>
Signed-off-by: Gaurav Gahlot <[email protected]>
Signed-off-by: Gaurav Gahlot <[email protected]>
183a2a3
to
f52ce9a
Compare
Signed-off-by: Gaurav Gahlot <[email protected]>
Signed-off-by: Gaurav Gahlot <[email protected]>
Signed-off-by: Gaurav Gahlot <[email protected]>
f52ce9a
to
a8f04fa
Compare
Signed-off-by: Gaurav Gahlot <[email protected]>
pushd /tmp | ||
curl 'https://tinkerbell-oss.s3.amazonaws.com/osie-uploads/latest.tar.gz' -o osie.tar.gz | ||
tar -zxf osie.tar.gz | ||
if pushd /tmp/osie*/ ; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be tabbed in
Note: The setup has been tested on Ubuntu 18.04 and CentOS 7.
To setup tinkerbell stack in interactive mode using the following commands:
You can also setup in declarative mode. To test the script I used:
c3.small.x86
Execute the setup with:
$ curl https://raw.githubusercontent.com/infracloudio/tink/deploy_stack/setup.sh | bash
Video samples: