Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 69603ef

Browse files
authored
Merge pull request #377 from omegaml/release-build-0.16.2
Release build 0.16.2
2 parents b41a439 + 7a4b2a9 commit 69603ef

File tree

9 files changed

+27
-16
lines changed

9 files changed

+27
-16
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[bumpversion]
2-
current_version = 0.16.1
2+
current_version = 0.16.2
33
commit = True
44
tag = False
55
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)([-](?P<release>(dev|rc))+(?P<build>\d+))?

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ jobs:
119119
chmod -R 777 /tmp/testlogs
120120
# build python specific wheel to allow dependency matching, e.g. tensorflow 2.5 requires py3.9
121121
# TODO consider using https://cibuildwheel.readthedocs.io or https://github.com/getsentry/milksnake or tox
122+
# PYTHON 3.12 is pending on https://github.com/jupyter/docker-stacks/pull/2072
122123
for PYVER in 3.10 3.11; do
123124
echo "Building distribution for $PYVER"
124125
# setup pyenv and build

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ release-test: bumpbuild dist
5353
: "twine upload to pypi test"
5454
# see https://packaging.python.org/tutorials/packaging-projects/
5555
# config is in $HOME/.pypirc
56-
twine upload --repository testpypi-omegaml dist/*gz dist/*whl
56+
twine upload --skip-existing --repository testpypi-omegaml dist/*gz
57+
twine upload --repository testpypi-omegaml dist/*whl
5758
sleep 5
5859
scripts/livetest.sh --testpypi --build
5960

@@ -106,7 +107,7 @@ bumpminor:
106107
bumpversion minor
107108

108109
bumpbuild:
109-
bumpversion build
110+
[ ! -z "${CI_PULL_REQUEST}" ] && echo "CI_PULL_REQUEST is set, not bumping" || bumpversion build
110111

111112
bumpfinal:
112113
bumpversion release
@@ -129,3 +130,4 @@ pipsync:
129130
scan: freeze pipsync
130131
snyk test --policy-path=./.snyk
131132
snyk code test
133+
mv requirements.txt scanned-pipreqs.txt

omegaml/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
0.16.1
1+
0.16.2
22

omegaml/backends/virtualobj.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import warnings
66

77
from omegaml.backends.basedata import BaseDataBackend
8+
from omegaml.util import tryOr
89

910

1011
class VirtualObjectBackend(BaseDataBackend):
@@ -255,7 +256,7 @@ def loads(self, data):
255256
# this is to deal with functions created outside of __main__
256257
# see https://stackoverflow.com/q/26193102/890242
257258
# https://stackoverflow.com/a/70513630/890242
258-
mod = types.ModuleType(e.name, 'dynamic module')
259+
mod = types.ModuleType(e.name, '__dynamic__')
259260
sys.modules[e.name] = mod # sys.modules['__main__']
260261
obj = dill.loads(data)
261262
return obj
@@ -348,7 +349,7 @@ def _dynamic_compile(self, obj, module='__main__'):
348349
return obj
349350

350351
def isdipped(self, data_or_obj):
351-
obj = dill.loads(data_or_obj) if not isinstance(data_or_obj, dict) else data_or_obj
352+
obj = tryOr(lambda : dill.loads(data_or_obj), None) if not isinstance(data_or_obj, dict) else data_or_obj
352353
return isinstance(obj, dict) and obj.get('__dipped__') == self.__calories
353354

354355

omegaml/client/cli/runtime.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class RuntimeCommandBase(CommandBase):
2525
om runtime log [-f] [options]
2626
om runtime status [workers|labels|stats] [options]
2727
om runtime restart app <name> [--insecure] [--apphub-url=<url>] [options]
28-
om runtime serve [<rule>...] [--rules=<rulefile>] [options]
28+
om runtime serve [<rule>...] [--rules=<rulefile>] [--port=<port>] [--ip=<ip>] [options]
2929
om runtime deploy [<deploy-action>] [--steps=<deployfile>] [--specs=<specs>] [--select=<filter>] [--dry] [options]
3030
om runtime (control|inspect|celery) [<celery-command>...] [--worker=<worker>] [--queue=<queue>] [--celery-help] [--flags <celery-flags>] [options]
3131
om runtime (export|import) [<prefix/name>...] [--path=<path>] [--compress] [--list] [--promote] [options]
@@ -45,6 +45,8 @@ class RuntimeCommandBase(CommandBase):
4545
--rules=VALUE /path/to/specs.txt, where each line is a <spec>
4646
--compress if specified the archive will be compress (tgz format) [default: True]
4747
--path=PATH path to directory where the archive should be written [default: ./mlops-export]
48+
--port=VALUE the port to use for the server [default: 8000]
49+
--ip=VALUE the ip to use for the server [default: localhost]
4850
--list if specified, print members of archive
4951
--promote if specified, import and promote objects
5052
--steps=VALUE /path/to/deployfile.yaml [default: ./deployfile.yaml]
@@ -429,11 +431,13 @@ def serve(self):
429431
om = get_omega(self.args, require_config=False)
430432
specs = self.args.get('<rule>')
431433
specfile = self.args.get('--rules')
434+
port = self.args.get('--port', 8000)
435+
host = self.args.get('--host', 'localhost')
432436
if specfile:
433437
with open(specfile, 'r') as fin:
434438
specs = [s.replace('\n', '') for s in fin.readlines() if not s.startswith('#')]
435439
os.environ['OMEGA_RESTAPI_FILTER'] = ';'.join(specs) if specs else om.defaults.OMEGA_RESTAPI_FILTER
436-
subprocess.run("gunicorn 'omegaml.restapi.app:serve_objects()'", shell=True)
440+
subprocess.run(f"gunicorn 'omegaml.restapi.app:serve_objects()' --bind {host}:{port}", shell=True)
437441

438442
def deploy(self):
439443
om = get_omega(self.args, require_config=False)

omegaml/defaults.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
'model.r': 'omegaml.backends.rsystem.rmodels.RModelBackend',
122122
'package.r': 'omegaml.backends.rsystem.rscripts.RPackageData',
123123
}
124-
#: supported frameworks
124+
#: supported frameworks (deprecated since 0.16.2, it is effectively ignored)
125125
OMEGA_FRAMEWORKS = os.environ.get('OMEGA_FRAMEWORKS', 'scikit-learn').split(',')
126126
if is_test_run:
127127
OMEGA_FRAMEWORKS = ('scikit-learn', 'tensorflow', 'keras')
@@ -394,14 +394,14 @@ def load_framework_support(vars=globals()):
394394
# -- note we do this here to ensure this happens after config updates
395395
if OMEGA_DISABLE_FRAMEWORKS:
396396
return
397-
if 'tensorflow' in vars['OMEGA_FRAMEWORKS'] and tensorflow_available():
397+
if tensorflow_available():
398398
#: tensorflow backend
399399
# https://stackoverflow.com/a/38645250
400400
os.environ['TF_CPP_MIN_LOG_LEVEL'] = os.environ.get('TF_CPP_MIN_LOG_LEVEL') or '3'
401401
logging.getLogger('tensorflow').setLevel(logging.ERROR)
402402
vars['OMEGA_STORE_BACKENDS'].update(vars['OMEGA_STORE_BACKENDS_TENSORFLOW'])
403403
#: keras backend
404-
if 'keras' in vars['OMEGA_FRAMEWORKS'] and keras_available():
404+
if keras_available():
405405
vars['OMEGA_STORE_BACKENDS'].update(vars['OMEGA_STORE_BACKENDS_KERAS'])
406406
#: sqlalchemy backend
407407
if module_available('sqlalchemy'):

omegaml/util.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,7 @@ def module_available(modname):
644644

645645

646646
def tensorflow_available():
647+
os.environ.setdefault('TF_CPP_MIN_LOG_LEVEL', '3')
647648
return module_available('tensorflow')
648649

649650

@@ -1088,7 +1089,7 @@ class SystemPosixPath(type(Path()), Path):
10881089
=> str(path) => will always be './foo/bar')
10891090
10901091
Rationale:
1091-
pathlib.Path('./foo/bar') will render as '\\foo\bar' on Windows
1092+
pathlib.Path('./foo/bar') will render as '\\foo\\bar' on Windows
10921093
while pathlib.PosixPath cannot be imported in Windows
10931094
"""
10941095

@@ -1166,9 +1167,9 @@ def tarfile_safe_extractall(tar, dest_path, filter='data'):
11661167
# Path is absolute even after stripping.
11671168
# For example, 'C:/foo' on Windows.
11681169
raise ValueError(f"tarfile: {member} is an absolute path")
1169-
# Ensure we stay in the destination
1170-
target_path = os.path.realpath(os.path.join(dest_path, name))
1171-
if os.path.commonpath([target_path, dest_path]) != dest_path:
1170+
# Ensure we stay in the destination
1171+
target_path = (Path(dest_path) / name).resolve()
1172+
if not target_path.is_relative_to(dest_path):
11721173
raise ValueError(f"tarfile: {member}, {target_path} is outside of destination")
11731174
# Python before 3.12, before backports to 3.11, 3.10, 3.9
11741175
return tar.extractall(dest_path)

requirements.txt renamed to scanned-pipreqs.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# This file is autogenerated by pip-compile with Python 3.11
2+
# This file is autogenerated by pip-compile with Python 3.10
33
# by the following command:
44
#
55
# pip-compile --output-file=requirements.txt
@@ -77,6 +77,8 @@ dnspython==2.5.0
7777
# pymongo
7878
docopt==0.6.2
7979
# via omegaml (setup.py)
80+
exceptiongroup==1.2.0
81+
# via ipython
8082
executing==2.0.1
8183
# via stack-data
8284
fastjsonschema==2.19.1

0 commit comments

Comments
 (0)