v0.3.0 Deployment on Single Machine
- Ubuntu server 16.04 operating system.
- Record the IP Address / domain name of the machine. If your machine has multiple IP addresses, please use the public IP address for installation purposes. Because of ease of use, domain name (DNS) is a preferred option for hostname in all the configuration files.
Most likely, your machine may be on a corporate private network with a gateway / proxy server / firewall connection to Internet. In that case, please use your machine's private IP address.
You can locate the configured IP address of your machine using the following command.
in the displayed output, look for IP address following the inet keyword.
ip addr show
- Change the listening port of SSH server to 2222 in
/etc/ssh/sshd_configfile and restart the SSH server using the following command.
sudo service ssh restart
If the SSH server is not running on your machine, please ignore the rest of this section and directly go to Installation section.
- For the SSH setting to be fully effective, logout of the current SSH session and relogin.
Download the code repository
wget https://github.com/AutolabJS/AutolabJS/archive/dev.zip -O AutolabJS.zip
mv AutolabJS-dev AutolabJS
Change to deploy directory.
Specify the installation directory by changing the
setup.conffile. If unchanged, the installation defaults to
Copy AutolabJS codebase to installation base directory.
All the further steps in the installation procedure need to be executed from the installation directory. Go to installation directory.
Install third-party software dependencies required for AutolabJS.
AutolabJS uses docker containers for implementing microservices. Docker containers are bulky and require significant download time. This step helps you download the docker container images.
The script should download three docker containers. If the download of container images fails due to network issues, you can re-run the
bash docker-pull.shcommand repeatedly until all the three container images are downloaded.
Build the docker containers of AutolabJS components by installing the required dependencies on the containers downloaded in the previous step.
The image building step can fail due to network errors. You can run the
bash docker_build.shas many times as you need until all the required docker images have been built. You can check the successful completion of this step by running the following command and checking the expected output.
sudo docker images
The expected output is as follows.
execution_node latest ... load_balancer latest ... main_server latest ... ubuntu 16.04 ... gitlab/gitlab-ce ce:10.1.4-ce.0 ... mysql latest ...
Configure the autolab components by editing the configuration files in
configs/<component>. Note that you need to use domain names for IP address of the machines wherever required. In case a domain name is not allocated to the machine, you can use the private IP address for installation. Unless you have special requirements, you can use the default host(name) and port numbers.
The list of configuration files to be changed are:
deploy/configs/main_server: APIKeys.json, conf.json, courses.json, labs.json
deploy/configs/execution_nodes: scores.json, conf.json
Do remember to change the default passwords in both the inventory file (
AutolabJS/deploy/inventory) and in the configuration files. Please make sure that the changed passwords match in both the inventory file and the configuration files.
The locations of credentials are:
File MySQL GitLab Main Server deploy/inventory ✔ ✔ deploy/configs/main_server/APIKeys.json ✔ (for /admin route) deploy/configs/main_server/conf.json ✔ ✔ deploy/configs/load_balancer/nodes_data_conf.json ✔
gitlabsection of inventory file, change the hostname of gitlab item from localhost to Machine IP / domain name. If the machine has multiple IP addresses, then please use the public IP address. The line should look like
[gitlab] <Machine_IP> ansible_connection=local ansible_python_interpreter=/usr/bin/python2 gitlab_password=<gitlab_password>
Update the SSL certificate information in
Execute the AutolabJS setup script to install node packages and create SSL certificates.
Run the ansible-playbook:
sudo ansible-playbook -i inventory playbook-single.yml
The password to be provided is that of root user (or sudoer) of the machine.
Ansible installs all the components of Autolab. If the previous step executes successfully, the installation is complete.
Add cron job to restart the autolab components automatically.
- Login as root
- Copy restart script to root account
cp deploy/autolab-restart.sh /root/
- Open crontab editor as root user
- Enter a job in the file to run the restart script every minute.
* * * * * bash /root/autolab-restart.sh
- Login as root
In case of installation failure due to incorrect configuration, please see the FAQ page to see if you can resolve the error. If not, you can run the following commands to uninstall AutolabJS.
The uninstall command is:
sudo ansible-playbook -i inventory uninstall.yml
The username and the password to be provided are the credentials of root user (or sudoer) of the machine.
Remove the autolab installation directory completely.
cd #go to home directory
rm -rf /opt/autolabjs
Repeat the installation steps-(10) to (15) given above to install AutolabJS again.
Installation creates containers for main server, load balancer, execution node, data base and Gitlab. For further information on managing these containers see container maintenance page.