diff options
author | Artem Veremey <artem@veremey.net> | 2021-09-10 21:49:59 -0700 |
---|---|---|
committer | Artem Veremey <artem@veremey.net> | 2021-09-10 21:49:59 -0700 |
commit | 42197cf61ea8ff51c58b47421ca62da35430b530 (patch) | |
tree | 9cb8a210026da0e0265be7d9703a0e9872c3942f | |
parent | 5ac02bcef09101f394324a915f888192a812b838 (diff) |
Implement Jupyter Lab container
-rw-r--r-- | docker/compose.env | 14 | ||||
-rw-r--r-- | docker/docker-compose.yaml | 2 | ||||
-rw-r--r-- | docker/entry-point-poetry-jupyter.sh | 6 | ||||
-rw-r--r-- | docker/extension.sh | 8 | ||||
-rw-r--r-- | docker/gst-poetry-jupyter.dockerfile | 9 | ||||
-rw-r--r-- | docker/gst-python.dockerfile | 3 | ||||
-rw-r--r-- | docker/lab-settings.json | 428 | ||||
-rw-r--r-- | jupyterlab/gst-settings/schema/settings.json | 2 |
8 files changed, 459 insertions, 13 deletions
diff --git a/docker/compose.env b/docker/compose.env index 596186a72ef..7a63a522330 100644 --- a/docker/compose.env +++ b/docker/compose.env @@ -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 diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 06f1868732f..3a311ee86be 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -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 diff --git a/docker/entry-point-poetry-jupyter.sh b/docker/entry-point-poetry-jupyter.sh index 49ad21ac9df..5c69edc0f0a 100644 --- a/docker/entry-point-poetry-jupyter.sh +++ b/docker/entry-point-poetry-jupyter.sh @@ -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 diff --git a/docker/extension.sh b/docker/extension.sh new file mode 100644 index 00000000000..f25cb86aab2 --- /dev/null +++ b/docker/extension.sh @@ -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 diff --git a/docker/gst-poetry-jupyter.dockerfile b/docker/gst-poetry-jupyter.dockerfile index 3c3632ea010..c2f7a56846f 100644 --- a/docker/gst-poetry-jupyter.dockerfile +++ b/docker/gst-poetry-jupyter.dockerfile @@ -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"] diff --git a/docker/gst-python.dockerfile b/docker/gst-python.dockerfile index c3370778fe4..8a93a685064 100644 --- a/docker/gst-python.dockerfile +++ b/docker/gst-python.dockerfile @@ -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/* diff --git a/docker/lab-settings.json b/docker/lab-settings.json new file mode 100644 index 00000000000..cdf3bcfea2a --- /dev/null +++ b/docker/lab-settings.json @@ -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": "" + } + } + } + } +} diff --git a/jupyterlab/gst-settings/schema/settings.json b/jupyterlab/gst-settings/schema/settings.json index 5f4f3b37d45..70bb21dba7b 100644 --- a/jupyterlab/gst-settings/schema/settings.json +++ b/jupyterlab/gst-settings/schema/settings.json @@ -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": "" }, |