@tedbrain/vlink 0.0.0-dpv2.ted-runner.plugin.0.1.1.r6 → 0.0.0-dpv2.ted-runner.python-linux-x64.3.9.0-dpv2.1.r6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/python3 +0 -0
- package/lib/libX11.so.6 +0 -0
- package/lib/libXau.so.6 +0 -0
- package/lib/libXdmcp.so.6 +0 -0
- package/lib/libcrypt.so.1 +0 -0
- package/lib/libcrypto.so.1.1 +0 -0
- package/lib/libffi.so.7 +0 -0
- package/lib/libfreebl3.so +0 -0
- package/lib/liblzma.so.5 +0 -0
- package/lib/libncursesw.so.6 +0 -0
- package/lib/libnsl.so.1 +0 -0
- package/lib/libpanelw.so.6 +0 -0
- package/lib/libpython3.9.so.1.0 +0 -0
- package/lib/libreadline.so.8 +0 -0
- package/lib/libsqlite3.so.0 +0 -0
- package/lib/libssl.so.1.1 +0 -0
- package/lib/libtcl8.6.so +0 -0
- package/lib/libtinfow.so.6 +0 -0
- package/lib/libtk8.6.so +0 -0
- package/lib/libxcb.so.1 +0 -0
- package/lib/libz.so.1 +0 -0
- package/lib/python3.9/LICENSE.txt +279 -0
- package/lib/python3.9/__future__.py +147 -0
- package/lib/python3.9/__phello__.foo.py +1 -0
- package/lib/python3.9/_aix_support.py +89 -0
- package/lib/python3.9/_bootlocale.py +46 -0
- package/lib/python3.9/_bootsubprocess.py +97 -0
- package/lib/python3.9/_collections_abc.py +1031 -0
- package/lib/python3.9/_compat_pickle.py +251 -0
- package/lib/python3.9/_compression.py +152 -0
- package/lib/python3.9/_markupbase.py +395 -0
- package/lib/python3.9/_osx_support.py +515 -0
- package/lib/python3.9/_py_abc.py +147 -0
- package/lib/python3.9/_pydecimal.py +6410 -0
- package/lib/python3.9/_pyio.py +2692 -0
- package/lib/python3.9/_sitebuiltins.py +103 -0
- package/lib/python3.9/_strptime.py +579 -0
- package/lib/python3.9/_sysconfigdata__linux_x86_64-linux-gnu.py +969 -0
- package/lib/python3.9/_sysconfigdata__linux_x86_64-linux-gnu.py.orig +969 -0
- package/lib/python3.9/_sysconfigdata_x86_64_conda_cos6_linux_gnu.py +969 -0
- package/lib/python3.9/_threading_local.py +242 -0
- package/lib/python3.9/_weakrefset.py +202 -0
- package/lib/python3.9/abc.py +129 -0
- package/lib/python3.9/aifc.py +947 -0
- package/lib/python3.9/antigravity.py +17 -0
- package/lib/python3.9/argparse.py +2575 -0
- package/lib/python3.9/ast.py +1530 -0
- package/lib/python3.9/asynchat.py +307 -0
- package/lib/python3.9/asyncio/__init__.py +47 -0
- package/lib/python3.9/asyncio/__main__.py +125 -0
- package/lib/python3.9/asyncio/base_events.py +1915 -0
- package/lib/python3.9/asyncio/base_futures.py +61 -0
- package/lib/python3.9/asyncio/base_subprocess.py +285 -0
- package/lib/python3.9/asyncio/base_tasks.py +85 -0
- package/lib/python3.9/asyncio/constants.py +27 -0
- package/lib/python3.9/asyncio/coroutines.py +269 -0
- package/lib/python3.9/asyncio/events.py +795 -0
- package/lib/python3.9/asyncio/exceptions.py +57 -0
- package/lib/python3.9/asyncio/format_helpers.py +76 -0
- package/lib/python3.9/asyncio/futures.py +423 -0
- package/lib/python3.9/asyncio/locks.py +451 -0
- package/lib/python3.9/asyncio/log.py +7 -0
- package/lib/python3.9/asyncio/proactor_events.py +868 -0
- package/lib/python3.9/asyncio/protocols.py +220 -0
- package/lib/python3.9/asyncio/queues.py +252 -0
- package/lib/python3.9/asyncio/runners.py +74 -0
- package/lib/python3.9/asyncio/selector_events.py +1099 -0
- package/lib/python3.9/asyncio/sslproto.py +733 -0
- package/lib/python3.9/asyncio/staggered.py +149 -0
- package/lib/python3.9/asyncio/streams.py +741 -0
- package/lib/python3.9/asyncio/subprocess.py +241 -0
- package/lib/python3.9/asyncio/tasks.py +980 -0
- package/lib/python3.9/asyncio/threads.py +25 -0
- package/lib/python3.9/asyncio/transports.py +329 -0
- package/lib/python3.9/asyncio/trsock.py +206 -0
- package/lib/python3.9/asyncio/unix_events.py +1466 -0
- package/lib/python3.9/asyncio/windows_events.py +908 -0
- package/lib/python3.9/asyncio/windows_utils.py +173 -0
- package/lib/python3.9/asyncore.py +642 -0
- package/lib/python3.9/base64.py +579 -0
- package/lib/python3.9/bdb.py +864 -0
- package/lib/python3.9/binhex.py +502 -0
- package/lib/python3.9/bisect.py +80 -0
- package/lib/python3.9/bz2.py +350 -0
- package/lib/python3.9/cProfile.py +180 -0
- package/lib/python3.9/calendar.py +770 -0
- package/lib/python3.9/cgi.py +996 -0
- package/lib/python3.9/cgitb.py +321 -0
- package/lib/python3.9/chunk.py +169 -0
- package/lib/python3.9/cmd.py +401 -0
- package/lib/python3.9/code.py +315 -0
- package/lib/python3.9/codecs.py +1126 -0
- package/lib/python3.9/codeop.py +178 -0
- package/lib/python3.9/collections/__init__.py +1508 -0
- package/lib/python3.9/collections/abc.py +2 -0
- package/lib/python3.9/colorsys.py +164 -0
- package/lib/python3.9/compileall.py +461 -0
- package/lib/python3.9/concurrent/__init__.py +1 -0
- package/lib/python3.9/concurrent/futures/__init__.py +53 -0
- package/lib/python3.9/concurrent/futures/_base.py +635 -0
- package/lib/python3.9/concurrent/futures/process.py +751 -0
- package/lib/python3.9/concurrent/futures/thread.py +230 -0
- package/lib/python3.9/config-3.9-x86_64-linux-gnu/Makefile +2015 -0
- package/lib/python3.9/config-3.9-x86_64-linux-gnu/Setup +372 -0
- package/lib/python3.9/config-3.9-x86_64-linux-gnu/Setup.local +1 -0
- package/lib/python3.9/config-3.9-x86_64-linux-gnu/config.c +116 -0
- package/lib/python3.9/config-3.9-x86_64-linux-gnu/config.c.in +67 -0
- package/lib/python3.9/config-3.9-x86_64-linux-gnu/install-sh +518 -0
- package/lib/python3.9/config-3.9-x86_64-linux-gnu/makesetup +309 -0
- package/lib/python3.9/config-3.9-x86_64-linux-gnu/python-config.py +74 -0
- package/lib/python3.9/config-3.9-x86_64-linux-gnu/python.o +0 -0
- package/lib/python3.9/configparser.py +1363 -0
- package/lib/python3.9/contextlib.py +676 -0
- package/lib/python3.9/contextvars.py +4 -0
- package/lib/python3.9/copy.py +303 -0
- package/lib/python3.9/copyreg.py +209 -0
- package/lib/python3.9/crypt.py +120 -0
- package/lib/python3.9/csv.py +448 -0
- package/lib/python3.9/ctypes/__init__.py +571 -0
- package/lib/python3.9/ctypes/_aix.py +331 -0
- package/lib/python3.9/ctypes/_endian.py +61 -0
- package/lib/python3.9/ctypes/macholib/README.ctypes +7 -0
- package/lib/python3.9/ctypes/macholib/__init__.py +9 -0
- package/lib/python3.9/ctypes/macholib/dyld.py +182 -0
- package/lib/python3.9/ctypes/macholib/dylib.py +63 -0
- package/lib/python3.9/ctypes/macholib/fetch_macholib +2 -0
- package/lib/python3.9/ctypes/macholib/fetch_macholib.bat +1 -0
- package/lib/python3.9/ctypes/macholib/framework.py +65 -0
- package/lib/python3.9/ctypes/util.py +379 -0
- package/lib/python3.9/ctypes/wintypes.py +202 -0
- package/lib/python3.9/curses/__init__.py +101 -0
- package/lib/python3.9/curses/ascii.py +99 -0
- package/lib/python3.9/curses/has_key.py +192 -0
- package/lib/python3.9/curses/panel.py +6 -0
- package/lib/python3.9/curses/textpad.py +201 -0
- package/lib/python3.9/dataclasses.py +1284 -0
- package/lib/python3.9/datetime.py +2555 -0
- package/lib/python3.9/dbm/__init__.py +189 -0
- package/lib/python3.9/dbm/dumb.py +316 -0
- package/lib/python3.9/dbm/gnu.py +3 -0
- package/lib/python3.9/dbm/ndbm.py +3 -0
- package/lib/python3.9/decimal.py +11 -0
- package/lib/python3.9/difflib.py +2096 -0
- package/lib/python3.9/dis.py +553 -0
- package/lib/python3.9/distutils/README +11 -0
- package/lib/python3.9/distutils/__init__.py +13 -0
- package/lib/python3.9/distutils/_msvccompiler.py +546 -0
- package/lib/python3.9/distutils/archive_util.py +256 -0
- package/lib/python3.9/distutils/bcppcompiler.py +393 -0
- package/lib/python3.9/distutils/ccompiler.py +1116 -0
- package/lib/python3.9/distutils/cmd.py +403 -0
- package/lib/python3.9/distutils/command/__init__.py +31 -0
- package/lib/python3.9/distutils/command/bdist.py +143 -0
- package/lib/python3.9/distutils/command/bdist_dumb.py +123 -0
- package/lib/python3.9/distutils/command/bdist_msi.py +749 -0
- package/lib/python3.9/distutils/command/bdist_rpm.py +579 -0
- package/lib/python3.9/distutils/command/bdist_wininst.py +377 -0
- package/lib/python3.9/distutils/command/build.py +157 -0
- package/lib/python3.9/distutils/command/build_clib.py +209 -0
- package/lib/python3.9/distutils/command/build_ext.py +754 -0
- package/lib/python3.9/distutils/command/build_py.py +416 -0
- package/lib/python3.9/distutils/command/build_scripts.py +160 -0
- package/lib/python3.9/distutils/command/check.py +148 -0
- package/lib/python3.9/distutils/command/clean.py +76 -0
- package/lib/python3.9/distutils/command/command_template +33 -0
- package/lib/python3.9/distutils/command/config.py +344 -0
- package/lib/python3.9/distutils/command/install.py +657 -0
- package/lib/python3.9/distutils/command/install_data.py +79 -0
- package/lib/python3.9/distutils/command/install_egg_info.py +77 -0
- package/lib/python3.9/distutils/command/install_headers.py +47 -0
- package/lib/python3.9/distutils/command/install_lib.py +217 -0
- package/lib/python3.9/distutils/command/install_scripts.py +60 -0
- package/lib/python3.9/distutils/command/register.py +304 -0
- package/lib/python3.9/distutils/command/sdist.py +494 -0
- package/lib/python3.9/distutils/command/upload.py +214 -0
- package/lib/python3.9/distutils/config.py +130 -0
- package/lib/python3.9/distutils/core.py +234 -0
- package/lib/python3.9/distutils/cygwinccompiler.py +410 -0
- package/lib/python3.9/distutils/debug.py +5 -0
- package/lib/python3.9/distutils/dep_util.py +92 -0
- package/lib/python3.9/distutils/dir_util.py +210 -0
- package/lib/python3.9/distutils/dist.py +1256 -0
- package/lib/python3.9/distutils/errors.py +97 -0
- package/lib/python3.9/distutils/extension.py +240 -0
- package/lib/python3.9/distutils/fancy_getopt.py +457 -0
- package/lib/python3.9/distutils/file_util.py +238 -0
- package/lib/python3.9/distutils/filelist.py +327 -0
- package/lib/python3.9/distutils/log.py +77 -0
- package/lib/python3.9/distutils/msvc9compiler.py +788 -0
- package/lib/python3.9/distutils/msvccompiler.py +643 -0
- package/lib/python3.9/distutils/spawn.py +125 -0
- package/lib/python3.9/distutils/sysconfig.py +560 -0
- package/lib/python3.9/distutils/text_file.py +286 -0
- package/lib/python3.9/distutils/unixccompiler.py +330 -0
- package/lib/python3.9/distutils/util.py +559 -0
- package/lib/python3.9/distutils/version.py +347 -0
- package/lib/python3.9/distutils/versionpredicate.py +166 -0
- package/lib/python3.9/doctest.py +2793 -0
- package/lib/python3.9/email/__init__.py +62 -0
- package/lib/python3.9/email/_encoded_words.py +233 -0
- package/lib/python3.9/email/_header_value_parser.py +3003 -0
- package/lib/python3.9/email/_parseaddr.py +549 -0
- package/lib/python3.9/email/_policybase.py +374 -0
- package/lib/python3.9/email/architecture.rst +216 -0
- package/lib/python3.9/email/base64mime.py +119 -0
- package/lib/python3.9/email/charset.py +404 -0
- package/lib/python3.9/email/contentmanager.py +250 -0
- package/lib/python3.9/email/encoders.py +69 -0
- package/lib/python3.9/email/errors.py +110 -0
- package/lib/python3.9/email/feedparser.py +536 -0
- package/lib/python3.9/email/generator.py +508 -0
- package/lib/python3.9/email/header.py +578 -0
- package/lib/python3.9/email/headerregistry.py +601 -0
- package/lib/python3.9/email/iterators.py +71 -0
- package/lib/python3.9/email/message.py +1173 -0
- package/lib/python3.9/email/mime/__init__.py +0 -0
- package/lib/python3.9/email/mime/application.py +37 -0
- package/lib/python3.9/email/mime/audio.py +74 -0
- package/lib/python3.9/email/mime/base.py +30 -0
- package/lib/python3.9/email/mime/image.py +47 -0
- package/lib/python3.9/email/mime/message.py +34 -0
- package/lib/python3.9/email/mime/multipart.py +48 -0
- package/lib/python3.9/email/mime/nonmultipart.py +22 -0
- package/lib/python3.9/email/mime/text.py +42 -0
- package/lib/python3.9/email/parser.py +131 -0
- package/lib/python3.9/email/policy.py +224 -0
- package/lib/python3.9/email/quoprimime.py +299 -0
- package/lib/python3.9/email/utils.py +368 -0
- package/lib/python3.9/encodings/__init__.py +169 -0
- package/lib/python3.9/encodings/aliases.py +551 -0
- package/lib/python3.9/encodings/ascii.py +50 -0
- package/lib/python3.9/encodings/base64_codec.py +55 -0
- package/lib/python3.9/encodings/big5.py +39 -0
- package/lib/python3.9/encodings/big5hkscs.py +39 -0
- package/lib/python3.9/encodings/bz2_codec.py +78 -0
- package/lib/python3.9/encodings/charmap.py +69 -0
- package/lib/python3.9/encodings/cp037.py +307 -0
- package/lib/python3.9/encodings/cp1006.py +307 -0
- package/lib/python3.9/encodings/cp1026.py +307 -0
- package/lib/python3.9/encodings/cp1125.py +698 -0
- package/lib/python3.9/encodings/cp1140.py +307 -0
- package/lib/python3.9/encodings/cp1250.py +307 -0
- package/lib/python3.9/encodings/cp1251.py +307 -0
- package/lib/python3.9/encodings/cp1252.py +307 -0
- package/lib/python3.9/encodings/cp1253.py +307 -0
- package/lib/python3.9/encodings/cp1254.py +307 -0
- package/lib/python3.9/encodings/cp1255.py +307 -0
- package/lib/python3.9/encodings/cp1256.py +307 -0
- package/lib/python3.9/encodings/cp1257.py +307 -0
- package/lib/python3.9/encodings/cp1258.py +307 -0
- package/lib/python3.9/encodings/cp273.py +307 -0
- package/lib/python3.9/encodings/cp424.py +307 -0
- package/lib/python3.9/encodings/cp437.py +698 -0
- package/lib/python3.9/encodings/cp500.py +307 -0
- package/lib/python3.9/encodings/cp720.py +309 -0
- package/lib/python3.9/encodings/cp737.py +698 -0
- package/lib/python3.9/encodings/cp775.py +697 -0
- package/lib/python3.9/encodings/cp850.py +698 -0
- package/lib/python3.9/encodings/cp852.py +698 -0
- package/lib/python3.9/encodings/cp855.py +698 -0
- package/lib/python3.9/encodings/cp856.py +307 -0
- package/lib/python3.9/encodings/cp857.py +694 -0
- package/lib/python3.9/encodings/cp858.py +698 -0
- package/lib/python3.9/encodings/cp860.py +698 -0
- package/lib/python3.9/encodings/cp861.py +698 -0
- package/lib/python3.9/encodings/cp862.py +698 -0
- package/lib/python3.9/encodings/cp863.py +698 -0
- package/lib/python3.9/encodings/cp864.py +690 -0
- package/lib/python3.9/encodings/cp865.py +698 -0
- package/lib/python3.9/encodings/cp866.py +698 -0
- package/lib/python3.9/encodings/cp869.py +689 -0
- package/lib/python3.9/encodings/cp874.py +307 -0
- package/lib/python3.9/encodings/cp875.py +307 -0
- package/lib/python3.9/encodings/cp932.py +39 -0
- package/lib/python3.9/encodings/cp949.py +39 -0
- package/lib/python3.9/encodings/cp950.py +39 -0
- package/lib/python3.9/encodings/euc_jis_2004.py +39 -0
- package/lib/python3.9/encodings/euc_jisx0213.py +39 -0
- package/lib/python3.9/encodings/euc_jp.py +39 -0
- package/lib/python3.9/encodings/euc_kr.py +39 -0
- package/lib/python3.9/encodings/gb18030.py +39 -0
- package/lib/python3.9/encodings/gb2312.py +39 -0
- package/lib/python3.9/encodings/gbk.py +39 -0
- package/lib/python3.9/encodings/hex_codec.py +55 -0
- package/lib/python3.9/encodings/hp_roman8.py +314 -0
- package/lib/python3.9/encodings/hz.py +39 -0
- package/lib/python3.9/encodings/idna.py +309 -0
- package/lib/python3.9/encodings/iso2022_jp.py +39 -0
- package/lib/python3.9/encodings/iso2022_jp_1.py +39 -0
- package/lib/python3.9/encodings/iso2022_jp_2.py +39 -0
- package/lib/python3.9/encodings/iso2022_jp_2004.py +39 -0
- package/lib/python3.9/encodings/iso2022_jp_3.py +39 -0
- package/lib/python3.9/encodings/iso2022_jp_ext.py +39 -0
- package/lib/python3.9/encodings/iso2022_kr.py +39 -0
- package/lib/python3.9/encodings/iso8859_1.py +307 -0
- package/lib/python3.9/encodings/iso8859_10.py +307 -0
- package/lib/python3.9/encodings/iso8859_11.py +307 -0
- package/lib/python3.9/encodings/iso8859_13.py +307 -0
- package/lib/python3.9/encodings/iso8859_14.py +307 -0
- package/lib/python3.9/encodings/iso8859_15.py +307 -0
- package/lib/python3.9/encodings/iso8859_16.py +307 -0
- package/lib/python3.9/encodings/iso8859_2.py +307 -0
- package/lib/python3.9/encodings/iso8859_3.py +307 -0
- package/lib/python3.9/encodings/iso8859_4.py +307 -0
- package/lib/python3.9/encodings/iso8859_5.py +307 -0
- package/lib/python3.9/encodings/iso8859_6.py +307 -0
- package/lib/python3.9/encodings/iso8859_7.py +307 -0
- package/lib/python3.9/encodings/iso8859_8.py +307 -0
- package/lib/python3.9/encodings/iso8859_9.py +307 -0
- package/lib/python3.9/encodings/johab.py +39 -0
- package/lib/python3.9/encodings/koi8_r.py +307 -0
- package/lib/python3.9/encodings/koi8_t.py +308 -0
- package/lib/python3.9/encodings/koi8_u.py +307 -0
- package/lib/python3.9/encodings/kz1048.py +307 -0
- package/lib/python3.9/encodings/latin_1.py +50 -0
- package/lib/python3.9/encodings/mac_arabic.py +698 -0
- package/lib/python3.9/encodings/mac_croatian.py +307 -0
- package/lib/python3.9/encodings/mac_cyrillic.py +307 -0
- package/lib/python3.9/encodings/mac_farsi.py +307 -0
- package/lib/python3.9/encodings/mac_greek.py +307 -0
- package/lib/python3.9/encodings/mac_iceland.py +307 -0
- package/lib/python3.9/encodings/mac_latin2.py +312 -0
- package/lib/python3.9/encodings/mac_roman.py +307 -0
- package/lib/python3.9/encodings/mac_romanian.py +307 -0
- package/lib/python3.9/encodings/mac_turkish.py +307 -0
- package/lib/python3.9/encodings/mbcs.py +47 -0
- package/lib/python3.9/encodings/oem.py +41 -0
- package/lib/python3.9/encodings/palmos.py +308 -0
- package/lib/python3.9/encodings/ptcp154.py +312 -0
- package/lib/python3.9/encodings/punycode.py +237 -0
- package/lib/python3.9/encodings/quopri_codec.py +56 -0
- package/lib/python3.9/encodings/raw_unicode_escape.py +45 -0
- package/lib/python3.9/encodings/rot_13.py +113 -0
- package/lib/python3.9/encodings/shift_jis.py +39 -0
- package/lib/python3.9/encodings/shift_jis_2004.py +39 -0
- package/lib/python3.9/encodings/shift_jisx0213.py +39 -0
- package/lib/python3.9/encodings/tis_620.py +307 -0
- package/lib/python3.9/encodings/undefined.py +49 -0
- package/lib/python3.9/encodings/unicode_escape.py +45 -0
- package/lib/python3.9/encodings/utf_16.py +155 -0
- package/lib/python3.9/encodings/utf_16_be.py +42 -0
- package/lib/python3.9/encodings/utf_16_le.py +42 -0
- package/lib/python3.9/encodings/utf_32.py +150 -0
- package/lib/python3.9/encodings/utf_32_be.py +37 -0
- package/lib/python3.9/encodings/utf_32_le.py +37 -0
- package/lib/python3.9/encodings/utf_7.py +38 -0
- package/lib/python3.9/encodings/utf_8.py +42 -0
- package/lib/python3.9/encodings/utf_8_sig.py +130 -0
- package/lib/python3.9/encodings/uu_codec.py +103 -0
- package/lib/python3.9/encodings/zlib_codec.py +77 -0
- package/lib/python3.9/enum.py +913 -0
- package/lib/python3.9/filecmp.py +309 -0
- package/lib/python3.9/fileinput.py +432 -0
- package/lib/python3.9/fnmatch.py +183 -0
- package/lib/python3.9/formatter.py +452 -0
- package/lib/python3.9/fractions.py +641 -0
- package/lib/python3.9/ftplib.py +974 -0
- package/lib/python3.9/functools.py +980 -0
- package/lib/python3.9/genericpath.py +155 -0
- package/lib/python3.9/getopt.py +215 -0
- package/lib/python3.9/getpass.py +185 -0
- package/lib/python3.9/gettext.py +788 -0
- package/lib/python3.9/glob.py +173 -0
- package/lib/python3.9/graphlib.py +245 -0
- package/lib/python3.9/gzip.py +609 -0
- package/lib/python3.9/hashlib.py +262 -0
- package/lib/python3.9/heapq.py +601 -0
- package/lib/python3.9/hmac.py +203 -0
- package/lib/python3.9/html/__init__.py +132 -0
- package/lib/python3.9/html/entities.py +2509 -0
- package/lib/python3.9/html/parser.py +462 -0
- package/lib/python3.9/http/__init__.py +149 -0
- package/lib/python3.9/http/client.py +1495 -0
- package/lib/python3.9/http/cookiejar.py +2113 -0
- package/lib/python3.9/http/cookies.py +612 -0
- package/lib/python3.9/http/server.py +1299 -0
- package/lib/python3.9/imaplib.py +1650 -0
- package/lib/python3.9/imghdr.py +168 -0
- package/lib/python3.9/imp.py +345 -0
- package/lib/python3.9/importlib/__init__.py +176 -0
- package/lib/python3.9/importlib/_bootstrap.py +1189 -0
- package/lib/python3.9/importlib/_bootstrap_external.py +1637 -0
- package/lib/python3.9/importlib/_common.py +62 -0
- package/lib/python3.9/importlib/abc.py +474 -0
- package/lib/python3.9/importlib/machinery.py +21 -0
- package/lib/python3.9/importlib/metadata.py +586 -0
- package/lib/python3.9/importlib/resources.py +215 -0
- package/lib/python3.9/importlib/util.py +300 -0
- package/lib/python3.9/inspect.py +3180 -0
- package/lib/python3.9/io.py +99 -0
- package/lib/python3.9/ipaddress.py +2280 -0
- package/lib/python3.9/json/__init__.py +359 -0
- package/lib/python3.9/json/decoder.py +356 -0
- package/lib/python3.9/json/encoder.py +442 -0
- package/lib/python3.9/json/scanner.py +73 -0
- package/lib/python3.9/json/tool.py +78 -0
- package/lib/python3.9/keyword.py +62 -0
- package/lib/python3.9/lib-dynload/_asyncio.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_bisect.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_blake2.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_bz2.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_codecs_cn.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_codecs_hk.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_codecs_iso2022.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_codecs_jp.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_codecs_kr.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_codecs_tw.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_contextvars.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_crypt.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_csv.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_ctypes.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_ctypes_test.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_curses.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_curses_panel.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_datetime.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_decimal.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_elementtree.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_hashlib.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_heapq.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_json.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_lsprof.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_lzma.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_md5.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_multibytecodec.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_multiprocessing.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_opcode.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_pickle.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_posixshmem.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_posixsubprocess.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_queue.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_random.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_sha1.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_sha256.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_sha3.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_sha512.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_socket.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_sqlite3.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_ssl.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_statistics.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_struct.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_testbuffer.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_testcapi.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_testimportmultiple.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_testinternalcapi.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_testmultiphase.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_tkinter.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_xxsubinterpreters.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_xxtestfuzz.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/_zoneinfo.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/array.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/audioop.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/binascii.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/cmath.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/fcntl.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/grp.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/math.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/mmap.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/nis.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/ossaudiodev.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/parser.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/pyexpat.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/readline.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/resource.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/select.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/spwd.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/syslog.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/termios.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/unicodedata.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/xxlimited.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/lib-dynload/zlib.cpython-39-x86_64-linux-gnu.so +0 -0
- package/lib/python3.9/linecache.py +177 -0
- package/lib/python3.9/locale.py +1755 -0
- package/lib/python3.9/logging/__init__.py +2208 -0
- package/lib/python3.9/logging/config.py +945 -0
- package/lib/python3.9/logging/handlers.py +1543 -0
- package/lib/python3.9/lzma.py +347 -0
- package/lib/python3.9/mailbox.py +2151 -0
- package/lib/python3.9/mailcap.py +276 -0
- package/lib/python3.9/mimetypes.py +614 -0
- package/lib/python3.9/modulefinder.py +685 -0
- package/lib/python3.9/multiprocessing/__init__.py +37 -0
- package/lib/python3.9/multiprocessing/connection.py +978 -0
- package/lib/python3.9/multiprocessing/context.py +362 -0
- package/lib/python3.9/multiprocessing/dummy/__init__.py +126 -0
- package/lib/python3.9/multiprocessing/dummy/connection.py +75 -0
- package/lib/python3.9/multiprocessing/forkserver.py +348 -0
- package/lib/python3.9/multiprocessing/heap.py +337 -0
- package/lib/python3.9/multiprocessing/managers.py +1369 -0
- package/lib/python3.9/multiprocessing/pool.py +954 -0
- package/lib/python3.9/multiprocessing/popen_fork.py +83 -0
- package/lib/python3.9/multiprocessing/popen_forkserver.py +74 -0
- package/lib/python3.9/multiprocessing/popen_spawn_posix.py +72 -0
- package/lib/python3.9/multiprocessing/popen_spawn_win32.py +131 -0
- package/lib/python3.9/multiprocessing/process.py +432 -0
- package/lib/python3.9/multiprocessing/queues.py +380 -0
- package/lib/python3.9/multiprocessing/reduction.py +281 -0
- package/lib/python3.9/multiprocessing/resource_sharer.py +154 -0
- package/lib/python3.9/multiprocessing/resource_tracker.py +231 -0
- package/lib/python3.9/multiprocessing/shared_memory.py +532 -0
- package/lib/python3.9/multiprocessing/sharedctypes.py +240 -0
- package/lib/python3.9/multiprocessing/spawn.py +297 -0
- package/lib/python3.9/multiprocessing/synchronize.py +394 -0
- package/lib/python3.9/multiprocessing/util.py +489 -0
- package/lib/python3.9/netrc.py +139 -0
- package/lib/python3.9/nntplib.py +1090 -0
- package/lib/python3.9/ntpath.py +794 -0
- package/lib/python3.9/nturl2path.py +73 -0
- package/lib/python3.9/numbers.py +389 -0
- package/lib/python3.9/opcode.py +217 -0
- package/lib/python3.9/operator.py +460 -0
- package/lib/python3.9/optparse.py +1681 -0
- package/lib/python3.9/os.py +1116 -0
- package/lib/python3.9/pathlib.py +1576 -0
- package/lib/python3.9/pdb.py +1731 -0
- package/lib/python3.9/pickle.py +1817 -0
- package/lib/python3.9/pickletools.py +2890 -0
- package/lib/python3.9/pipes.py +247 -0
- package/lib/python3.9/pkgutil.py +707 -0
- package/lib/python3.9/platform.py +1259 -0
- package/lib/python3.9/plistlib.py +881 -0
- package/lib/python3.9/poplib.py +483 -0
- package/lib/python3.9/posixpath.py +525 -0
- package/lib/python3.9/pprint.py +638 -0
- package/lib/python3.9/profile.py +600 -0
- package/lib/python3.9/pstats.py +779 -0
- package/lib/python3.9/pty.py +172 -0
- package/lib/python3.9/py_compile.py +215 -0
- package/lib/python3.9/pyclbr.py +404 -0
- package/lib/python3.9/pydoc.py +2855 -0
- package/lib/python3.9/pydoc_data/__init__.py +0 -0
- package/lib/python3.9/pydoc_data/_pydoc.css +6 -0
- package/lib/python3.9/pydoc_data/topics.py +13968 -0
- package/lib/python3.9/queue.py +326 -0
- package/lib/python3.9/quopri.py +242 -0
- package/lib/python3.9/random.py +887 -0
- package/lib/python3.9/re.py +384 -0
- package/lib/python3.9/reprlib.py +161 -0
- package/lib/python3.9/rlcompleter.py +205 -0
- package/lib/python3.9/runpy.py +300 -0
- package/lib/python3.9/sched.py +167 -0
- package/lib/python3.9/secrets.py +72 -0
- package/lib/python3.9/selectors.py +619 -0
- package/lib/python3.9/shelve.py +243 -0
- package/lib/python3.9/shlex.py +350 -0
- package/lib/python3.9/shutil.py +1443 -0
- package/lib/python3.9/signal.py +85 -0
- package/lib/python3.9/site.py +643 -0
- package/lib/python3.9/smtpd.py +967 -0
- package/lib/python3.9/smtplib.py +1123 -0
- package/lib/python3.9/sndhdr.py +257 -0
- package/lib/python3.9/socket.py +958 -0
- package/lib/python3.9/socketserver.py +817 -0
- package/lib/python3.9/sqlite3/__init__.py +23 -0
- package/lib/python3.9/sqlite3/dbapi2.py +89 -0
- package/lib/python3.9/sqlite3/dump.py +70 -0
- package/lib/python3.9/sre_compile.py +784 -0
- package/lib/python3.9/sre_constants.py +259 -0
- package/lib/python3.9/sre_parse.py +1064 -0
- package/lib/python3.9/ssl.py +1489 -0
- package/lib/python3.9/stat.py +195 -0
- package/lib/python3.9/statistics.py +1120 -0
- package/lib/python3.9/string.py +280 -0
- package/lib/python3.9/stringprep.py +272 -0
- package/lib/python3.9/struct.py +15 -0
- package/lib/python3.9/subprocess.py +2074 -0
- package/lib/python3.9/sunau.py +526 -0
- package/lib/python3.9/symbol.py +122 -0
- package/lib/python3.9/symtable.py +243 -0
- package/lib/python3.9/sysconfig.py +720 -0
- package/lib/python3.9/tabnanny.py +333 -0
- package/lib/python3.9/tarfile.py +2576 -0
- package/lib/python3.9/telnetlib.py +677 -0
- package/lib/python3.9/tempfile.py +832 -0
- package/lib/python3.9/textwrap.py +486 -0
- package/lib/python3.9/this.py +28 -0
- package/lib/python3.9/threading.py +1502 -0
- package/lib/python3.9/timeit.py +375 -0
- package/lib/python3.9/token.py +136 -0
- package/lib/python3.9/tokenize.py +682 -0
- package/lib/python3.9/trace.py +740 -0
- package/lib/python3.9/traceback.py +623 -0
- package/lib/python3.9/tracemalloc.py +560 -0
- package/lib/python3.9/tty.py +36 -0
- package/lib/python3.9/turtle.py +4140 -0
- package/lib/python3.9/types.py +299 -0
- package/lib/python3.9/typing.py +2147 -0
- package/lib/python3.9/unittest/__init__.py +95 -0
- package/lib/python3.9/unittest/__main__.py +18 -0
- package/lib/python3.9/unittest/_log.py +69 -0
- package/lib/python3.9/unittest/async_case.py +160 -0
- package/lib/python3.9/unittest/case.py +1437 -0
- package/lib/python3.9/unittest/loader.py +517 -0
- package/lib/python3.9/unittest/main.py +275 -0
- package/lib/python3.9/unittest/mock.py +2891 -0
- package/lib/python3.9/unittest/result.py +216 -0
- package/lib/python3.9/unittest/runner.py +221 -0
- package/lib/python3.9/unittest/signals.py +71 -0
- package/lib/python3.9/unittest/suite.py +361 -0
- package/lib/python3.9/unittest/util.py +170 -0
- package/lib/python3.9/urllib/__init__.py +0 -0
- package/lib/python3.9/urllib/error.py +77 -0
- package/lib/python3.9/urllib/parse.py +1179 -0
- package/lib/python3.9/urllib/request.py +2765 -0
- package/lib/python3.9/urllib/response.py +84 -0
- package/lib/python3.9/urllib/robotparser.py +273 -0
- package/lib/python3.9/uu.py +206 -0
- package/lib/python3.9/uuid.py +728 -0
- package/lib/python3.9/venv/__init__.py +504 -0
- package/lib/python3.9/venv/__main__.py +10 -0
- package/lib/python3.9/venv/scripts/common/Activate.ps1 +241 -0
- package/lib/python3.9/venv/scripts/common/activate +66 -0
- package/lib/python3.9/venv/scripts/posix/activate.csh +25 -0
- package/lib/python3.9/venv/scripts/posix/activate.fish +64 -0
- package/lib/python3.9/warnings.py +549 -0
- package/lib/python3.9/wave.py +513 -0
- package/lib/python3.9/weakref.py +664 -0
- package/lib/python3.9/webbrowser.py +713 -0
- package/lib/python3.9/wsgiref/__init__.py +23 -0
- package/lib/python3.9/wsgiref/handlers.py +571 -0
- package/lib/python3.9/wsgiref/headers.py +184 -0
- package/lib/python3.9/wsgiref/simple_server.py +165 -0
- package/lib/python3.9/wsgiref/util.py +172 -0
- package/lib/python3.9/wsgiref/validate.py +441 -0
- package/lib/python3.9/xdrlib.py +241 -0
- package/lib/python3.9/xml/__init__.py +20 -0
- package/lib/python3.9/xml/dom/NodeFilter.py +27 -0
- package/lib/python3.9/xml/dom/__init__.py +140 -0
- package/lib/python3.9/xml/dom/domreg.py +99 -0
- package/lib/python3.9/xml/dom/expatbuilder.py +965 -0
- package/lib/python3.9/xml/dom/minicompat.py +109 -0
- package/lib/python3.9/xml/dom/minidom.py +2011 -0
- package/lib/python3.9/xml/dom/pulldom.py +349 -0
- package/lib/python3.9/xml/dom/xmlbuilder.py +387 -0
- package/lib/python3.9/xml/etree/ElementInclude.py +185 -0
- package/lib/python3.9/xml/etree/ElementPath.py +405 -0
- package/lib/python3.9/xml/etree/ElementTree.py +2085 -0
- package/lib/python3.9/xml/etree/__init__.py +33 -0
- package/lib/python3.9/xml/etree/cElementTree.py +3 -0
- package/lib/python3.9/xml/parsers/__init__.py +8 -0
- package/lib/python3.9/xml/parsers/expat.py +8 -0
- package/lib/python3.9/xml/sax/__init__.py +107 -0
- package/lib/python3.9/xml/sax/_exceptions.py +131 -0
- package/lib/python3.9/xml/sax/expatreader.py +446 -0
- package/lib/python3.9/xml/sax/handler.py +342 -0
- package/lib/python3.9/xml/sax/saxutils.py +369 -0
- package/lib/python3.9/xml/sax/xmlreader.py +380 -0
- package/lib/python3.9/xmlrpc/__init__.py +1 -0
- package/lib/python3.9/xmlrpc/client.py +1524 -0
- package/lib/python3.9/xmlrpc/server.py +993 -0
- package/lib/python3.9/zipapp.py +206 -0
- package/lib/python3.9/zipfile.py +2426 -0
- package/lib/python3.9/zipimport.py +792 -0
- package/lib/python3.9/zoneinfo/__init__.py +31 -0
- package/lib/python3.9/zoneinfo/_common.py +165 -0
- package/lib/python3.9/zoneinfo/_tzpath.py +175 -0
- package/lib/python3.9/zoneinfo/_zoneinfo.py +752 -0
- package/package.json +1 -1
- package/runtime.json +1 -0
- package/ssl/cacert.pem +3959 -0
- package/README.md +0 -59
- package/entry.py +0 -5
- package/openapi.yaml +0 -739
- package/plugin_cli.py +0 -253
- package/runtime/cli.ps1 +0 -4
- package/runtime/cli.sh +0 -5
- package/ted_runner_dpv2/__init__.py +0 -5
- package/ted_runner_dpv2/auth.py +0 -95
- package/ted_runner_dpv2/executor/__init__.py +0 -8
- package/ted_runner_dpv2/executor/isolated.py +0 -111
- package/ted_runner_dpv2/executor/launch.py +0 -115
- package/ted_runner_dpv2/executor/local.py +0 -43
- package/ted_runner_dpv2/executor/plan.py +0 -290
- package/ted_runner_dpv2/executor/podman.py +0 -143
- package/ted_runner_dpv2/files.py +0 -204
- package/ted_runner_dpv2/joblog.py +0 -81
- package/ted_runner_dpv2/jobrun/__init__.py +0 -12
- package/ted_runner_dpv2/jobrun/artifacts.py +0 -90
- package/ted_runner_dpv2/jobrun/environment.py +0 -37
- package/ted_runner_dpv2/jobrun/supervisor.py +0 -313
- package/ted_runner_dpv2/jobrun/worker.py +0 -55
- package/ted_runner_dpv2/jobs.py +0 -300
- package/ted_runner_dpv2/jsonio.py +0 -57
- package/ted_runner_dpv2/language.py +0 -93
- package/ted_runner_dpv2/lease.py +0 -137
- package/ted_runner_dpv2/pdk.py +0 -133
- package/ted_runner_dpv2/policy.py +0 -73
- package/ted_runner_dpv2/relay.py +0 -283
- package/ted_runner_dpv2/service.py +0 -512
- package/ted_runner_dpv2/worker.py +0 -430
- package/tedbrain_plugin_runtime/__init__.py +0 -2
- package/tedbrain_plugin_runtime/admission.py +0 -39
- package/tedbrain_plugin_runtime/auth.py +0 -92
- package/tedbrain_plugin_runtime/bootstrap.py +0 -110
- package/tedbrain_plugin_runtime/cli.py +0 -238
- package/tedbrain_plugin_runtime/engine.py +0 -132
- package/tedbrain_plugin_runtime/executor.py +0 -115
- package/tedbrain_plugin_runtime/handoff.py +0 -193
- package/tedbrain_plugin_runtime/installer.py +0 -400
- package/tedbrain_plugin_runtime/jobs.py +0 -293
- package/tedbrain_plugin_runtime/launcher.py +0 -122
- package/tedbrain_plugin_runtime/ops.py +0 -311
- package/tedbrain_plugin_runtime/publication.py +0 -53
- package/tedbrain_plugin_runtime/request_contract.py +0 -226
- package/tedbrain_plugin_runtime/rungc.py +0 -178
- package/tedbrain_plugin_runtime/service.py +0 -382
- package/tedbrain_plugin_runtime/sessions.py +0 -96
- package/tedbrain_plugin_runtime/ssh_workstation.py +0 -40
- package/tedbrain_plugin_runtime/supervisor.py +0 -165
- package/tedbrain_plugin_runtime/worker.py +0 -345
- package/tedbrain_plugin_runtime/workstations.py +0 -170
package/ted_runner_dpv2/jobs.py
DELETED
|
@@ -1,300 +0,0 @@
|
|
|
1
|
-
"""Durable job state. An API or worker restart never replays an execution attempt.
|
|
2
|
-
|
|
3
|
-
Each job runs once. The row is the authority for state; the job directory
|
|
4
|
-
holds what the run produced (logs, result, artifacts). Idempotency keys make
|
|
5
|
-
a retried submission return the original job instead of starting another.
|
|
6
|
-
"""
|
|
7
|
-
|
|
8
|
-
from contextlib import contextmanager
|
|
9
|
-
import hashlib
|
|
10
|
-
import json
|
|
11
|
-
from pathlib import Path
|
|
12
|
-
import re
|
|
13
|
-
import secrets
|
|
14
|
-
import sqlite3
|
|
15
|
-
import time
|
|
16
|
-
|
|
17
|
-
from .jsonio import canonical, dump, loads
|
|
18
|
-
from .policy import DEFAULT_LIMITS, Rejected, validate_upload_reason
|
|
19
|
-
|
|
20
|
-
TERMINAL = ("SUCCEEDED", "FAILED", "TIMED_OUT", "CANCELLED", "INTERRUPTED")
|
|
21
|
-
ACTIVE = ("RUNNING", "CANCELLING")
|
|
22
|
-
JOB_ID = re.compile(r"[a-f0-9]{12}")
|
|
23
|
-
FILE_ID = re.compile(r"[a-f0-9]{16}")
|
|
24
|
-
ALIAS = re.compile(r"[A-Za-z0-9][A-Za-z0-9._-]{0,127}")
|
|
25
|
-
KEY = re.compile(r"[A-Za-z0-9._:-]{8,128}")
|
|
26
|
-
MODES = ("pre", "route", "full")
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class Conflict(ValueError):
|
|
30
|
-
pass
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class NotFound(ValueError):
|
|
34
|
-
pass
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def validate_request(request):
|
|
38
|
-
"""The submission body, checked and normalised. Raises Rejected."""
|
|
39
|
-
if not isinstance(request, dict):
|
|
40
|
-
raise Rejected("request must be a JSON object")
|
|
41
|
-
allowed = {"source", "name", "time_limit_seconds", "pdk", "upload_reason"}
|
|
42
|
-
if set(request) - allowed:
|
|
43
|
-
raise Rejected("unknown request fields: %s" % ", ".join(sorted(set(request) - allowed)))
|
|
44
|
-
source = request.get("source")
|
|
45
|
-
if not isinstance(source, dict) or set(source) not in ({"code"}, {"file_id"}):
|
|
46
|
-
raise Rejected("source must give either code or file_id")
|
|
47
|
-
value = {"source": dict(source)}
|
|
48
|
-
if "code" in source:
|
|
49
|
-
if not isinstance(source["code"], str) or not source["code"].encode("utf-8") \
|
|
50
|
-
or len(source["code"].encode("utf-8")) > DEFAULT_LIMITS["source_max_bytes"]:
|
|
51
|
-
raise Rejected("source.code must be 1..%d bytes of UTF-8" % DEFAULT_LIMITS["source_max_bytes"])
|
|
52
|
-
elif not isinstance(source["file_id"], str) or not FILE_ID.fullmatch(source["file_id"]):
|
|
53
|
-
raise Rejected("source.file_id must be 16 lower-case hex characters")
|
|
54
|
-
name = request.get("name", "ted-job")
|
|
55
|
-
if not isinstance(name, str) or not 1 <= len(name) <= 128 or any(ord(char) < 32 or ord(char) == 127 for char in name):
|
|
56
|
-
raise Rejected("name must be 1..128 printable characters")
|
|
57
|
-
value["name"] = name
|
|
58
|
-
limits = DEFAULT_LIMITS["time_limit_seconds"]
|
|
59
|
-
limit = request.get("time_limit_seconds", limits["default"])
|
|
60
|
-
if type(limit) is not int or not limits["min"] <= limit <= limits["max"]:
|
|
61
|
-
raise Rejected("time_limit_seconds must be %d..%d" % (limits["min"], limits["max"]))
|
|
62
|
-
value["time_limit_seconds"] = limit
|
|
63
|
-
pdk = request.get("pdk")
|
|
64
|
-
if pdk is not None:
|
|
65
|
-
if not isinstance(pdk, dict) or set(pdk) - {"alias", "mode"} or not isinstance(pdk.get("alias"), str) \
|
|
66
|
-
or not ALIAS.fullmatch(pdk["alias"]):
|
|
67
|
-
raise Rejected("pdk must give an alias of 1..128 characters")
|
|
68
|
-
mode = pdk.get("mode", "pre")
|
|
69
|
-
if mode not in MODES:
|
|
70
|
-
raise Rejected("pdk.mode must be one of %s" % ", ".join(MODES))
|
|
71
|
-
value["pdk"] = {"alias": pdk["alias"], "mode": mode}
|
|
72
|
-
reason = request.get("upload_reason")
|
|
73
|
-
if reason is not None:
|
|
74
|
-
value["upload_reason"] = validate_upload_reason(reason)
|
|
75
|
-
return value
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
class Jobs:
|
|
79
|
-
def __init__(self, path):
|
|
80
|
-
self.path = str(path)
|
|
81
|
-
Path(path).parent.mkdir(parents=True, exist_ok=True, mode=0o700)
|
|
82
|
-
with self.connection() as db:
|
|
83
|
-
db.executescript("""
|
|
84
|
-
CREATE TABLE IF NOT EXISTS jobs (
|
|
85
|
-
id TEXT PRIMARY KEY, subject TEXT NOT NULL, state TEXT NOT NULL, attempt TEXT NOT NULL,
|
|
86
|
-
version TEXT NOT NULL, name TEXT NOT NULL, request TEXT NOT NULL, source TEXT NOT NULL,
|
|
87
|
-
source_sha256 TEXT NOT NULL, time_limit INTEGER NOT NULL, pdk TEXT, bindings TEXT,
|
|
88
|
-
result TEXT, error TEXT, upload TEXT, launcher TEXT, exit_code INTEGER,
|
|
89
|
-
cancel_requested INTEGER NOT NULL DEFAULT 0, cancel_confirmed INTEGER NOT NULL DEFAULT 0,
|
|
90
|
-
created REAL NOT NULL, updated REAL NOT NULL, started REAL, finished REAL);
|
|
91
|
-
CREATE INDEX IF NOT EXISTS jobs_subject ON jobs(subject, created);
|
|
92
|
-
CREATE INDEX IF NOT EXISTS jobs_state ON jobs(state, version);
|
|
93
|
-
CREATE TABLE IF NOT EXISTS requests (
|
|
94
|
-
subject TEXT NOT NULL, key TEXT NOT NULL, digest TEXT NOT NULL,
|
|
95
|
-
job TEXT NOT NULL, PRIMARY KEY(subject, key));
|
|
96
|
-
CREATE TABLE IF NOT EXISTS events (
|
|
97
|
-
seq INTEGER PRIMARY KEY AUTOINCREMENT, job TEXT NOT NULL, attempt TEXT NOT NULL,
|
|
98
|
-
body TEXT NOT NULL, created REAL NOT NULL);
|
|
99
|
-
CREATE INDEX IF NOT EXISTS events_job ON events(job, seq);
|
|
100
|
-
""")
|
|
101
|
-
|
|
102
|
-
@contextmanager
|
|
103
|
-
def connection(self):
|
|
104
|
-
db = sqlite3.connect(self.path, timeout=30)
|
|
105
|
-
db.row_factory = sqlite3.Row
|
|
106
|
-
db.execute("PRAGMA journal_mode=WAL")
|
|
107
|
-
db.execute("PRAGMA synchronous=FULL")
|
|
108
|
-
try:
|
|
109
|
-
yield db
|
|
110
|
-
db.commit()
|
|
111
|
-
except BaseException:
|
|
112
|
-
db.rollback()
|
|
113
|
-
raise
|
|
114
|
-
finally:
|
|
115
|
-
db.close()
|
|
116
|
-
|
|
117
|
-
@staticmethod
|
|
118
|
-
def event(db, job, attempt, body):
|
|
119
|
-
encoded = dump(body)
|
|
120
|
-
if len(encoded) > 65536:
|
|
121
|
-
raise ValueError("event too large")
|
|
122
|
-
db.execute("INSERT INTO events(job, attempt, body, created) VALUES(?,?,?,?)", (job, attempt, encoded, time.time()))
|
|
123
|
-
|
|
124
|
-
@staticmethod
|
|
125
|
-
def decode(row):
|
|
126
|
-
"""The stored row as plain data."""
|
|
127
|
-
value = dict(row)
|
|
128
|
-
for column in ("request", "pdk", "bindings", "result", "error", "upload", "launcher"):
|
|
129
|
-
if value.get(column) is not None:
|
|
130
|
-
value[column] = loads(value[column])
|
|
131
|
-
return value
|
|
132
|
-
|
|
133
|
-
@staticmethod
|
|
134
|
-
def public(value):
|
|
135
|
-
return {"job_id": value["id"], "state": value["state"], "attempt": value["attempt"],
|
|
136
|
-
"name": value["name"], "submitted_at": value["created"], "started_at": value["started"],
|
|
137
|
-
"finished_at": value["finished"], "time_limit_seconds": value["time_limit"],
|
|
138
|
-
"cancel_requested": bool(value["cancel_requested"]), "cancel_confirmed": bool(value["cancel_confirmed"]),
|
|
139
|
-
"exit_code": value["exit_code"], "error": value.get("error"), "source_sha256": value["source_sha256"],
|
|
140
|
-
"inputs": [value["request"]["source"]["file_id"]] if "file_id" in value["request"]["source"] else [],
|
|
141
|
-
"pdk": value.get("pdk"), "upload_reason": value["request"].get("upload_reason"),
|
|
142
|
-
"bindings": value.get("bindings") or {}}
|
|
143
|
-
|
|
144
|
-
def _get(self, db, subject, job):
|
|
145
|
-
row = db.execute("SELECT * FROM jobs WHERE id=? AND subject=?", (job, subject)).fetchone()
|
|
146
|
-
if row is None:
|
|
147
|
-
raise NotFound("job not found")
|
|
148
|
-
return row
|
|
149
|
-
|
|
150
|
-
def get(self, subject, job):
|
|
151
|
-
with self.connection() as db:
|
|
152
|
-
return self.decode(self._get(db, subject, job))
|
|
153
|
-
|
|
154
|
-
def view(self, subject, job):
|
|
155
|
-
return self.public(self.get(subject, job))
|
|
156
|
-
|
|
157
|
-
def list(self, subject, state=None, limit=100):
|
|
158
|
-
with self.connection() as db:
|
|
159
|
-
if state is None:
|
|
160
|
-
rows = db.execute("SELECT * FROM jobs WHERE subject=? ORDER BY created DESC, id LIMIT ?", (subject, limit)).fetchall()
|
|
161
|
-
else:
|
|
162
|
-
rows = db.execute("SELECT * FROM jobs WHERE subject=? AND state=? ORDER BY created DESC, id LIMIT ?",
|
|
163
|
-
(subject, state, limit)).fetchall()
|
|
164
|
-
return [self.public(self.decode(row)) for row in rows]
|
|
165
|
-
|
|
166
|
-
def submit(self, subject, request, key, version, source, *, bindings=None, pdk=None):
|
|
167
|
-
"""Create a job, or return the one this key already created. Never creates twice."""
|
|
168
|
-
if not isinstance(key, str) or not KEY.fullmatch(key):
|
|
169
|
-
raise Rejected("Idempotency-Key of 8..128 characters is required")
|
|
170
|
-
digest = hashlib.sha256(canonical({"subject": subject, "request": request, "pdk": pdk})).hexdigest()
|
|
171
|
-
now = time.time()
|
|
172
|
-
with self.connection() as db:
|
|
173
|
-
db.execute("BEGIN IMMEDIATE")
|
|
174
|
-
known = db.execute("SELECT * FROM requests WHERE subject=? AND key=?", (subject, key)).fetchone()
|
|
175
|
-
if known is not None:
|
|
176
|
-
if known["digest"] != digest:
|
|
177
|
-
raise Conflict("this Idempotency-Key was used for a different request")
|
|
178
|
-
value = dict(self.public(self.decode(self._get(db, subject, known["job"]))))
|
|
179
|
-
value["replayed"] = True
|
|
180
|
-
return value
|
|
181
|
-
job = secrets.token_hex(6)
|
|
182
|
-
attempt = secrets.token_hex(16)
|
|
183
|
-
db.execute("INSERT INTO jobs(id, subject, state, attempt, version, name, request, source, source_sha256,"
|
|
184
|
-
"time_limit, pdk, bindings, created, updated) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?,?)",
|
|
185
|
-
(job, subject, "ACCEPTED", attempt, version, request["name"], dump(request), source,
|
|
186
|
-
hashlib.sha256(source.encode("utf-8")).hexdigest(), request["time_limit_seconds"],
|
|
187
|
-
dump(pdk) if pdk is not None else None, dump(bindings or {}), now, now))
|
|
188
|
-
db.execute("INSERT INTO requests VALUES(?,?,?,?)", (subject, key, digest, job))
|
|
189
|
-
self.event(db, job, attempt, {"event": "accepted", "plugin_version": version})
|
|
190
|
-
return dict(self.public(self.decode(self._get(db, subject, job))), replayed=False)
|
|
191
|
-
|
|
192
|
-
def active(self):
|
|
193
|
-
with self.connection() as db:
|
|
194
|
-
rows = db.execute("SELECT * FROM jobs WHERE state IN ('RUNNING','CANCELLING') ORDER BY created").fetchall()
|
|
195
|
-
return [self.decode(row) for row in rows]
|
|
196
|
-
|
|
197
|
-
def claim(self, version, *, per_subject=DEFAULT_LIMITS["concurrent_jobs_per_user"], max_total=64):
|
|
198
|
-
"""Move the oldest queued job of ``version`` to RUNNING, honouring both concurrency bounds."""
|
|
199
|
-
with self.connection() as db:
|
|
200
|
-
db.execute("BEGIN IMMEDIATE")
|
|
201
|
-
total = db.execute("SELECT COUNT(*) FROM jobs WHERE state IN ('RUNNING','CANCELLING')").fetchone()[0]
|
|
202
|
-
if total >= max_total:
|
|
203
|
-
return None
|
|
204
|
-
row = db.execute(
|
|
205
|
-
"SELECT * FROM jobs AS queued WHERE state='ACCEPTED' AND version=? AND "
|
|
206
|
-
"(SELECT COUNT(*) FROM jobs AS running WHERE running.subject=queued.subject "
|
|
207
|
-
" AND running.state IN ('RUNNING','CANCELLING'))<? ORDER BY created, id LIMIT 1",
|
|
208
|
-
(version, per_subject)).fetchone()
|
|
209
|
-
if row is None:
|
|
210
|
-
return None
|
|
211
|
-
now = time.time()
|
|
212
|
-
db.execute("UPDATE jobs SET state=?, started=?, updated=? WHERE id=?", ("RUNNING", now, now, row["id"]))
|
|
213
|
-
self.event(db, row["id"], row["attempt"], {"event": "running"})
|
|
214
|
-
return self.decode(db.execute("SELECT * FROM jobs WHERE id=?", (row["id"],)).fetchone())
|
|
215
|
-
|
|
216
|
-
def cancel(self, subject, job, key):
|
|
217
|
-
if not isinstance(key, str) or not KEY.fullmatch(key):
|
|
218
|
-
raise Rejected("Idempotency-Key of 8..128 characters is required")
|
|
219
|
-
digest = hashlib.sha256(canonical({"action": "cancel", "job": job})).hexdigest()
|
|
220
|
-
with self.connection() as db:
|
|
221
|
-
db.execute("BEGIN IMMEDIATE")
|
|
222
|
-
row = self._get(db, subject, job)
|
|
223
|
-
known = db.execute("SELECT * FROM requests WHERE subject=? AND key=?", (subject, key)).fetchone()
|
|
224
|
-
if known is not None and known["digest"] == digest and known["job"] == job:
|
|
225
|
-
return dict(self.public(self.decode(row)), replayed=True)
|
|
226
|
-
if known is not None:
|
|
227
|
-
raise Conflict("this Idempotency-Key was already used")
|
|
228
|
-
db.execute("INSERT INTO requests VALUES(?,?,?,?)", (subject, key, digest, job))
|
|
229
|
-
if row["state"] in TERMINAL:
|
|
230
|
-
return self.public(self.decode(row))
|
|
231
|
-
state = "CANCELLED" if row["state"] == "ACCEPTED" else "CANCELLING"
|
|
232
|
-
now = time.time()
|
|
233
|
-
db.execute("UPDATE jobs SET state=?, cancel_requested=1, cancel_confirmed=?, updated=?, finished=? WHERE id=?",
|
|
234
|
-
(state, int(state == "CANCELLED"), now, now if state == "CANCELLED" else None, job))
|
|
235
|
-
self.event(db, job, row["attempt"], {"event": "cancel_requested", "confirmed": state == "CANCELLED"})
|
|
236
|
-
return self.public(self.decode(db.execute("SELECT * FROM jobs WHERE id=?", (job,)).fetchone()))
|
|
237
|
-
|
|
238
|
-
def append(self, job, attempt, body):
|
|
239
|
-
with self.connection() as db:
|
|
240
|
-
db.execute("BEGIN IMMEDIATE")
|
|
241
|
-
row = db.execute("SELECT attempt, state FROM jobs WHERE id=?", (job,)).fetchone()
|
|
242
|
-
if row is None or row["attempt"] != attempt:
|
|
243
|
-
raise Conflict("stale attempt")
|
|
244
|
-
if row["state"] in TERMINAL:
|
|
245
|
-
raise Conflict("job already finished")
|
|
246
|
-
self.event(db, job, attempt, body)
|
|
247
|
-
|
|
248
|
-
def finish(self, job, attempt, outcome):
|
|
249
|
-
"""Record the terminal state of one run. A pending cancel outranks a success."""
|
|
250
|
-
state = outcome["state"]
|
|
251
|
-
if state not in TERMINAL:
|
|
252
|
-
raise ValueError("not a terminal state: %r" % state)
|
|
253
|
-
with self.connection() as db:
|
|
254
|
-
db.execute("BEGIN IMMEDIATE")
|
|
255
|
-
row = db.execute("SELECT * FROM jobs WHERE id=?", (job,)).fetchone()
|
|
256
|
-
if row is None or row["attempt"] != attempt:
|
|
257
|
-
raise Conflict("stale attempt")
|
|
258
|
-
if row["state"] in TERMINAL:
|
|
259
|
-
return self.decode(row)
|
|
260
|
-
result, error = outcome.get("result"), outcome.get("error")
|
|
261
|
-
if row["state"] == "CANCELLING" and state == "SUCCEEDED":
|
|
262
|
-
# The cancel was accepted first: a result recorded after it is not reported.
|
|
263
|
-
state, result = "CANCELLED", None
|
|
264
|
-
error = {"code": "CANCELLED", "message": "Cancellation was requested before the result was recorded"}
|
|
265
|
-
db.execute("UPDATE jobs SET state=?, result=?, error=?, upload=?, launcher=?, exit_code=?, "
|
|
266
|
-
"cancel_confirmed=?, updated=?, finished=? WHERE id=?",
|
|
267
|
-
(state, dump(result) if result is not None else None,
|
|
268
|
-
dump(error) if error is not None else None,
|
|
269
|
-
dump(outcome["upload"]) if outcome.get("upload") is not None else None,
|
|
270
|
-
dump(outcome["launcher"]) if outcome.get("launcher") is not None else None,
|
|
271
|
-
outcome.get("exit_code"), int(bool(outcome.get("cancel_confirmed")) or row["cancel_confirmed"]),
|
|
272
|
-
time.time(), time.time(), job))
|
|
273
|
-
self.event(db, job, attempt, {"event": "finished", "job_status": state})
|
|
274
|
-
return self.decode(db.execute("SELECT * FROM jobs WHERE id=?", (job,)).fetchone())
|
|
275
|
-
|
|
276
|
-
def interrupt(self, job, attempt, error):
|
|
277
|
-
return self.finish(job, attempt, {"state": "INTERRUPTED", "error": error})
|
|
278
|
-
|
|
279
|
-
def set_upload(self, job, attempt, upload):
|
|
280
|
-
with self.connection() as db:
|
|
281
|
-
db.execute("BEGIN IMMEDIATE")
|
|
282
|
-
row = db.execute("SELECT attempt FROM jobs WHERE id=?", (job,)).fetchone()
|
|
283
|
-
if row is None or row["attempt"] != attempt:
|
|
284
|
-
raise Conflict("stale attempt")
|
|
285
|
-
db.execute("UPDATE jobs SET upload=?, updated=? WHERE id=?", (dump(upload), time.time(), job))
|
|
286
|
-
|
|
287
|
-
def events(self, subject, job, after=0):
|
|
288
|
-
self.get(subject, job)
|
|
289
|
-
if type(after) is not int or after < 0:
|
|
290
|
-
raise ValueError("invalid event cursor")
|
|
291
|
-
with self.connection() as db:
|
|
292
|
-
return [{"seq": row["seq"], "attempt": row["attempt"], "event": loads(row["body"]), "at": row["created"]}
|
|
293
|
-
for row in db.execute("SELECT * FROM events WHERE job=? AND seq>? ORDER BY seq LIMIT 200", (job, after))]
|
|
294
|
-
|
|
295
|
-
def lookup(self, subject, key):
|
|
296
|
-
with self.connection() as db:
|
|
297
|
-
row = db.execute("SELECT job FROM requests WHERE subject=? AND key=?", (subject, key)).fetchone()
|
|
298
|
-
if row is None:
|
|
299
|
-
raise NotFound("request not found")
|
|
300
|
-
return dict(self.view(subject, row["job"]), replayed=True)
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"""JSON helpers with the strictness a job protocol needs: one encoding, no NaN, atomic files."""
|
|
2
|
-
|
|
3
|
-
import json
|
|
4
|
-
import os
|
|
5
|
-
from pathlib import Path
|
|
6
|
-
import tempfile
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def canonical(value):
|
|
10
|
-
"""The one byte encoding used for digests and stored manifests."""
|
|
11
|
-
return json.dumps(value, sort_keys=True, separators=(",", ":"), ensure_ascii=False, allow_nan=False).encode("utf-8")
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
def dump(value):
|
|
15
|
-
return json.dumps(value, ensure_ascii=False, allow_nan=False)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def _pairs(pairs):
|
|
19
|
-
value = {}
|
|
20
|
-
for key, item in pairs:
|
|
21
|
-
if key in value:
|
|
22
|
-
raise ValueError("duplicate JSON key: %s" % key)
|
|
23
|
-
value[key] = item
|
|
24
|
-
return value
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def _constant(name):
|
|
28
|
-
raise ValueError("non-finite JSON constant: %s" % name)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def loads(raw):
|
|
32
|
-
if isinstance(raw, bytes):
|
|
33
|
-
raw = raw.decode("utf-8")
|
|
34
|
-
return json.loads(raw, object_pairs_hook=_pairs, parse_constant=_constant)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def atomic_write(path, data, mode=0o600):
|
|
38
|
-
path = Path(path)
|
|
39
|
-
descriptor, temporary = tempfile.mkstemp(prefix=".new-", dir=str(path.parent))
|
|
40
|
-
try:
|
|
41
|
-
with os.fdopen(descriptor, "wb") as stream:
|
|
42
|
-
stream.write(data)
|
|
43
|
-
stream.flush()
|
|
44
|
-
os.fsync(stream.fileno())
|
|
45
|
-
os.chmod(temporary, mode)
|
|
46
|
-
os.replace(temporary, path)
|
|
47
|
-
finally:
|
|
48
|
-
if os.path.exists(temporary):
|
|
49
|
-
os.unlink(temporary)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
def atomic_json(path, value, mode=0o600):
|
|
53
|
-
atomic_write(path, dump(value).encode("utf-8"), mode)
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
def load_json(path):
|
|
57
|
-
return loads(Path(path).read_bytes())
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"""Native Python/TED execution inside the job container.
|
|
2
|
-
|
|
3
|
-
TED uses classes, decorators, extension objects, filesystem exports and its
|
|
4
|
-
own profiling hooks, so the program runs as ordinary Python. Admission only
|
|
5
|
-
identifies a TED job; it is not a Python security sandbox. The job container
|
|
6
|
-
owns filesystem and network isolation and the CPU, memory and process limits.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
import ast
|
|
10
|
-
import math
|
|
11
|
-
import sys
|
|
12
|
-
|
|
13
|
-
from .policy import POLICY_VERSION, Rejected, is_ted_module
|
|
14
|
-
|
|
15
|
-
MAX_SOURCE = 65536
|
|
16
|
-
MAX_ITEMS = 10000
|
|
17
|
-
MAX_STRING = 65536
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
def validate(source):
|
|
21
|
-
if not isinstance(source, str) or len(source.encode("utf-8")) > MAX_SOURCE:
|
|
22
|
-
raise Rejected("Source exceeds 64 KiB")
|
|
23
|
-
try:
|
|
24
|
-
tree = ast.parse(source, filename="source.py")
|
|
25
|
-
compile(tree, "source.py", "exec")
|
|
26
|
-
except (SyntaxError, ValueError, RecursionError) as exc:
|
|
27
|
-
raise Rejected("Invalid Python: %s" % exc) from exc
|
|
28
|
-
imports = []
|
|
29
|
-
for node in ast.walk(tree):
|
|
30
|
-
if isinstance(node, ast.Import):
|
|
31
|
-
imports.extend(item.name for item in node.names)
|
|
32
|
-
elif isinstance(node, ast.ImportFrom) and node.level == 0 and node.module:
|
|
33
|
-
imports.append(node.module)
|
|
34
|
-
if not any(is_ted_module(name) for name in imports):
|
|
35
|
-
raise Rejected("A TED job must declare an import from the TED SDK")
|
|
36
|
-
return tree
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
def json_value(value, depth=0, budget=None):
|
|
40
|
-
"""Bound the management response, without invoking SDK conversion methods."""
|
|
41
|
-
if budget is None:
|
|
42
|
-
budget = [30000, 1024 * 1024]
|
|
43
|
-
budget[0] -= 1
|
|
44
|
-
if depth > 24 or budget[0] < 0:
|
|
45
|
-
raise Rejected("RESULT exceeds nesting or aggregate item limits")
|
|
46
|
-
if value is None or type(value) in (bool, int, float, str):
|
|
47
|
-
if type(value) is int and value.bit_length() > 256:
|
|
48
|
-
raise Rejected("RESULT integer exceeds 256 bits")
|
|
49
|
-
if type(value) is float and not math.isfinite(value):
|
|
50
|
-
raise Rejected("RESULT contains a non-finite number")
|
|
51
|
-
if type(value) is str:
|
|
52
|
-
budget[1] -= len(value.encode("utf-8"))
|
|
53
|
-
if len(value) > MAX_STRING or budget[1] < 0:
|
|
54
|
-
raise Rejected("RESULT exceeds text limits")
|
|
55
|
-
return value
|
|
56
|
-
if type(value) in (tuple, list, dict):
|
|
57
|
-
if len(value) > MAX_ITEMS:
|
|
58
|
-
raise Rejected("RESULT collection exceeds 10000 items")
|
|
59
|
-
if type(value) is dict:
|
|
60
|
-
if any(type(key) is not str for key in value):
|
|
61
|
-
raise Rejected("RESULT object keys must be strings")
|
|
62
|
-
return {json_value(k, depth + 1, budget): json_value(v, depth + 1, budget)
|
|
63
|
-
for k, v in value.items()}
|
|
64
|
-
return [json_value(item, depth + 1, budget) for item in value]
|
|
65
|
-
raise Rejected("RESULT must contain JSON-compatible values; convert SDK objects explicitly")
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
class Interpreter:
|
|
69
|
-
"""Runs the program as ``__main__`` and collects RESULT and ARTIFACTS."""
|
|
70
|
-
|
|
71
|
-
def __init__(self, source, filename="source.py"):
|
|
72
|
-
self.tree = validate(source)
|
|
73
|
-
self.filename = filename
|
|
74
|
-
|
|
75
|
-
def run(self):
|
|
76
|
-
def eprint(*args, **kwargs):
|
|
77
|
-
print(*args, file=sys.stderr, flush=True, **kwargs)
|
|
78
|
-
|
|
79
|
-
namespace = {"__name__": "__main__", "__file__": self.filename, "eprint": eprint}
|
|
80
|
-
try:
|
|
81
|
-
exec(compile(self.tree, self.filename, "exec"), namespace, namespace)
|
|
82
|
-
except SystemExit as exc:
|
|
83
|
-
if exc.code not in (None, 0):
|
|
84
|
-
raise
|
|
85
|
-
artifacts = namespace.get("ARTIFACTS", [])
|
|
86
|
-
if type(artifacts) not in (list, tuple) or len(artifacts) > 32:
|
|
87
|
-
raise Rejected("ARTIFACTS must be a list of at most 32 generated file paths")
|
|
88
|
-
if any(type(path) is not str or not path or len(path) > 4096 for path in artifacts):
|
|
89
|
-
raise Rejected("ARTIFACTS entries must be nonempty file path strings")
|
|
90
|
-
if len(set(artifacts)) != len(artifacts):
|
|
91
|
-
raise Rejected("ARTIFACTS must not contain duplicate paths")
|
|
92
|
-
return {"value": json_value(namespace.get("RESULT")), "policy": POLICY_VERSION,
|
|
93
|
-
"artifact_paths": list(artifacts)}
|
package/ted_runner_dpv2/lease.py
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
"""The runner's client side of pdkadapt's workstation-session interface.
|
|
2
|
-
|
|
3
|
-
A job that binds a delivered PDK may call the EDA tools installed on the
|
|
4
|
-
workstation that tree was delivered to. The channel credentials - the serve
|
|
5
|
-
token and the workstation's transport connection - must never enter the job
|
|
6
|
-
container or any job-visible file (``plan.json``, ``in/spec.json``, the job
|
|
7
|
-
directory). The worker asks pdkadapt for a short lease scoped to one
|
|
8
|
-
(subject, workstation, job) and hands it to the job's launcher process
|
|
9
|
-
through the environment alone. The launcher serves the job an ``elink``
|
|
10
|
-
relay backed by that lease and revokes the lease once the job is over.
|
|
11
|
-
"""
|
|
12
|
-
|
|
13
|
-
import json
|
|
14
|
-
import os
|
|
15
|
-
from pathlib import Path
|
|
16
|
-
import urllib.request
|
|
17
|
-
from urllib.parse import urlsplit
|
|
18
|
-
|
|
19
|
-
PLUGIN = "ted-runner"
|
|
20
|
-
MIN_TTL, MAX_TTL = 60, 7200
|
|
21
|
-
TIMEOUT = 10
|
|
22
|
-
# The variables of one launcher process. They name a lease that exists only
|
|
23
|
-
# for this job; they are host-side values and never reach the container,
|
|
24
|
-
# whose environment is declared separately in the plan.
|
|
25
|
-
LEASE = "TED_RUNNER_WORKSTATION_LEASE"
|
|
26
|
-
SESSION_URL = "TED_RUNNER_SESSION_URL"
|
|
27
|
-
SESSION_SECRET = "TED_RUNNER_SESSION_SECRET"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
class LeaseError(RuntimeError):
|
|
31
|
-
pass
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
def configured(config):
|
|
35
|
-
"""The session_lease configuration when complete, None when absent.
|
|
36
|
-
|
|
37
|
-
A half-specified section is refused loudly: a job that needs the channel
|
|
38
|
-
must fail because it is misconfigured, not silently run without it.
|
|
39
|
-
"""
|
|
40
|
-
value = config.get("session_lease")
|
|
41
|
-
if not value:
|
|
42
|
-
return None
|
|
43
|
-
if not isinstance(value, dict) or not all(
|
|
44
|
-
isinstance(value.get(name), str) and value[name]
|
|
45
|
-
for name in ("url", "secret_file", "serve_url")):
|
|
46
|
-
raise LeaseError("session_lease needs url, secret_file and serve_url")
|
|
47
|
-
return value
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
def secret(config):
|
|
51
|
-
"""The shared secret of pdkadapt's internal interface, from a private file."""
|
|
52
|
-
path = Path(config["secret_file"])
|
|
53
|
-
if not path.is_absolute() or not path.is_file() or path.is_symlink() or path.stat().st_mode & 0o077:
|
|
54
|
-
raise LeaseError("session_lease secret_file must be an absolute private regular file")
|
|
55
|
-
return path.read_text().strip()
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
def loopback(url, name):
|
|
59
|
-
"""An explicit loopback http URL: these endpoints are host-side only."""
|
|
60
|
-
parsed = urlsplit(url)
|
|
61
|
-
if parsed.scheme != "http" or parsed.hostname not in ("127.0.0.1", "::1") \
|
|
62
|
-
or not parsed.port or parsed.query or parsed.fragment:
|
|
63
|
-
raise LeaseError("session_lease %s must be an explicit loopback http URL" % name)
|
|
64
|
-
return parsed
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def request(config, subject, workstation_id, job_id, ttl):
|
|
68
|
-
"""A lease for one (subject, workstation, job), enriched with the serve endpoint."""
|
|
69
|
-
if not workstation_id or not isinstance(workstation_id, str):
|
|
70
|
-
raise LeaseError("the PDK manifest does not name the workstation its tree lives on")
|
|
71
|
-
ttl = max(MIN_TTL, min(MAX_TTL, int(ttl)))
|
|
72
|
-
loopback(config["url"], "url")
|
|
73
|
-
body = json.dumps({"subject": subject, "workstation_id": workstation_id, "plugin": PLUGIN,
|
|
74
|
-
"job": job_id, "ttl": ttl}).encode()
|
|
75
|
-
headers = {"Content-Type": "application/json", "X-TB-Session-Secret": secret(config)}
|
|
76
|
-
call = urllib.request.Request(config["url"].rstrip("/") + "/internal/workstation-sessions",
|
|
77
|
-
data=body, headers=headers, method="POST")
|
|
78
|
-
try:
|
|
79
|
-
with urllib.request.urlopen(call, timeout=TIMEOUT) as response:
|
|
80
|
-
value = json.loads(response.read())
|
|
81
|
-
except (OSError, ValueError):
|
|
82
|
-
raise LeaseError("the workstation lease was refused") from None
|
|
83
|
-
if not isinstance(value, dict) or not isinstance(value.get("lease_id"), str) or not value["lease_id"] \
|
|
84
|
-
or not isinstance(value.get("connection"), str) or not value["connection"] \
|
|
85
|
-
or not isinstance(value.get("token"), str) or not value["token"] \
|
|
86
|
-
or not contract(value.get("runtime_contract")):
|
|
87
|
-
raise LeaseError("the workstation lease response is incomplete")
|
|
88
|
-
return {"lease_id": value["lease_id"], "connection": value["connection"], "token": value["token"],
|
|
89
|
-
"expires_at": value.get("expires_at"), "serve_url": config["serve_url"],
|
|
90
|
-
"runtime_contract": value["runtime_contract"]}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
def contract(value):
|
|
94
|
-
"""The workstation runtime contract as the lease carries it: no identity of its own."""
|
|
95
|
-
return (isinstance(value, dict) and value.get("schema") == 1 and value.get("kind") == "dpv2-npm-executor"
|
|
96
|
-
and isinstance(value.get("home"), str) and value["home"].startswith("/")
|
|
97
|
-
and isinstance(value.get("release_sha256"), str) and len(value["release_sha256"]) == 64
|
|
98
|
-
and isinstance(value.get("components"), list) and bool(value["components"])
|
|
99
|
-
and "connection_id" not in value and "serve_url" not in value) or None
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
def revoke(url, secret_value, lease_id, subject):
|
|
103
|
-
"""Best-effort revocation: True only when pdkadapt confirms it."""
|
|
104
|
-
body = json.dumps({"subject": subject}).encode()
|
|
105
|
-
call = urllib.request.Request(
|
|
106
|
-
url.rstrip("/") + "/internal/workstation-sessions/%s/revocations" % lease_id,
|
|
107
|
-
data=body, headers={"Content-Type": "application/json", "X-TB-Session-Secret": secret_value},
|
|
108
|
-
method="POST")
|
|
109
|
-
try:
|
|
110
|
-
with urllib.request.urlopen(call, timeout=TIMEOUT) as response:
|
|
111
|
-
return json.loads(response.read()).get("revoked") is True
|
|
112
|
-
except (OSError, ValueError):
|
|
113
|
-
return False
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
def environment(lease, url, secret_value):
|
|
117
|
-
"""The launcher's variables for one lease; the only path the lease ever travels."""
|
|
118
|
-
return {LEASE: json.dumps(lease, sort_keys=True, separators=(",", ":")),
|
|
119
|
-
SESSION_URL: url, SESSION_SECRET: secret_value}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
def from_environment(environ=None):
|
|
123
|
-
"""The lease this launcher process was given, or None."""
|
|
124
|
-
environ = os.environ if environ is None else environ
|
|
125
|
-
value = environ.get(LEASE)
|
|
126
|
-
if not value:
|
|
127
|
-
return None
|
|
128
|
-
try:
|
|
129
|
-
lease = json.loads(value)
|
|
130
|
-
except ValueError:
|
|
131
|
-
raise LeaseError("the workstation lease in the environment is not valid JSON") from None
|
|
132
|
-
if not isinstance(lease, dict) or not isinstance(lease.get("lease_id"), str) or not lease["lease_id"] \
|
|
133
|
-
or not isinstance(lease.get("connection"), str) or not lease["connection"] \
|
|
134
|
-
or not isinstance(lease.get("token"), str) or not lease["token"] \
|
|
135
|
-
or not isinstance(lease.get("serve_url"), str) or not lease["serve_url"]:
|
|
136
|
-
raise LeaseError("the workstation lease in the environment is incomplete")
|
|
137
|
-
return lease
|