Skip to content

Commit dedcbff

Browse files
committed
merged to get release commit ready
2 parents f69582c + e843f10 commit dedcbff

File tree

4 files changed

+40
-56
lines changed

4 files changed

+40
-56
lines changed

README.md

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@
22

33
# The Harness Control Client
44

5-
### **Version 0.5.2-SNAPSHOT, for Harness 0.5.2-SNAPSHOT**
6-
75
The Harness Command Line Interface uses a connection to a running Harness Server to perform administrative tasks.
86

7+
**Major Changes:**
8+
9+
- `hctl` is the preferred alternative to `harness-cli`. Both continue to function. This doc uses `harness-cli` but will switch to `hctl` in the next version.
10+
911
# Requirements
1012

1113
- Python 3: Install so that it is executed with `python3` NOT `python`. Check with `which python3` or `python3 -version`
@@ -48,9 +50,6 @@ Set your PATH env variable to point to the `harness-cli/harness-cli` directory o
4850
### Container Installation
4951

5052
After [installing Docker](https://docs.docker.com/engine/install/) either Engine or Desktop, proceed to install the `harness-cli` container.
51-
52-
1.
53-
5453

5554
### Localhost
5655

@@ -68,7 +67,7 @@ Various settings are passed into `harness-cli` via the host's env and will allow
6867

6968
Notice that `HARNESS_CLI_HOME` should not be set since it is calculated internally.
7069

71-
**Deprecation Warning:** This env based configuration will eventually be replaced with a different scheme using YAML files. Before all upgrades consult this README.
70+
**Deprecation Warning:** This env based configuration may be changed at any time so before all upgrades consult this README.
7271

7372
## Help
7473

@@ -83,28 +82,22 @@ To use this setup with integration tests make the changes to the cli above then
8382
- `"master": "spark:<//some-spark-master>:7077"` This should point to the correct Spark master, or use `"local"` to use the Spark build-in to Harness
8483
- `"es.nodes": "<some-es-node-1>,<some-es-node2>"` These should be the IPs or DNS names of the ES nodes in the installation, comma separated with no spaces, quotes or < > characters.
8584

86-
Run the test with new params for the remote installation of harness like this:
85+
Run the test with new params for the remote installation of harness (harness-env must also point the cli to the correct location) like this:
8786

8887
- `./examples/ur/ur-integration-test.sh <address-of-harness> <port-of-harness>`
8988
- The parameters default to `localhost` and `9090`
9089

91-
Note: Tests do not currently work with https.
92-
93-
The test will pause to allow hand start of training and finishing training to start queries. At the end it will compare actual results to expected ones and exit with 0 if the tests pass or 1 if they do not.
94-
95-
**Deprecation Warning:** The tests are a work in progress so expect changes as they are refactored. Consult this README before any upgrade.
96-
97-
# Versions
90+
At the end it will compare actual results to expected ones and exit with 0 if the tests pass or 1 if they do not.
9891

99-
The Harness-CLI follows the same version numbers as the Harness Server. If you build from source there will be a git tag in the master branch for every release after 0.4.0-RC1. For containers the image tags also follow Harness naming.
92+
**Deprecation Warning:** The tests are a work in progress so expect changes.
10093

10194
# Containers
10295

103-
This project is published as `actionml/harness-cli:<tag>` where supported tags are:
96+
This project is published as a docker image with tags of the form: `actionml/harness-cli:<tag>` where supported tags are:
10497

105-
- `latest`: most recent stable release, the most recent version of code tagged and pushed to the master branch of the git repo.
106-
- `develop`: the most recent version of the work-in-progress. The most recent commit to the git `develop` branch. See the commit number tag to find the exact commit.
107-
- `0.4.0-RC1`, `0.4.0`: release tags by version, which will match the tag in the master branch of the git repo.
98+
- `latest`: most recent stable release, the most recent version of code tagged and pushed to the master branch of the git repo as an official release.
99+
- `develop`: the most recent version of the work-in-progress. The most recent commit to the git `develop` branch. See the commit tag to find the last 6 characters of exact git commit number.
100+
- `0.5.1-RC1`, `0.6.0`, ...: release tags by version, which will match the tag in the git repo.
108101

109102
## Running the `harness-cli` Container
110103

@@ -143,7 +136,20 @@ root@f87d1403aca9:/#
143136

144137
The "status" gives an "OK" if connections can be made, the rest of the info is client config. The "status engines" hits the DB to find any installed engines so if you have new Harness installation you will get an empty JSON array of Engine Instance info.
145138

146-
## Changes from v0.4.0
139+
# Versions
140+
141+
The Harness-CLI follows the same version numbers as the Harness Server. If you build from source there will be a git tag in the master branch for every release after 0.4.0-RC1. For containers the image tags also follow Harness naming.
142+
143+
## harness-cli version 0.6.0
144+
145+
This is in sync with Harness 0.6.0 but should be backward compatible with all 0.5.x harness versions.
146+
147+
New features:
148+
149+
- `harness-cli` now has an alias of `hctl` which is the preferred invocation.
150+
- Some slight edits to command responses for clarity. These include the renaming of "_id" to "name" in the JSON response for `hctl status engines`.
151+
152+
## 0.5.0 changes from v0.4.0
147153

148154
- **This CLI replaces** the one integrated with Harness in Harness 0.4.0.
149155
- This CLI **cannot be used to start or stop** Harness, the integrated `harness start` and `harness stop` in the Harness project should work.

examples/ur/expected-ur-results.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ No results since no items have categories: Phones AND Tablets
4040
------------- No Tablets AND no Phones -------------
4141
No difference from OR
4242
{"result":[{"item":"USB-C Ear Buds","score":4.731611728668213},{"item":"iPhone Case","score":3.657214403152466},{"item":" AirPods","score":3.657214403152466},{"item":"Sleeve","score":1.4489619731903076}]}
43+
------------- No USB-C Ear Buds, no iPhone Case -------------
44+
exclude one item
45+
{"result":[{"item":"iPhone XS","score":3.657214403152466},{"item":"iPad Pro","score":3.657214403152466},{"item":" AirPods","score":3.657214403152466},{"item":"iPhone 8","score":2.0563013553619385}]}
4346

4447
============= Boost =============
4548
============= by categories =============

examples/ur/simple-integration-test.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ case ${command} in
2929
engine_json=examples/ur/simple_test_ur_mobile_device_dc_install.json
3030
;;
3131
*) # assume localhost if no style passed in
32-
training_sleep_seconds=120
32+
training_sleep_seconds=30
3333
sleep_seconds=1
3434
DEPLOYMENT_STYLE="all-localhost"
3535
engine_json=examples/ur/simple_test_ur_mobile_device_host_install.json
@@ -91,8 +91,8 @@ echo
9191
./${test_queries} ${host_url} > ${actual_query_results}
9292
# echo "Queries sent"
9393

94-
diff ${actual_query_results} ${expected_test_results} | grep -i '^[\<,\>]' | ./compare-results.sh 5 > ${diffs_and_errors_file}
95-
#diff ${actual_query_results} ${expected_test_results} | grep "result" > ${diffs_and_errors_file}
94+
#diff ${actual_query_results} ${expected_test_results} | grep -i '^[\<,\>]' | ./compare-results.sh 5 > ${diffs_and_errors_file}
95+
diff ${actual_query_results} ${expected_test_results} > ${diffs_and_errors_file}
9696
cat ${actual_query_results} | grep "error" >> ${diffs_and_errors_file}
9797

9898
# echo "Getting diffs"
@@ -112,12 +112,13 @@ else
112112
echo "Running Phase 2: Realtime model updates"
113113
echo
114114
python3 examples/ur/import_mobile_device_ur_data.py --input_file ${property_change_events} --url ${host_url}
115+
sleep 1
115116

116117
./${test_queries} ${host_url} > ${actual_query_results}
117118
# echo "Queries sent"
118119

119-
diff ${actual_query_results} ${expected_rt_update_test_results} | grep -i '^[\<,\>]' | ./compare-results.sh 5 > ${diffs_and_errors_file_property_changes}
120-
#diff ${actual_query_results} ${expected_rt_update_test_results} | grep "result" > ${diffs_and_errors_file}
120+
#diff ${actual_query_results} ${expected_rt_update_test_results} | grep -i '^[\<,\>]' | ./compare-results.sh 5 > ${diffs_and_errors_file_property_changes}
121+
diff ${actual_query_results} ${expected_test_results} > ${diffs_and_errors_file}
121122
cat ${actual_query_results} | grep "error" >> ${diffs_and_errors_file_property_changes}
122123

123124
if [ -s ${diffs_and_errors_file_property_changes} ]

query.sh

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,8 @@
11
#!/usr/bin/env bash
22
curl -H "Content-Type: application/json" -d '
33
{
4-
"from": 0,
5-
"num": 2,
6-
"rules": [
7-
{
8-
"name": "opportunity-class",
9-
"values": ["FederalContractOpportunityModel"],
10-
"bias": -1
11-
},
12-
{
13-
"name": "set-aside",
14-
"values": ["No Set-Aside Used"],
15-
"bias": -1
16-
},
17-
{
18-
"name": "naics",
19-
"values": ["511210-N", "541519-N"],
20-
"bias": -1
21-
},
22-
{
23-
"name": "opp-type",
24-
"values": ["Solicitation", "Pre-Solicitation", "Special Notice", "Grant", "Cooperative Agreement", "Procurement Contract", "Other"],
25-
"bias": -1
26-
}],
27-
"dateRange":
28-
{
29-
"name": "due-date",
30-
"after": "2020-04-24T21:07:06Z"
31-
},
32-
"user": "YWFXNE5xYVhicmx3NkVsUXhnRm5yUT09"
33-
}' http://gt:9090/engines/govtribe_opportunity_recommender_v7/queries
34-
echo
4+
"event":"$delete",
5+
"entityType":"item",
6+
"entityId":"iPhone XS",
7+
"eventTime" : "2016-10-05T21:02:49.228Z"
8+
}' http://localhost:9090/engines/test_ur/events

0 commit comments

Comments
 (0)