Skip to content

Commit a800e68

Browse files
committed
Merge branch 'release' into main
2 parents 046b184 + 9723fb8 commit a800e68

15 files changed

+468
-259
lines changed

.github/workflows/create-prerelease.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
run: |
3232
echo "::set-output name=version::$(date +'%Y-%m-%d' --utc)"
3333
-
34-
name: Create Stable Release
34+
name: Create Pre-Release
3535
id: create_release
3636
uses: actions/create-release@v1
3737
env:

Dockerfile

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,22 @@ FROM ubuntu:20.04
33
USER root
44
WORKDIR /root
55

6+
# RUN alias apt_install="DEBIAN_FRONTEND=noninteractive apt update -y && DEBIAN_FRONTEND=noninteractive apt install -y"
7+
# RUN alias apt_clean="apt clean && rm -rf /var/cache/apt/archives /var/lib/apt/lists/*"
8+
9+
COPY --chmod=777 apt_install /apt_install
10+
611
# install utility software packages
7-
RUN DEBIAN_FRONTEND=noninteractive apt update -y && apt install -y software-properties-common&& rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
8-
RUN DEBIAN_FRONTEND=noninteractive apt update -y && apt install -y inetutils-ping net-tools wget && rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
9-
RUN DEBIAN_FRONTEND=noninteractive apt update -y && apt install -y htop screen zip nano && rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
12+
RUN /apt_install software-properties-common
13+
RUN /apt_install inetutils-ping net-tools wget
14+
RUN /apt_install htop screen zip nano
1015

1116
# install and configure git
12-
RUN DEBIAN_FRONTEND=noninteractive apt update -y && apt install -y git && rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
17+
RUN /apt_install git
1318
RUN DEBIAN_FRONTEND=noninteractive git config --global commit.gpgsign false
1419

1520
# configure ssh daemon
16-
RUN DEBIAN_FRONTEND=noninteractive apt update -y && apt install -y openssh-server && rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
21+
RUN /apt_install openssh-server
1722
RUN if ! [ -d /var/run/sshd ]; then mkdir /var/run/sshd; fi
1823
RUN echo 'root:password!!' | chpasswd
1924
RUN sed -i 's/^[# ]*PermitRootLogin .*$/PermitRootLogin yes/g' /etc/ssh/sshd_config
@@ -41,9 +46,9 @@ RUN echo 'export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64/' >> ~/.bashrc
4146
RUN DEBIAN_FRONTEND=noninteractive apt update -y && apt install -y python3 python3-pip python3-dev && rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
4247

4348
# install PyCOMPSs
44-
RUN DEBIAN_FRONTEND=noninteractive apt update -y && apt install -y graphviz xdg-utils libtool automake build-essential \
49+
RUN /apt_install graphviz xdg-utils libtool automake build-essential \
4550
python python-dev libpython2.7 libboost-serialization-dev libboost-iostreams-dev libxml2 libxml2-dev csh gfortran \
46-
libgmp3-dev flex bison texinfo libpapi-dev && rm -rf /var/cache/apt/archives /var/lib/apt/lists/*
51+
libgmp3-dev flex bison texinfo libpapi-dev
4752
RUN python3 -m pip install --upgrade pip setuptools
4853
RUN python3 -m pip install dill guppy3
4954
RUN python3 -m pip install "pycompss==3.1" -v

apt_install

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# script used for installing software through apt in Dockerfiles, avoiding layer cache and size problems
4+
5+
# update packages lists
6+
DEBIAN_FRONTEND=noninteractive apt update -y
7+
8+
# install required software
9+
DEBIAN_FRONTEND=noninteractive apt install -y $@
10+
11+
# clean apt cache and lists
12+
DEBIAN_FRONTEND=noninteractive apt clean
13+
rm -rf /var/cache/apt/archives /var/lib/apt/lists/*

parsoda/function/analysis/parallel_fp_growth.py

Lines changed: 0 additions & 57 deletions
This file was deleted.

parsoda/function/analysis/sequential_fp_growth.py

Lines changed: 0 additions & 38 deletions
This file was deleted.

parsoda/model/driver/parsoda_driver.py

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,13 @@ def init_environment(self) -> None:
3030
def set_num_partitions(self, num_partitions: int) -> None:
3131
"""
3232
Sets the number of data partitions
33-
:return: None
3433
"""
3534
pass
3635

3736
@abstractmethod
3837
def set_chunk_size(self, chunk_size: int) -> None:
3938
"""
4039
Sets the size of data partitions in bytes
41-
:return: None
4240
"""
4341
pass
4442

@@ -55,53 +53,60 @@ def crawl(self, crawler: List[Crawler]) -> None:
5553
5654
After invoking this function the implementor should hold a representation of an initial dataset
5755
(e.g., on Spark a new RDD is populated with the SocialDataItem objects provided by crawlers)
58-
:return: None
5956
"""
6057
pass
6158

6259
@abstractmethod
6360
def filter(self, filter_func: Callable[[Any], bool]) -> None:
6461
"""
6562
Applies the given filter to the current dataset, dropping all items that does not satisfy the filter
66-
:param filter_func: the filter to apply
67-
:return: None
63+
64+
Args:
65+
filter_func: the filter to apply
6866
"""
6967
pass
7068

7169
@abstractmethod
7270
def flatmap(self, mapper: Callable[[Any], Iterable[Any]]) -> None:
7371
"""
7472
Executes a mapping of each item to a list of custom key-value pairs, represented as tuples of two elements each
75-
:param mapper: the (object -> list[(K,V)]) mapping function to apply
76-
:return: None
73+
74+
Args:
75+
mapper: the (object -> list[(K,V)]) mapping function to apply
7776
"""
7877
pass
7978

8079
def map(self, mapper: Callable[[Any], Any]) -> None:
8180
"""
82-
Executes a mapping of each item in the current dataset to a new object
83-
:param mapper: the (object -> list[(K,V)]) mapping function to apply
84-
:return: None
81+
Executes a mapping of each item in the current dataset to a new object.
82+
83+
Args:
84+
mapper: the (object -> list[(K,V)]) mapping function to apply
8585
"""
8686
self.flatmap(_flatmapper(mapper))
8787

8888
#TODO: documentation
8989
def group_by_key(self) -> None:
90-
"""Assumes that the current dataset is a bulk of key-value pairs and creates a new dataset which groups all the items with the same key. The new dataset will be a bulk of (key)-(list-of-values) pairs.
90+
"""Assumes that the current dataset is a bulk of key-value pairs
91+
and creates a new dataset which groups all the items with the same key.
92+
The new dataset will be a bulk of (key)-(list-of-values) pairs.
9193
"""
9294
pass
9395

9496
def get_result(self) -> Any:
9597
"""
9698
Gets the current dataset
97-
:return: the current dataset
99+
100+
Returns:
101+
Any: the current dataset
98102
"""
99103
pass
100104

101105
@abstractmethod
102106
def dispose_environment(self) -> None:
103107
"""
104-
Disposes instantiated resources of the underlying environment, after executing the ParSoDA application, in order to reuse this driver as a new fresh driver that should be re-initialized
105-
:return: None
108+
Disposes instantiated resources of the underlying environment,
109+
after executing the ParSoDA application, in order to reuse
110+
this driver as a new fresh driver that should be re-initialized
106111
"""
107112
pass

parsoda/model/function/analyzer.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,15 @@ class Analyzer(ABC, Generic[K, R, A]):
1515

1616
@abstractmethod
1717
def analyze(self, driver: ParsodaDriver, data: Dict[K, R]) -> A:
18+
"""Applies an analysis algorithm to the output data from reduction step.
19+
The analyzer might be a sequential, parallel or distributed algorithm.
20+
In the latter case, the algorithm would use the same driver used by the current application for running a new, nested, ParSoDA application.
21+
22+
Args:
23+
driver (ParsodaDriver): the driver used during the execution of the parallel phase
24+
data (Dict[K, R]): output data from reducton step organized as a dictionary of key-value pairs
25+
26+
Returns:
27+
A: the outputdata type from the analysis
28+
"""
1829
pass

parsoda/model/function/crawler.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,11 @@ def get_partitions(self, num_of_partitions=0, partition_size=1024*1024*1024) ->
6464

6565
@abstractmethod
6666
def supports_remote_partitioning(self) -> bool:
67+
"""Checks if the crawler supports remote partitioning, i.e. the ability to read data directly from the worker nodes
68+
69+
Returns:
70+
bool: true if the crawler supports remote partitionig of data source.
71+
"""
6772
pass
6873

6974

parsoda/model/function/filter.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,12 @@ class Filter(ABC):
1010

1111
@abstractmethod
1212
def test(self, item: SocialDataItem) -> bool:
13-
"""
14-
Test if the item satisfies the predicate of the filter
15-
:param item: the item to test
16-
:return: True if the item satisfies the predicate, False otherwise
17-
"""
13+
"""Test if the item satisfies the predicate of the filter
14+
15+
Args:
16+
item (SocialDataItem): the item to test
17+
18+
Returns:
19+
bool: True if the item satisfies the predicate, False otherwise
20+
"""
1821
pass

parsoda/model/function/mapper.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,13 @@ class Mapper(ABC, Generic[K, V]):
1414

1515
@abstractmethod
1616
def map(self, item: SocialDataItem) -> Iterable[Tuple[K, V]]:
17-
"""
18-
Returns a list of key-value pairs computed from the given item.
17+
"""Returns a list of key-value pairs computed from the given item.
1918
Example result: [ (item.user_id, item.tags[0]), (item.user_id, item.tags[1]), ... ]
20-
:param item: the item to map
21-
:return: a list of key-value pairs
19+
20+
Args:
21+
item (SocialDataItem): the item to map
22+
23+
Returns:
24+
Iterable[Tuple[K, V]]: an iterable of key-value pairs
2225
"""
2326
pass

parsoda/model/function/reducer.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@ class Reducer(ABC, Generic[K, V, R]):
1212
"""
1313

1414
def reduce(self, key: K, values: List[V]) -> R:
15-
"""
16-
Applies the reduction algorithm to values
17-
:param key: the key all values are associated to
18-
:param values: all the values associated to the key
19-
:return: the reduced value
15+
"""Applies the reduction algorithm to values
16+
17+
Args:
18+
key (K): the key all values are associated to
19+
values (List[V]): all the values associated to the key
20+
21+
Returns:
22+
R: the reduced value
2023
"""
2124
pass

parsoda/model/function/visualizer.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,9 @@ class Visualizer(ABC, Generic[A]):
1111

1212
@abstractmethod
1313
def visualize(self, result: A) -> None:
14+
"""Transforms data from the analysis step in some output format, then write them to some output device or system.
15+
16+
Args:
17+
result (A): the data resulting from the analysis step
18+
"""
1419
pass

0 commit comments

Comments
 (0)