<commit_before>#!/usr/bin/env bash
#
# This file is generated by l2tdevtools update-dependencies.py any dependency
# related changes should be made in dependencies.ini.

# Exit on error.
set -e

sudo add-apt-repository ppa:gift/dev -y
sudo apt-get update -qq
sudo apt-get install -y python3-pip


if [[ "$*" =~ "include-docker" ]]; then
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    sudo add-apt-repository \
       "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
       $(lsb_release -cs) \
       stable"
    sudo apt-get update -qq
    sudo apt-get install -qq -y docker-ce
    curl -L https://github.com/docker/compose/releases/download/1.26.1/docker-compose-$(uname -s)-$(uname -m) -o docker-compose
    sudo cp docker-compose /usr/local/bin/docker-compose
    sudo chmod +x /usr/local/bin/docker-compose
fi

if [[ "$*" =~ "include-grr" ]]; then
    # Start the GRR server container.
    mkdir ~/grr-docker
    sudo docker run \
      --name grr-server -v ~/grr-docker/db:/var/grr-datastore \
      -v ~/grr-docker/logs:/var/log \
      -e EXTERNAL_HOSTNAME="localhost" \
      -e ADMIN_PASSWORD="<PASSWORD>" \
      --ulimit nofile=1048576:1048576 \
      -p 127.0.0.1:8000:8000 -p 127.0.0.1:8080:8080 \
      -d grrdocker/grr:release grr

    # Wait for GRR to initialize.
    /bin/sleep 120

    # Install the client.
    sudo docker cp grr-server:/usr/share/grr-server/executables/installers .
    sudo dpkg -i installers/*amd64.deb
fi

if [[ "$*" =~ "include-timesketch" ]]; then
    # Start the Timesketch server container.
     export OPENSEARCH_VERSION=1.2.2
     git clone https://github.com/google/timesketch.git
     cd timesketch
     cd docker
     cd e2e
     sudo -E docker-compose up -d
     # Wait for Timesketch to initialize
     /bin/sleep 300
     cd ../../..
     cp config/linux/timesketchrc ~/.timesketchrc
     cp config/linux/timesketch.token ~/.timesketch.token
fi

if [[ "$*" =~ "include-plaso" ]]; then
    sudo apt-get -qq -y install plaso-tools
fi

# pending resolution of https://github.com/log2timeline/l2tdevtools/issues/595
if [[ "$*" =~ "include-turbinia" ]]; then
    echo "Installing Turbinia"
    sudo pip3 install turbinia
fi

echo "Installing dftimewolf requirements"
# Install dftimewolf's pinned requirements
pip3 install -r requirements.txt<commit_msg>More verbose jenkins script (#593)<commit_after>#!/usr/bin/env bash
#
# This file is generated by l2tdevtools update-dependencies.py any dependency
# related changes should be made in dependencies.ini.

# Exit on error.
set -e

sudo add-apt-repository ppa:gift/dev -y
sudo apt-get update -qq
sudo apt-get install -y python3-pip


if [[ "$*" =~ "include-docker" ]]; then
    echo "Adding docker key"
    curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
    sudo add-apt-repository \
       "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
       $(lsb_release -cs) \
       stable"
    echo "apt update and install docker-ce"
    sudo apt-get update -qq
    sudo apt-get install -qq -y docker-ce
    curl -L https://github.com/docker/compose/releases/download/1.26.1/docker-compose-$(uname -s)-$(uname -m) -o docker-compose
    sudo cp docker-compose /usr/local/bin/docker-compose
    sudo chmod +x /usr/local/bin/docker-compose
fi

if [[ "$*" =~ "include-grr" ]]; then
    # Start the GRR server container.
    echo "Running include-grr"
    mkdir ~/grr-docker
    echo "Running the GRR docker container"
    sudo docker run \
      --name grr-server -v ~/grr-docker/db:/var/grr-datastore \
      -v ~/grr-docker/logs:/var/log \
      -e EXTERNAL_HOSTNAME="localhost" \
      -e ADMIN_PASSWORD="<PASSWORD>" \
      --ulimit nofile=1048576:1048576 \
      -p 127.0.0.1:8000:8000 -p 127.0.0.1:8080:8080 \
      -d grrdocker/grr:release grr

    echo "Sleeping 180 seconds"
    # Wait for GRR to initialize.
    /bin/sleep 180

    # Install the client.
    echo "Installing GRR client on $NODE_NAME"
    sudo docker cp grr-server:/usr/share/grr-server/executables/installers .
    if sudo dpkg -i installers/*amd64.deb; then
        echo "GRR client installed successfully"
    else
        echo "GRR client installation failed"
        exit 1
    fi
fi

if [[ "$*" =~ "include-timesketch" ]]; then
    # Start the Timesketch server container.
     export OPENSEARCH_VERSION=1.2.2
     echo "Cloning Timesketch from Github"
     git clone https://github.com/google/timesketch.git
     cd timesketch
     cd docker
     cd e2e
     echo "Running the Timesketch docker-compose script"
     sudo -E docker-compose up -d
     # Wait for Timesketch to initialize
     echo "Sleeping 300 seconds..."
     /bin/sleep 300
     cd ../../..
     cp config/linux/timesketchrc ~/.timesketchrc
     cp config/linux/timesketch.token ~/.timesketch.token
fi

if [[ "$*" =~ "include-plaso" ]]; then
    echo "Installing plaso"
    sudo apt-get -qq -y install plaso-tools
fi

# pending resolution of https://github.com/log2timeline/l2tdevtools/issues/595
if [[ "$*" =~ "include-turbinia" ]]; then
    echo "Installing Turbinia"
    sudo pip3 install turbinia
fi

echo "Installing dftimewolf requirements"
# Install dftimewolf's pinned requirements
pip3 install -r requirements.txt
{'fraction_non_alphanumeric': 0.1262135922330097, 'fraction_numerical': 0.0281743765467352, 'mean_word_length': 2.697396199859254, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 10, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4880648', 'n_tokens_mistral': 2000, 'n_tokens_neox': 1757, 'n_words': 478}