nre-learning / antidote-selfmedicate

Configs and scripts for spinning up a local instance of Antidote on your laptop for testing and lesson development
Apache License 2.0
11 stars 19 forks source link

I do not see any lesson when I am running nre-learning on my computer #32

Closed littlespace closed 5 years ago

littlespace commented 5 years ago

Hi

I followed all the instructions to install and use the nre-learning locally on my comouter.

I did not get any errors :

Creating minikube cluster. This can take a few minutes, please be patient... There is a newer version of minikube available (v1.3.0). Download it here: https://github.com/kubernetes/minikube/releases/tag/v1.3.0

To disable this notification, run the following: minikube config set WantUpdateNotification false 😄 minikube v0.34.1 on linux (amd64) 🔥 Creating kvm2 VM (CPUs=4, Memory=8096MB, Disk=20000MB) ... 💿 Downloading Minikube ISO ... 184.30 MB / 184.30 MB [============================================] 100.00% 0s 📶 "minikube" IP address is 192.168.39.111 🐳 Configuring Docker as the container runtime ... ✨ Preparing Kubernetes environment ... ▪ kubelet.network-plugin=cni 💾 Downloading kubeadm v1.13.3 💾 Downloading kubelet v1.13.3 🚜 Pulling images required by Kubernetes v1.13.3 ... 🚀 Launching Kubernetes v1.13.3 using kubeadm ... 🔑 Configuring cluster permissions ... 🤔 Verifying component health ..... E0806 20:54:39.340764 6419 console.go:75] applyStyle(mount): unknown style: "mount" Creating mount /home/ubuntu/nrelabs-curriculum:/antidote ... 💗 kubectl is now configured to use "minikube" 🏄 Done! Thank you for using minikube!

The minikube cluster is now online. Now, we need to add some additional infrastructure components.

This will take some time - this script will pre-download large images so that you don't have to later. BE PATIENT.

######################################## Done. ######################################## Done. ######################################## Done. ######################################## Done. ######################################## Done. ######################################## Done. About to modify /etc/hosts to add record for 'antidote-local' at IP address 192.168.39.111. You will now be prompted for your sudo password. Finished! Antidote should now be available at http://antidote-local:30001/

and

time="2019-08-06T21:01:50Z" level=info msg="Successfully imported collection 12: Cisco" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported collection 8: Cumulus Networks" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported collection 3: General Datatech (GDT)" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported collection 4: HexaBuild" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported collection 5: IGNW" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported collection 1: Juniper Networks" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported collection 6: Myriad360" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported collection 10: Network To Code" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported collection 9: Packet Pushers" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported collection 7: Red Hat" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported collection 2: Synercomm" time="2019-08-06T21:01:50Z" level=info msg="Imported 11 collection definitions." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/fundamentals/lesson-1-demo/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 1: Antidote Test Lesson with 6 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/fundamentals/lesson-100-frr/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 100: Introduction to Lessons with 1 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/fundamentals/lesson-14-yaml/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 14: Introduction to YAML with 1 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/fundamentals/lesson-16-jinja/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 16: Using Jinja for Configuration Templates with 1 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/fundamentals/lesson-17-git/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 17: Version Control with Git with 1 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/fundamentals/lesson-19-restapis/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 19: Working with REST APIs with 4 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/fundamentals/lesson-22-python/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 22: Introduction to Python with 1 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/fundamentals/lesson-23-linux/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 23: Linux Basics with 1 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/fundamentals/lesson-50-bash/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 50: Introduction to BASH with 1 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/tools/lesson-12-jsnapy/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 12: Network Unit Testing with JSNAPY with 4 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/tools/lesson-13-napalm/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 13: Multi-Vendor Network Automation with NAPALM with 2 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/tools/lesson-15-stackstorm/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 15: Event-Driven Network Automation with StackStorm with 4 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/tools/lesson-18-todd/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 18: End-to-End Network Testing with ToDD with 3 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/tools/lesson-24-pyez/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 24: Junos Automation with PyEZ with 2 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/tools/lesson-25-junosjet/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 25: Juniper Extension Toolkit (JET) with 2 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/tools/lesson-26-openconfig/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 26: Vendor-Neutral Network Configuration with OpenConfig with 2 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/tools/lesson-29-robot/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 29: Using Robot Framework for Automated Testing with 2 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/tools/lesson-30-salt/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 30: Network Automation with Salt with 2 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/tools/lesson-31-terraform/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 31: Terraform & Junos with 4 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/workflows/lesson-21-tshoot-ipphone/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 21: Automating the Troubleshooting Chain with 7 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/workflows/lesson-32-stigcompliance/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 32: Automated STIG Compliance Validation with 2 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/workflows/lesson-33-quickdeviceinventory/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 33: Quick and Easy Device Inventory with 3 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/workflows/lesson-34-configbackup/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 34: Automated Device Configuration Backup with 3 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Importing lesson definition at: /antidote/lessons/workflows/lesson-35-devicespecifictemplate/lesson.meta.yaml" time="2019-08-06T21:01:50Z" level=info msg="Successfully imported lesson 35: Device Specific Template Generation with 3 endpoints." time="2019-08-06T21:01:50Z" level=info msg="Imported 24 lesson definitions." All detected curriculum resources imported successfully.

When I check http://antidote-local:30001/ it looks good but when I click on Lesson Catalog I do not see any lesson. I already checked the config file and everything looks good

Thanks

littlespace commented 5 years ago

@Mierdin Can you please let me know how can I fix this?

Thanks

Mierdin commented 5 years ago

Sorry for the delayed response. I gave this a test drive as I was updating selfmedicate to pull the latest version of the platform released this week and with the latest master, I was able to get the lessons loaded:

./selfmedicate.sh start
WARNING - EXISTING MINIKUBE CONFIGURATION DETECTED
This command is designed to start a new minikube cluster from scratch, and must delete any existing configurations in order to move forward.
Press any key to DESTROY THE EXISTING CLUSTER and create a new one for antidote (Ctrl+C will escape).
⚠️  There is a newer version of minikube available (v1.3.0).  Download it here:
https://github.com/kubernetes/minikube/releases/tag/v1.3.0

To disable this notification, run the following:
minikube config set WantUpdateNotification false

Creating minikube cluster. This can take a few minutes, please be patient...
😄  minikube v1.2.0 on linux (amd64)
🔥  Creating virtualbox VM (CPUs=2, Memory=8192MB, Disk=20000MB) ...
🐳  Configuring environment for Kubernetes v1.15.0 on Docker 18.09.6
    ▪ kubelet.network-plugin=cni
❌  Unable to load cached images: loading cached images: loading image /home/mierdin/.minikube/cache/images/gcr.io/k8s-minikube/storage-provisioner_v1.8.1: creating copyable file asset: storage-provisioner_v1.8.1: Error opening file asset: /home/mierdin/.minikube/cache/images/gcr.io/k8s-minikube/storage-provisioner_v1.8.1: open /home/mierdin/.minikube/cache/images/gcr.io/k8s-minikube/storage-provisioner_v1.8.1: permission denied
🚜  Pulling images ...
🚀  Launching Kubernetes ... 
📁  Creating mount ../nrelabs-curriculum:/antidote ...
⌛  Verifying: apiserver etcd scheduler controller
🏄  Done! kubectl is now configured to use "minikube"

The minikube cluster is now online. Now, we need to add some additional infrastructure components.

This will take some time - this script will pre-download large images so that you don't have to later. BE PATIENT.

######################################## Done.
######################################## Done.
######################################## Done.
######################################## Done.
######################################## Done.
######################################## Done.
About to modify /etc/hosts to add record for 'antidote-local' at IP address 192.168.99.100.
You will now be prompted for your sudo password.
[sudo] password for mierdin: 
Finished! Antidote should now be available at http://antidote-local:30001/

Screenshot from 2019-08-11 20-38-55

I noticed you're running v0.34.1, likely due to the fact that our selfmedicate docs still say to use that version due to a bug in v0.35. Obviously, strong kudos for actually reading the docs :smile: but in this case I think the bug we were avoiding in those days is not present now, as I'm using a much more recent version of minikube. Can you try:

Then report back and let us know the results.

littlespace commented 5 years ago

@Mierdin thanks for checking this. I have created a new box and did it again:

WARNING - EXISTING MINIKUBE CONFIGURATION DETECTED This command is designed to start a new minikube cluster from scratch, and must delete any existing configurations in order to move forward. Press any key to DESTROY THE EXISTING CLUSTER and create a new one for antidote (Ctrl+C will escape). Creating minikube cluster. This can take a few minutes, please be patient... 😄 minikube v1.3.0 on Ubuntu 16.04 🔥 Creating virtualbox VM (CPUs=2, Memory=8192MB, Disk=20000MB) ... 🐳 Preparing Kubernetes v1.15.2 on Docker 18.09.8 ... ▪ kubelet.network-plugin=cni 🚜 Pulling images ... 🚀 Launching Kubernetes ... 📁 Creating mount ../nrelabs-curriculum:/antidote ... ⌛ Waiting for: apiserver etcd scheduler controller 🏄 Done! kubectl is now configured to use "minikube"

The minikube cluster is now online. Now, we need to add some additional infrastructure components.

This will take some time - this script will pre-download large images so that you don't have to later. BE PATIENT.

######################################## Done. ######################################## Done. ######################################## Done. ######################################## Done. ######################################## Done. ######################################## Done. About to modify /etc/hosts to add record for 'antidote-local' at IP address 192.168.99.102. You will now be prompted for your sudo password. Finished! Antidote should now be available at http://antidote-local:30001/

but still not seeing anything :( Screenshot from 2019-08-12 11-05-27

littlespace commented 5 years ago

@Mierdin I have found the issue. I was doing this on a remote server and was trying to access it from my local PC. I had to add antidote-local with the IP address of my remote server to my local /etc/hosts file. so try this by IP like http://192.168.99.101:30001 is not going to work. it has to be by hostname http://antidote-local:30001 even if you want to test it locally on your computer.

Mierdin commented 5 years ago

Yes, this is due to the fact that the kubernetes ingresses require this at the moment. I'll look into at a minimum documenting this more explicitly, or perhaps using some kind of wildcard when running locally. Thanks for sticking it out

littlespace commented 5 years ago

@Mierdin thanks for doing this. is there a way to speed up the lab load time? I have a config with 24 CPU and 48GB of RAM but still does not load as fast as your nre-lab demo web site. I Am using KVM by the way and it was faster that VirtualBox.

littlespace commented 5 years ago

I am getting this error for couple of those labs:

Screen Shot 2019-08-13 at 3 14 02 PM
Mierdin commented 5 years ago

It depends on what's causing the timeout. There are a myriad of things that need to happen before a lesson shows in the UI, many of which are just waiting for kubernetes to do it's thing. For instance, downloading images. So one thing you could do, is check the status of the pods in your lesson and see where it's hung up. Could be you're just timing out the first time since the lesson images weren't cached. Selfmedicate downloads a few of the commonly used images on setup, but not all. Please check out the troubleshooting docs for some things you can try

We've also had a bunch of issues with the default minikube VM, and we're currently working on some changes to selfmedicate which would run kubernetes baremetal instead. So if you're running Linux that will work really well. Optionally though, we'll also provide a Vagrantfile for those that aren't running Linux, so you can still run selfmedicate on non-Linux, but that Vagrantfile will be optimized to run this stuff. No ETA yet, but this is probably coming in the next release cycle I would expect, so hopefully in the next few weeks.

We've expanded beyond the original topic for this issue, so I'm going to close this - but please do try to load the lesson again, and try gathering some output from the commands in the troubleshooting doc, and if you're still having issues, follow up on the community forums.

Mierdin commented 5 years ago

@littlespace FYI, https://github.com/nre-learning/antidote-selfmedicate/pull/34 is an awesome new PR which implements what I mentioned above, using a Vagrantfile. So if you have a linux machine, you can use the selfmedicate script inside, which uses driver=none. If you don't, you can use the Vagrant environment which gives you a linux VM which likely works better than the lightweight VM natively provided by minikube. Might want to check that out and provide feedback