-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
232 changed files
with
1,805 additions
and
976 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
Release procedure | ||
================= | ||
|
||
* Make sure you are in the master branch, with the latest changes, | ||
and a clean copy:: | ||
|
||
git checkout master | ||
git pull | ||
git status | ||
|
||
* Decide a new version number (with major, minor, patch components) and apply it | ||
in all packages' ``setup.py``:: | ||
|
||
VERSION_MAJOR=X | ||
VERSION_MINOR=Y | ||
VERSION_PATCH=Z | ||
VERSION=$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH | ||
SETUP_FILES="daliuge-common/setup.py daliuge-translator/setup.py daliuge-runtime/setup.py setup.py" | ||
sed -i "s/MAJOR = .*/MAJOR = $VERSION_MAJOR/; s/MINOR = .*/MINOR = $VERSION_MINOR/; s/PATCH = .*/PATCH = $VERSION_PATCH/" $SETUP_FILES | ||
|
||
* Double-check these are the only changes you will commit:: | ||
|
||
git diff | ||
|
||
* Commit the version changes:: | ||
|
||
git commit $SETUP_FILES -m "daliuge $VERSION" | ||
|
||
* Tag the repository with a new version name tag (using ``vX.Y.Z`` format):: | ||
|
||
git tag v$VERSION -m "daliuge $VERSION" | ||
# Alternatively, if you want to sign it | ||
git tag v$VERSION -m "daliuge $VERSION" -s | ||
|
||
* Push the new commit and the tag to GitHub:: | ||
|
||
git push origin master v$VERSION | ||
|
||
* Produce and collect source distributions for all packages:: | ||
|
||
python setup.py sdist | ||
for package in daliuge-common daliuge-translator daliuge-runtime; do | ||
cd $package | ||
python setup.py sdist | ||
cp dist/*-$VERSION.tar.gz $OLDPWD/dist | ||
cd $OLDPWD | ||
done | ||
|
||
* Upload to PyPI:: | ||
|
||
pip install twine | ||
# Adjust credentials in ~/.pypirc, then | ||
twine upload dist/daliuge*-$VERSION.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# | ||
# ICRAR - International Centre for Radio Astronomy Research | ||
# (c) UWA - The University of Western Australia, 2020 | ||
# Copyright by UWA (in the framework of the ICRAR) | ||
# All rights reserved | ||
# | ||
# This library is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU Lesser General Public | ||
# License as published by the Free Software Foundation; either | ||
# version 2.1 of the License, or (at your option) any later version. | ||
# | ||
# This library is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public | ||
# License along with this library; if not, write to the Free Software | ||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
# MA 02111-1307 USA | ||
# | ||
|
||
# Declaring this as a namespace package | ||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) # @ReservedAssignment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
# | ||
# ICRAR - International Centre for Radio Astronomy Research | ||
# (c) UWA - The University of Western Australia, 2020 | ||
# Copyright by UWA (in the framework of the ICRAR) | ||
# All rights reserved | ||
# | ||
# This library is free software; you can redistribute it and/or | ||
# modify it under the terms of the GNU Lesser General Public | ||
# License as published by the Free Software Foundation; either | ||
# version 2.1 of the License, or (at your option) any later version. | ||
# | ||
# This library is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
# Lesser General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Lesser General Public | ||
# License along with this library; if not, write to the Free Software | ||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, | ||
# MA 02111-1307 USA | ||
# | ||
"""Common utilities used by daliuge packages""" | ||
import sys | ||
|
||
from .osutils import terminate_or_kill, wait_or_kill | ||
from .network import check_port, connect_to, portIsClosed, portIsOpen, write_to | ||
from .streams import ZlibCompressedStream, JSONStream | ||
|
||
STORAGE_TYPES = {'memory', 'file', 'ngas', 'null', 'json'} | ||
|
||
if sys.version_info[0] > 2: | ||
def b2s(b, enc='utf8'): | ||
return b.decode(enc) | ||
else: | ||
def b2s(b, enc='utf8'): | ||
return b | ||
b2s.__doc__ = "Converts bytes into a string" | ||
|
||
|
||
class dropdict(dict): | ||
""" | ||
An intermediate representation of a DROP that can be easily serialized | ||
into a transport format such as JSON or XML. | ||
This dictionary holds all the important information needed to call any given | ||
DROP constructor. The most essential pieces of information are the | ||
DROP's OID, and its type (which determines the class to instantiate). | ||
Depending on the type more fields will be required. This class doesn't | ||
enforce these requirements though, as it only acts as an information | ||
container. | ||
This class also offers a few utility methods to make it look more like an | ||
actual DROP class. This way, users can use the same set of methods | ||
both to create DROPs representations (i.e., instances of this class) | ||
and actual DROP instances. | ||
Users of this class are, for example, the graph_loader module which deals | ||
with JSON -> DROP representation transformations, and the different | ||
repositories where graph templates are expected to be found by the | ||
DROPManager. | ||
""" | ||
def _addSomething(self, other, key): | ||
if key not in self: | ||
self[key] = [] | ||
if other['oid'] not in self[key]: | ||
self[key].append(other['oid']) | ||
|
||
def addConsumer(self, other): | ||
self._addSomething(other, 'consumers') | ||
def addStreamingConsumer(self, other): | ||
self._addSomething(other, 'streamingConsumers') | ||
def addInput(self, other): | ||
self._addSomething(other, 'inputs') | ||
def addStreamingInput(self, other): | ||
self._addSomething(other, 'streamingInputs') | ||
def addOutput(self, other): | ||
self._addSomething(other, 'outputs') | ||
def addProducer(self, other): | ||
self._addSomething(other, 'producers') | ||
|
||
|
||
def get_roots(pg_spec): | ||
""" | ||
Returns a set with the OIDs of the dropspecs that are the roots of the given physical | ||
graph specification. | ||
""" | ||
|
||
# We find all the nonroots first, which are easy to spot. | ||
# The rest are the roots | ||
all_oids = set() | ||
nonroots = set() | ||
for dropspec in pg_spec: | ||
|
||
oid = dropspec['oid'] | ||
all_oids.add(oid) | ||
|
||
if dropspec['type'] in ('app', 'socket'): | ||
if dropspec.get('inputs', None) or dropspec.get('streamingInputs', None): | ||
nonroots.add(oid) | ||
if dropspec.get('outputs', None): | ||
nonroots |= set(dropspec['outputs']) | ||
elif dropspec['type'] == 'plain': | ||
if dropspec.get('producers', None): | ||
nonroots.add(oid) | ||
if dropspec.get('consumers', None): | ||
nonroots |= set(dropspec['consumers']) | ||
if dropspec.get('streamingConsumers', None): | ||
nonroots |= set(dropspec['streamingConsumers']) | ||
|
||
return all_oids - nonroots | ||
|
||
|
||
def get_leaves(pg_spec): | ||
""" | ||
Returns a set with the OIDs of the dropspecs that are the leaves of the given physical | ||
graph specification. | ||
""" | ||
|
||
# We find all the nonleaves first, which are easy to spot. | ||
# The rest are the leaves | ||
all_oids = set() | ||
nonleaves = set() | ||
for dropspec in pg_spec: | ||
|
||
oid = dropspec['oid'] | ||
all_oids.add(oid) | ||
|
||
if dropspec['type'] == 'app': | ||
if dropspec.get('outputs', None): | ||
nonleaves.add(oid) | ||
if dropspec.get('streamingInputs', None): | ||
nonleaves |= set(dropspec['streamingInputs']) | ||
if dropspec.get('inputs', None): | ||
nonleaves |= set(dropspec['inputs']) | ||
elif dropspec['type'] == 'plain': | ||
if dropspec.get('producers', None): | ||
nonleaves |= set(dropspec['producers']) | ||
if dropspec.get('consumers', None) or dropspec.get('streamingConsumers', None): | ||
nonleaves.add(oid) | ||
|
||
return all_oids - nonleaves |
Oops, something went wrong.