### Verify Docker installation Source: https://github.com/logpai/logparser/blob/main/docs/installation/install_docker.md Runs the hello-world image to confirm Docker is installed correctly. ```bash $ sudo docker run hello-world ``` -------------------------------- ### Run Demo Source: https://github.com/logpai/logparser/blob/main/logparser/DivLog/README.md Starts the DivLog demo by replacing 'sk-xxx' with your OpenAI API Key. ```bash python demo.py -key sk-xxx ``` -------------------------------- ### Build logpai/logparser:py3 Source: https://github.com/logpai/logparser/blob/main/docs/installation/install_docker.md Builds the logpai/logparser:py3 Docker image. ```bash $ sudo docker run --name logparser_py3 -it ubuntu:16.04 bash $ apt-get update $ apt-get install -y wget bzip2 git $ rm -rf /var/lib/apt/lists/* $ cd / mkdir anaconda cd anaconda wget https://repo.anaconda.com/archive/Anaconda3-5.1.0-Linux-x86_64.sh bash Anaconda3-5.1.0-Linux-x86_64.sh source ~/.bashrc cd .. rm -r anaconda pip install deap exit $ docker commit logparser_py3 logpai/logparser:py3 $ docker login $ docker push logpai/logparser:py3 ``` -------------------------------- ### Install Requirements Source: https://github.com/logpai/logparser/blob/main/logparser/Brain/README.md Install the required environment for the project. ```bash pip install -r requirements.txt ``` -------------------------------- ### Install LogParser Source: https://github.com/logpai/logparser/blob/main/README.md Install the logparser package and its requirements using pip. ```bash pip install logparser3 ``` -------------------------------- ### Build logpai/logparser:py2 Source: https://github.com/logpai/logparser/blob/main/docs/installation/install_docker.md Builds the logpai/logparser:py2 Docker image. ```bash $ sudo docker run --name logparser_py2 -it ubuntu:16.04 bash $ apt-get update $ apt-get install -y wget bzip2 $ apt-get install -y gcc perl git $ rm -rf /var/lib/apt/lists/* $ cd / mkdir anaconda cd anaconda wget https://repo.anaconda.com/archive/Anaconda2-5.2.0-Linux-x86_64.sh bash Anaconda2-5.2.0-Linux-x86_64.sh source ~/.bashrc cd .. rm -r anaconda exit $ docker commit logparser_py2 logpai/logparser:py2 $ docker login $ docker push logpai/logparser:py2 ``` -------------------------------- ### Install Docker package (Ubuntu 16.04) Source: https://github.com/logpai/logparser/blob/main/docs/installation/install_docker.md Installs the Docker CE package on Ubuntu 16.04. ```bash $ sudo dpkg -i ~/docker/docker-ce_17.03.2~ce-0~ubuntu-xenial_amd64.deb ``` -------------------------------- ### Run Logparser Demos Source: https://github.com/logpai/logparser/blob/main/docs/demo.md After starting the Docker container, these commands clone the logparser repository and execute the Drain demo script on HDFS sample logs. ```bash $ git clone https://github.com/logpai/logparser.git /logparser/ $ cd /logparser/demo/ $ python Drain_demo.py ``` -------------------------------- ### Uninstall old docker versions Source: https://github.com/logpai/logparser/blob/main/docs/installation/install_docker.md Removes any previously installed Docker packages. ```bash $ sudo apt-get remove docker docker-engine docker.io ``` -------------------------------- ### Install linux-image-extra for aufs storage drivers (Ubuntu 14.04) Source: https://github.com/logpai/logparser/blob/main/docs/installation/install_docker.md Installs necessary kernel image extras for Docker's aufs storage driver on Ubuntu 14.04. ```bash $ sudo apt-get update $ sudo apt-get install \ linux-image-extra-$(uname -r) \ linux-image-extra-virtual ``` -------------------------------- ### Add user to docker group Source: https://github.com/logpai/logparser/blob/main/docs/installation/install_docker.md Allows running Docker commands without sudo by adding the current user to the docker group. ```bash $ sudo groupadd docker $ sudo usermod -aG docker $USER ``` -------------------------------- ### Install Docker package (Ubuntu 14.04) Source: https://github.com/logpai/logparser/blob/main/docs/installation/install_docker.md Installs the Docker CE package on Ubuntu 14.04. ```bash $ sudo dpkg -i ~/docker/docker-ce_17.03.2~ce-0~ubuntu-trusty_amd64.deb ``` -------------------------------- ### Run Docker Container for Python 2 Source: https://github.com/logpai/logparser/blob/main/docs/demo.md This command sets up a Docker container for Python 2, mounting a local directory for persistence and entering the container's bash shell. ```bash $ mkdir logparser $ docker run --name logparser_py2 -it -v logparser:/logparser logpai/logparser:py2 bash ``` -------------------------------- ### Run Docker Container for Python 3 Source: https://github.com/logpai/logparser/blob/main/docs/demo.md This command sets up a Docker container for Python 3, suitable for running tools like MoLFI, mounting a local directory for persistence and entering the container's bash shell. ```bash $ mkdir logparser $ docker run --name logparser_py3 -it -v logparser:/logparser logpai/logparser:py3 bash ``` -------------------------------- ### Run Benchmark Source: https://github.com/logpai/logparser/blob/main/logparser/DivLog/README.md Executes the DivLog benchmark by replacing 'sk-xxx' with your OpenAI API Key. ```bash python benchmark.py -key sk-xxx ``` -------------------------------- ### Docker Images Source: https://github.com/logpai/logparser/blob/main/logparser/Brain/README.md Pull and run the Docker image for Brain. ```bash 1. docker pull docker.io/gaiusyu/brain:v2 2. docker run -it --name brain gaiusyu/brain:v2 ``` -------------------------------- ### Run Drain Demo Source: https://github.com/logpai/logparser/blob/main/README.md Navigate to the Drain parser directory and run the demo script. ```bash cd logparser/Drain python demo.py ``` -------------------------------- ### Replace API Request for Chat Completion Source: https://github.com/logpai/logparser/blob/main/logparser/DivLog/README.md Example of replacing the original API request design for GPT-3 models with the latest Chat Completion API. ```python ### Replace it response = openai.Completion.create( model=model, prompt=instruction + "\n\n\n" + prompt + ":":" + line.strip() + "\n: ", temperature=temperature, max_tokens=token_len) ``` -------------------------------- ### Run Demo Source: https://github.com/logpai/logparser/blob/main/logparser/AEL/README.md Scripts to run the AEL demo. ```bash python demo.py ```