Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • jr662933/jupyterhub-ai
  • buecker/jupyterhub-ai
  • buecker/jupyterhub
  • sr151511/vennemann
4 results
Show changes
Commits on Source (70)
......@@ -9,5 +9,6 @@ docker-build-master:
before_script:
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
script:
- cp $ENV_FILE .env
- docker build --pull -t "$CI_REGISTRY_IMAGE":prod .
- docker push "$CI_REGISTRY_IMAGE":prod
......@@ -3,14 +3,41 @@ FROM jupyter/scipy-notebook:hub-1.5.0
# Install from APT repository
USER root
RUN apt-get update -y
RUN apt-get install -y git
RUN apt-get install -y git libpq-dev gcc
# Set working directory
WORKDIR /usr/src/app
# Install basics
USER jovyan
# RUN pip3 install --upgrade pip setuptools wheel
RUN pip3 install --upgrade pip
# RUN pip3 install pip-review
# RUN pip-review --local --auto
COPY .env .env
RUN pip3 install jupyterlab-git==0.34.0
RUN pip3 install jupyterlab-gitlab==3.0.0
RUN pip3 install psycopg2-binary
RUN pip3 install psycopg2
RUN pip3 install python-dotenv
RUN pip3 install sqlalchemy
RUN pip3 install urllib3
RUN pip3 install yahooquery==2.3.7
RUN pip3 install numpy==1.26.4
# RUN pip3 install numba==0.59.1
RUN pip3 install scipy==1.13.1
RUN pip3 install matplotlib==3.8.4
RUN pip3 install seaborn==0.13.2
RUN pip3 install plotly==5.22.0
# Install 'nice to have lab extensions'
RUN pip install --upgrade jupyterlab
RUN pip install jupyterlab-git==0.34.0
RUN pip install jupyterlab-gitlab==3.0.0
# Install python packages
#COPY requirements.txt requirements.txt
#RUN pip install --no-cache-dir -r requirements.txt
#RUN pip install --ignore-installed --no-cache-dir -r requirements.txt
# ENV IPYTHONDIR /usr/src/app/ipython/
# WORKDIR /usr/src/app/ipython/profile_default/startup/
# COPY python_startup/ ./
# WORKDIR /home/
# vennemann
# bücker
import os
from dotenv import load_dotenv
import sqlalchemy
import pandas as pd
from urllib.parse import quote_plus
load_dotenv("/usr/src/app/.env")
class Database:
def __init__(self, db_name):
self.conn = db_connect(db_name)
def __getattr__(self, table_name):
return pd.read_sql_table(table_name, self.conn)
def list_tables(self):
inspector = sqlalchemy.inspect(self.conn)
table_names = inspector.get_table_names()
return table_names
def db_connect(db_name):
hostname=os.getenv("DB_HOST")
user=os.getenv("DB_USER")
password=quote_plus(os.getenv("DB_PASSWORD"))
conn = sqlalchemy.create_engine(f'postgresql+psycopg2://{user}:{password}@{hostname}/{db_name}')
return conn
def get_table(db_name, table_name):
conn = db_connect(db_name)
dat = pd.read_sql_table(table_name, conn)
return dat
def get_all_tables(db_name):
db_obj = Database(db_name)
return db_obj
jupyterlab-git==0.34.0
jupyterlab-gitlab==3.0.0
psycopg2-binary
psycopg2
python-dotenv
sqlalchemy
urllib3
yahooquery==2.3.7
numpy==1.26.4
numba==0.59.1
scipy==1.13.1
matplotlib==3.8.4
seaborn==0.13.2
plotly==5.22.0
\ No newline at end of file