-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
413 changed files
with
4,801 additions
and
5,726 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,35 @@ | ||
import sys | ||
from time import sleep | ||
|
||
import pymongo | ||
|
||
N_CLIENTS = 2 | ||
RETRIES = 18 | ||
SLEEP = 10 | ||
|
||
|
||
def _eprint(*args, **kwargs): | ||
print(*args, file=sys.stderr, **kwargs) | ||
|
||
|
||
def _wait_n_rounds(collection): | ||
n = 0 | ||
for _ in range(RETRIES): | ||
query = {'type': 'INFERENCE'} | ||
n = collection.count_documents(query) | ||
if n == N_CLIENTS: | ||
return n | ||
_eprint(f'Succeded cleints {n}. Sleeping for {SLEEP}.') | ||
sleep(SLEEP) | ||
_eprint(f'Succeded clients: {n}. Giving up.') | ||
return n | ||
|
||
|
||
if __name__ == '__main__': | ||
# Connect to mongo | ||
client = pymongo.MongoClient("mongodb://fedn_admin:password@localhost:6534") | ||
|
||
# Wait for successful rounds | ||
succeded = _wait_n_rounds(client['fedn-test-network']['control']['status']) | ||
assert(succeded == N_CLIENTS) # check that all rounds succeeded | ||
_eprint(f'Succeded inference clients: {succeded}. Test passed.') |
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,19 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Parse example name | ||
if [ "$#" -lt 1 ]; then | ||
>&2 echo "Wrong number of arguments (usage: run_infrence.sh <example-name>)" | ||
exit 1 | ||
fi | ||
example="$1" | ||
|
||
>&2 echo "Run inference" | ||
pushd "examples/$example" | ||
curl -k -X POST https://localhost:8090/infer | ||
|
||
>&2 echo "Checking inference success" | ||
".$example/bin/python" ../../.ci/tests/examples/inference_test.py | ||
|
||
>&2 echo "Test completed successfully" | ||
popd |
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
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
network_id: fedn-test-network | ||
network_id: fedn-network | ||
discover_host: reducer | ||
discover_port: 8090 |
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
network_id: fedn-test-network | ||
controller: | ||
discover_host: reducer | ||
discover_port: 8090 | ||
network_id: fedn-network | ||
discover_host: reducer | ||
discover_port: 8090 | ||
|
||
name: combiner | ||
host: combiner | ||
port: 12080 | ||
max_clients: 30 | ||
|
||
|
||
combiner: | ||
name: combiner | ||
host: combiner | ||
port: 12080 | ||
max_clients: 30 |
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
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
Oops, something went wrong.