Administrator

General

  1. How many machines do I need to run Autolab?
    Ans: Autolab can support up to 200 concurrent students on a single machine with 4GB RAM and dual-core processors, 40GB hard disk space. Autolab can easily support up to 600 students with take home style of home work assignments.

Installation

  1. The configuration file seems to be full of IP addresses. Does the Autolab support domain names (DNS)?
    Ans: The domain names are supported and are in fact the preferred way of specifying the hostnames in all the configuration files.

  2. I tried to run the Ansible playbook twice and got the database error shown below.
    TASK [Create Autolab database] *************************************************
    fatal: [localhost]: FAILED! => {"changed": true, "cmd": ["docker", "exec", "autolab-db", "bash", "-c", "mysql -u root -proot -e 'CREATE DATABASE Autolab'"], "delta": "0:00:01.447437", "end": "2016-11-28 02:28:17.562664", "failed": true, "rc": 1, "start": "2016-11-28 02:28:16.115227", "stderr": "mysql: [Warning] Using a password on the command line interface can be insecure.\nERROR 1007 (HY000) at line 1: Can't create database 'Autolab'; database exists", "stdout": "", "stdout_lines": [], "warnings": []}

What should I do now?
Ans: Comment (Please put a # symbol at the beginning of each line) lines 41 and 42 of playbook.yml file. Now run the installation command again. That should install the Autolab setup properly.
Another solution is to look at deleting an existing Autolab database completely. Please understand that choosing this option leads to data loss. Given that caveat, you can try the following recipe.

$sudo docker exec -it autolab-db bash
#mysql -u root -p          #on prompt, enter the DB root password set in "inventory" file
mysql>DROP DATABASE Autolab;
mysql>quit
#exit
  1. I got the installation error with Gitlab server with the error shown below.
    TASK [Waiting for Unicorn on GitLab server to be up] ***************************
    fatal: [13.65.36.224]: FAILED! => {"changed": true, "cmd": "docker exec gitlab bash -c \"/wait-for-it.sh -t 300 127.0.0.1:8080\"", "delta": "0:05:00.112174", "end": "2016-11-28 02:17:04.006885", "failed": true, "rc": 124, "start": "2016-11-28 02:12:03.894711", "stderr": "wait-for-it.sh: waiting 300 seconds for 127.0.0.1:8080\nwait-for-it.sh: timeout occurred after waiting 300 seconds for 127.0.0.1:8080", "stdout": "", "stdout_lines": [], "warnings": []}
        to retry, use: --limit @/home/autolab/JavaAutolab/deploy/playbook.retry

What should I do now?
Ans: Comment (Please put a # symbol at the beginning of each line) lines 41 and 42 of playbook.yml file. Now run the installation command again. That should install the Autolab setup properly.

  1. I made a configuration mistake in one of the containers (i.e., mainserver, loadbalancer or execution nodes) and that container is restarting. What should I do now?
    Ans: First stop the container using the following command
    sudo docker stop <container_name>
    Correct the configuration in the configuration files available in the following locations.
    mainserver --> JavaAutolab/deploy/configs/main_server/.json
    loadbalancer --> JavaAutolab/deploy/configs/load_balancer/
    .json
    execution_nodes... --> /root/.autolab/configs/execution_nodes
    AND then restart the respective container.

Load Balancer

  1. My evaluation requests get stuck forever. Upon checking the load balancer logs, I see socket connection refused message. Why?
    Ans: The scores.json file of the execution nodes are not configured properly. Please correctly set the hostname and port parameters in scores.json for each of the execution nodes.

Execution Nodes

  1. How do I add more execution nodes?
    Ans: We have not automated the process for this step. In general the outline for adding extra execution nodes is as follows.

    1. Login to the machine running the execution node. In a two machine setup, this would be Machine 2. In a single machine setup, the steps would be followed on the same machine.

    2. Change to root user.
      sudo su

    3. Change to execution node SSH keys directory.
      cd /root/.autolab/keys (for two machine case, this path would be on machine-2)
      cd ~/.autolab/keys (for single machine case, ~ refers to home directory of logged in user)

    4. Create a new directory with the intended name of execution node, for ex: execution-node-10.0.0.5-8083.
      mkdir execution-node-10.0.0.5-8083

    5. Change to the newly created directory.
      cd execution-node-10.0.0.5-8083

    6. Create a new SSH key for the execution node.
      ssh-keygen -t rsa -C 'admin@javaautolab.com' -f id_rsa -N ''

    7. Add the public key to ssh keys of root user in Gitlab. Follow this Gitlab guide if you need help with this step.

    8. Change to configs directory.
      cd /root/.autolab/configs (for two machine case, this path would be on machine-2)
      cd ~/.autolab/configs (for single machine case, ~ refers to home directory of logged in user)

    9. Copy the existing settings of an execution node into new directory, say execution_nodes2.
      cp -r execution_nodes execution_nodes2

    10. Change the host port in execution_nodes2/conf.json to one higher, non-used port, say 8083.

    11. Set the hostname and port parameters in execution_nodes2/scores.json appropriately. The hostname field is the IP address of the machine on which the execution node container is to be run. The port field needs to be one higher, non-used port, say 8083.

    12. Use the existing docker image execution_node to run a new container with name, say execution-node-10.0.0.5-8083.
      docker run --net=host --name=execution-node-10.0.0.5-8083 -e GITLAB_IP='10.0.0.4' -v /etc/localtime:/etc/localtime:ro -v /root/.autolab/configs/execution_nodes2:/etc/execution_node -v /root/.autolab/keys/execution-node-10.0.0.5-8083:/root/.ssh/ -dit execution_node

    13. Exit the super user account.
      exit

    14. Update the load balancer configuration to add new execution node.
      "Nodes": [ { "hostname": "10.0.0.5", "port": "8082" }, { "hostname": "10.0.0.5", "port": "8083" } .......rest of configuration file continues

    15. Restart the load balancer.
      sudo ansible -i inventory loadbalancer --become --ask-become-pass -m docker_container -a "name=loadbalancer state=started restart=yes"

  2. What is the role of scores.json configuration file?
    Ans: Execution node uses json object format specified in scores.json to configure itself. Please set the hostname and port of each execution node properly.

gitlab

  1. How do I change my gitlab server IP address?
    Ans: First, make sure that your gitlab container is up and running. Then follow these steps:
    $sudo docker stop gitlab
    $sudo docker rm gitlab
    $sudo docker run --detach --hostname gitlab.example.com -e GITLAB_ROOT_PASSWORD="<pwd>" -e GITLAB_OMNIBUS_CONFIG="external_url 'https://<new_ip>'; nginx['redirect_http_to_https'] = true;" --publish 443:443 --publish 80:80 --publish 22:22 --name gitlab --restart always --volume /srv/gitlab/config:/etc/gitlab --volume /srv/gitlab/logs:/var/log/gitlab --volume /srv/gitlab/data:/var/opt/gitlab gitlab/gitlab-ce:latest
    $sudo docker exec -it gitlab bash
    #gitlab-ctl reconfigure
    #gitlab-ctl restart

    Change the and variables to suit your scenario.

  2. I am not able to send / receive forgotten password emails from gitlab. What should I do?
    Ans: You need to enable SMTP settings in Gitlab. Modify the /etc/gitlab/gitlab.rb file in gitlab container as per the instructions available on the gitlab smtp settings page.
    Reconfigure gitlab using the command
    gitlab-ctl reconfigure
    send a test mail to yourself by using the following commands
    gitlab-rails console
    From gitlab ruby terminal, type
    irb(main):003:0> Notify.test_email('<your_mail_id>', 'Message Subject', 'Message Body').deliver_now
    Most mail providers like Gmail and Yahoo need modifications to settings in their mail accounts from more secure to less secure in order for the mail account to be used for sending gitlab email.

  3. I forgot the root password of gitlab. Is there a way to recover the same?
    Ans: You can recover the password using instructions from GitLab.

  4. How do I disable groups feature for regular users?
    Ans: Please see the groups documentation available on gitlab.