Skip to content

v0.4.0 Container Maintenance

AnkshitJain edited this page Sep 29, 2018 · 1 revision

Ansible can be used to start/stop/restart the containers. All the commands need to be executed from AutolabJS/deploy directory. The following commands can be used for the same.

  • Database

    • Start Container
    sudo ansible -i inventory mysql --become --ask-become-pass  -m docker_container -a "name=autolab-db state=started"
    
    • Stop Container
    sudo ansible -i inventory mysql --become --ask-become-pass  -m docker_container -a "name=autolab-db state=stopped"
    
    • Restart Container
    sudo ansible -i inventory mysql --become --ask-become-pass  -m docker_container -a "name=autolab-db state=started  restart=yes"
    
  • Gitlab

    • Start Container
    sudo ansible -i inventory gitlab --become --ask-become-pass  -m docker_container -a "name=gitlab state=started"
    
    • Stop Container
    sudo ansible -i inventory gitlab --become --ask-become-pass  -m docker_container -a "name=gitlab state=stopped"
    
    • Restart Container
    sudo ansible -i inventory gitlab --become --ask-become-pass  -m docker_container -a "name=gitlab state=started   restart=yes"
    
  • Loadbalancer

    • Start Container
    sudo ansible -i inventory loadbalancer --become --ask-become-pass  -m docker_container -a "name=loadbalancer state=started"
    
    • Stop Container
    sudo ansible -i inventory loadbalancer --become --ask-become-pass  -m docker_container -a "name=loadbalancer state=stopped"
    
    • Restart Container
    sudo ansible -i inventory loadbalancer --become --ask-become-pass  -m docker_container -a "name=loadbalancer  state=started restart=yes"
    
  • Main Server

    • Start Container
    sudo ansible -i inventory mainserver --become --ask-become-pass  -m docker_container -a "name=mainserver state=started"
    
    • Stop Container
    sudo ansible -i inventory mainserver --become --ask-become-pass  -m docker_container -a "name=mainserver state=stopped"
    
    • Restart Container
    sudo ansible -i inventory mainserver --become --ask-become-pass  -m docker_container -a "name=mainserver  state=started restart=yes"
    
  • Execution Node

    • Start Container
    sudo ansible -i inventory executionnodes --become --ask-become-pass  -m docker_container -a "name=execution-node-<ip>-<port> state=started"
    
    • Stop Container
    sudo ansible -i inventory executionnodes --become --ask-become-pass  -m docker_container -a "name=execution-node-<ip>-<port> state=stopped"
    
    • Restart Container
    sudo ansible -i inventory executionnodes --become --ask-become-pass  -m docker_container -a "name=execution-node-<ip>-<port> state=started restart=yes"
    

Useful Docker Commands

docker cp (src and dst can be on containers)
docker inspect <container_name>
docker images
docker ps
docker ps -a
docker images export and import

Clone this wiki locally
You can’t perform that action at this time.