Skip to content

Commit 78de11c

Browse files
authored
Merge branch 'main' into future
2 parents 82f1b04 + 594fe3c commit 78de11c

File tree

153 files changed

+659
-325
lines changed

Some content is hidden

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

153 files changed

+659
-325
lines changed

.github/workflows/main.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,23 @@ jobs:
2424
ref: ${{ github.event.pull_request.head.sha }}
2525
- name: Running-Pash-Benchmarks
2626
run: |
27-
bash scripts/distro-deps.sh
28-
bash scripts/setup-pash.sh
27+
sudo touch /.githubenv
28+
# install the system deps and pash the environment
29+
sudo -E bash scripts/distro-deps.sh -o
30+
# install pash
31+
sudo -E bash scripts/setup-pash.sh -o
2932
export PASH_TOP=$PWD
3033
export PATH=$PATH:$PASH_TOP
31-
cd scripts
32-
bash run_tests.sh
33-
cd workflow
34-
bash parse.sh > results.log 2>&1
35-
# get the timer in english
36-
d=$(LANG=en_us_88591; date)
34+
# run all the tests (INTRO, INTERFACE, COMPILER)
35+
cd scripts && bash run_tests.sh
36+
# fetch the execution results of the passed/failed
37+
cd workflow && bash parse.sh > results.log 2>&1
38+
# get the timer
39+
timer=$(LANG=en_us_88591; date)
3740
echo "VERSION<<EOF" >> $GITHUB_ENV
38-
echo "OS:${{matrix.os}}" >> $GITHUB_ENV
39-
echo "$d" >> $GITHUB_ENV
40-
# Parses the results and construct a github message post
41+
echo "OS:${{matrix.os}}" >> $GITHUB_ENV
42+
echo "$timer" >> $GITHUB_ENV
43+
# Parse the results and construct a github message post
4144
# we append the data to the global env
4245
cat results.log >> $GITHUB_ENV
4346
echo 'EOF' >> $GITHUB_ENV
@@ -54,5 +57,5 @@ jobs:
5457
})
5558
- name: Exit-code
5659
run: |
57-
cd scripts/workflow
58-
bash exit_code.sh
60+
# check if everything executed without errors
61+
cd scripts/workflow && bash exit_code.sh

README.md

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,26 @@
11
## PaSh: Light-touch Data-Parallel Shell Processing
2+
23
> _A system for parallelizing POSIX shell scripts._
4+
> _Hosted by the [Linux Foundation](https://linuxfoundation.org/press-release/linux-foundation-to-host-the-pash-project-accelerating-shell-scripting-with-automated-parallelization-for-industrial-use-cases/)._
35
46
Quick Jump: [Running PaSh](#running-pash) | [Installation](#installation) | [Testing](#testing) | [Repo Structure](#repo-structure) | [Community & More](#community--more) | [Citing](#citing)
57

68
## Running PaSh
79

8-
To parallelize, say, `./evaluation/intro/hello-world.sh` with parallelization width of `2`, from the top-level directory of the repository run:
10+
To parallelize, say, `./evaluation/intro/hello-world.sh` with parallelization degree of run:
911

1012
```sh
1113
./pa.sh ./evaluation/intro/hello-world.sh
12-
```
14+
```
1315

1416
Run `./pa.sh --help` to get more information about the available commands.
15-
See [docs/tutorial](docs/tutorial/) for a longer tutorial.
17+
Jump to [docs/tutorial](docs/tutorial/) for a longer tutorial.
1618

1719
## Installation
1820

19-
On Ubuntu, Fedora, Debian, or Arch, run `curl up.pash.ndr.md | sh` to setup PaSh.
20-
Alternatively, you can clone the repo and run `./scripts/distro-deps.sh;
21-
./scripts/setup-pash.sh`
22-
23-
You can also built the Docker container from scratch by running
24-
```sh
25-
git clone [email protected]:binpash/pash.git
26-
cd pash/scripts
27-
docker build -t "pash/18.04" .
28-
# Then launch container:
29-
docker run --name pash-play -it pash/18.04
30-
```
21+
On Ubuntu, Fedora, Debian, or Arch, run `curl up.pash.ndr.md | sh` to set up PaSh.
3122

32-
More installation instructions in [the tutorial](./docs/tutorial.md#installation).
33-
Remember to `export` `PASH_TOP` in your startup scripts!
23+
For more details, manual installation, or other platforms see [installation instructions](./docs/install).
3424

3525
## Testing
3626

@@ -45,20 +35,23 @@ To execute the current tests before committing and pushing code, simply run:
4535
This repo hosts the core `pash` development. The structure is as follows:
4636

4737
* [annotations](./annotations/): DSL characterizing commands, parallelizability study, and associated annotations.
48-
* [compiler](./compiler): Shell-Dataflow translations and associated parallelization transformations.
38+
* [compiler](./compiler): Shell-dataflow translations and associated parallelization transformations.
4939
* [docs](./docs): Design documents, tutorials, installation instructions, etc.
50-
* [evaluation](./evaluation): Shell pipelines and example [scripts](./evaluation/scripts) used for the evaluation.
40+
* [evaluation](./evaluation): Shell pipelines and example [scripts](./evaluation/other/more-scripts) used for the evaluation.
5141
* [runtime](./runtime): Runtime component — e.g., `eager`, `split`, and assocaited combiners.
5242
* [scripts](./scripts): Scripts related to continuous integration, deployment, and testing.
5343

5444
## Community & More
5545

56-
Mailing Lists:
57-
* [pash-users](https://groups.google.com/g/pash-users): Join this mailing list for discussing all things `pash`
46+
Chat:
47+
* [Discord Server](ttps://discord.com/channels/947328962739187753/) ([Invite](http://join.binpa.sh/))
48+
49+
Mailing Lists:
50+
* [pash-dev](https://groups.google.com/g/pash-dev): Join this mailing list for discussing all things `pash`
5851
* [pash-commits](https://groups.google.com/g/pash-commits): Join this mailing list for commit notifications
5952

6053
Development/contributions:
61-
* Contribution guide: [docs/contrib](docs/contrib)
54+
* Contribution guide: [docs/contributing](docs/contributing/contrib.md)
6255
* Continuous Integration Server: [ci.binpa.sh](http://ci.binpa.sh)
6356

6457
## Citing

annotations/grep.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
"predicate": "default",
4040
"class": "stateless",
4141
"inputs": ["args[:]"],
42-
"outputs": ["stdout"]
42+
"outputs": ["stdout"],
43+
"comment": "This isn't _quite_ right---we need to identify a pattern somewhere and exclude it from `input`."
4344
}
4445
],
4546
"comment": "For the stateless one we need to add -h|--no-filename as a requirement if it takes multiple files as input."

compiler/pash.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,4 +261,3 @@ def execute_script(compiled_script_filename, command, arguments, shell_name):
261261
if __name__ == "__main__":
262262
main()
263263

264-

compiler/test_evaluation_scripts.sh

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ results_time="$test_results_dir/results.time"
2929
results_time_bash=${results_time}_bash
3030
results_time_pash=${results_time}_pash
3131

32-
3332
echo "Deleting eager intermediate files..."
34-
rm -f /tmp/eager*
35-
mkdir -p $intermediary_dir
3633
rm -rf "$test_results_dir"
34+
rm -rf "$intermediary_dir"
35+
mkdir -p $intermediary_dir
3736
mkdir -p "$test_results_dir"
3837

3938
echo "Generating inputs..."
@@ -46,7 +45,6 @@ n_inputs=(
4645
8
4746
)
4847

49-
5048
if [ "$EXPERIMENTAL" -eq 1 ]; then
5149
configurations=(
5250
# "" # Commenting this out since the tests take a lot of time to finish
@@ -106,10 +104,20 @@ execute_pash_and_check_diff() {
106104
{ time "$PASH_TOP/pa.sh" $@ ; } 1> "$pash_output" 2> >(tee -a "${pash_time}" >&2) &&
107105
diff -s "$seq_output" "$pash_output" | head | tee -a "${pash_time}" >&2
108106
else
109-
{ time "$PASH_TOP/pa.sh" $@ ; } 1> "$pash_output" 2> "${pash_time}"
110-
timer=$(cat "$pash_time");
111-
difference=$(diff -s "$seq_output" "$pash_output" | head)
112-
echo "$difference$timer" > "${pash_time}"
107+
108+
{ time "$PASH_TOP/pa.sh" $@ ; } 1> "$pash_output" 2>> "${pash_time}" &&
109+
b=$(cat "$pash_time");
110+
test_diff_ec=0
111+
$(diff "$seq_output" "$pash_output" || test_diff_ec=$?)
112+
echo "$c$b" > "${pash_time}"
113+
# differ
114+
script=$(basename $script_to_execute)
115+
if [ $test_diff_ec -ne 0 ]; then
116+
echo "$script are not identical" >> $test_results_dir/result_status
117+
else
118+
echo "$script are identical" >> $test_results_dir/result_status
119+
fi
120+
113121
fi
114122
}
115123

@@ -135,7 +143,7 @@ execute_tests() {
135143
export seq_output="${intermediary_dir}/${microbenchmark}_seq_output"
136144
seq_time="$test_results_dir/${microbenchmark}_seq.time"
137145

138-
script_to_execute="${prefix}.sh"
146+
export script_to_execute="${prefix}.sh"
139147
env_file="${prefix}_env_test.sh"
140148
funs_file="${prefix}_funs.sh"
141149
input_file="${prefix}_test.in"
@@ -214,13 +222,11 @@ echo "group,Bash,Pash2,Pash8" > ${results_time}
214222
paste -d'@' $test_results_dir/results.time_* | sed 's\,\.\g' | sed 's\:\,\g' | sed 's\@\,\g' >> ${results_time}
215223

216224
echo "Below follow the identical outputs:"
217-
grep --files-with-match "are identical" "$test_results_dir"/*_distr*.time |
218-
sed "s,^$PASH_TOP/,,"
225+
grep "are identical" "$test_results_dir"/result_status | awk '{print $1}'
219226

220-
echo "Below follow the non-identical outputs:"
221-
grep -L "are identical" "$test_results_dir"/*_distr*.time |
222-
sed "s,^$PASH_TOP/,,"
227+
echo "Below follow the non-identical outputs:"
228+
grep "are not identical" "$test_results_dir"/result_status | awk '{print $1}'
223229

224-
TOTAL_TESTS=$(ls -la "$test_results_dir"/*_distr*.time | wc -l)
225-
PASSED_TESTS=$(grep --files-with-match "are identical" "$test_results_dir"/*_distr*.time | wc -l)
230+
TOTAL_TESTS=$(cat "$test_results_dir"/result_status | wc -l)
231+
PASSED_TESTS=$(grep -c "are identical" "$test_results_dir"/result_status)
226232
echo "Summary: ${PASSED_TESTS}/${TOTAL_TESTS} tests passed."

docs/contributing/contrib.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
## Commits & Commit Messages
2+
3+
Here are a few important guidelines w.r.t to `git` and GitHub:
4+
5+
1. Push your work in a separate branch and create a PR when ready. PRs are always *squashed* so you can push as many corrections as you want to a PR.
6+
7+
2. Strive for [clear and short commit messages](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). At a minimum, start with an 80-character summary, with verbs in present tense.
8+
9+
3. Add the `--signoff` or `-s` flag to `git commit`. This flag is intended to certify that you have created the patch in question, or that you certify that to the best of your knowledge, it was created under an appropriate open-source license, or that it has been provided to you by someone else under those terms.
10+
11+
> To admins: You can always add `Signed-off-by: Name <email>` when squashing commits.
12+
13+
114
## PaSh on Docker: A Pocket Guide
215

316
This is a pocket guide for running PaSh in a docker container.
@@ -109,7 +122,7 @@ Restart-Computer
109122
Run the `wsl` command (or find the installed Linux distribution in Windows Start menu and run it).
110123
After a few minutes of installation, enter a username and password for the internal WSL account to be created.
111124

112-
Continue the PaSh installation process from [here](https://github.com/binpash/pash/blob/main/docs/tutorial.md#installation) inside the WSL installation.
125+
Continue the PaSh installation process from [here](https://github.com/binpash/pash/blob/main/docs/tutorial/tutorial.md#installation) inside the WSL installation.
113126

114127

115128
## Docker TODO
@@ -153,11 +166,6 @@ git merge master # fetch changes from main/master
153166

154167
(You can use `rebase` instead of `merge` if your branch is local and hasn't been pushed to GitHub, but `merge` if your branch is already pushed.)
155168

156-
## Commit Messages
157-
158-
It's important to write [clear commit messages](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
159-
At a minimum, a short single-line summary at the top with verbs in present tense:-)
160-
161169
## Process for Using EC2 Instance
162170

163171
A reason to use Amazon Elastic Compute Cloud (EC2) is having insufficient computing power in your local machine. The steps to do are as follows. The generated key is of the form user@hostname.

docs/install/README.md

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Installation
2+
3+
On Ubuntu, Fedora, Debian, or Arch, run `curl up.pash.ndr.md | sh` to get PaSh up and running.
4+
5+
If on other environments or prefer manual setup, there are essentially three steps required to set PaSh up:
6+
1. Clone repo: `git clone [email protected]:binpash/pash.git`
7+
2. Run `distro-deps.sh` (with `sudo`) and `setup-pash.sh`
8+
3. Export `PASH_TOP` and, optionally, add it to your `PATH`
9+
10+
Most scripts support a `--help` flag that documents their options. These three steps are described in detail below, depending on the environment.
11+
12+
13+
Quick Jump: [Clone & Setup](#) | [Manual Setup](#) | [Docker Setup](#) | [Windows using WSL](#repo-structure)
14+
15+
16+
### Clone & Setup
17+
18+
The following steps clone the repo, set up dependencies (e.g., compilers), and then build PaSh:
19+
20+
```sh
21+
git clone [email protected]:binpash/pash.git
22+
sudo pash/scripts/distro-deps.sh
23+
./pash/scripts/setup-pash.sh
24+
```
25+
26+
These scripts have been tested on Ubuntu, Fedora, Debian, and Arch.
27+
28+
### Manual Setup
29+
30+
Use the system's package manager to install the following packages (some of which might already be installed in your system):
31+
32+
```
33+
automake bc bsdmainutils curl gcc git libffi-dev libtool locales locales-all m4 netcat-openbsd pkg-config python python3 python3-pip python3-setuptools python3-testresources sudo wamerican-insane wget
34+
```
35+
36+
Then clone the PaSh repository and run `setup-pash.sh` as follows:
37+
38+
```sh
39+
git clone [email protected]:binpash/pash.git
40+
./pash/scripts/setup-pash.sh
41+
```
42+
43+
As noted at the end of `setup-pash.sh`, make sure you set `PASH_TOP` pointing to the absolute path of the directory `pa.sh` resides (you can optionally place that in your `PATH`).
44+
45+
### Docker Setup
46+
47+
If Docker [is available](https://docs.docker.com/get-docker/), PaSh can be used as part of a Docker container.
48+
Depending on the setup, PaSh running on Docker may or may not be able to exploit all available hardware resources.
49+
There are two main options for setting up PaSh on Docker:
50+
51+
_Pull from DockerHub (Major Releases):_
52+
To `pull` the docker image [from Docker Hub](https://hub.docker.com/r/binpash/pash), run:
53+
```sh
54+
docker pull binpash/pash
55+
```
56+
We refresh this image (as well as other images) on every major release.
57+
58+
[//]: # "TODO(@nvasilakis, @dkarnikis): Need to automate this per release."
59+
60+
_Build Image (Latest Commit):_
61+
To build the latest Docker container, run `docker build` in [scripts/docker](https://github.com/binpash/pash/tree/main/scripts/docker):
62+
```sh
63+
git clone [email protected]:binpash/pash.git
64+
cd pash/scripts/docker/
65+
docker build -f ./ubuntu/Dockerfile -t "pash:latest" .
66+
```
67+
In the last line, replace `ubuntu` with `fedora` or `debian` to get the corresponding base.
68+
69+
70+
To run the container:
71+
```sh
72+
docker run --name pash-play -it pash:latest
73+
```
74+
75+
PaSh can be found in the container's `/opt/pash` directory, so run `cd pash; git pull` to fetch the latest updates.
76+
More information in the [pash-on-docker guide](../contributing/contrib.md#pash-on-docker-a-pocket-guide).
77+
78+
### Windows using WSL
79+
80+
To run PaSh on windows without Docker, install [WSL](https://docs.microsoft.com/en-us/windows/wsl/install-win10).
81+
A short tutorial is included in the [contributing](../contributing/contrib.md) guide.
82+
83+
[//]: # "TODO(@nvasilakis, @dkarnikis): Need to add instructions for OS X."

docs/troubleshooting.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# PaSh Troubleshooting
2+
3+
This is a list of issues when setting up or running PaSh (and how to solve them).
4+
5+
### Module `pexpect` not found OR libdash library for parser not working
6+
7+
_Solution_: run dependency scipt with **sudo** and build pash libraries
8+
9+
```console
10+
cd $PASH_TOP
11+
sudo bash scripts/distro-deps.sh
12+
bash scripts/setup-pash.sh
13+
```
14+

0 commit comments

Comments
 (0)