Skip to content

Commit b02b1b1

Browse files
authored
Merge pull request #84 from cropsinsilico/topic/cloud
Topic/cloud
2 parents 4edfba0 + b344ef0 commit b02b1b1

File tree

93 files changed

+4196
-533
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+4196
-533
lines changed

.github/workflows/test-install.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -987,7 +987,7 @@ jobs:
987987
test-flags1:
988988
- --long-running --languages python R matlab
989989
test-flags2:
990-
- ''
990+
- tests/test_services.py --nocapture
991991
install-c:
992992
- true
993993
install-mpi:
@@ -1644,3 +1644,31 @@ jobs:
16441644
user: __token__
16451645
password: ${{ secrets.pypi }}
16461646
skip_existing: true
1647+
docker:
1648+
name: Build and Publish Docker images
1649+
needs:
1650+
- test_pip
1651+
- test_conda
1652+
- test_rmq_pip
1653+
- test_rmq_conda
1654+
- test_stripped
1655+
- docs
1656+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
1657+
runs-on: ubuntu-latest
1658+
steps:
1659+
- uses: actions/checkout@v2
1660+
with:
1661+
submodules: true
1662+
- name: Set up Python
1663+
uses: actions/setup-python@v2
1664+
with:
1665+
python-version: 3.9
1666+
- name: Login to DockerHub
1667+
uses: docker/login-action@v1
1668+
with:
1669+
username: ${{ secrets.DOCKERHUB_USERNAME }}
1670+
password: ${{ secrets.DOCKERHUB_TOKEN }}
1671+
- name: Build and push environment docker images for the new release
1672+
run: python utils/build_docker.py --push
1673+
- name: Build and push executable docker images for the new release
1674+
run: python utils/build_docker.py --push executable

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ docs/source/modules.rst
2929
docs/source/examples/*.rst
3030
docs/source/tables
3131
docs/source/temp
32+
docs/source/schema
3233
docs/source/advanced/YggInterface_R.rst
34+
docs/source/cli.rst
35+
docs/source/cli.py
3336

3437
# Dev setup
3538
requirements_pruned.txt

HISTORY.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,30 @@
22
History
33
=======
44

5+
1.8.0 (2021-09-15) Support for REST API based communicators, running integrations as services, and connecting to remote integration services
6+
------------------
7+
8+
* Added option to return printStatus string for YggClass subclasses via return_str keyword
9+
* Added classes for managing models as services via Flask or RabbitMQ
10+
* Transitioned from as_function to complete_partial keyword in parse_yaml that can be used for services as well as functions
11+
* Added client side instrumentation for connecting to remote model services and tests
12+
* Added support for registering integrations that can be called locally as services
13+
* Added 'integration-service-manager' CLI for managing service managers
14+
* Added configuration options for services
15+
* Added communicator for use with REST API
16+
* Added ValueEvent class for returning a value with the event
17+
* Added methods for waiting on a function to return True
18+
* Refactored multitasking classes to use __slots__ for improved memory performance
19+
* Added tools for building yggdrasil docker containers and documentation on those tools
20+
* Added repository_url, description, and contact_email parameters to model YAML schema that allows for a repository to be specified in the YAML (in addition to via the command line as before)
21+
* Added model_only and model_submission options to yggdrasil.yamfile.parse_yaml method and YAML validation CLI
22+
* Added generated documentation on command line utilities
23+
* Added a glossary of terms
24+
* Included downloadable versions of the schemas in the documentation
25+
* Moved console_scripts list into a text file
26+
* Note deprecation of the old GUI in the docs for the 2018 & 2019 hackathons
27+
* Added validate_model_submission method for validating model repository submissions
28+
529
1.7.0 (2021-08-26) Support for MPI communicators, MPI execution, and pika >= 1.0.0
630
------------------
731

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ include *.svg
44
include *.txt
55
recursive-include yggdrasil *.cfg
66
recursive-include yggdrasil *.yml
7+
recursive-include yggdrasil *.yaml
78
recursive-include yggdrasil *.sh
89
recursive-include yggdrasil *.m
910
recursive-include yggdrasil *.R
@@ -23,6 +24,7 @@ recursive-include yggdrasil/demos *.py
2324
recursive-include yggdrasil/tests/scripts *.py
2425
recursive-include yggdrasil/examples Makefile_linux
2526
recursive-include yggdrasil/examples Makefile_windows
27+
include yggdrasil/templates/*.html
2628
include yggdrasil/examples/gs_lesson4/src/Makefile_linux
2729
include yggdrasil/examples/gs_lesson4/src/Makefile_windows
2830
recursive-include yggdrasil/languages install.py

console_scripts.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
yggdrasil=yggdrasil.command_line:main
2+
ygginfo=yggdrasil.command_line:ygginfo
3+
yggrun=yggdrasil.command_line:yggrun
4+
cisrun=yggdrasil.command_line:yggrun
5+
yggcompile=yggdrasil.command_line:yggcompile
6+
yggcc=yggdrasil.command_line:yggcc
7+
yggcctool=yggdrasil.command_line:cc_toolname
8+
yggldtool=yggdrasil.command_line:ld_toolname
9+
yggccflags=yggdrasil.command_line:cc_flags
10+
yggldflags=yggdrasil.command_line:ld_flags
11+
yggtest=yggdrasil.command_line:run_tsts
12+
yggmetaschema=yggdrasil.command_line:regen_metaschema
13+
yggschema=yggdrasil.command_line:regen_schema
14+
yggbuildapi_c=yggdrasil.command_line:rebuild_c_api
15+
yggconfig=yggdrasil.command_line:update_config
16+
yggtime_comm=yggdrasil.command_line:yggtime_comm
17+
yggtime_lang=yggdrasil.command_line:yggtime_lang
18+
yggtime_os=yggdrasil.command_line:yggtime_os
19+
yggtime_py=yggdrasil.command_line:yggtime_py
20+
yggtime_paper=yggdrasil.command_line:yggtime_paper
21+
yggvalidate=yggdrasil.command_line:validate_yaml
22+
ygginstall=yggdrasil.command_line:ygginstall
23+
yggclean=yggdrasil.command_line:yggclean
24+
yggmodelform=yggdrasil.command_line:yggmodelform
25+
yggdevup=yggdrasil.command_line:yggdevup
26+
ygggha=yggdrasil.command_line:generate_gha_workflow

create_coveragerc.py

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import sys
3+
import site
34
PY_MAJOR_VERSION = sys.version_info[0]
45
IS_WINDOWS = (sys.platform in ['win32', 'cygwin'])
56
_on_gha = bool(os.environ.get('GITHUB_ACTIONS', False))
@@ -14,6 +15,7 @@
1415
from configparser import RawConfigParser as HandyConfigParser
1516
except ImportError:
1617
HandyConfigParser = None
18+
_package_dir = os.path.join(site.getsitepackages()[0], 'yggdrasil')
1719

1820

1921
def add_excl_rule(excl_list, new_rule):
@@ -142,6 +144,24 @@ def create_coveragerc(installed_languages):
142144
excl_list = rm_excl_rule(excl_list, 'pragma: no %s' % k)
143145
# Add new rules
144146
cp.set('report', 'exclude_lines', '\n' + '\n'.join(excl_list))
147+
# Set include path so that filenames in the report are absolute
148+
if os.path.isdir(_package_dir):
149+
PACKAGE_DIR = _package_dir
150+
else:
151+
PACKAGE_DIR = os.path.join(os.path.abspath(os.path.dirname(__file__)),
152+
'yggdrasil')
153+
section = 'source'
154+
if section == 'include':
155+
section_path = os.path.join(PACKAGE_DIR, '*')
156+
else:
157+
section_path = PACKAGE_DIR
158+
if not cp.has_section('run'):
159+
cp.add_section('run')
160+
incl_list = []
161+
if cp.has_option('run', section):
162+
incl_list = cp.get('run', section).strip().split('\n')
163+
incl_list.append(section_path)
164+
cp.set('run', section, '\n' + '\n'.join(incl_list))
145165
# Write
146166
with open(covrc, 'w') as fd:
147167
cp.write(fd)
@@ -151,8 +171,11 @@ def create_coveragerc(installed_languages):
151171
def run():
152172
r"""Run coverage creation function after getting a list of installed
153173
languages."""
154-
LANG_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)),
155-
'yggdrasil', 'languages')
174+
if os.path.isdir(_package_dir):
175+
LANG_PATH = os.path.join(_package_dir, 'languages')
176+
else:
177+
LANG_PATH = os.path.join(os.path.abspath(os.path.dirname(__file__)),
178+
'yggdrasil', 'languages')
156179
sys.path.insert(0, LANG_PATH)
157180
try:
158181
import install_languages

docs/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ roxy:
4646
scripts:
4747
python $(SOURCEDIR)/examples/make_example_rst.py
4848
python $(SOURCEDIR)/make_tables_rst.py
49+
python $(SOURCEDIR)/build_schema.py
50+
python $(SOURCEDIR)/create_cli_docs.py
4951

5052
# Catch-all target: route all unknown targets to Sphinx using the new
5153
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).

docs/source/advanced/metaschema.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
JSON Metaschema
55
###############
66

7-
|yggdrasil| uses the JSON metaschema below for evaluating schemas including
7+
|yggdrasil| uses :download:`this JSON metaschema <../schema/metaschema.json>` (shown below) for evaluating schemas including
88
type definitions. This metaschema is an expansion of the default metaschema defined by
99
`JSON schema <https://json-schema.org/>`_ with the addition of several more
1010
specific ``simpleTypes`` that allow validation of more complex/specific data types.
@@ -40,6 +40,6 @@ metaschema include:
4040
Unicode objects that will be encoded as bytes using utf-8 encoding.
4141

4242

43-
.. literalinclude:: /../../yggdrasil/.ygg_metaschema.json
43+
.. literalinclude:: ../schema/metaschema.json
4444
:language: json
4545
:linenos:

docs/source/advanced/schema.rst

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
11
.. _schema_rst:
22

3-
######################
3+
Schemas
4+
#######
5+
46
YAML Validation Schema
5-
######################
7+
======================
68

79

8-
|yggdrasil| uses the schema below for validating the YAML specification files
10+
|yggdrasil| uses :download:`this schema <../schema/integration.json>` (shown below) for validating the YAML specification files
911
used to define integration networks. Users should not need to interact with the
1012
schema directly. Instead |yggdrasil| provides a command line utility ``yggvalidate``
1113
for using the schema to validate a provided list of YAML specification files
1214
defining a run.
1315

1416

15-
.. literalinclude:: /../../yggdrasil/.ygg_schema.yml
16-
:language: yaml
17+
.. literalinclude:: ../schema/integration.json
18+
:language: json
1719
:linenos:
1820

21+
22+
Additional Schemas
23+
==================
24+
25+
:download:`model_form.json <../schema/model_form.json>`
26+
Pure JSON schema (without |yggdrasil| metaschema extensions) for validating models submitted to the :term:`Yggdrasil Model Repository`.
27+
28+
:download:`integration_strict.json <../schema/integration_strict.json>`
29+
Pure JSON schema (without |yggdrasil| metaschema extensions) for validating integration objects.

docs/source/build_schema.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import os
2+
import shutil
3+
from yggdrasil import schema, metaschema
4+
5+
6+
schema_dir = os.path.join(os.path.dirname(__file__), 'schema')
7+
if not os.path.isdir(schema_dir):
8+
os.mkdir(schema_dir)
9+
10+
11+
indent = ' '
12+
s = schema.get_schema()
13+
shutil.copy(metaschema._metaschema_fname,
14+
os.path.join(schema_dir, 'metaschema.json'))
15+
with open(os.path.join(schema_dir, 'integration.json'), 'w') as fd:
16+
metaschema.encoder.encode_json(s.schema, fd=fd, indent=indent,
17+
sort_keys=False)
18+
schema.get_json_schema(os.path.join(schema_dir, 'integration_strict.json'),
19+
indent=indent)
20+
schema.get_model_form_schema(os.path.join(schema_dir, 'model_form.json'),
21+
indent=indent)

0 commit comments

Comments
 (0)