{"id":21262873,"url":"https://github.com/stackql/stackql-demo-notebook","last_synced_at":"2025-07-09T13:08:32.209Z","repository":{"id":233943107,"uuid":"625486478","full_name":"stackql/stackql-demo-notebook","owner":"stackql","description":null,"archived":false,"fork":false,"pushed_at":"2023-04-09T09:01:50.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-15T07:46:01.543Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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}},"created_at":"2023-04-09T09:01:48.000Z","updated_at":"2023-04-09T09:01:54.000Z","dependencies_parsed_at":"2024-04-17T19:14:19.684Z","dependency_job_id":"c63997e8-70a2-47e2-beb0-a1eb6aedfa71","html_url":"https://github.com/stackql/stackql-demo-notebook","commit_stats":null,"previous_names":["stackql/stackql-demo-notebook"],"tags_count":0,"template":false,"template_full_name":"stackql/stackql-notebook","purl":"pkg:github/stackql/stackql-demo-notebook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fstackql-demo-notebook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fstackql-demo-notebook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fstackql-demo-notebook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fstackql-demo-notebook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackql","download_url":"https://codeload.github.com/stackql/stackql-demo-notebook/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fstackql-demo-notebook/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264465845,"owners_count":23612580,"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":[],"created_at":"2024-11-21T04:59:35.073Z","updated_at":"2025-07-09T13:08:32.191Z","avatar_url":"https://github.com/stackql.png","language":"Jupyter Notebook","readme":"\u003ca href=\"https://stackql.io/\" target=\"_blank\"\u003e\n\u003cimg src=\"assets/stackql-logo-bold.png\" alt=\"StackQL\" width=\"33%\" height=\"33%\"\u003e\n\u003c/a\u003e\n\u003cbr /\u003e\n\n![License](https://img.shields.io/github/license/stackql/stackql)\n\n## StackQL Jupyter Notebook Template Repository\n\nTemplate repository to create a StackQL analytics notebook Docker container image including StackQL, Jupyter and Python (including `pandas`).  \n\n\u003e Use StackQL to query cloud inventory and perform analysis and visualisations for security analysis, cost management and optimization, and for cloud automation and provisioning.  For more information see the [StackQL documentation](https://stackql.io/docs).\n\n## Usage\n\n\u003c!--ts--\u003e\n   * [1. Prerequisites](#1-prerequisites)\n   * [2. Configure providers](#2-configure-providers)\n   * [3. Set up auth variables and keys](#3-set-up-auth-variables-and-keys)\n   * [4. Build image](#4-build-image)\n   * [5. Run notebook](#5-run-notebook)\n   * [6. Use the notebook](#6-use-the-notebook)\n   * [7. Stop and remove container](#7-stop-and-remove-container)\n   * [8. Remove the image (optional)](#8-remove-the-image-optional)\n\u003c!--te--\u003e  \n\n\u003cbr /\u003e\n\n### 1. Prerequisites\n\n- Docker\n\n### 2. Configure providers\n\nConfigure the providers you want to query in your notebook using the `config/providers` file, edit this file adding each provider on a new line, for example:  \n\n```\naws\nazure\ngithub\n```\n### 3. Set up auth variables and keys\n\nYou will need to setup credentials in enviroment variables for the providers required by... \n- adding the appropriate service account key(s) to the `keys/` directory \n- populating the necessary environment variables on your host machine (passed to the docker container at runtime).  \n\n\u003e For more information on the environment variables required for each provider, see the authentication instructions for the given provider at [registry.stackql.io](https://registry.stackql.io/)  \n\nExamples are shown here:  \n\n\u003cdetails\u003e\n\u003csummary\u003eSetting Environment Variables (bash)\u003c/summary\u003e\n\u003cp\u003e\n\n```bash\nexport AWS_ACCESS_KEY_ID=YOURACCESSKEYID\nexport AWS_SECRET_ACCESS_KEY=YOURSECRETACCESSKEY\nexport STACKQL_GITHUB_USERNAME=githubusername\nexport STACKQL_GITHUB_PASSWORD=your_github_personal_access_token\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eSetting Environment Variables (powershell)\u003c/summary\u003e\n\u003cp\u003e\n\n```powershell\n$Env:AWS_ACCESS_KEY_ID = \"YOURACCESSKEYID\"\n$Env:AWS_SECRET_ACCESS_KEY = \"YOURSECRETACCESSKEY\"\n$Env:STACKQL_GITHUB_USERNAME = \"githubusername\"\n$Env:STACKQL_GITHUB_PASSWORD = \"your_github_personal_access_token\"\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n### 4. Build image\n\nBuild the image using the following command:  \n\n```\ndocker build --no-cache -t stackql-notebook .\n```\n\n### 5. Run notebook\n\nTo run the notebook locally in detatched mode, execute the following command:  \n\n```bash\ndocker run -d -p 8888:8888 \\\n-e AWS_ACCESS_KEY_ID \\\n-e AWS_SECRET_ACCESS_KEY \\\n-e STACKQL_GITHUB_USERNAME \\\n-e STACKQL_GITHUB_PASSWORD \\\nstackql-notebook \\\n/bin/sh -c \"/scripts/entrypoint.sh\"\n```\nor using PowerShell:  \n\n```powershell\ndocker run -p 8888:8888 `\n-e AWS_ACCESS_KEY_ID `\n-e AWS_SECRET_ACCESS_KEY `\n-e STACKQL_GITHUB_USERNAME `\n-e STACKQL_GITHUB_PASSWORD `\nstackql-notebook `\n/bin/sh -c \"/scripts/entrypoint.sh\"\n```\n\n\u003e the `entrypoint.sh` script starts the notebook using `stackql` in `exec` mode, to start the notebook in `stackql` server mode, use the `srv` argument with the`entrypoint.sh` as follows : `entrypoint.sh srv`.\n\n### 6. Use the notebook\n\nOnce the container is running, you can access the notebook by opening a browser to http://localhost:8888. \n\n\u003e __NOTE:__ it may take a minute or so for the bootstrap scripts to run once the container is started, so if you get a __`connection refused`__ error, wait a minute or so and try again.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"images/stackql-jupyter.png\" alt=\"StackQL\" width=\"70%\" height=\"70%\"\u003e\n\u003c/p\u003e\n\nOpen the `stackql.ipynb` notebook and run the cells.  In your own repositiory, you can add your own notebooks and use StackQL to query the providers you configured.  \n\n### 7. Stop and remove container\n\nTo stop and remove the container when you're finished, run...   \n\n```\ndocker stop $(docker ps -l -q --filter status=running --filter ancestor=stackql-notebook)\ndocker rm $(docker ps --filter status=exited --filter ancestor=stackql-notebook -q)\n```\n\n### 8. Remove the image (optional)\n\nTo remove the image locally run:\n```bash \ndocker rmi stackql-notebook\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackql%2Fstackql-demo-notebook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackql%2Fstackql-demo-notebook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackql%2Fstackql-demo-notebook/lists"}