Skip to content

Commit

Permalink
Merge branch 'staging' into andreas/spark3
Browse files Browse the repository at this point in the history
  • Loading branch information
anargyri authored Oct 8, 2021
2 parents 1602d17 + 846d214 commit 287c3cc
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 5 deletions.
28 changes: 28 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
ARG PYTHON_VERSION
FROM mcr.microsoft.com/vscode/devcontainers/python:${PYTHON_VERSION}

ARG REMOTE_USER
ENV HOME="/home/${REMOTE_USER}" \
JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64" \
PYSPARK_PYTHON="/usr/local/bin/python" \
PYSPARK_DRIVER_PYTHON="/usr/local/bin/python"

RUN apt-get update && \
apt-get -y install --no-install-recommends software-properties-common && \
apt-add-repository 'deb http://security.debian.org/debian-security stretch/updates main' && \
apt-get update && \
apt-get -y install --no-install-recommends \
openjdk-8-jre \
cmake

# Switch to non-root user
USER ${REMOTE_USER}
WORKDIR ${HOME}

# Setup Jupyter Notebook
ENV NOTEBOOK_CONFIG="${HOME}/.jupyter/jupyter_notebook_config.py"
RUN mkdir -p $(dirname ${NOTEBOOK_CONFIG}) && \
echo "c.NotebookApp.ip='0.0.0.0'" >> ${NOTEBOOK_CONFIG} && \
echo "c.NotebookApp.open_browser=False" >> ${NOTEBOOK_CONFIG} && \
echo "c.NotebookApp.allow_origin='*'" >> ${NOTEBOOK_CONFIG}
EXPOSE 8888
44 changes: 44 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"name": "Recommenders",
"build": {
"dockerfile": "Dockerfile",
"context": "..",
"args": {
// Python version: 3, 3.6, 3.7
"PYTHON_VERSION": "3.7",
"REMOTE_USER": "vscode"
}
},

// Set *default* container specific settings.json values on container create.
"settings": {
"python.pythonPath": "/usr/local/bin/python",
"python.languageServer": "Pylance",
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.formatting.autopep8Path": "/usr/local/py-utils/bin/autopep8",
"python.formatting.blackPath": "/usr/local/py-utils/bin/black",
"python.formatting.yapfPath": "/usr/local/py-utils/bin/yapf",
"python.linting.banditPath": "/usr/local/py-utils/bin/bandit",
"python.linting.flake8Path": "/usr/local/py-utils/bin/flake8",
"python.linting.mypyPath": "/usr/local/py-utils/bin/mypy",
"python.linting.pycodestylePath": "/usr/local/py-utils/bin/pycodestyle",
"python.linting.pydocstylePath": "/usr/local/py-utils/bin/pydocstyle",
"python.linting.pylintPath": "/usr/local/py-utils/bin/pylint"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-python.python",
"ms-python.vscode-pylance"
],

// Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [8888],

// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "pip install -U pip && pip install --user -e .[dev,examples,spark,xlearn]",

// Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode"
}
19 changes: 14 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

from os import environ
from pathlib import Path
from setuptools import setup, find_packages
import site
import sys
import time
from os import environ

# Version
# workround for enabling editable user pip installs
site.ENABLE_USER_SITE = "--user" in sys.argv[1:]

# version
here = Path(__file__).absolute().parent
version_data = {}
with open(here.joinpath("recommenders", "__init__.py"), "r") as f:
Expand Down Expand Up @@ -53,7 +58,7 @@
"examples": [
"azure.mgmt.cosmosdb>=0.8.0,<1",
"hyperopt>=0.1.2,<1",
"ipykernel>=4.6.1,<5",
"ipykernel>=4.6.1,<7",
"jupyter>=1,<2",
"locust>=1,<2",
"papermill>=2.1.2,<3",
Expand All @@ -74,7 +79,11 @@
"cmake>=3.18.4.post1",
"xlearn==0.40a1",
],
"dev": ["black>=18.6b4,<21", "pytest>=3.6.4", "pytest-cov>=2.12.1"],
"dev": [
"black>=18.6b4,<21",
"pytest>=3.6.4",
"pytest-cov>=2.12.1",
],
}
# for the brave of heart
extras_require["all"] = list(set(sum([*extras_require.values()], [])))
Expand Down Expand Up @@ -118,6 +127,6 @@
"machine learning python spark gpu",
install_requires=install_requires,
package_dir={"recommenders": "recommenders"},
packages=find_packages(where=".", exclude=["tests", "tools", "examples"]),
python_requires=">=3.6, <3.9", # latest Databricks versions come with Python 3.8 installed
packages=find_packages(where=".", exclude=["contrib", "docs", "examples", "scenarios", "tests", "tools"]),
)

0 comments on commit 287c3cc

Please sign in to comment.