Skip to content

Commit 8ba65a1

Browse files
committed
Documentation, Dockerfile, cleaning
* Improved documentation of some components * Optimization of the Dockerfile * Deletion of unused old scripts
1 parent 66760c2 commit 8ba65a1

File tree

8 files changed

+317
-231
lines changed

8 files changed

+317
-231
lines changed

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

0 commit comments

Comments
 (0)