Skip to content

PXLAIRobotics/PXL_InFluxDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Environment: PXL Devbox with InfluxDB and Chronograf

This project sets up a development environment using Docker with the following services:

  1. PXL Devbox: A development container with essential tools and Python libraries pre-installed.
  2. InfluxDB: A time-series database for storing metrics and data.
  3. Chronograf: A web interface for InfluxDB, enabling data visualization and management.

Table of Contents


Services Overview

1. PXL Devbox

  • Image: Custom-built from 01_pxl_devbox.
  • Purpose: Development environment with Python, FastAPI, InfluxDB client, and other utilities.
  • Ports: Exposes port 80 for development.
  • Features:
    • Base Image: Ubuntu 22.04.
    • Pre-installed libraries:
      • FastAPI 0.68.1
      • Uvicorn 0.15.0
      • Pandas 2.2.3
      • PyMongo 4.2.0
      • Bcrypt 4.0.0
      • Passlib 1.7.4
      • SlowAPI 0.1.6
      • PyJWT 2.4.0
    • Development tools: tmux, vim, nano, git, htop, python3-pip.
    • Includes SSH support and custom tmux configurations.

2. InfluxDB

  • Image: Custom-built from 02_influxdb.
  • Purpose: Time-series database for storing metrics.
  • Ports: Exposes port 8086.
  • Features:
    • Base Image: influxdb:1.8-alpine.
    • Includes SSH support.
    • User-configurable environment variables for database credentials.
    • Persistent data storage via volumes.

3. Chronograf

  • Image: chronograf:1.8-alpine (official image).
  • Purpose: Web-based interface for visualizing and managing InfluxDB data.
  • Ports: Exposes port 8888.
  • Features:
    • Pre-configured to connect to the InfluxDB service.
    • Stores Chronograf settings and dashboards in persistent volumes.

Volumes

Volume Path Service Description
./App PXL Devbox Application code for the development environment.
./Data PXL Devbox, Chronograf Data storage shared between services.
./Commands PXL Devbox Custom scripts and commands for the devbox.
./Logs PXL Devbox Logs generated by the devbox.
./Test PXL Devbox Test files for the devbox.
./InfluxDB InfluxDB Persistent data directory for InfluxDB.
./Data/chronograf Chronograf Persistent data directory for Chronograf.

Networking

All services are connected via the pxl_influx_network Docker network. This ensures inter-service communication while isolating them from external traffic.


Version Information

Service Image/Version Notes
PXL Devbox Custom-built from Ubuntu 22.04 Includes Python 3.10, FastAPI 0.68.1, Pandas 2.2.3, and other tools.
InfluxDB influxdb:1.8-alpine Lightweight version of InfluxDB 1.8.
Chronograf chronograf:1.8-alpine Official Chronograf 1.8 version.

Setup

  1. Build the images
./000_build_images.sh
  1. Restart the docker environment (only the DevBox and InfluxDB)
./001_create_and_restart_containers.sh

Wait for the images to be downloaded and the containers to be set up.

  1. Setup InfluxDB with username admin and password: password, and initialize the tokens for telegraf
./002_init_influx_and_telegraf.sh
  1. DevBox: Attach a bash shell to the DevBox container by executing the following script:
./003_attach_bash_to_devbox_container.sh

Testing InfluxDB connection from the DevBox:

cd test
python3 test_influx_conn.py

You can start a jupyter environment by executing:

start_jupyter

(preferable in the home directory)

  1. InfluxDB: Attach a bash shell to the InfluxDB container by executing the following script:
./004_attach_bash_to_influxdb_container.sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published