Thanks for using Themis, below is the 11 step list to getting it working!
-
Navigate to your GCP Console [link]
-
Once in the CGP Console, go to the page to create a Compute Engine instance
-
Select the suggested VM or modify parameters you need (You may want to increase to a e2-standard-2 type machine)
-
Wait for the VM to spin up
-
Once the instance has been created and is running we will connect to it.
-
In the Connect section of the page, click on the drop down and select the Open Browser Window option
-
Set up the VM
$ sudo apt-get update
$ sudo apt-get install git
Install git$ git --version
Confirm git was installed and shows version$ python3 --version
Ensure Python 3 is installed$ sudo apt install python3-pip
Install pip for Python 3 if needed$ pip3 --version
Confirm pip3 was installed
- Set up the Repo & dependencies
$ git clone https://github.com/looker-open-source/themis.git
Clone the Themis repo$ cd Themis
Navigate into the directory$ pip3 install -r requirements.txt
Install the dependencies$ sudo apt-get install build-essential python3-dev python3-pip python3-setuptools python3-wheel python3-cffi libcairo2 libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev shared-mime-info
Install dependencies for the rendering package for the PDF report
- Set up the script variables
$ vi looker.ini
Create the Looker file for authentication- Setting Up Env Var Create environment variables for SENDGRID_API_KEY and THEMIS_EMAIL_RECIPIENTS
- Run the application
$ python3 main.py
Runs the application Expected output from script:
> Checking instance: https://COMPANY.dev.looker.com
>>> Checked: USERS IN LOOKER in 0.8229 sec so far
>>> Checked: PROJECTS IN LOOKER in 1.0607 sec so far
>>> Checked: CONTENT IN LOOKER in 124.0097 sec so far
>>> Checked: SCHEDULES IN LOOKER in 128.0676 sec so far
>>> Checked: CONNECTIVITY IN LOOKER in 176.1308 sec so far
>>> Created email attachment 177.2215 sec so far
>>> Created email body 177.2216 sec so far
>>> Sent email out 177.6384 sec so far
>>> Completed process in 177.6385 seconds
- You can use Cloud Scheduler to set the application to run on a specific interval.