Skip to content
CodioMay 25, 20164 min read

New "Install Software" feature

We are pleased to announce the introduction of our easy-to-use Install Software feature. Available from the Tools menu, Install Software allows users to create scripts that can install or reconfigure software on any Codio box. These scripts can then be run by any user at any time.

Codio's older G1 boxes used something called 'Box Parts'. Whilst friendly, this was extremely hard to configure and maintain and was a non-standard approach to package management. With the introduction of our G2 boxes and the advent of sudo access for all users, the new Install Software feature is a major improvement.

Screen Shot Image

Why use scripts?

When you are configuring a new Codio box (server) with software you can, of course, use the command line. However, this can be cumbersome and requires either deep understanding of what you are installing or you need to Google a solution and then follow what is often a complex set of steps.

The Install Software feature allows these scripts to be written once and then run by anyone with a single click from a friendly screen.

If you need to install and configure MySQL, for example, then while you could always bring up the command line and go through the various steps one by one, Install Software lets you do it with a single click.

Stacks vs. Install Software

Codio's Stacks allows any user to create a fully configured box from a template library in a couple of seconds - very fast and powerful. But if you need to add any components to an existing box or configure an empty box as efficiently as possible then Install Software lets you drive in the fast lane.

Once you have a box reconfigured in this way, you can then add to your Stack library or update an existing Stack.

How it works
What is a script?

A script is typically, but not necessarily, a bash script that runs a series of commands as you would on the command line to install or configure software on your Codio box. However, it can be any executable code you choose.

The scripts written by Codio typically use Ansible, a very friendly deployment management system that greatly reduces complexity.

Open Source

All of our Install Software scripts are open source and can be found at }https://github.com/codio/install_software.

You can fork this repository, make your own additions or improvements and then submit a pull request to update our global library.

The code is very simple to understand and is composed of the following.

  • package_list.json - this is the manifest that lists the entire contents of the publicly available scripts.
  • script folder - this is where you place your script. Feel free to examine the repo to see some examples.
  • Ansible playbook - if you want to use Ansible to manage the installation, then your main script should reference the .yaml file for the installation. You can find an example of this below.
Example : MySQL

The following bash file and corresponding Ansible script show how you can install MySQL from the Install Software menu in a few seconds.

Bash script

The following bash script is the one we use for MySQL. All this does is to call our standard Ansible loader script which in turn loads the relevant playbook.

#!/bin/bash bash -c "$(curl -fsSL https://raw.github.com/codio/install_software/master/tools/ansible.sh)" mysql echo "Mysql password root user password is 'codio'"
Ansible playbook script

As Ansible makes installations and configurations so easy, we use this to make our lives easier. We could have accomplished the same thing within the main bash script but it would be less readable and harder to maintain.

If you are interested in finding out more about Ansible playbooks, click here.

--- - name: Install MySQL hosts: 127.0.0.1 sudo: True vars: MySQL_root_pass: codio tasks: - name: Set MySQL root password before installing debconf: name='mysql-server' question='mysql-server/root_password' value='' vtype='password' - name: Set MySQL root again password before installing debconf: name='mysql-server' question='mysql-server/root_password_again' value='' vtype='password' - name: Install MySQL apt: name={{item}} state=present with_items: - mysql-server - mysql-client - python-mysqldb - copy: src=my.cnf dest=/home/codio/.my.cnf

Coming soon

In 2016, we will be enhancing the Install Software capabilities in a couple of important ways.

  • Local PC Execution - you will be able to create and manage scripts that control installations on local PCs. This will allow you to rapidly configure local environments for offline work and then synchronize your local projects with its associated Codio project.
  • Private scripts - organizations or users can create their own private scripts that do not form a part of the global Install software list but contain commonly used installations that you and your organization users commonly require.
Related Links

Technical documentation

avatar

Codio

Codio is the evidence-based platform for building mastery in computing education.