Skip to content

Commit

Permalink
Merge pull request #63 from usnistgov/fix/mongo-support
Browse files Browse the repository at this point in the history
Update docker to Ubuntu 22, Python 3.10, MongoDB 7.0.  Additional testing to be done as part of oar-pdr-py.
  • Loading branch information
RayPlante authored Jun 23, 2024
2 parents a056b47 + 2ee0fe7 commit 57ed4ae
Show file tree
Hide file tree
Showing 13 changed files with 34 additions and 25 deletions.
18 changes: 9 additions & 9 deletions docker/ejsonschema/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ FROM oar-metadata/jqfromsrc:latest

RUN apt-get update && apt-get install -y unzip uwsgi uwsgi-src \
uuid-dev libcap-dev libpcre3-dev python3-distutils
RUN PYTHON=python3.8 uwsgi --build-plugin "/usr/src/uwsgi/plugins/python python38" && \
mv python38_plugin.so /usr/lib/uwsgi/plugins/python38_plugin.so && \
chmod 644 /usr/lib/uwsgi/plugins/python38_plugin.so
RUN PYTHON=python3 uwsgi --build-plugin "/usr/src/uwsgi/plugins/python python3" && \
mv python3_plugin.so /usr/lib/uwsgi/plugins/python3_plugin.so && \
chmod 644 /usr/lib/uwsgi/plugins/python3_plugin.so

RUN update-alternatives --install /usr/lib/uwsgi/plugins/python3_plugin.so \
python_plugin.so /usr/lib/uwsgi/plugins/python38_plugin.so 1
RUN update-alternatives --install /usr/lib/uwsgi/plugins/python_plugin.so \
python_plugin.so /usr/lib/uwsgi/plugins/python3_plugin.so 1

RUN python -m pip install "setuptools<66.0.0"
RUN python -m pip install json-spec jsonschema==2.4.0 requests \
Expand All @@ -17,16 +17,16 @@ RUN python -m pip install --no-dependencies jsonmerge==1.3.0
WORKDIR /root

RUN curl -L -o ejsonschema.zip \
https://github.com/usnistgov/ejsonschema/archive/master.zip && \
https://github.com/usnistgov/ejsonschema/archive/1.0rc4.zip && \
unzip ejsonschema.zip && \
cd ejsonschema-master && \
python setup.py install --install-purelib=/usr/local/lib/python3.8/dist-packages
cd ejsonschema-1.0rc4 && \
python setup.py install --install-purelib=/usr/local/lib/python3.10/dist-packages

RUN curl -L -o pynoid.zip \
https://github.com/RayPlante/pynoid/archive/master.zip && \
unzip pynoid.zip && \
cd pynoid-master && \
python setup.py install --install-purelib=/usr/local/lib/python3.8/dist-packages
python setup.py install --install-purelib=/usr/local/lib/python3.10/dist-packages

CMD ["bash"]

11 changes: 6 additions & 5 deletions docker/pymongo/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# This provides the base support for Python 3.8 and MongoDB 4.4
# This provides the base support for Python 3.10 and MongoDB 7.0

FROM mongo:4.4
FROM mongo:7.0-jammy
# VOLUME /data
MAINTAINER Ray Plante <[email protected]>
COPY mongod.conf /etc/mongod.conf
COPY mongod_ctl.sh /usr/local/bin

RUN apt-get update && apt-get install -y ca-certificates locales python3.8 python3-pip python3.8-dev
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.8 1; \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1; \
RUN apt-get update && apt-get install -y ca-certificates locales \
python3 python3-pip python3-dev python-is-python3
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1; \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3 1; \
update-alternatives --install /usr/bin/pip pip /usr/bin/pip3 1
RUN locale-gen en_US.UTF-8

Expand Down
3 changes: 2 additions & 1 deletion python/nistoar/doi/datacite.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
DataCite services.
"""
import re
from collections import OrderedDict, Mapping
from collections import OrderedDict
from collections.abc import Mapping
from copy import deepcopy
from io import StringIO
import requests
Expand Down
3 changes: 2 additions & 1 deletion python/nistoar/id/persist.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
locking to prevent two processes from acquiring the same ID.
"""
import os, logging, json
from collections import Mapping
from collections import OrderedDict
from collections.abc import Mapping
from copy import deepcopy
from .minter import IDRegistry, IDMinter, NoidMinter, NIST_ARK_NAAN
import pynoid as noid, filelock
Expand Down
3 changes: 2 additions & 1 deletion python/nistoar/nerdm/convert/latest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
Module for converting a NERDm record to the latest schema versions.
"""
import re
from collections import OrderedDict, Mapping
from collections import OrderedDict
from collections.abc import Mapping
from copy import deepcopy
from urllib.parse import urlparse

Expand Down
3 changes: 2 additions & 1 deletion python/nistoar/nerdm/convert/pod.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
Classes and functions for converting from and to the NERDm schema
"""
import os, json, re
from collections import OrderedDict, Mapping
from collections import OrderedDict
from collections.abc import Mapping

from ... import jq
from ...doi import resolve, is_DOI
Expand Down
3 changes: 2 additions & 1 deletion python/nistoar/nerdm/convert/rmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
as a version-specific ID.
"""
import re
from collections import OrderedDict, Mapping
from collections import OrderedDict
from collections.abc import Mapping
from urllib.parse import urljoin
from copy import deepcopy

Expand Down
3 changes: 2 additions & 1 deletion python/nistoar/nerdm/validate.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""
tools for validating NERDm metadata
"""
from collections import Mapping
from collections import OrderedDict
from collections.abc import Mapping

import ejsonschema as ejs
from ejsonschema import ValidationError, RefResolutionError
Expand Down
3 changes: 2 additions & 1 deletion python/nistoar/rmm/mongo/nerdm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
"""
# import pandas as pd
import json, os, sys, warnings
from collections import Mapping
from collections import OrderedDict
from collections.abc import Mapping

from .loader import (Loader, RecordIngestError, JSONEncodingError,
UpdateWarning, LoadLog)
Expand Down
2 changes: 1 addition & 1 deletion python/tests/nistoar/doi/resolving/test_crossref.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os, sys, pdb, shutil, logging, json
import unittest as test
from collections import Mapping
from collections.abc import Mapping
# from nistoar.tests import *

import nistoar.doi.resolving.crossref as res
Expand Down
2 changes: 1 addition & 1 deletion python/tests/nistoar/doi/resolving/test_datacite.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os, sys, pdb, shutil, logging, json
import unittest as test
from collections import Mapping
from collections.abc import Mapping
# from nistoar.tests import *

import nistoar.doi.resolving.datacite as res
Expand Down
3 changes: 2 additions & 1 deletion python/tests/nistoar/doi/sim_datacite_srv.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import json, os, sys, re, hashlib, json, logging, random
from datetime import datetime
from wsgiref.headers import Headers
from collections import OrderedDict, Mapping
from collections import OrderedDict
from collections.abc import Mapping
from copy import deepcopy
from urllib.parse import parse_qs

Expand Down
2 changes: 1 addition & 1 deletion python/tests/nistoar/nerdm/test_validate.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import unittest, pdb, os, json
from collections import Mapping
from collections.abc import Mapping

import ejsonschema as ejs

Expand Down

0 comments on commit 57ed4ae

Please sign in to comment.