From dc033f4c14819531c9629ff8d3a4bb438ca2fd3a Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 19 Jan 2025 19:45:26 -0500 Subject: [PATCH] set up for mongo, left to do is writing the test --- dockbuild.log | 368 ++++++++++++++++++ python/nistoar/midas/dbio/mongo.py | 12 +- .../midas/dbio/test_mongo_websocket.py | 0 scripts/midas-uwsgi.py | 2 +- 4 files changed, 376 insertions(+), 6 deletions(-) create mode 100644 dockbuild.log create mode 100644 python/tests/nistoar/midas/dbio/test_mongo_websocket.py diff --git a/dockbuild.log b/dockbuild.log new file mode 100644 index 00000000..eef88fb9 --- /dev/null +++ b/dockbuild.log @@ -0,0 +1,368 @@ +Exec: dockbuild.sh -d midasserver + started at Thu Jan 16 17:09:09 EST 2025 ++ docker build --build-arg=devuid=501 -t oar-pdr-py/pyenv pyenv +#0 building with "desktop-linux" instance using docker driver + +#1 [internal] load .dockerignore +#1 transferring context: 2B done +#1 DONE 0.0s + +#2 [internal] load build definition from Dockerfile +#2 transferring dockerfile: 1.82kB done +#2 DONE 0.0s + +#3 [internal] load metadata for docker.io/oar-metadata/ejsonschema:latest +#3 DONE 0.0s + +#4 [1/8] FROM docker.io/oar-metadata/ejsonschema +#4 DONE 0.0s + +#5 [2/8] RUN apt-get update && apt-get install -y python3-yaml curl wget less sudo zip p7zip-full ca-certificates git +#5 0.238 Hit:1 http://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 InRelease +#5 0.364 Hit:2 http://ports.ubuntu.com/ubuntu-ports jammy InRelease +#5 0.454 Hit:3 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease +#5 0.553 Hit:4 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease +#5 0.647 Hit:5 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease +#5 0.732 Reading package lists... +#5 1.399 Reading package lists... +#5 2.019 Building dependency tree... +#5 2.153 Reading state information... +#5 2.311 ca-certificates is already the newest version (20240203~22.04.1). +#5 2.311 curl is already the newest version (7.81.0-1ubuntu1.20). +#5 2.311 The following additional packages will be installed: +#5 2.312 git-man libcbor0.8 libcurl3-gnutls libedit2 liberror-perl libfido2-1 +#5 2.312 libxext6 libxmuu1 libyaml-0-2 openssh-client p7zip xauth +#5 2.312 Suggested packages: +#5 2.312 gettext-base git-daemon-run | git-daemon-sysvinit git-doc git-email git-gui +#5 2.312 gitk gitweb git-cvs git-mediawiki git-svn keychain libpam-ssh monkeysphere +#5 2.312 ssh-askpass p7zip-rar +#5 2.366 The following NEW packages will be installed: +#5 2.370 git git-man less libcbor0.8 libcurl3-gnutls libedit2 liberror-perl +#5 2.370 libfido2-1 libxext6 libxmuu1 libyaml-0-2 openssh-client p7zip p7zip-full +#5 2.370 python3-yaml sudo wget xauth zip +#5 2.572 0 upgraded, 19 newly installed, 0 to remove and 1 not upgraded. +#5 2.572 Need to get 8,635 kB of archives. +#5 2.572 After this operation, 35.4 MB of additional disk space will be used. +#5 2.572 Get:1 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 less arm64 590-1ubuntu0.22.04.3 [141 kB] +#5 3.011 Get:2 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 libyaml-0-2 arm64 0.2.2-1build2 [51.0 kB] +#5 3.038 Get:3 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 python3-yaml arm64 5.4.1-1ubuntu1 [122 kB] +#5 3.121 Get:4 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 sudo arm64 1.9.9-1ubuntu2.4 [807 kB] +#5 3.331 Get:5 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 libcbor0.8 arm64 0.8.0-2ubuntu1 [24.3 kB] +#5 3.332 Get:6 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 libedit2 arm64 3.1-20210910-1build1 [96.0 kB] +#5 3.342 Get:7 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 libfido2-1 arm64 1.10.0-1 [81.8 kB] +#5 3.359 Get:8 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 libxext6 arm64 2:1.3.4-1build1 [31.1 kB] +#5 3.364 Get:9 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 libxmuu1 arm64 2:1.1.3-3 [10.4 kB] +#5 3.364 Get:10 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 openssh-client arm64 1:8.9p1-3ubuntu0.10 [863 kB] +#5 3.449 Get:11 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 wget arm64 1.21.2-2ubuntu1.1 [334 kB] +#5 3.663 Get:12 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 xauth arm64 1:1.1-1build2 [26.8 kB] +#5 3.868 Get:13 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 libcurl3-gnutls arm64 7.81.0-1ubuntu1.20 [279 kB] +#5 4.185 Get:14 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 liberror-perl all 0.17029-1 [26.5 kB] +#5 4.197 Get:15 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 git-man all 1:2.34.1-1ubuntu1.12 [955 kB] +#5 4.414 Get:16 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 git arm64 1:2.34.1-1ubuntu1.12 [3,224 kB] +#5 4.634 Get:17 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 p7zip arm64 16.02+dfsg-8 [324 kB] +#5 4.647 Get:18 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 p7zip-full arm64 16.02+dfsg-8 [1,065 kB] +#5 4.683 Get:19 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 zip arm64 3.0-12build2 [173 kB] +#5 5.053 debconf: delaying package configuration, since apt-utils is not installed +#5 5.088 Fetched 8,635 kB in 2s (3,710 kB/s) +#5 5.109 Selecting previously unselected package less. +#5 5.109 (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 19025 files and directories currently installed.) +#5 5.127 Preparing to unpack .../00-less_590-1ubuntu0.22.04.3_arm64.deb ... +#5 5.131 Unpacking less (590-1ubuntu0.22.04.3) ... +#5 5.161 Selecting previously unselected package libyaml-0-2:arm64. +#5 5.163 Preparing to unpack .../01-libyaml-0-2_0.2.2-1build2_arm64.deb ... +#5 5.167 Unpacking libyaml-0-2:arm64 (0.2.2-1build2) ... +#5 5.192 Selecting previously unselected package python3-yaml. +#5 5.194 Preparing to unpack .../02-python3-yaml_5.4.1-1ubuntu1_arm64.deb ... +#5 5.196 Unpacking python3-yaml (5.4.1-1ubuntu1) ... +#5 5.230 Selecting previously unselected package sudo. +#5 5.232 Preparing to unpack .../03-sudo_1.9.9-1ubuntu2.4_arm64.deb ... +#5 5.237 Unpacking sudo (1.9.9-1ubuntu2.4) ... +#5 5.277 Selecting previously unselected package libcbor0.8:arm64. +#5 5.279 Preparing to unpack .../04-libcbor0.8_0.8.0-2ubuntu1_arm64.deb ... +#5 5.281 Unpacking libcbor0.8:arm64 (0.8.0-2ubuntu1) ... +#5 5.305 Selecting previously unselected package libedit2:arm64. +#5 5.307 Preparing to unpack .../05-libedit2_3.1-20210910-1build1_arm64.deb ... +#5 5.310 Unpacking libedit2:arm64 (3.1-20210910-1build1) ... +#5 5.341 Selecting previously unselected package libfido2-1:arm64. +#5 5.344 Preparing to unpack .../06-libfido2-1_1.10.0-1_arm64.deb ... +#5 5.346 Unpacking libfido2-1:arm64 (1.10.0-1) ... +#5 5.372 Selecting previously unselected package libxext6:arm64. +#5 5.374 Preparing to unpack .../07-libxext6_2%3a1.3.4-1build1_arm64.deb ... +#5 5.376 Unpacking libxext6:arm64 (2:1.3.4-1build1) ... +#5 5.402 Selecting previously unselected package libxmuu1:arm64. +#5 5.403 Preparing to unpack .../08-libxmuu1_2%3a1.1.3-3_arm64.deb ... +#5 5.405 Unpacking libxmuu1:arm64 (2:1.1.3-3) ... +#5 5.430 Selecting previously unselected package openssh-client. +#5 5.432 Preparing to unpack .../09-openssh-client_1%3a8.9p1-3ubuntu0.10_arm64.deb ... +#5 5.440 Unpacking openssh-client (1:8.9p1-3ubuntu0.10) ... +#5 5.481 Selecting previously unselected package wget. +#5 5.483 Preparing to unpack .../10-wget_1.21.2-2ubuntu1.1_arm64.deb ... +#5 5.485 Unpacking wget (1.21.2-2ubuntu1.1) ... +#5 5.512 Selecting previously unselected package xauth. +#5 5.514 Preparing to unpack .../11-xauth_1%3a1.1-1build2_arm64.deb ... +#5 5.516 Unpacking xauth (1:1.1-1build2) ... +#5 5.537 Selecting previously unselected package libcurl3-gnutls:arm64. +#5 5.539 Preparing to unpack .../12-libcurl3-gnutls_7.81.0-1ubuntu1.20_arm64.deb ... +#5 5.542 Unpacking libcurl3-gnutls:arm64 (7.81.0-1ubuntu1.20) ... +#5 5.564 Selecting previously unselected package liberror-perl. +#5 5.565 Preparing to unpack .../13-liberror-perl_0.17029-1_all.deb ... +#5 5.567 Unpacking liberror-perl (0.17029-1) ... +#5 5.585 Selecting previously unselected package git-man. +#5 5.587 Preparing to unpack .../14-git-man_1%3a2.34.1-1ubuntu1.12_all.deb ... +#5 5.589 Unpacking git-man (1:2.34.1-1ubuntu1.12) ... +#5 5.621 Selecting previously unselected package git. +#5 5.623 Preparing to unpack .../15-git_1%3a2.34.1-1ubuntu1.12_arm64.deb ... +#5 5.630 Unpacking git (1:2.34.1-1ubuntu1.12) ... +#5 5.763 Selecting previously unselected package p7zip. +#5 5.764 Preparing to unpack .../16-p7zip_16.02+dfsg-8_arm64.deb ... +#5 5.766 Unpacking p7zip (16.02+dfsg-8) ... +#5 5.811 Selecting previously unselected package p7zip-full. +#5 5.813 Preparing to unpack .../17-p7zip-full_16.02+dfsg-8_arm64.deb ... +#5 5.819 Unpacking p7zip-full (16.02+dfsg-8) ... +#5 5.930 Selecting previously unselected package zip. +#5 5.932 Preparing to unpack .../18-zip_3.0-12build2_arm64.deb ... +#5 5.934 Unpacking zip (3.0-12build2) ... +#5 5.984 Setting up wget (1.21.2-2ubuntu1.1) ... +#5 6.007 Setting up libyaml-0-2:arm64 (0.2.2-1build2) ... +#5 6.021 Setting up libcbor0.8:arm64 (0.8.0-2ubuntu1) ... +#5 6.026 Setting up libedit2:arm64 (3.1-20210910-1build1) ... +#5 6.032 Setting up less (590-1ubuntu0.22.04.3) ... +#5 6.042 Setting up libxext6:arm64 (2:1.3.4-1build1) ... +#5 6.053 Setting up python3-yaml (5.4.1-1ubuntu1) ... +#5 6.170 Setting up libcurl3-gnutls:arm64 (7.81.0-1ubuntu1.20) ... +#5 6.176 Setting up liberror-perl (0.17029-1) ... +#5 6.182 Setting up zip (3.0-12build2) ... +#5 6.187 Setting up sudo (1.9.9-1ubuntu2.4) ... +#5 6.236 Setting up git-man (1:2.34.1-1ubuntu1.12) ... +#5 6.241 Setting up libfido2-1:arm64 (1.10.0-1) ... +#5 6.247 Setting up libxmuu1:arm64 (2:1.1.3-3) ... +#5 6.253 Setting up p7zip (16.02+dfsg-8) ... +#5 6.271 Setting up openssh-client (1:8.9p1-3ubuntu0.10) ... +#5 6.406 update-alternatives: using /usr/bin/ssh to provide /usr/bin/rsh (rsh) in auto mode +#5 6.406 update-alternatives: warning: skip creation of /usr/share/man/man1/rsh.1.gz because associated file /usr/share/man/man1/ssh.1.gz (of link group rsh) doesn't exist +#5 6.409 update-alternatives: using /usr/bin/slogin to provide /usr/bin/rlogin (rlogin) in auto mode +#5 6.410 update-alternatives: warning: skip creation of /usr/share/man/man1/rlogin.1.gz because associated file /usr/share/man/man1/slogin.1.gz (of link group rlogin) doesn't exist +#5 6.413 update-alternatives: using /usr/bin/scp to provide /usr/bin/rcp (rcp) in auto mode +#5 6.414 update-alternatives: warning: skip creation of /usr/share/man/man1/rcp.1.gz because associated file /usr/share/man/man1/scp.1.gz (of link group rcp) doesn't exist +#5 6.435 Setting up p7zip-full (16.02+dfsg-8) ... +#5 6.448 Setting up git (1:2.34.1-1ubuntu1.12) ... +#5 6.462 Setting up xauth (1:1.1-1build2) ... +#5 6.467 Processing triggers for libc-bin (2.35-0ubuntu3.8) ... +#5 DONE 6.8s + +#6 [3/8] RUN pip install funcsigs 'bagit>=1.6.3,<2.0' 'fs>=2.0.21' jsonpatch mako pyjwt jsonpath_ng lxml webdavclient3 websockets +#6 0.719 Collecting funcsigs +#6 0.838 Downloading funcsigs-1.0.2-py2.py3-none-any.whl (17 kB) +#6 0.879 Collecting bagit<2.0,>=1.6.3 +#6 0.902 Downloading bagit-1.8.1-py2.py3-none-any.whl (35 kB) +#6 0.970 Collecting fs>=2.0.21 +#6 0.989 Downloading fs-2.4.16-py2.py3-none-any.whl (135 kB) +#6 1.019 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 135.3/135.3 KB 4.8 MB/s eta 0:00:00 +#6 1.058 Collecting jsonpatch +#6 1.087 Downloading jsonpatch-1.33-py2.py3-none-any.whl (12 kB) +#6 1.131 Collecting mako +#6 1.151 Downloading Mako-1.3.8-py3-none-any.whl (78 kB) +#6 1.157 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.6/78.6 KB 13.3 MB/s eta 0:00:00 +#6 1.233 Collecting pyjwt +#6 1.258 Downloading PyJWT-2.10.1-py3-none-any.whl (22 kB) +#6 1.261 Requirement already satisfied: jsonpath_ng in /usr/local/lib/python3.10/dist-packages (1.7.0) +#6 1.262 Requirement already satisfied: lxml in /usr/local/lib/python3.10/dist-packages (5.3.0) +#6 1.289 Collecting webdavclient3 +#6 1.310 Downloading webdavclient3-3.14.6.tar.gz (23 kB) +#6 1.316 Preparing metadata (setup.py): started +#6 1.414 Preparing metadata (setup.py): finished with status 'done' +#6 1.565 Collecting websockets +#6 1.589 Downloading websockets-14.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (168 kB) +#6 1.599 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 168.8/168.8 KB 17.3 MB/s eta 0:00:00 +#6 1.605 Requirement already satisfied: setuptools in /usr/lib/python3/dist-packages (from fs>=2.0.21) (59.6.0) +#6 1.632 Collecting appdirs~=1.4.3 +#6 1.653 Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB) +#6 1.657 Requirement already satisfied: six~=1.10 in /usr/local/lib/python3.10/dist-packages (from fs>=2.0.21) (1.17.0) +#6 1.693 Collecting jsonpointer>=1.9 +#6 1.724 Downloading jsonpointer-3.0.0-py2.py3-none-any.whl (7.6 kB) +#6 1.815 Collecting MarkupSafe>=0.9.2 +#6 1.851 Downloading MarkupSafe-3.0.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (21 kB) +#6 1.864 Requirement already satisfied: ply in /usr/local/lib/python3.10/dist-packages (from jsonpath_ng) (3.11) +#6 1.899 Collecting python-dateutil +#6 1.929 Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB) +#6 1.939 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 229.9/229.9 KB 27.5 MB/s eta 0:00:00 +#6 1.941 Requirement already satisfied: requests in /usr/local/lib/python3.10/dist-packages (from webdavclient3) (2.32.3) +#6 1.950 Requirement already satisfied: urllib3<3,>=1.21.1 in /usr/local/lib/python3.10/dist-packages (from requests->webdavclient3) (1.26.16) +#6 1.950 Requirement already satisfied: charset-normalizer<4,>=2 in /usr/local/lib/python3.10/dist-packages (from requests->webdavclient3) (3.4.1) +#6 1.951 Requirement already satisfied: idna<4,>=2.5 in /usr/local/lib/python3.10/dist-packages (from requests->webdavclient3) (3.10) +#6 1.951 Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.10/dist-packages (from requests->webdavclient3) (2024.12.14) +#6 1.963 Building wheels for collected packages: webdavclient3 +#6 1.964 Building wheel for webdavclient3 (setup.py): started +#6 2.087 Building wheel for webdavclient3 (setup.py): finished with status 'done' +#6 2.088 Created wheel for webdavclient3: filename=webdavclient3-3.14.6-py3-none-any.whl size=20889 sha256=0b655de24570cf6fb287707920d8a66a19a4fc402cefb863a176a93ab61d81fc +#6 2.089 Stored in directory: /root/.cache/pip/wheels/6e/14/66/e35c0618088019f3b11742283f7ecc5c89904eb27b96fe38d8 +#6 2.089 Successfully built webdavclient3 +#6 2.243 Installing collected packages: funcsigs, bagit, appdirs, websockets, python-dateutil, pyjwt, MarkupSafe, jsonpointer, fs, webdavclient3, mako, jsonpatch +#6 2.604 Successfully installed MarkupSafe-3.0.2 appdirs-1.4.4 bagit-1.8.1 fs-2.4.16 funcsigs-1.0.2 jsonpatch-1.33 jsonpointer-3.0.0 mako-1.3.8 pyjwt-2.10.1 python-dateutil-2.9.0.post0 webdavclient3-3.14.6 websockets-14.1 +#6 2.604 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv +#6 DONE 2.7s + +#7 [4/8] RUN multibag_ver=0.5 && curl -L -o multibag-py.zip https://github.com/usnistgov/multibag-py/archive/$multibag_ver.zip && unzip -oq multibag-py.zip && cd multibag-py-$multibag_ver && echo __version__ = $multibag_ver >> multibag/__init__.py && python setup.py install --install-purelib=/usr/local/lib/python3.10/dist-packages +#7 0.266 % Total % Received % Xferd Average Speed Time Time Time Current +#7 0.266 Dload Upload Total Spent Left Speed +#7 0.266 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0 +#7 0.734 100 1083k 0 1083k 0 0 2312k 0 --:--:-- --:--:-- --:--:-- 2312k +#7 0.833 running install +#7 0.833 /usr/lib/python3/dist-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. +#7 0.833 warnings.warn( +#7 0.854 /usr/lib/python3/dist-packages/setuptools/command/easy_install.py:158: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. +#7 0.854 warnings.warn( +#7 0.872 running bdist_egg +#7 0.872 running egg_info +#7 0.872 creating multibag.egg-info +#7 0.872 writing multibag.egg-info/PKG-INFO +#7 0.873 writing dependency_links to multibag.egg-info/dependency_links.txt +#7 0.873 writing top-level names to multibag.egg-info/top_level.txt +#7 0.873 writing manifest file 'multibag.egg-info/SOURCES.txt' +#7 0.874 reading manifest file 'multibag.egg-info/SOURCES.txt' +#7 0.874 writing manifest file 'multibag.egg-info/SOURCES.txt' +#7 0.874 installing library code to build/bdist.linux-aarch64/egg +#7 0.875 running install_lib +#7 0.875 running build_py +#7 0.875 creating build +#7 0.875 creating build/lib +#7 0.875 creating build/lib/multibag +#7 0.875 copying multibag/__init__.py -> build/lib/multibag +#7 0.875 copying multibag/amend.py -> build/lib/multibag +#7 0.875 copying multibag/split.py -> build/lib/multibag +#7 0.875 copying multibag/restore.py -> build/lib/multibag +#7 0.875 copying multibag/constants.py -> build/lib/multibag +#7 0.875 creating build/lib/multibag/access +#7 0.875 copying multibag/access/extended.py -> build/lib/multibag/access +#7 0.876 copying multibag/access/__init__.py -> build/lib/multibag/access +#7 0.876 copying multibag/access/bagit.py -> build/lib/multibag/access +#7 0.876 copying multibag/access/multibag.py -> build/lib/multibag/access +#7 0.876 copying multibag/access/exceptions.py -> build/lib/multibag/access +#7 0.876 creating build/lib/multibag/validate +#7 0.876 copying multibag/validate/__init__.py -> build/lib/multibag/validate +#7 0.876 copying multibag/validate/headbag.py -> build/lib/multibag/validate +#7 0.877 copying multibag/validate/member.py -> build/lib/multibag/validate +#7 0.877 copying multibag/validate/bag.py -> build/lib/multibag/validate +#7 0.877 copying multibag/validate/base.py -> build/lib/multibag/validate +#7 0.877 creating build/lib/multibag/testing +#7 0.877 copying multibag/testing/__init__.py -> build/lib/multibag/testing +#7 0.877 copying multibag/testing/mkdata.py -> build/lib/multibag/testing +#7 0.877 creating build/bdist.linux-aarch64 +#7 0.877 creating build/bdist.linux-aarch64/egg +#7 0.877 creating build/bdist.linux-aarch64/egg/multibag +#7 0.877 copying build/lib/multibag/__init__.py -> build/bdist.linux-aarch64/egg/multibag +#7 0.878 creating build/bdist.linux-aarch64/egg/multibag/validate +#7 0.878 copying build/lib/multibag/validate/__init__.py -> build/bdist.linux-aarch64/egg/multibag/validate +#7 0.878 copying build/lib/multibag/validate/headbag.py -> build/bdist.linux-aarch64/egg/multibag/validate +#7 0.878 copying build/lib/multibag/validate/member.py -> build/bdist.linux-aarch64/egg/multibag/validate +#7 0.878 copying build/lib/multibag/validate/bag.py -> build/bdist.linux-aarch64/egg/multibag/validate +#7 0.878 copying build/lib/multibag/validate/base.py -> build/bdist.linux-aarch64/egg/multibag/validate +#7 0.878 copying build/lib/multibag/amend.py -> build/bdist.linux-aarch64/egg/multibag +#7 0.878 creating build/bdist.linux-aarch64/egg/multibag/access +#7 0.878 copying build/lib/multibag/access/extended.py -> build/bdist.linux-aarch64/egg/multibag/access +#7 0.878 copying build/lib/multibag/access/__init__.py -> build/bdist.linux-aarch64/egg/multibag/access +#7 0.878 copying build/lib/multibag/access/bagit.py -> build/bdist.linux-aarch64/egg/multibag/access +#7 0.878 copying build/lib/multibag/access/multibag.py -> build/bdist.linux-aarch64/egg/multibag/access +#7 0.878 copying build/lib/multibag/access/exceptions.py -> build/bdist.linux-aarch64/egg/multibag/access +#7 0.879 copying build/lib/multibag/split.py -> build/bdist.linux-aarch64/egg/multibag +#7 0.879 creating build/bdist.linux-aarch64/egg/multibag/testing +#7 0.879 copying build/lib/multibag/testing/__init__.py -> build/bdist.linux-aarch64/egg/multibag/testing +#7 0.879 copying build/lib/multibag/testing/mkdata.py -> build/bdist.linux-aarch64/egg/multibag/testing +#7 0.879 copying build/lib/multibag/restore.py -> build/bdist.linux-aarch64/egg/multibag +#7 0.879 copying build/lib/multibag/constants.py -> build/bdist.linux-aarch64/egg/multibag +#7 0.879 byte-compiling build/bdist.linux-aarch64/egg/multibag/__init__.py to __init__.cpython-310.pyc +#7 0.880 byte-compiling build/bdist.linux-aarch64/egg/multibag/validate/__init__.py to __init__.cpython-310.pyc +#7 0.880 byte-compiling build/bdist.linux-aarch64/egg/multibag/validate/headbag.py to headbag.cpython-310.pyc +#7 0.883 byte-compiling build/bdist.linux-aarch64/egg/multibag/validate/member.py to member.cpython-310.pyc +#7 0.884 byte-compiling build/bdist.linux-aarch64/egg/multibag/validate/bag.py to bag.cpython-310.pyc +#7 0.884 byte-compiling build/bdist.linux-aarch64/egg/multibag/validate/base.py to base.cpython-310.pyc +#7 0.885 byte-compiling build/bdist.linux-aarch64/egg/multibag/amend.py to amend.cpython-310.pyc +#7 0.886 byte-compiling build/bdist.linux-aarch64/egg/multibag/access/extended.py to extended.cpython-310.pyc +#7 0.888 byte-compiling build/bdist.linux-aarch64/egg/multibag/access/__init__.py to __init__.cpython-310.pyc +#7 0.888 byte-compiling build/bdist.linux-aarch64/egg/multibag/access/bagit.py to bagit.cpython-310.pyc +#7 0.890 byte-compiling build/bdist.linux-aarch64/egg/multibag/access/multibag.py to multibag.cpython-310.pyc +#7 0.891 byte-compiling build/bdist.linux-aarch64/egg/multibag/access/exceptions.py to exceptions.cpython-310.pyc +#7 0.892 byte-compiling build/bdist.linux-aarch64/egg/multibag/split.py to split.cpython-310.pyc +#7 0.893 byte-compiling build/bdist.linux-aarch64/egg/multibag/testing/__init__.py to __init__.cpython-310.pyc +#7 0.893 byte-compiling build/bdist.linux-aarch64/egg/multibag/testing/mkdata.py to mkdata.cpython-310.pyc +#7 0.895 byte-compiling build/bdist.linux-aarch64/egg/multibag/restore.py to restore.cpython-310.pyc +#7 0.896 byte-compiling build/bdist.linux-aarch64/egg/multibag/constants.py to constants.cpython-310.pyc +#7 0.896 creating build/bdist.linux-aarch64/egg/EGG-INFO +#7 0.896 copying multibag.egg-info/PKG-INFO -> build/bdist.linux-aarch64/egg/EGG-INFO +#7 0.896 copying multibag.egg-info/SOURCES.txt -> build/bdist.linux-aarch64/egg/EGG-INFO +#7 0.896 copying multibag.egg-info/dependency_links.txt -> build/bdist.linux-aarch64/egg/EGG-INFO +#7 0.896 copying multibag.egg-info/top_level.txt -> build/bdist.linux-aarch64/egg/EGG-INFO +#7 0.897 zip_safe flag not set; analyzing archive contents... +#7 0.901 creating dist +#7 0.901 creating 'dist/multibag-0.2-py3.10.egg' and adding 'build/bdist.linux-aarch64/egg' to it +#7 0.914 removing 'build/bdist.linux-aarch64/egg' (and everything under it) +#7 0.916 Processing multibag-0.2-py3.10.egg +#7 0.916 Copying multibag-0.2-py3.10.egg to /usr/local/lib/python3.10/dist-packages +#7 0.918 Adding multibag 0.2 to easy-install.pth file +#7 0.919 +#7 0.919 Installed /usr/local/lib/python3.10/dist-packages/multibag-0.2-py3.10.egg +#7 0.919 Processing dependencies for multibag==0.2 +#7 0.919 Finished processing dependencies for multibag==0.2 +#7 DONE 1.0s + +#8 [5/8] RUN sed --in-place -e '/CREATE_MAIL_SPOOL/ s/=yes/=no/' /etc/default/useradd +#8 DONE 0.3s + +#9 [6/8] RUN grep -qs :501: /etc/group || groupadd --gid 501 developer +#9 DONE 0.3s + +#10 [7/8] RUN grep -Pqs ":501:\d+:" /etc/passwd || useradd -m --comment "OAR Developer" --shell /bin/bash --gid 501 --uid 501 developer +#10 DONE 0.2s + +#11 [8/8] RUN echo developer "ALL=(ALL)" NOPASSWD:ALL > /etc/sudoers.d/90-developers +#11 DONE 0.1s + +#12 exporting to image +#12 exporting layers 0.1s done +#12 writing image sha256:a76ecfc68220adca2ff655bf24ddb3d61bf5814d6ed1116a05e27b0dbaa66148 done +#12 naming to docker.io/oar-pdr-py/pyenv done +#12 DONE 0.1s + +What's Next? + View summary of image vulnerabilities and recommendations → docker scout quickview ++ docker build --build-arg=devuid=501 -t oar-pdr-py/midasserver midasserver +#0 building with "desktop-linux" instance using docker driver + +#1 [internal] load .dockerignore +#1 transferring context: 2B done +#1 DONE 0.0s + +#2 [internal] load build definition from Dockerfile +#2 transferring dockerfile: 717B 0.0s done +#2 DONE 0.0s + +#3 [internal] load metadata for docker.io/oar-pdr-py/pyenv:latest +#3 DONE 0.0s + +#4 [internal] load build context +#4 transferring context: 35B done +#4 DONE 0.0s + +#5 [1/5] FROM docker.io/oar-pdr-py/pyenv +#5 DONE 0.1s + +#6 [2/5] COPY entrypoint.sh /usr/local/bin/entrypoint.sh +#6 DONE 0.0s + +#7 [3/5] RUN chmod a+rx /usr/local/bin/entrypoint.sh +#7 DONE 0.1s + +#8 [4/5] RUN mkdir -p /dev/oar-pdr-py /app && chmod a+rwx /app +#8 DONE 0.3s + +#9 [5/5] WORKDIR /dev/oar-pdr-py +#9 DONE 0.0s + +#10 exporting to image +#10 exporting layers 0.0s done +#10 writing image sha256:78a3a358780d1951fe2cd60ecabba7d01f6980e802e06d080474e7822c6c76fb done +#10 naming to docker.io/oar-pdr-py/midasserver done +#10 DONE 0.0s + +What's Next? + View summary of image vulnerabilities and recommendations → docker scout quickview diff --git a/python/nistoar/midas/dbio/mongo.py b/python/nistoar/midas/dbio/mongo.py index 25193691..1b2fa191 100644 --- a/python/nistoar/midas/dbio/mongo.py +++ b/python/nistoar/midas/dbio/mongo.py @@ -6,6 +6,7 @@ from collections.abc import Mapping, MutableMapping, Set from typing import Iterator, List from . import base +from .notifier import Notifier from pymongo import MongoClient, ASCENDING @@ -20,7 +21,7 @@ class MongoDBClient(base.DBClient): ACTION_LOG_COLL = base.PROV_ACT_LOG HISTORY_COLL = 'history' - def __init__(self, dburl: str, config: Mapping, projcoll: str, foruser: str = base.ANONYMOUS): + def __init__(self, dburl: str, config: Mapping, projcoll: str, foruser: str = base.ANONYMOUS, notification_server: Notifier = None): """ create the client with its connector to the MongoDB database @@ -34,7 +35,7 @@ def __init__(self, dburl: str, config: Mapping, projcoll: str, foruser: str = ba dburl) self._dburl = dburl self._mngocli = None - super(MongoDBClient, self).__init__(config, projcoll, None, foruser) + super(MongoDBClient, self).__init__(config, projcoll, None, foruser,notification_server) def connect(self): """ @@ -287,7 +288,7 @@ class MongoDBClientFactory(base.DBClientFactory): ``mongodb://``*[USER*``:``*PASS*``@``*]HOST[*``:``*PORT]*``/``*DBNAME* """ - def __init__(self, config: Mapping, dburl: str = None): + def __init__(self, config: Mapping, dburl: str = None, notification_server: Notifier = None): """ Create the factory with the given configuration. @@ -300,7 +301,8 @@ def __init__(self, config: Mapping, dburl: str = None): argument nor a configuration parameter. :raise ValueError: if the specified database URL is of an incorrect form """ - super(MongoDBClientFactory, self).__init__(config) + super(MongoDBClientFactory, self).__init__(config, notification_server) + self.notification_server = notification_server if not dburl: dburl = self._cfg.get("db_url") if not dburl: @@ -313,4 +315,4 @@ def __init__(self, config: Mapping, dburl: str = None): def create_client(self, servicetype: str, config: Mapping = {}, foruser: str = base.ANONYMOUS): cfg = merge_config(config, deepcopy(self._cfg)) - return MongoDBClient(self._dburl, cfg, servicetype, foruser) + return MongoDBClient(self._dburl, cfg, servicetype, foruser,self.notification_server) diff --git a/python/tests/nistoar/midas/dbio/test_mongo_websocket.py b/python/tests/nistoar/midas/dbio/test_mongo_websocket.py new file mode 100644 index 00000000..e69de29b diff --git a/scripts/midas-uwsgi.py b/scripts/midas-uwsgi.py index 0416116c..a78a4453 100644 --- a/scripts/midas-uwsgi.py +++ b/scripts/midas-uwsgi.py @@ -153,7 +153,7 @@ def initialize_notification_server(): factory = FSBasedDBClientFactory(cfg.get("dbio", {}), dbdir) elif dbtype == "mongo": - factory = MongoDBClientFactory(cfg.get("dbio", {}), dburl) + factory = MongoDBClientFactory(cfg.get("dbio", {}), dburl,notification_server=notification_server) elif dbtype == "inmem": factory = InMemoryDBClientFactory(cfg.get("dbio", {}),notification_server=notification_server)