GithubHelp home page GithubHelp logo

learnlinux / tuxlab-infra Goto Github PK

View Code? Open in Web Editor NEW
4.0 4.0 1.0 1.18 MB

Ansible Tower Repository for TuxLab Infrastructure

License: GNU General Public License v2.0

Makefile 100.00%
ansible linux tuxlab tuxlab-infrastructure vagrant

tuxlab-infra's People

Contributors

amortenson avatar cemersoz avatar derektbrown avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

amortenson

tuxlab-infra's Issues

[FEATURE] Let's Encrypt

Because of the operation of RedRouter, we no longer need to do SSL key syncing across the SSHD Docker containers. We do, however, need to manage key syncing across the RedRouter proxy containers, such as to enable HTTPS/SSL via Let's Encrypt. Some key considerations:

  1. This code resides in the tuxlab-ssh-proxy branch (it is really obvious in proxy.js)
  2. Remember that Let's Encrypt keys expire after 90 days. So this key needs to be updated and propagated.
  3. These keys cannot be generated separately on each host. They need to be generated once and synced.

[FEATURE] Docker Restart

WE need to make sure that docker containers (RedRouter, Swarm) run forever- restarting if they fail.

[FEATURE] Docker Registry

  • Put Proxy and DNS on Registry
  • Allow for Lab Images from Registry
  • Use enclosejs to minify native includes (particularly for RedRouter)

[BUG] docker_container new image error

The release of centos/atomic we use does not include the latest version of docker-py, which means that we get the following error:

ansible/ansible-modules-core#5515

As a temporary fix, I pull the new images using the shell module prior to running the docker_container module. These temporary fix blocks should be removed once the bug above is resolved. I have marked these blocks as follows:

#TODO https://github.com/ansible/ansible-modules-core/issues/5515

[BUG] [REFACTOR] Fix SSH testing

SSH tests, were they run, would now currently fail. The only reason for this is that tux_pass is not copied over to meteor. We just need to do this.

[REFACTOR] LabVM Refactoring

  • Move RUN commands in the Dockerfile into a separate shell file
  • Put the password write command at the top of the file (resolves issues @cemersoz is having)

[FEATURE] Setup CI/CD

For the most part, no free platform allows for running a Vagrant VM (whether VirtualBox, Libvirt, VMWare) inside. We will need to setup a dedicated Jenkins CI Server inside an AWS Instance

[REFACTOR] test.yml

The beta version of the infrastructure makes some critical changes to the microservice architecture. We need to recreate test.yml to validate the state of the services TuxLab relies on:

  • Docker Swarm / HTTPS (:4000)
  • Docker Engine / HTTPS (:2375)
  • ETCD / HTTPS (:2379)
  • TuxLab Proxy (Docker Container on Hosts)
  • Meteor (:80 => :443 and :443)

[Bug] HelixDNS with ETCD Authentication

After revoking all guest permissions to make ETCD secure, I discovered that helixDNS no longer works. We need to find a way to pass ETCD authentication info into helixdns. I created an issue in the helixdns repo asking about this. For now, we should probably disable ETCD authentication.

[FEATURE] Update tuxlab-proxy role

The biggest problem right now is that the RedRouter container needs to be given access to the host docker process. I believe that it is possible to give it access via the binding at 172.17.0.1, but this needs to be tested. In addition, we need to be sure to block this access from all other containers so that LabVMs can't access services on the host:

  • Ensure RedRouter is given access to Docker, ETCD
  • Ensure LabVMs dont have access to any ports on the host (alpha.2)

There are then going to be some refactoring changes since we have moved to RedRouter:

  • Delete the variables currently associated with the template in the config.yml file
  • Needs to sync keys (#13) across RedRouter instances. (This task can be delayed until alpha.2)

[REFACTOR] Update LabVM

We need to perform some updates on the standard Alpine LabVM:

  • Update the Maintainer Field in the Dockerfile
  • Change the default shell to Bash

[REFACTOR] SSH Testing

The final SSH testing of proxy doesn't work, and needs to be fundamentally changed. The only way to really test the session is to create an interactive session, which requires "abusing" Ansible by adding a host (which is actually the LabVM) and trying to connect to it.

[REFACTOR] Add Meteor Steps to Ansible Role

The new version of Meteor has been released officially. However, I am not sure that it is installed as part of the default installer. In any case though, it seems we need to add at least the chown step from the temporary Meteor fix into the Ansible role for tuxlab-app so that the app will function properly:

learnlinux/tuxlab-app#130

Test it with just the chown step first, and add the other rm steps only if necessary.

[FEATURE] Docker ETCD Daemon

We need to create a simple nodejs application which runs inside the proxy container which listens to ETCD records and stops the docker containers if needed.

[FEATURE] Managing Storage Space

Another concern we haven't thought a ton about is the idea of actual HDD storage space- if we are automatically pulling whatever images the instructors specify, this could be a problem. How are we going to handle running out of storage space?

[FEATURE] Docker Host Scaling

We need to re-implement the code which performs health checks on the Docker Hosts. Ultimately, it needs the following functionality;

  • Checks RedRouter for WebSSH and SSH Use
  • Checks RAM and Processor use of the Docker Host

With this data, it can make a scaling request to AWS to scale using SQS.

[FEATURE] Pass node-etcd authentication details

In order for this to work down the road with etcd authentication, we need to pass in the correct etcd credentials during Ansible configuration:

  • tuxlab-app
    Currently the tuxlab-app ansible role creates a file called settings.env.json from a template. It only includes the etcd ip address, but ultimately needs to include the etcd authentication information (username, password) for the meteor role.
  • RedRouter
    The RedRouter backend object takes this input as the etcd_conn_opts object, which is just a raw node-etcd auth object. Ideally, this is imported from a file.

[FEATURE] DNS Testing

When we switched to skyDNS, the way to create and dig(?) for DNS records changed. We need to modify our infrastructure tests to account for this.

[FEATURE] Create different user for labs

When SSHing into lab containers, we currently always do so as the root user. The code upon which labs are built is written such that we can only SSH as the root user, even if other users are created. We want to be able to create a new user with a unique password and SSH as that user.

[REFACTOR] Docker-SSHD

  • The banner you created will only display on regular SSH (and not WebSSH connections). I think this is good in the long run- as it identifies our server. However, we need to create a separate MOTD for users once they login. This resides in /etc/motd and needs to be edited from the alpine default.
  • Can we rename from docker-sshd? We have made too many changes to call it the same thing.
  • Remove key syncing (#13)
  • Post to the Docker Hub

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.