Skip to content

Commit

Permalink
Merge branch 'master' of github.com:phyloviz/phyloDB
Browse files Browse the repository at this point in the history
  • Loading branch information
cvaz committed Dec 31, 2023
2 parents 2523912 + 1f4f7ea commit 66c1fbf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 33 deletions.
6 changes: 6 additions & 0 deletions docker/start-docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ fi
# Passing file contents to Neo4j container cypher via 'cat':
# https://neo4j.com/docs/operations-manual/current/docker/operations/

echo "[$SCRIPT_NAME][INFO] - waiting for containers..."
sleep 30
echo "[$SCRIPT_NAME][INFO] - initializing data..."

# Initialize Neo4j PhyloDB schema (creates indices and properties).
SCHEMA_QUERY_FILE="$PROJ_ROOT/scripts/init/init_schema.cypher"
cat $SCHEMA_QUERY_FILE | docker exec --interactive phylodb-neo4j sh -c "cypher-shell -u neo4j -p password" >/dev/null 2>&1
Expand All @@ -90,4 +94,6 @@ cat $SCHEMA_QUERY_FILE | docker exec --interactive phylodb-neo4j sh -c "cypher-s
DATA_QUERY_FILE="$PROJ_ROOT/scripts/init/init_data.cypher"
cat $DATA_QUERY_FILE | docker exec --interactive phylodb-neo4j sh -c "cypher-shell -u neo4j -p password" >/dev/null 2>&1

echo "[$SCRIPT_NAME][INFO] - done."

popd
40 changes: 7 additions & 33 deletions scripts/example/example.sh
Original file line number Diff line number Diff line change
Expand Up @@ -156,23 +156,9 @@ curl -v --location --request POST 'http://localhost:8080/projects?provider=googl
"users": [{"id": "aplf@tecnico.pt", "provider": "google"}]
}'


if [ -z "$PROJECT" ]; then cat << EOF
Error: PROJECT is not defined. Please follow these steps:
# TODO
#
# Then, execute
#
# > export PROJECT="YOUR_PROJECT_ID"
#
# and run this script again.
EOF
exit 1
else
echo "ok PROJECT is defined."
fi

# Set the project id.
PROJECT=$(curl -s --location --request GET 'http://localhost:8080/projects?provider=google' --header "Authorization: Bearer $TOKEN" | python3 -c "import sys, json; print(json.load(sys.stdin)[0]['id'])")
echo "Project: $PROJECT"

log_checkpoint "List all datasets:"
echo -n "Datasets: "
Expand All @@ -190,21 +176,9 @@ curl -v --location --request POST "http://localhost:8080/projects/$PROJECT/datas
"description": "Example dataset"
}'

if [ -z "$DATASET" ]; then cat << EOF
Error: DATASET is not defined. Please follow these steps:
# TODO
#
# Then, execute
#
# > export DATASET="YOUR_DATASET_ID"
#
# and run this script again.
EOF
exit 1
else
echo "ok DATASET is defined."
fi
# Set dataset id:
DATASET=$(curl -s --location --request GET "http://localhost:8080/projects/$PROJECT/datasets?provider=google" --header "Authorization: Bearer $TOKEN" | python3 -c "import sys, json; print(json.load(sys.stdin)[0]['id'])")
echo "Dataset: $DATASET"

log_checkpoint "Load profiles:"
curl -v --location --request POST "http://localhost:8080/projects/$PROJECT/datasets/$DATASET/profiles/files?provider=google" \
Expand Down Expand Up @@ -239,7 +213,7 @@ echo -n "Inferences: "
curl --location --request GET "http://localhost:8080/projects/$PROJECT/datasets/$DATASET/inferences?provider=google" \
--header "Authorization: Bearer $TOKEN"
echo
INFERENCE="CHANGE_ME"
INFERENCE=$(curl -s --location --request GET "http://localhost:8080/projects/$PROJECT/datasets/$DATASET/inferences?provider=google" --header "Authorization: Bearer $TOKEN" | python3 -c "import sys, json; print(json.load(sys.stdin)[0]['id'])")
echo -n "Inference: "
curl --location --request GET "http://localhost:8080/projects/$PROJECT/datasets/$DATASET/inferences/$INFERENCE?provider=google" \
--header "Authorization: Bearer $TOKEN"
Expand Down

0 comments on commit 66c1fbf

Please sign in to comment.