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

Small scikit bring your own fixes #67

Merged
merged 3 commits into from
Nov 27, 2017
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ ENV PYTHONUNBUFFERED=TRUE
ENV PYTHONDONTWRITEBYTECODE=TRUE
ENV PATH="/opt/program:${PATH}"

# Make nginx log to stdout/err so that the log messages will be picked up by the
# Docker logger
RUN ln -s /dev/stdout /tmp/nginx.access.log && ln -s /dev/stderr /tmp/nginx.error.log

# Set up the program in the image
COPY decision_trees /opt/program
WORKDIR /opt/program
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ daemon off; # Prevent forking


pid /tmp/nginx.pid;
error_log /tmp/nginx.error.log;
error_log /var/log/nginx/error.log;

events {
# defaults
Expand All @@ -12,8 +12,8 @@ events {
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /tmp/nginx.access.log combined;

access_log /var/log/nginx/access.log combined;
upstream gunicorn {
server unix:/tmp/gunicorn.sock;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ def start_server():
print('Starting the inference server with {} workers.'.format(model_server_workers))


# link the log streams to stdout/err so they will be logged to the container logs
subprocess.check_call(['ln', '-sf', '/dev/stdout', '/var/log/nginx/access.log'])
subprocess.check_call(['ln', '-sf', '/dev/stderr', '/var/log/nginx/error.log'])

nginx = subprocess.Popen(['nginx', '-c', '/opt/program/nginx.conf'])
gunicorn = subprocess.Popen(['gunicorn',
'--timeout', str(model_server_timeout),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,15 +481,15 @@
"metadata": {},
"outputs": [],
"source": [
"sess.delete_endpoint(predictor.endpoint)"
"# sess.delete_endpoint(predictor.endpoint)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented out code?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we've settled on a best practice here. I prefer the endpoint deletion to be commented out because I think users will likely click "Run All" and then delete the endpoint before they even get a chance to play around with it. But, others vote for uncommented. Since others do the same thing, we can push this through and then change if we ever settle on a "right" way to do this.

]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "Environment (conda_python3)",
"language": "python",
"name": "python3"
"name": "conda_python3"
},
"language_info": {
"codemirror_mode": {
Expand Down