Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

Commit ea23898

Browse files
author
John Andersen
committed
service: http: Release HTTP service
Signed-off-by: John Andersen <john.s.andersen@intel.com>
1 parent 075577a commit ea23898

36 files changed

+1863
-2
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ htmlcov/
1919
.venv/
2020
html/
2121
pages/
22+
docs/plugins/service/http

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ env:
1919
- PLUGIN=model/scikit
2020
- PLUGIN=feature/git
2121
- PLUGIN=feature/auth
22+
- PLUGIN=service/http
2223
- CHANGELOG=1
2324
- WHITESPACE=1
2425
- STYLE=1

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3030
- Multiple Scikit Models with dynamic config
3131
- Entrypoint listing command to development service to aid in debugging issues
3232
with entrypoints.
33+
- HTTP API service to enable interacting with DFFML over HTTP. Currently
34+
includes APIs for configuring and using Sources.
3335
### Changed
3436
- feature/codesec became it's own branch, binsec
3537
- BaseOrchestratorContext `run_operations` strict is default to true. With

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ and other functionality in more specific packages.
3333
tutorials/index
3434
usage/index
3535
plugins/index
36+
plugins/service/http/index
3637
api/index
3738
community
3839

docs/plugins/dffml_service_cli.rst

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,19 @@ dev
5050

5151
*Core*
5252

53-
Development utilities for hacking on DFFML itself
53+
Development utilities for hacking on DFFML itself
54+
55+
dffml_service_http
56+
------------------
57+
58+
.. code-block:: console
59+
60+
pip install dffml-service-http
61+
62+
63+
http
64+
~~~~
65+
66+
*Core*
67+
68+
HTTP interface to access DFFML API

scripts/docs.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22
set -e
33

44
rm -rf pages
5+
# HTTP Service
6+
mkdir -p docs/plugins/service/
7+
rm -f docs/plugins/service/http
8+
ln -s "${PWD}/service/http/docs/" docs/plugins/service/http
9+
# Main docs
510
python3.7 scripts/docs.py
611
python3.7 -c 'import os, pkg_resources; [e.load() for e in pkg_resources.iter_entry_points("console_scripts") if e.name.startswith("sphinx-build")][0]()' -b html docs pages
712
find pages/ -name \*.html -exec \

scripts/docs/care

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
dffml.operation.implementation dffml dffml_feature_git dffml_operations_binsec dffml_feature_auth
22
dffml.model dffml dffml_model_tensorflow dffml_model_scratch dffml_model_scikit
33
dffml.source dffml
4-
dffml.service.cli dffml
4+
dffml.service.cli dffml dffml_service_http

service/http/.ci/run.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
if [ -d "$HOME/.local/bin" ]; then
5+
export PATH="$HOME/.local/bin:$PATH"
6+
fi
7+
8+
function run_plugin() {
9+
python setup.py install
10+
cd "$PLUGIN"
11+
coverage run setup.py test
12+
coverage report -m
13+
cd -
14+
}
15+
16+
function run_changelog() {
17+
# Only run this check on pull requests
18+
if [ "x$TRAVIS_PULL_REQUEST" == "xfalse" ]; then
19+
exit 0
20+
fi
21+
# Ensure the number of lines added in the changelog is not 0
22+
added_to_changelog=$(git diff origin/master --numstat -- CHANGELOG.md \
23+
| awk '{print $1}')
24+
if [ "x$added_to_changelog" == "x" ] || [ "$added_to_changelog" -eq 0 ]; then
25+
echo "No changes to CHANGELOG.md" >&2
26+
exit 1
27+
fi
28+
}
29+
30+
function run_whitespace() {
31+
git diff --check HEAD~1 HEAD
32+
if [ "$lines" -ne 0 ]; then
33+
echo "Trailing whitespace found" >&2
34+
exit 1
35+
fi
36+
}
37+
38+
function run_style() {
39+
black --check .
40+
}
41+
42+
if [ "x$PLUGIN" != "x" ]; then
43+
run_plugin
44+
elif [ "x$CHANGELOG" != "x" ]; then
45+
run_changelog
46+
elif [ "x$WHITESPACE" != "x" ]; then
47+
run_whitespace
48+
elif [ "x$STYLE" != "x" ]; then
49+
run_style
50+
fi

service/http/.coveragerc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[run]
2+
source =
3+
dffml_service_http
4+
tests
5+
branch = True
6+
7+
[report]
8+
exclude_lines =
9+
no cov
10+
no qa
11+
noqa
12+
pragma: no cover
13+
if __name__ == .__main__.:

service/http/.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.key
2+
*.pem
3+
*.csr

0 commit comments

Comments
 (0)