Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
65ee314
Added Dask translator coverage
henricasanova Aug 5, 2025
fe22c08
Re-org of translator tests
henricasanova Aug 5, 2025
059372b
Added a Parsl translator test
henricasanova Aug 5, 2025
fd81786
Re-enabling skipped tests for now
henricasanova Aug 5, 2025
84c55dd
Added Nextflow translator test
henricasanova Aug 5, 2025
e39aa7a
Merge branch 'main' into testing
henricasanova Aug 5, 2025
6e048f6
Testing++
henricasanova Aug 5, 2025
ffae854
disabling Airflow test
henricasanova Aug 5, 2025
d91c037
disabling Nextflow test
henricasanova Aug 5, 2025
ca84fc8
Disabling all translator tests
henricasanova Aug 5, 2025
1cd259d
Replaced the use of shutil.which() with getting directly the pythong …
henricasanova Aug 5, 2025
a757be1
Airflow translator testing
henricasanova Aug 6, 2025
4365e46
Fixing toml warning
henricasanova Aug 6, 2025
726df34
setup.py fix
henricasanova Aug 6, 2025
5299a58
toml fix
henricasanova Aug 6, 2025
e554b15
toml fix
henricasanova Aug 6, 2025
f69363b
missing import
henricasanova Aug 6, 2025
53ce2e2
path fix
henricasanova Aug 6, 2025
e00bb0a
Another path fix
henricasanova Aug 6, 2025
098fe0f
Yet another path fix (for wfbench this time)
henricasanova Aug 6, 2025
2f6ebd8
Fixing import
henricasanova Aug 6, 2025
add824b
Disabling some tests for easier CI debugging
henricasanova Aug 6, 2025
59a6c36
Re-enabling more tests
henricasanova Aug 6, 2025
58d8034
Re-enabling Airflow test
henricasanova Aug 6, 2025
7b6edf1
Adding debugging output to container for CI debugging
henricasanova Aug 6, 2025
734ff74
adding debug to test
henricasanova Aug 6, 2025
6dcfc37
Trying a different approach for airflow translator testing
henricasanova Aug 6, 2025
8b7f183
Making the airflow docker container run as non-root
henricasanova Aug 6, 2025
b518a5a
airflow translator debugging
henricasanova Aug 6, 2025
4773f02
Fixed airflow Docker image
henricasanova Aug 6, 2025
fa97b05
Re-establishing some tests
henricasanova Aug 6, 2025
dbaf9ad
gitignore update
henricasanova Aug 6, 2025
b711f5c
setup.py improvements
henricasanova Aug 6, 2025
215d93e
Revamped build process
henricasanova Aug 6, 2025
e85b318
Removing the -e flag from the pip install in the workflow (otherwise
henricasanova Aug 6, 2025
72e58b3
Removing "-e" from pip install, so that data_files are installed!!
henricasanova Aug 6, 2025
73ab2df
Dead code / commented out code removal
henricasanova Aug 7, 2025
0572c91
Put bin directory back in the root directory (for now)
henricasanova Aug 7, 2025
40107a0
whitespace++
henricasanova Aug 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ]
# python-version: [ "3.9", "3.10" ]
python-version: [ "3.11", "3.12", "3.13" ]
steps:
- uses: actions/checkout@v4

Expand All @@ -23,12 +22,16 @@ jobs:
pip install sphinx_rtd_theme recommonmark pytest pytest-cov
pip install --upgrade setuptools

- name: Install utilities for testing
run: |
pip install docker

- name: Check package install
run: |
pip install -e .
pip install .

- name: Run tests
run: pytest -m unit --cov=wfcommons tests/
run: python3 -m pytest -s -v -m unit --cov=wfcommons tests/

- name: Upload coverage
if: github.ref == 'refs/heads/main'
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,8 @@ bin/gpu_benchmark
/wfcommons/wfc-1.3_to_dask/out
/wfcommons/wfc-1.3_to_dask/htmlcov

# Coverage stuff
.coverage
coverage.xml

test/
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This Python package provides a collection of tools for:
## Installation

WfCommons is available on [PyPI](https://pypi.org/project/wfcommons).
WfCommons requires Python3.9+ and has been tested on Linux and macOS.
WfCommons requires Python3.11+ and has been tested on Linux and MacOS.

### Installation using pip

Expand Down
2 changes: 1 addition & 1 deletion docs/source/quickstart_installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Installation
============

WfCommons is available on `PyPI <https://pypi.org/project/wfcommons>`_.
WfCommons requires Python3.9+ and has been tested on Linux and macOS.
WfCommons requires Python3.11+ and has been tested on Linux and macOS.

Installation using pip
----------------------
Expand Down
7 changes: 2 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ name = "wfcommons"
authors = [{name = "WfCommons team", email = "support@wfcommons.org"}]
description = "A Framework for Enabling Scientific Workflow Research and Education"
readme = "README.md"
requires-python = ">=3.9"
requires-python = ">=3.11"
classifiers = [
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
Expand All @@ -33,7 +30,7 @@ dependencies = [
"pandas",
"python-dateutil",
"requests",
"scipy",
"scipy>=1.16.1",
"pyyaml",
"pandas",
"shortuuid",
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[metadata]
description-file = README.md
description_file = README.md
10 changes: 6 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
from setuptools import setup, find_packages
from setuptools.command.build_ext import build_ext


class Build(build_ext):
"""Customized setuptools build command - builds protos on build."""

def run(self):
protoc_command = ["make"]
if subprocess.call(protoc_command) != 0:
print("Error: 'make' is not istnalled. Please install 'make' and try again.")
sys.stderr.write("Error: 'make' is not installed. Please install 'make' and try again.\n")
sys.exit(-1)
super().run()

Expand All @@ -33,11 +32,14 @@ def run(self):
'build_ext': Build,
},
data_files=[
('bin', ['bin/cpu-benchmark', 'bin/wfbench'])
('bin', ['bin/cpu-benchmark'])
],
scripts=[
'bin/wfbench'
],
entry_points={
'console_scripts': [
'wfchef=wfcommons.wfchef.chef:main'
'wfchef=wfcommons.wfchef.chef:main',
],
'workflow_recipes': [
'epigenomics_recipe = wfcommons.wfchef.recipes:EpigenomicsRecipe',
Expand Down
68 changes: 34 additions & 34 deletions tests/recipes/test_recipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,37 +39,37 @@ class TestRecipes:
SrasearchRecipe,
]

# @pytest.mark.unit
# @pytest.mark.parametrize(
# "recipe_class",
# recipe_class_list
# )
# def test_recipes(self, recipe_class) -> None:
#
# recipe = recipe_class.from_num_tasks(num_tasks=200, runtime_factor=1.1, input_file_size_factor=1.5,
# output_file_size_factor=0.8)
# workflow = WorkflowGenerator(recipe).build_workflow()
#
#
# @pytest.mark.unit
# @pytest.mark.parametrize(
# "recipe_class",
# recipe_class_list
# )
# def test_recipes_errors(self, recipe_class) -> None:
# # Not enough tasks
# recipe = recipe_class.from_num_tasks(num_tasks=2, runtime_factor=1.1, input_file_size_factor=1.5,
# output_file_size_factor=0.8)
# with pytest.raises(ValueError):
# WorkflowGenerator(recipe).build_workflow()
#
# # Bogus parameters
# with pytest.raises(ValueError):
# recipe_class.from_num_tasks(num_tasks=2, runtime_factor=-1.1, input_file_size_factor=1.5,
# output_file_size_factor=0.8)
# with pytest.raises(ValueError):
# recipe_class.from_num_tasks(num_tasks=2, runtime_factor=1.1, input_file_size_factor=-1.5,
# output_file_size_factor=0.8)
# with pytest.raises(ValueError):
# recipe_class.from_num_tasks(num_tasks=2, runtime_factor=1.1, input_file_size_factor=-1.5,
# output_file_size_factor=-0.8)
@pytest.mark.unit
@pytest.mark.parametrize(
"recipe_class",
recipe_class_list
)
def test_recipes(self, recipe_class) -> None:

recipe = recipe_class.from_num_tasks(num_tasks=200, runtime_factor=1.1, input_file_size_factor=1.5,
output_file_size_factor=0.8)
workflow = WorkflowGenerator(recipe).build_workflow()


@pytest.mark.unit
@pytest.mark.parametrize(
"recipe_class",
recipe_class_list
)
def test_recipes_errors(self, recipe_class) -> None:
# Not enough tasks
recipe = recipe_class.from_num_tasks(num_tasks=2, runtime_factor=1.1, input_file_size_factor=1.5,
output_file_size_factor=0.8)
with pytest.raises(ValueError):
WorkflowGenerator(recipe).build_workflow()

# Bogus parameters
with pytest.raises(ValueError):
recipe_class.from_num_tasks(num_tasks=2, runtime_factor=-1.1, input_file_size_factor=1.5,
output_file_size_factor=0.8)
with pytest.raises(ValueError):
recipe_class.from_num_tasks(num_tasks=2, runtime_factor=1.1, input_file_size_factor=-1.5,
output_file_size_factor=0.8)
with pytest.raises(ValueError):
recipe_class.from_num_tasks(num_tasks=2, runtime_factor=1.1, input_file_size_factor=-1.5,
output_file_size_factor=-0.8)
80 changes: 80 additions & 0 deletions tests/translators/Dockerfile.airflow
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# docker build -t wfcommons-dev -f Dockerfile.airflow .
# docker run -it --rm -v .:/home/wfcommons/mount wfcommons-dev /bin/bash

FROM amd64/ubuntu:noble

LABEL org.containers.image.authors="sukaryor@hawaii.edu"

# update repositories
RUN apt-get update

# set timezone
RUN echo "America/Los_Angeles" > /etc/timezone && export DEBIAN_FRONTEND=noninteractive && apt-get install -y tzdata

# install useful stuff
RUN apt-get -y install pkg-config
RUN apt-get -y install git
RUN apt-get -y install wget
RUN apt-get -y install make
RUN apt-get -y install cmake
RUN apt-get -y install cmake-data
RUN apt-get -y install sudo
RUN apt-get -y install vim --fix-missing
RUN apt-get -y install gcc
#RUN apt-get -y install gcc-multilib

# Python stuff
RUN apt-get -y install python3 python3-pip
RUN python3 -m pip install --break-system-packages pathos pandas filelock
RUN python3 -m pip install --break-system-packages networkx scipy matplotlib
RUN python3 -m pip install --break-system-packages pyyaml jsonschema requests
RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1

# Stress-ng
RUN apt-get -y install stress-ng

# WfCommons
#RUN python3 -m pip install --break-system-packages wfcommons

# Install Airflow
RUN python3 -m pip install --break-system-packages apache-airflow==2.10.2 --constraint "https://raw.githubusercontent.com/apache/airflow/constraints-2.10.2/constraints-3.12.txt"

# Install MySQL/MyClient
RUN apt-get install -y mysql-server
RUN apt-get install -y python3-dev build-essential
RUN apt-get install -y default-libmysqlclient-dev
RUN python3 -m pip install --break-system-packages mysqlclient

# Create an run_a_workflow script to start mysqld in the background and setup the Airflow DB,
# copy things around, and the run the workflow

RUN echo '#!/bin/bash' > /run_a_workflow.sh && \
echo 'mysqld --explicit-defaults-for-timestamp &' >> /run_a_workflow.sh && \
echo 'until mysqladmin ping -h localhost --silent; do' >> /run_a_workflow.sh && \
echo ' echo "Waiting for MySQL to be ready..."' >> /run_a_workflow.sh && \
echo ' sleep 2' >> /run_a_workflow.sh && \
echo 'done' >> /run_a_workflow.sh && \
echo 'echo "MySQL is ready!"' >> /run_a_workflow.sh && \
echo 'echo "Setting up database for Airflow..."' >> /run_a_workflow.sh && \
echo 'mysql -u root -e "CREATE DATABASE airflow_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci";' >> /run_a_workflow.sh && \
echo "mysql -u root -e \"CREATE USER 'airflow_user'@'%' IDENTIFIED BY 'airflow_pass';\"" >> /run_a_workflow.sh && \
echo "mysql -u root -e \"GRANT ALL PRIVILEGES ON airflow_db.* TO 'airflow_user';\"" >> /run_a_workflow.sh && \
echo 'export AIRFLOW_HOME="$(pwd)"/airflow/' >> /run_a_workflow.sh && \
echo "airflow config list 1> /dev/null" >> /run_a_workflow.sh && \
echo "sed -i ./airflow/airflow.cfg -e 's/sqlite:.*/mysql+mysqldb:\/\/airflow_user:airflow_pass@localhost:3306\/airflow_db/'" >> /run_a_workflow.sh && \
echo 'airflow db migrate' >> /run_a_workflow.sh && \
echo 'echo "Airflow database setup!"' >> /run_a_workflow.sh && \
echo 'mkdir ./airflow/dags' >> /run_a_workflow.sh && \
echo 'cp -r /tmp/airflow_translated_workflow ./airflow/dags/' >> /run_a_workflow.sh && \
echo 'mv ./airflow/dags/airflow_translated_workflow/workflow.py ./airflow/dags/workflow.py' >> /run_a_workflow.sh && \
echo 'airflow dags test $1' >> /run_a_workflow.sh && \
chmod +x /run_a_workflow.sh

# Create wfcommons user
RUN useradd -ms /bin/bash wfcommons
RUN adduser wfcommons sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
ENV PATH="$PATH:/home/wfcommons/.local/bin/"

USER wfcommons
WORKDIR /home/wfcommons
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# docker build --platform amd64 -t wfcommons-dev-dask -f Dockerfile_Dask .
# docker build --platform amd64 -t wfcommons-dev-dask -f Dockerfile.dask .
# docker run -it --rm -v `pwd`:/home/wfcommons wfcommons-dev-dask /bin/bash

FROM amd64/ubuntu:noble
Expand Down Expand Up @@ -29,6 +29,7 @@ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
RUN python3 -m pip install --break-system-packages pathos pandas filelock
RUN python3 -m pip install --break-system-packages networkx scipy matplotlib
RUN python3 -m pip install --break-system-packages pyyaml jsonschema requests
RUN python3 -m pip install --break-system-packages --upgrade setuptools

# Stress-ng
RUN apt-get -y install stress-ng
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# docker build --platform amd64 -t wfcommons-dev-nextflow -f Dockerfile_Nextflow .
# docker build --platform amd64 -t wfcommons-dev-nextflow -f Dockerfile.nextflow .
# docker run -it --rm -v `pwd`:/home/wfcommons wfcommons-dev-nextflow /bin/bash

FROM amd64/ubuntu:noble
Expand Down Expand Up @@ -30,14 +30,15 @@ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
RUN pip install --break-system-packages pathos pandas filelock
RUN pip install --break-system-packages networkx scipy matplotlib
RUN pip install --break-system-packages pyyaml jsonschema requests
RUN python3 -m pip install --break-system-packages --upgrade setuptools

# Stress-ng
RUN apt-get -y install stress-ng

# Install Java
RUN apt-get -y install openjdk-21-jdk

# Create wfcomomns user
# Create wfcommons user
RUN useradd -ms /bin/bash wfcommons
RUN adduser wfcommons sudo
RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
Expand All @@ -48,5 +49,3 @@ WORKDIR /home/wfcommons
# Install Nextflow and dependencies
RUN curl -s https://get.nextflow.io | bash && sudo mv ./nextflow /usr/local/bin/

# Add wfcommons user

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# docker build --platform amd64 -t wfcommons-dev -f Dockerfile_Parsl .
# docker build --platform amd64 -t wfcommons-dev -f Dockerfile.parsl .
# docker run -it --rm -v `pwd`:/home/wfcommons wfcommons-dev /bin/bash

FROM amd64/ubuntu:noble
Expand Down Expand Up @@ -29,6 +29,7 @@ RUN update-alternatives --install /usr/bin/python python /usr/bin/python3 1
RUN python3 -m pip install --break-system-packages pathos pandas filelock
RUN python3 -m pip install --break-system-packages networkx scipy matplotlib
RUN python3 -m pip install --break-system-packages pyyaml jsonschema requests
RUN python3 -m pip install --break-system-packages --upgrade setuptools

# Stress-ng
RUN apt-get -y install stress-ng
Expand Down
1 change: 0 additions & 1 deletion tests/translators/README

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
This README file describes steps to install/run Airflow, and then run a
translated workflow.
This README file describes steps to install/run Airflow, and then run a translated workflow.

There are three sections:
- Installing Airflow on bare-metal
Expand Down Expand Up @@ -52,14 +51,17 @@ A much simpler alternative is to use Docker.

1. Build the docker image

docker build -t wfcommons-dev -f Dockerfile_Airflow .
docker build -t wfcommons/wfcommons-testing-airflow -f Dockerfile.airflow .

(if building on a Mac, add the `--platform linux/amd64` argument after build above)

This dockerfile is meant for testing purposes (so it has some testing specific things in it)


2. Run the docker container in the directory to contains the translated
workflow (see last section below)

docker run -it --rm -v .:/home/wfcommons/mount wfcommons-dev /bin/bash
docker run -it --rm -v .:/home/wfcommons/translated_workflow wfcommons/wfcommons-testing-airflow /bin/bash


Running a translated workflow with Airflow
Expand All @@ -84,19 +86,21 @@ translator = AirflowTranslator(benchmark.workflow)
translator.translate(output_folder=pathlib.Path("/tmp/translated_workflow/"))
```

The above will create a JSON worfklow file in /tmp/blast-benchmark-45.json.
In that file, the workflow name (this is used below) is set to
"Blast-Benchmark".
The above will create a JSON workflow file in /tmp/blast-benchmark-45.json.
In that file, the workflow name (this is used below) is set to "Blast-Benchmark".

The above will also create the translated workflow the
/tmp/translated_workflow/ directory. Some directories and files need to be copied/moved as follows:
/tmp/translated_workflow/ directory. Some directories and files need to be copied/moved as follows.
As

cp -r /tmp/translated_workflow/ $AIRFLOW_HOME/dags/
mv $AIRFLOW_HOME/dags/translated_workflow/workflow.py $AIRFLOW_HOME/dags/

Finally, run the workflow as:

airflow dags test Blast-Benchmark (not the "Blast-Benchmark" workflow name from above)
airflow dags test Blast-Benchmark (note the "Blast-Benchmark" workflow name from above)


Note that if you're using docker, the above two commands need to be done on the container,
with the right paths (i.e., /home/wfcommons/translated_workflow instead of /tmp/translated_workflow/)

Loading