mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 04:31:13 +00:00
Implement Jupyter Lab container (#741)
* Updating dependencies to address pillow security * Implement Jupyter Lab container
This commit is contained in:
14
docker/compose.env
vendored
14
docker/compose.env
vendored
@@ -1,11 +1,11 @@
|
||||
GST_DOCKER_IMAGE_PREFIX="ghcr.io/gamestonkterminal"
|
||||
GST_DOCKER_PYTHON_VERSION="1.1.0"
|
||||
GST_DOCKER_DEPS_VERSION="1.4.0"
|
||||
GST_DOCKER_POETRY_DEPS_VERSION="1.4.0"
|
||||
GST_DOCKER_POETRY_FULL_DEPS_VERSION="1.4.0"
|
||||
GST_DOCKER_GST_VERSION="1.4.0"
|
||||
GST_DOCKER_POETRY_VERSION="1.4.0"
|
||||
GST_DOCKER_POETRY_FULL_VERSION="1.4.0"
|
||||
GST_DOCKER_PYTHON_VERSION="1.2.0"
|
||||
GST_DOCKER_DEPS_VERSION="1.5.0"
|
||||
GST_DOCKER_POETRY_DEPS_VERSION="1.5.0"
|
||||
GST_DOCKER_POETRY_FULL_DEPS_VERSION="1.5.0"
|
||||
GST_DOCKER_GST_VERSION="1.5.0"
|
||||
GST_DOCKER_POETRY_VERSION="1.5.0"
|
||||
GST_DOCKER_POETRY_FULL_VERSION="1.5.0"
|
||||
|
||||
export GST_DOCKER_IMAGE_PREFIX
|
||||
export GST_DOCKER_PYTHON_VERSION
|
||||
|
||||
2
docker/docker-compose.yaml
vendored
2
docker/docker-compose.yaml
vendored
@@ -56,7 +56,7 @@ services:
|
||||
dockerfile: docker/gst-poetry-jupyter.dockerfile
|
||||
args:
|
||||
GST_DOCKER_IMAGE_PREFIX: ${GST_DOCKER_IMAGE_PREFIX}
|
||||
GST_DOCKER_POETRY_DEPS_VERSION: ${GST_DOCKER_POETRY_DEPS_VERSION}
|
||||
GST_DOCKER_POETRY_FULL_DEPS_VERSION: ${GST_DOCKER_POETRY_FULL_DEPS_VERSION}
|
||||
image: "${GST_DOCKER_IMAGE_PREFIX}/gst-poetry-jupyter:${GST_DOCKER_POETRY_VERSION}"
|
||||
tty: true
|
||||
env_file: setenv
|
||||
|
||||
6
docker/entry-point-poetry-jupyter.sh
vendored
6
docker/entry-point-poetry-jupyter.sh
vendored
@@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
source $(poetry env info --path)/bin/activate
|
||||
#export PS1="(gst) > "
|
||||
# stty erase ^h
|
||||
poetry run jupyter notebook --ip=0.0.0.0 &
|
||||
poetry run python terminal.py
|
||||
jupyter lab --ip=0.0.0.0
|
||||
#poetry run python terminal.py
|
||||
|
||||
8
docker/extension.sh
vendored
Normal file
8
docker/extension.sh
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
#!/bin/bash
|
||||
|
||||
source $(poetry env info --path)/bin/activate
|
||||
|
||||
pip install -e jupyterlab/gst
|
||||
pip install -e jupyterlab/gst-settings
|
||||
jupyter-labextension install jupyterlab/gst
|
||||
jupyter-labextension install jupyterlab/gst-settings
|
||||
9
docker/gst-poetry-jupyter.dockerfile
vendored
9
docker/gst-poetry-jupyter.dockerfile
vendored
@@ -1,9 +1,14 @@
|
||||
ARG GST_DOCKER_IMAGE_PREFIX="ghcr.io/gamestonkterminal"
|
||||
ARG GST_DOCKER_POETRY_DEPS_VERSION="1.2.0"
|
||||
FROM ${GST_DOCKER_IMAGE_PREFIX}/gst-poetry-deps:${GST_DOCKER_POETRY_DEPS_VERSION}
|
||||
ARG GST_DOCKER_POETRY_FULL_DEPS_VERSION="1.2.0"
|
||||
FROM ${GST_DOCKER_IMAGE_PREFIX}/gst-poetry-full-deps:${GST_DOCKER_POETRY_FULL_DEPS_VERSION}
|
||||
|
||||
LABEL org.opencontainers.image.source https://github.com/GamestonkTerminal/GamestonkTerminal
|
||||
|
||||
EXPOSE 8888
|
||||
|
||||
COPY --chown=python:python . .
|
||||
|
||||
RUN cp docker/lab-settings.json jupyterlab/gst-settings/schema/settings.json && \
|
||||
bash -x docker/extension.sh
|
||||
|
||||
CMD ["bash", "docker/entry-point-poetry-jupyter.sh"]
|
||||
|
||||
3
docker/gst-python.dockerfile
vendored
3
docker/gst-python.dockerfile
vendored
@@ -22,6 +22,9 @@ RUN apt-get update && apt-get -y install --no-install-recommends \
|
||||
libpng16-16 \
|
||||
procps \
|
||||
python3-tk && \
|
||||
curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh && \
|
||||
bash nodesource_setup.sh && \
|
||||
apt-get install -y nodejs && \
|
||||
apt-get -y autoremove && \
|
||||
apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||
|
||||
428
docker/lab-settings.json
vendored
Normal file
428
docker/lab-settings.json
vendored
Normal file
@@ -0,0 +1,428 @@
|
||||
{
|
||||
"title": "Gamestonk settings",
|
||||
"description": "Settings for Gamestonk Terminal extension.",
|
||||
"type": "object",
|
||||
"properties":
|
||||
{
|
||||
"FEATURE_FLAGS":
|
||||
{
|
||||
"title": "Feature flags",
|
||||
"description": "Feature flags for the Gamestonk Terminal.",
|
||||
"default":
|
||||
{
|
||||
"GTFF_USE_CLEAR_AFTER_CMD":
|
||||
{
|
||||
"type": "bool",
|
||||
"form": "checkbox",
|
||||
"title": "Clear after command",
|
||||
"description": "Use clear console after each command",
|
||||
"default": false,
|
||||
"value": ""
|
||||
},
|
||||
"GTFF_USE_COLOR":
|
||||
{
|
||||
"type": "bool",
|
||||
"form": "checkbox",
|
||||
"title": "Colors",
|
||||
"description": "Use coloring features",
|
||||
"default": true,
|
||||
"value": ""
|
||||
},
|
||||
"GTFF_USE_FLAIR":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "text",
|
||||
"title": "Console flair",
|
||||
"description": "Select console flair (choose from config_terminal.py list)",
|
||||
"default": "stars",
|
||||
"value": ""
|
||||
},
|
||||
"GTFF_USE_ION":
|
||||
{
|
||||
"type": "bool",
|
||||
"form": "checkbox",
|
||||
"title": "Interactive charts",
|
||||
"description": "Enable interactive matplotlib",
|
||||
"default": true,
|
||||
"value": ""
|
||||
},
|
||||
"GTFF_USE_PROMPT_TOOLKIT":
|
||||
{
|
||||
"type": "bool",
|
||||
"form": "checkbox",
|
||||
"title": "Autocomplete",
|
||||
"description": "Enable Prompt Toolkit",
|
||||
"default": true,
|
||||
"value": ""
|
||||
},
|
||||
"GTFF_ENABLE_PREDICT":
|
||||
{
|
||||
"type": "bool",
|
||||
"form": "checkbox",
|
||||
"title": "Prediction menu",
|
||||
"description": "Enable Prediction features",
|
||||
"default": true,
|
||||
"value": ""
|
||||
},
|
||||
"GTFF_USE_PLOT_AUTOSCALING":
|
||||
{
|
||||
"type": "bool",
|
||||
"form": "checkbox",
|
||||
"title": "Plot autoscaling",
|
||||
"description": "Enable plot autoscaling",
|
||||
"default": false,
|
||||
"value": ""
|
||||
},
|
||||
"GTFF_ENABLE_THOUGHTS_DAY":
|
||||
{
|
||||
"type": "bool",
|
||||
"form": "checkbox",
|
||||
"title": "Thoughts of the day",
|
||||
"description": "Enable thoughts of the day",
|
||||
"default": false,
|
||||
"value": ""
|
||||
},
|
||||
"GTFF_ENABLE_QUICK_EXIT":
|
||||
{
|
||||
"type": "bool",
|
||||
"form": "checkbox",
|
||||
"title": "Quick exit",
|
||||
"description": "Quick exit for testing",
|
||||
"default": false,
|
||||
"value": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"APP_SETTINGS":
|
||||
{
|
||||
"title": "General",
|
||||
"description": "Application settings for the Gamestonk Terminal.",
|
||||
"default":
|
||||
{
|
||||
"PAPERMILL_NOTEBOOK_REPORT_PORT":
|
||||
{
|
||||
"type": "number",
|
||||
"form": "number",
|
||||
"title": "Papermill port",
|
||||
"description": "Papermill port",
|
||||
"default": 8892,
|
||||
"value": ""
|
||||
},
|
||||
"PYTHON_BINARY":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "text",
|
||||
"title": "Python executable",
|
||||
"description": "Path to the python in your custom environment",
|
||||
"default": "poetry run python",
|
||||
"value": ""
|
||||
},
|
||||
"TERMINAL_PATH":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "text",
|
||||
"title": "Terminal path",
|
||||
"description": "Path to the terminal.py",
|
||||
"default": "terminal.py",
|
||||
"value": ""
|
||||
},
|
||||
"PATH_TO_SELENIUM_DRIVER":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "text",
|
||||
"title": "Path to webdriver",
|
||||
"description": "Path to the selenium driver",
|
||||
"default": "",
|
||||
"value": ""
|
||||
},
|
||||
"WEBDRIVER_TO_USE":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "text",
|
||||
"title": "Webdriver",
|
||||
"description": "Selenium browser drivers can be found at https://selenium-python.readthedocs.io/installation.html",
|
||||
"default": "chrome",
|
||||
"value": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"API_KEYS":
|
||||
{
|
||||
"title": "API Keys",
|
||||
"description": "Access credentials for data providers.",
|
||||
"default":
|
||||
{
|
||||
"GT_API_KEY_ALPHAVANTAGE":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Alphavantage",
|
||||
"description": "https://www.alphavantage.co",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_KEY_FINANCIALMODELINGPREP":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "financialmodelingprep",
|
||||
"description": "https://financialmodelingprep.com/developer",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_KEY_QUANDL":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "quandl",
|
||||
"description": "https://www.quandl.com/tools/api",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_REDDIT_CLIENT_ID":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Reddit client ID",
|
||||
"description": "https://www.reddit.com/prefs/apps",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_REDDIT_CLIENT_SECRET":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Reddit client secret",
|
||||
"description": "https://www.reddit.com/prefs/apps",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_REDDIT_USERNAME":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Reddit username",
|
||||
"description": "https://www.reddit.com/prefs/apps",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_REDDIT_USER_AGENT":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Reddit user agent",
|
||||
"description": "https://www.reddit.com/prefs/apps",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_REDDIT_PASSWORD":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Reddit password",
|
||||
"description": "https://www.reddit.com/prefs/apps",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_POLYGON_KEY":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Polygon",
|
||||
"description": "https://polygon.io",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_TWITTER_KEY":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Twitter key",
|
||||
"description": "https://developer.twitter.com",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_TWITTER_SECRET_KEY":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Twitter secret",
|
||||
"description": "https://developer.twitter.com",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_TWITTER_BEARER_TOKEN":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Twitter token",
|
||||
"description": "https://developer.twitter.com",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_FRED_KEY":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "FRED",
|
||||
"description": "https://fred.stlouisfed.org/docs/api/api_key.html",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_NEWS_TOKEN":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "NewsAPI",
|
||||
"description": "https://newsapi.org",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_RH_USERNAME":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Robinhood username",
|
||||
"description": "Robinhood",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_RH_PASSWORD":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Robinhood password",
|
||||
"description": "Robinhood",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_DG_USERNAME":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Degiro username",
|
||||
"description": "Degiro",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_DG_PASSWORD":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Degiro password",
|
||||
"description": "Degiro",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_DG_TOTP_SECRET":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Degiro secret",
|
||||
"description": "Degiro",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_OANDA_ACCOUNT_TYPE":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Oanda account type",
|
||||
"description": "https://developer.oanda.com",
|
||||
"default": "practice",
|
||||
"value": ""
|
||||
},
|
||||
"GT_OANDA_ACCOUNT":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Oanda account",
|
||||
"description": "https://developer.oanda.com",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_OANDA_TOKEN":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Oanda token",
|
||||
"description": "https://developer.oanda.com",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_TRADIER_TOKEN":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Tradier token",
|
||||
"description": "https://tradier.com/products/market-data-api",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_CMC_KEY":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Coinmarketcap key",
|
||||
"description": "https://coinmarketcap.com/api/",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_BINANCE_KEY":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Binance key",
|
||||
"description": "https://www.binance.com/en/",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_BINANCE_SECRET":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Binance secret",
|
||||
"description": "Binance secret",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_FINNHUB_KEY":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Finnhub key",
|
||||
"description": "https://finnhub.io",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_IEX_KEY":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "IEX Cloud key",
|
||||
"description": "https://iexcloud.io",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_SENTIMENTINVESTOR_KEY":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Sentimentinvestor key",
|
||||
"description": "https://www.sentimentinvestor.com",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
},
|
||||
"GT_API_SENTIMENTINVESTOR_TOKEN":
|
||||
{
|
||||
"type": "string",
|
||||
"form": "password",
|
||||
"title": "Sentimentinvestor token",
|
||||
"description": "https://www.sentimentinvestor.com",
|
||||
"default": "REPLACE_ME",
|
||||
"value": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
2
jupyterlab/gst-settings/schema/settings.json
vendored
2
jupyterlab/gst-settings/schema/settings.json
vendored
@@ -113,7 +113,7 @@
|
||||
"type": "string",
|
||||
"form": "text",
|
||||
"title": "Python executable",
|
||||
"description": "Path to the python in your custom environmen",
|
||||
"description": "Path to the python in your custom environment",
|
||||
"default": "python",
|
||||
"value": ""
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user