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 (67)
......@@ -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,43 +3,25 @@ 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
# Install XPRA
RUN apt-get install -y gnupg2 apt-transport-https software-properties-common apt-utils mc
RUN apt-get install -y yaru-theme-gnome-shell yaru-theme-gtk yaru-theme-icon
RUN apt-get install -y ca-certificates
RUN wget -q https://xpra.org/gpg.asc -O- | sudo apt-key add -
RUN add-apt-repository "deb https://xpra.org/ focal main"
RUN apt-get update -y
RUN apt-get install -y xpra
RUN pip install git+https://git.fh-muenster.de/sr151511/xprahtml.git
RUN apt-get install -y lightdm
#RUN rm -rf /usr/share/applications
#RUN mkdir /usr/share/applications
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
# 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/
# 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 for -> ewirtsch
RUN pip install pandaSDMX==1.6.0
RUN pip install plotly==5.4.0
# Install for -> artifint
RUN pip install python-constraint==1.4.0
RUN pip install ortools==9.1.9490
RUN pip install tensorflow==2.7.0
RUN pip install keras==2.7.0
# Install for -> windkanl
RUN pip install paho-mqtt==1.6.1
# Install for -> stroemmt
RUN pip install openpivgui
# 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