{"id":21262865,"url":"https://github.com/stackql/stackql-jupyter-demo","last_synced_at":"2025-07-21T09:33:59.310Z","repository":{"id":104132582,"uuid":"456722161","full_name":"stackql/stackql-jupyter-demo","owner":"stackql","description":"StackQL Jupyter Notebook Demo","archived":false,"fork":false,"pushed_at":"2024-09-26T02:07:06.000Z","size":4919,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-07-04T19:09:14.916Z","etag":null,"topics":["analytics","aws","azure","digitalocean","docker","finops","gcp","hacktoberfest","jupyter","jupyter-notebook","linode","python","reporting","security-audit","sql","stackql"],"latest_commit_sha":null,"homepage":"https://github.com/stackql/stackql","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stackql.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-02-08T00:08:08.000Z","updated_at":"2024-09-26T02:07:10.000Z","dependencies_parsed_at":null,"dependency_job_id":"cd0e974a-69a4-47a2-9dbe-2bb84a488bf9","html_url":"https://github.com/stackql/stackql-jupyter-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stackql/stackql-jupyter-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fstackql-jupyter-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fstackql-jupyter-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fstackql-jupyter-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fstackql-jupyter-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackql","download_url":"https://codeload.github.com/stackql/stackql-jupyter-demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fstackql-jupyter-demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266276191,"owners_count":23903983,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analytics","aws","azure","digitalocean","docker","finops","gcp","hacktoberfest","jupyter","jupyter-notebook","linode","python","reporting","security-audit","sql","stackql"],"created_at":"2024-11-21T04:59:33.810Z","updated_at":"2025-07-21T09:33:59.287Z","avatar_url":"https://github.com/stackql.png","language":"Jupyter Notebook","readme":"\u003e ⚡ **Calling All Cloud/Data/Security Enthusiasts, Hacktoberfest 2024 is here!** ⚡  \r\n\u003e Interested in contributing StackQL (SQL) queries, notebooks and visualizations for **Cloud Security Posture Management (CSPM)**, **FinOps**, **Cloud Inventory Analysis**, or **Infrastructure-as-Code (IaC)**?  \r\n\u003e\r\n\u003e Check out the issues and get started with your first pull request!, Let’s build something amazing together this Hacktoberfest!  \r\n\r\n💡 **Explore our repositories:** [StackQL](https://github.com/stackql/stackql), [StackQL Deploy](https://stackql-deploy.io/docs/), find provider documentation in the [StackQL Provider Registry Docs](https://registry.stackql.io/)  \r\n\r\n🔎 Build out example queries for [`aws`](https://aws.stackql.io/providers/aws/), [`gcp`](https://google.stackql.io/providers/google/), [`azure`](https://azure.stackql.io/providers/azure/), [`digitalocean`](https://digitalocean.stackql.io/providers/digitalocean/), [`linode`](https://linode.stackql.io/providers/linode/), [`okta`](https://okta.stackql.io/providers/okta/) and more, including multicloud queries!  \r\n\r\n---\r\n\r\n[![StackQL](https://stackql.io/img/stackql-logo-bold.png)](https://stackql.io/)  \r\n\u003cbr /\u003e\r\n[![GitHub Actions](https://github.com/stackql/stackql-jupyter-demo/actions/workflows/main.yml/badge.svg?branch=main)](https://github.com/stackql/stackql-jupyter-demo/actions/workflows/main.yml)\r\n![License](https://img.shields.io/github/license/stackql/stackql)\r\n\r\n# StackQL Jupyter Demo\r\n\r\nQuery cloud inventory and perform analysis and visualisations using Jupyter, Python and StackQL.\r\n\r\n## Table of contents\r\n\r\n\u003c!--ts--\u003e\r\n   * [Prerequisites](#prerequisites)\r\n   * [Setting up authentication](#setting-up-authentication)\r\n   * [Instructions to pull and run image from Dockerhub](#instructions-to-pull-and-run-image-from-dockerhub)\r\n   * [Instructions to build and run locally](#instructions-to-build-and-run-locally)\r\n\u003c!--te--\u003e  \r\n\r\n\u003cbr /\u003e\r\n\r\n![StackQL Jupyter](images/stackql-jupyter.png)\r\n\r\n## Prerequisites\r\n\r\n- Docker\r\n- Doocker Compose (optional)\r\n\r\n## Setting up authentication\r\n\r\nYou will need to setup credentials for the providers required by... \r\n- adding the appropriate service account key(s) to the `keys/` directory \r\n- populating the necessary environment variables on your host machine, examples are shown here:\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003eSetting Environment Variables (bash)\u003c/summary\u003e\r\n\u003cp\u003e\r\n\r\n```bash\r\nexport AWS_ACCESS_KEY_ID=YOURACCESSKEYID\r\nexport AWS_SECRET_ACCESS_KEY=YOURSECRETACCESSKEY\r\nexport STACKQL_GITHUB_USERNAME=yourusername\r\nexport STACKQL_GITHUB_PASSWORD=ghp_yourtoken\r\nexport OKTA_API_TOKEN=YOUROKTAAPIKEY\r\nexport NETLIFY_AUTH_TOKEN=YOURNETLIFYTOKEN\r\nexport SUMOLOGIC_ACCESSID=YOURSUMOACCESSID\r\nexport SUMOLOGIC_ACCESSKEY=YOURSUMOACCESSKEY\r\nexport GOOGLE_CREDENTIALS=$(cat creds/my-key.json)\r\n```\r\n\u003c/p\u003e\r\n\u003c/details\u003e\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003eSetting Environment Variables (powershell)\u003c/summary\u003e\r\n\u003cp\u003e\r\n\r\n```powershell\r\n$Env:AWS_ACCESS_KEY_ID = \"YOURACCESSKEYID\"\r\n$Env:AWS_SECRET_ACCESS_KEY = \"YOURSECRETACCESSKEY\"\r\n$Env:STACKQL_GITHUB_USERNAME = \"yourusername\"\r\n$Env:STACKQL_GITHUB_PASSWORD = \"ghp_yourtoken\"\r\n$Env:OKTA_API_TOKEN = \"YOUROKTAAPIKEY\"\r\n$Env:NETLIFY_AUTH_TOKEN = \"YOURNETLIFYTOKEN\"\r\n$Env:SUMOLOGIC_ACCESSID = \"YOURSUMOACCESSID\"\r\n$Env:SUMOLOGIC_ACCESSKEY = \"YOURSUMOACCESSKEY\"\r\n$env:GOOGLE_CREDENTIALS = Get-Content -Raw -Path creds\\my-key.json\r\n```\r\n\r\n\u003c/p\u003e\r\n\u003c/details\u003e\r\n\r\n## Instructions to pull and run image from Dockerhub\r\n\r\nThe `stackql-jupyter-demo` image is available on Dockerhub ([hub.docker.com/r/stackql/stackql-jupyter-demo](https://hub.docker.com/r/stackql/stackql-jupyter-demo)). To run it in detatched mode, execute the following command:  \r\n\r\n\u003e you can omit credentials for providers you don't need\r\n\r\nusing `bash`...\r\n\r\n```bash\r\ndocker pull stackql/stackql-jupyter-demo\r\nCID=`docker run -d -p 8888:8888 \\\r\n-e AWS_ACCESS_KEY_ID \\\r\n-e AWS_SECRET_ACCESS_KEY \\\r\n-e STACKQL_GITHUB_USERNAME \\\r\n-e STACKQL_GITHUB_PASSWORD \\\r\n-e OKTA_API_TOKEN \\\r\n-e NETLIFY_AUTH_TOKEN \\\r\n-e SUMOLOGIC_ACCESSID \\\r\n-e SUMOLOGIC_ACCESSKEY \\\r\n-e GOOGLE_CREDENTIALS \\\r\nstackql/stackql-jupyter-demo \\\r\n/bin/sh -c \"/scripts/entrypoint.sh\"`\r\n# optional - copy service account keys to container\r\ndocker cp keys/stackql-security-reviewer.json  $CID:/jupyter/.keys/google-sa-key.json\r\n```\r\n\r\nusing `powershell`...\r\n\r\n```powershell\r\ndocker pull stackql/stackql-jupyter-demo\r\n$CID=$(docker run -d -p 8888:8888 `\r\n-e AWS_ACCESS_KEY_ID `\r\n-e AWS_SECRET_ACCESS_KEY `\r\n-e STACKQL_GITHUB_USERNAME `\r\n-e STACKQL_GITHUB_PASSWORD `\r\n-e OKTA_API_TOKEN `\r\n-e NETLIFY_AUTH_TOKEN `\r\n-e SUMOLOGIC_ACCESSID `\r\n-e SUMOLOGIC_ACCESSKEY `\r\n-e GOOGLE_CREDENTIALS `\r\nstackql/stackql-jupyter-demo `\r\n/bin/sh -c \"/scripts/entrypoint.sh\")\r\n# optional - copy service account keys to container\r\n$target=$CID + \":/jupyter/.keys/google-sa-key.json\" \r\ndocker cp keys/stackql-security-reviewer.json  $target\r\n```\r\n\r\nTo stop and remove the container when you're finished, run...   \r\n\r\n```bash\r\ndocker stop $(docker ps -l -q --filter status=running --filter ancestor=stackql/stackql-jupyter-demo)\r\ndocker rm $(docker ps --filter status=exited --filter ancestor=stackql/stackql-jupyter-demo -q)\r\n```\r\n\r\n## Instructions to build and run locally\r\n\r\nFollow these instructions to build and run the container locally using `docker compose`, this could be adapted to use `docker run` as well if you prefer.\r\n\r\n### 1. Clone the repo\r\n\r\nClone this repo `git clone https://github.com/stackql/stackql-jupyter-demo`\r\n\r\n### 2. Build and run the container\r\n\r\nBuild and run the image using the `docker-compose.yml` file:\r\n```bash\r\ndocker-compose build --no-cache\r\ndocker compose up --build\r\n```\r\n\u003e Add authentication if running this on a server which is accessible to others, see [https://jupyter-notebook.readthedocs.io/en/stable/security.html](https://jupyter-notebook.readthedocs.io/en/stable/security.html)\r\n\r\nor\r\n\r\n```bash\r\ndocker buildx build --no-cache -t stackql-jupyter-demo:latest .\r\n```\r\nensure nothing is running on port `8888`:\r\n\r\n```bash\r\nsudo lsof -i -P -n | grep LISTEN\r\n```\r\n\r\nthen run using:\r\n\r\n```bash\r\ndocker run -d -p 8888:8888 \\\r\n-e AWS_ACCESS_KEY_ID=\"$AWS_ACCESS_KEY_ID\" \\\r\n-e AWS_SECRET_ACCESS_KEY=\"$AWS_SECRET_ACCESS_KEY\" \\\r\n-e STACKQL_GITHUB_USERNAME=\"$STACKQL_GITHUB_USERNAME\" \\\r\n-e STACKQL_GITHUB_PASSWORD=\"$STACKQL_GITHUB_PASSWORD\" \\\r\n-e GOOGLE_CREDENTIALS=\"$GOOGLE_CREDENTIALS\" \\\r\nstackql-jupyter-demo:latest \\\r\n/bin/sh -c \"/scripts/entrypoint.sh\"\r\n```\r\n\r\nto stop and remove:\r\n\r\n```bash\r\ndocker stop $(docker ps -l -q --filter status=running --filter ancestor=stackql-jupyter-demo)\r\ndocker rm $(docker ps --filter status=exited --filter ancestor=stackql-jupyter-demo -q)\r\n```\r\n\r\n### 3. Use your notebook\r\nNavigate to `http://localhost:8888` and run your StackQL commands!  Use the sample notebook files included in the Jupyter workspace in the image.  \r\n\r\n### 4. Stop and remove the container\r\nStop and remove the container when finished by:\r\nPressing `cntl + c` in the terminal window where the container is running and then running:  \r\n```bash\r\ndocker compose down\r\n```\r\n\r\n### 5. Remove the image (optional)\r\n\r\nTo remove the image locally run:\r\n```bash \r\ndocker rmi stackql-jupyter-demo-jupyter:latest\r\n```\r\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackql%2Fstackql-jupyter-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackql%2Fstackql-jupyter-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackql%2Fstackql-jupyter-demo/lists"}