Skip to content

NapierNLP/CiViL

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CiViL Project

The dockerized version of the project facilitates the process of installing the system on your local machine.

Base system requirements

  • Docker, Docker-Compose

Installation

The following installation instructions are taken from the websites below. Check them out for more details.

Set up the repository

  1. Update the apt package index:
sudo apt update
  1. Install packages to allow apt to use a repository over HTTPS:
sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
  1. Add Docker’s official GPG key:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

Verify that you now have the key with the fingerprint 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88, by searching for the last 8 characters of the fingerprint:

sudo apt-key fingerprint 0EBFCD88

The output should look as follows:

pub   rsa4096 2017-02-22 [SCEA]
      9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid           [ unknown] Docker Release (CE deb) <docker@docker.com>
sub   rsa4096 2017-02-22 [S]
  1. Use the following command to set up the stable repository:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

Install Docker Engine - Community

  1. Update the apt package index:
sudo apt update
  1. Install the latest version of Docker Engine - Community:
sudo apt-get install docker-ce docker-ce-cli containerd.io
  1. Verify that Docker Engine - Community is installed correctly by running the hello-world image:
sudo docker run hello-world

This command downloads a test image and runs it in a container. When the container runs, it prints an informational message and exits.

Post-installation steps

Docker Engine - Community is installed and running. The docker group is created but no users are added to it. You need to use sudo to run docker commands. Fulfilling the following steps will let you run docker commands without sudo.

  1. Create the docker group:
sudo groupadd docker
  1. Add your user to the docker group:
sudo usermod -aG docker $USER
  1. Run the following command to activate the changes to groups:
newgrp docker
  1. Verify that you can run docker commands without sudo:
docker run hello-world

Install Docker Compose

  1. Run this command to download the current stable release of Docker Compose:
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  1. Check if your ip address matches the address in the docker-compose.yml file. Type the following command and look for "docker0":
ip addr show

If your ip address is different, change it in the docker-compose.yml file.

Usage

Testing CiViL project

First, you need to build docker containers:

docker-compose up --build --no-cache

Note: You may want to start the system in detached mode by adding -d to the docker-compose command, the console output can then be accessed using docker-compose logs -f service_name.

Re-building containers after you've made changes to the project

When you make changes to the project (e.g. to some CiViL bots), you will need to rebuild the containers.

To take the system down and remove the virtual network run:

docker-compose down

To remove all unused images:

docker image prune -a

To remove all building cache:

docker builder prune -a

If you just wish to re-build the images that have been changed and restart the necessary containers without downtime run:

docker-compose up --build  --no-cache

Only containers with changes will be rebuilt, the others will be skipped.

Viewing system logs

Use the following command if you wish to view system logs:

docker-compose logs -f

Use the following command if you wish to view the output of a particular system service such as the directions_bot:

docker-compose logs -f directions_bot

To exit the preview, press Ctrl+C. You can also use docker attach directions_bot to view the logs, but this directly attaches the terminal so when you press Ctrl+C, it'll stop the service.

##AWS Instance

To access to the aws instance

ssh -i /path/key-pair-name.pem instance-user-name@instance-public-dns-name

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published