-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#133] add the third test bare model
- Loading branch information
Showing
7 changed files
with
108 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
FROM python:3.6-alpine3.7 | ||
|
||
COPY . /app | ||
WORKDIR /app | ||
|
||
RUN pip install -r requirements.txt | ||
|
||
LABEL com.epam.legion.model.id="demo-abc-model" \ | ||
com.epam.legion.model.version="1.2" \ | ||
com.epam.legion.container_type="model" | ||
|
||
ENTRYPOINT ["python"] | ||
CMD ["app.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
from flask import Flask, jsonify | ||
|
||
app = Flask(__name__) | ||
|
||
|
||
@app.route('/') | ||
def root(): | ||
return jsonify(demo=True) | ||
|
||
|
||
@app.route('/healthcheck') | ||
def healthcheck(): | ||
return jsonify(demo=True) | ||
|
||
|
||
@app.route('/api/model/<model>/<version>/info', methods=['GET', 'POST']) | ||
def model_info(model, version): | ||
return jsonify( | ||
model_version=version, | ||
model_id=model, | ||
endpoints={ | ||
'default': { | ||
'name': 'default', | ||
'use_df': False, | ||
'input_params': {'b': {'numpy_type': 'int64', 'type': 'Integer'}, | ||
'a': {'numpy_type': 'int64', 'type': 'Integer'}} | ||
|
||
} | ||
} | ||
) | ||
|
||
|
||
@app.route('/api/model/<model>/<version>/invoke', methods=['GET', 'POST']) | ||
@app.route('/api/model/<model>/<version>/invoke/<endpoint>', methods=['GET', 'POST']) | ||
def model_invoke(model, version, endpoint=None): | ||
return jsonify(result=42.0) | ||
|
||
|
||
if __name__ == '__main__': | ||
app.run(host='0.0.0.0') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Flask==0.10.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters