diff --git a/.ci_support/environment.yml b/.ci_support/environment.yml new file mode 100644 index 0000000..1f735a7 --- /dev/null +++ b/.ci_support/environment.yml @@ -0,0 +1,4 @@ +channels: + - conda-forge +dependencies: + - pyiron_workflow diff --git a/.github/workflows/run_workflow.yml b/.github/workflows/run_workflow.yml new file mode 100644 index 0000000..1473137 --- /dev/null +++ b/.github/workflows/run_workflow.yml @@ -0,0 +1,38 @@ +name: Run workflow + +on: + push: + branches: [ main ] + pull_request: + types: [labeled, opened, synchronize, reopened] + workflow_call: + +jobs: + run_workflow: + if: | + github.event_name == 'push' || + ( github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'run_workflow' )) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup environment + uses: pyiron/actions/cached-miniforge@actions-3.2.0 + with: + python-version: '3.11' + env-files: .ci_support/environment.yml + local-code-directory: '' + use-cache: 'true' + miniforge-channels: conda-forge + pip-install-versioneer: 'false' + no-build-isolation: 'false' + - name: Add papermill + shell: bash -l {0} + run: mamba install -n my-env papermill + - name: Execute workflow + shell: bash -l {0} + run: papermill workflow.ipynb workflow-out.ipynb -k python3 + - name: Upload updated notebook as artifact + uses: actions/upload-artifact@v4 + with: + name: workflow-out.ipynb + path: ./workflow-out.ipynb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index 2b91c3c..1399409 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ # graphathon -Playground for collaborative environment in order to create a workflow in parallel by distributing nodes (i.e. tasks) to different people. - -## Basic idea - -1. Create a workflow in a large group, with empty nodes with only inputs and outputs defined -2. Distribute the nodes to different people -3. As people finish their tasks, they push the nodes to the repository, where CI takes care of the workflow execution - -More will follow... +A template repository for setting up an environment where nodes for a workflow using `pyiron_workflow` can be developed by different people in parallel. + +Usage goes like so: +- the team sets up a dummy workflow using placeholder-vwersions of the involved nodes +- the team creates a repository using *this* repo as a template (especially anything located in `.github/` and `.ci_support/`) +- each dev opens a branch + PR for her work +- as soon as the `run_workflow` label is added to the PR, each push triggers workflow execution via actions. +- the updated notebook is uploaded as a github action artifact (Actions -> select CI run -> Artifacts). Download, unzip and view locally. diff --git a/nodes/time.py b/nodes/time.py index 8aa303f..587ad11 100644 --- a/nodes/time.py +++ b/nodes/time.py @@ -2,4 +2,4 @@ @Workflow.wrap.as_function_node("travel_time") def get_time(distance: float, speed: float) -> float: - return 10. + return 42.