Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM python:3.9

ARG CODE_SERVER_VERSION=2.1692-vsc1.39.2
ENV CODE_SERVER_AUTH=none \
CODE_SERVER_PASSWORD=feathr \
JUPYTER_TOKEN=feathr

# install enssential libs
RUN apt-get update && \
apt-get install -y \
wget curl git cmake


# install useful tools: sshd, jupyterlab and so on...
RUN apt-get update && \
apt-get install -y supervisor vim sudo zip unzip htop && \
pip install --no-cache-dir jupyterlab==0.35.4 pandavro

RUN mkdir /feathr
WORKDIR /feathr
RUN pip install git+https://github.com/linkedin/feathr.git#subdirectory=feathr_project

# install code-server
RUN mkdir -p /opt/code-server && \
wget -qO- https://github.com/cdr/code-server/releases/download/${CODE_SERVER_VERSION}/code-server${CODE_SERVER_VERSION}-linux-x86_64.tar.gz | tar -xzf - --strip=1 -C /opt/code-server


# copy supervisord configuration and mkdir
COPY supervisord.conf /opt/supervisord.conf
RUN mkdir -p /opt/logs

# 8080: VsCode, 9090: jupyter
EXPOSE 8080 9090

CMD ["supervisord", "-c", "/opt/supervisord.conf"]
39 changes: 39 additions & 0 deletions docker/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
[unix_http_server]
file=/var/run/supervisor.sock ; (the path to the socket file)
chmod=0700 ; sockef file mode (default 0700)

[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket

[supervisord]
pidfile=/var/run/supervisord.log
logfile=/opt/logs/supervisord.log
logfile_maxbytes=256MB
logfile_backups=8
loglevel=info
nodaemon=true

[program:jupyter]
directory=/
command=jupyter lab --ip 0.0.0.0 --port 9090 --allow-root --LabApp.token=%(ENV_JUPYTER_TOKEN)s
stdout_logfile=/opt/logs/jupyter.log
autostart=true
autorestart=true
startsecs=1
startretries=3
stopasgroup=true
killasgroup=true
priority=1001

[program:codeserver]
directory=/
environment=PASSWORD="%(ENV_CODE_SERVER_PASSWORD)s"
command=/opt/code-server/code-server --host 0.0.0.0 --port 8080 --auth %(ENV_CODE_SERVER_AUTH)s
stdout_logfile=/opt/logs/code-server.log
autostart=true
autorestart=true
startsecs=1
startretries=3
stopasgroup=true
killasgroup=true
priority=1002
Binary file added docs/dev_guide/images/docker_port_mapping.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/dev_guide/images/jupyterlab_browser.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/dev_guide/images/vscode_browser.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions docs/dev_guide/python_dev_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,25 @@ We use [Google Python Style Guide](https://google.github.io/styleguide/pyguide.h

Run `pytest` in this folder to kick off the integration test. The integration test will test the creation of feature dataset, the materialization to online storage, and retrieve from online storage, as well as the CLI. It usually takes 5 ~ 10 minutes. It needs certain keys for cloud resources.

## Using Docker

We provide a dockerfile with feathr installed, and with embedded vscode server, and jupyter lab.
To build the docker, navigate to Feathr root folder, and use following command to build a docker file:
`docker build -t <Your Image Name> docker`

Run the docker image with port mapping.
![dockerportmapping](./images/docker_port_mapping.png)


8080 : VsCode (default password is 'feathr')

9090: Jupyter Lab (default password is 'feathr')

With the docker image running, open your browser and access
`localhost:<your mapped port>` to access apps.
![codeserver](./images/vscode_browser.png)
![jupyterlab](./images/jupyterlab_browser.png)


## Using Virtual Environment

Expand Down