generated from usnistgov/opensource-repo
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge advance searching, Py3.10 from integration into main
- Loading branch information
Showing
150 changed files
with
12,987 additions
and
2,130 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
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
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,68 +1,20 @@ | ||
#! /bin/bash | ||
# | ||
mongod_ctl=/usr/local/bin/mongod_ctl.sh | ||
[ "$1" = "" ] && exec /bin/bash | ||
|
||
function install { | ||
scripts/install.sh --prefix=/app/pdr || return 1 | ||
export OAR_HOME=/app/pdr | ||
export PYTHONPATH=$OAR_HOME/lib/python | ||
export OAR_LOG_DIR=$OAR_HOME/var/logs | ||
} | ||
|
||
function exitopwith { | ||
echo $2 > $1.exit | ||
exit $2 | ||
} | ||
|
||
cmd=$1 | ||
case "$1" in | ||
makedist) | ||
shift | ||
scripts/makedist "$@" | ||
;; | ||
testall) | ||
install || { | ||
echo "testall: Failed to install oar-pdr-py" | ||
exitopwith testall 2 | ||
} | ||
shift | ||
scripts/testall "$@"; stat=$? | ||
|
||
[ "$stat" != "0" ] && { | ||
echo "testall: One or more tests failed (last=$stat)" | ||
exitopwith testall 3 | ||
} | ||
|
||
echo All python tests passed | ||
;; | ||
install) | ||
install | ||
python -c 'import nistoar.pdr, jq' | ||
;; | ||
testshell) | ||
# libdir=`ls /dev/oar-pdr-py/python/build | grep lib.` | ||
export OAR_PYTHONPATH=/dev/oar-pdr-py/python/build/lib | ||
export OAR_JQ_LIB=/dev/oar-pdr-py/metadata/jq | ||
export OAR_MERGE_ETC=/dev/oar-pdr-py/metadata/etc/merge | ||
export OAR_SCHEMA_DIR=/dev/oar-pdr-py/metadata/model | ||
export PYTHONPATH=$OAR_PYTHONPATH | ||
exec /bin/bash | ||
;; | ||
shell) | ||
exec /bin/bash | ||
;; | ||
installshell) | ||
install | ||
exec /bin/bash | ||
testall|testshell) | ||
[ -x $mongo_ctl ] && $mongod_ctl start && sleep 1 | ||
exec /usr/local/bin/gosu developer /usr/local/bin/runtests.sh $@ | ||
;; | ||
*) | ||
echo Unknown command: $1 | ||
echo Available commands: makedist testall testshell install shell installshell testmdservshell testpreserveshell | ||
exec /usr/local/bin/gosu developer /usr/local/bin/runtests.sh $@ | ||
;; | ||
esac | ||
|
||
[ $? -ne 0 ] && exitopwith $cmd 1 | ||
true | ||
|
||
|
||
|
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,70 @@ | ||
#! /bin/bash | ||
# | ||
function install { | ||
scripts/setversion.sh | ||
scripts/install.sh --prefix=/app/pdr || return 1 | ||
export OAR_HOME=/app/pdr | ||
export PYTHONPATH=$OAR_HOME/lib/python | ||
export OAR_LOG_DIR=$OAR_HOME/var/logs | ||
} | ||
|
||
function exitopwith { | ||
echo $2 > $1.exit | ||
exit $2 | ||
} | ||
|
||
|
||
|
||
cmd=$1 | ||
case "$1" in | ||
makedist) | ||
shift | ||
scripts/makedist "$@" | ||
EXCODE=$? | ||
;; | ||
build) | ||
scripts/setversion.sh | ||
(cd python && python setup.py build) | ||
EXCODE=$? | ||
;; | ||
testall) | ||
install || { | ||
echo "testall: Failed to install oar-pdr-py" | ||
exitopwith testall 2 | ||
} | ||
shift | ||
|
||
# wrapper root shell should have already started mongodb | ||
stat=0 | ||
scripts/testall "$@"; stat=$? | ||
|
||
[ "$stat" != "0" ] && { | ||
echo "testall: One or more test packages failed (last=$stat)" | ||
echo NOT OK | ||
exitopwith testall 3 | ||
} | ||
# echo All OK | ||
EXCODE=$stat | ||
;; | ||
install) | ||
install | ||
python -c 'import nistoar.pdr, jq' | ||
EXCODE=$? | ||
;; | ||
testshell) | ||
# wrapper root shell should have already started mongodb | ||
install | ||
exec /bin/bash | ||
;; | ||
shell) | ||
exec /bin/bash | ||
;; | ||
*) | ||
echo Unknown command: $1 | ||
echo Available commands: build makedist testall install shell | ||
EXCODE=100 | ||
;; | ||
esac | ||
|
||
echo $EXCODE > $cmd.exit | ||
exit $EXCODE |
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,23 @@ | ||
######################################################################### | ||
# | ||
# Programmatic Data Publishing (PDP) web service | ||
# | ||
# This container launches the PDP web service via scripts/pdp-uwsgi.py | ||
# | ||
######################################################################### | ||
FROM oar-pdr-py/pyenv | ||
|
||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh | ||
RUN chmod a+rx /usr/local/bin/entrypoint.sh | ||
|
||
VOLUME /dev/oar-pdr-py | ||
VOLUME /app/dist | ||
|
||
RUN mkdir -p /dev/oar-pdr-py /app /data/nsd && chmod a+rwx /app | ||
WORKDIR /dev/oar-pdr-py | ||
|
||
ENV PYTHONPATH /app/dist/pdr/lib/python | ||
|
||
ARG devuser=developer | ||
USER $devuser | ||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] |
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,21 @@ | ||
#! /bin/bash | ||
# | ||
script=scripts/people-uwsgi.py | ||
port=9092 | ||
[ -z "$OAR_PEOPLESERVER_PORT" ] || port=$OAR_PEOPLESERVER_PORT | ||
[ -n "$OAR_WORKING_DIR" ] || OAR_WORKING_DIR=`mktemp --tmpdir -d _nsdserver.XXXXX` | ||
[ -d "$OAR_WORKING_DIR" ] || { | ||
echo peopleserver: ${OAR_WORKING_DIR}: working directory does not exist | ||
exit 10 | ||
} | ||
[ -n "$OAR_LOG_DIR" ] || export OAR_LOG_DIR=$OAR_WORKING_DIR | ||
[ -n "$OAR_PEOPLESERVER_CONFIG" ] || OAR_PEOPLESERVER_CONFIG=docker/peopleserver/people_config.yml | ||
|
||
echo | ||
echo Working Dir: $OAR_WORKING_DIR | ||
echo Access the NSD web service at http://localhost:$port/ | ||
echo | ||
|
||
uwsgi --plugin python3 --http-socket :$port --wsgi-file $script \ | ||
--set-ph oar_config_file=$OAR_PEOPLESERVER_CONFIG \ | ||
--set-ph oar_working_dir=$OAR_WORKING_DIR |
Oops, something went wrong.