Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix notebook UI issues in Sandbox #1082

Merged
merged 1 commit into from
Feb 20, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 8 additions & 1 deletion FeathrSandbox.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ COPY --chown=1000:100 ./docs/samples/local_quickstart_notebook.ipynb .
COPY --chown=1000:100 ./feathr-sandbox/feathr_init_script.py .

# Run the script so that maven cache can be added for better experience. Otherwise users might have to wait for some time for the maven cache to be ready.
RUN python feathr_init_script.py
RUN python -m pip install interpret

USER root
Expand All @@ -80,6 +79,14 @@ RUN sed -i "s/\r//g" /usr/src/registry/start_local.sh

WORKDIR /home/jovyan/work

USER jovyan

ENV API_BASE="api/v1"
ENV FEATHR_SANDBOX=True
# Run the script so that maven cache can be added for better experience. Otherwise users might have to wait for some time for the maven cache to be ready.
RUN /usr/src/registry/start_local.sh -m build_docker && python feathr_init_script.py

USER root

# 80: Feathr UI
# 8000: Feathr REST API
Expand Down
5 changes: 5 additions & 0 deletions deploy/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ http {

location /api {
proxy_pass http://localhost:8000/api;
proxy_send_timeout 2m;
proxy_read_timeout 2m;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
}
12 changes: 6 additions & 6 deletions feathr-sandbox/feathr_init_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,12 +193,12 @@ def preprocessing(df: DataFrame) -> DataFrame:
feature_names


# # Try to register the service after the spark run (so that the Feathr API can start with sufficient time)
# try:
# client.register_features()
# except Exception as e:
# print(e)
# print(client.list_registered_features(project_name=client.project_name))
# Try to register the service after the spark run (so that the Feathr API can start with sufficient time)
try:
client.register_features()
except Exception as e:
print(e)
print(client.list_registered_features(project_name=client.project_name))


now = datetime.now().strftime("%Y%m%d%H%M%S")
Expand Down
28 changes: 26 additions & 2 deletions feathr-sandbox/start_local.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
#!/bin/bash

while getopts ":m:p:" opt; do
case $opt in
m) mode="$OPTARG"
;;
p) p_out="$OPTARG"
;;
\?) echo "Invalid option -$OPTARG" >&2
exit 1
;;
esac

case $OPTARG in
-*) echo "Option $opt needs a valid argument"
exit 1
;;
esac
done


printf "Argument mode is %s\n" "$mode"

# Generate static env.config.js for UI app
envfile=/usr/share/nginx/html/env-config.js
Expand Down Expand Up @@ -76,5 +95,10 @@ else
fi
fi

# start the notebooks
start-notebook.sh --ip='*' --NotebookApp.password='' --NotebookApp.token='' --no-browser

if [ "$mode" == "build_docker" ]; then
echo "Jupyter Notebook Server is not started when building docker images"
else
# start the notebooks
start-notebook.sh --ip='*' --NotebookApp.password='' --NotebookApp.token='' --no-browser
fi