Skip to content

Commit

Permalink
Merge branch 'main' into dag-name-validation
Browse files Browse the repository at this point in the history
Signed-off-by: Elliot Gunton <elliotgunton@gmail.com>
  • Loading branch information
elliotgunton committed May 31, 2024
2 parents 5c043ba + 08038f0 commit a28ecd4
Show file tree
Hide file tree
Showing 70 changed files with 3,123 additions and 488 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
cache: "poetry"

- name: Install dependencies
run: poetry install -E cli
run: poetry install --all-extras

- name: run ci checks
run: make ci
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:

- name: Install dependencies
run: |
poetry install -E cli
poetry install --all-extras
poetry run pip install "pydantic<2"
- name: run ci checks
Expand All @@ -95,8 +95,6 @@ jobs:
workflow-tests:
name: run workflow tests
timeout-minutes: 10
strategy:
fail-fast: false

runs-on: ubuntu-latest

Expand All @@ -114,7 +112,7 @@ jobs:
cache: "poetry"

- name: Install dependencies
run: poetry install -E cli
run: poetry install --all-extras

- name: setup k3d cluster
run: make install-k3d
Expand Down
113 changes: 113 additions & 0 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Hera Governance

This document outlines the governance for the Hera Project.

Any changes to Hera's governance and this document require a unanimous vote by all TOC members.

All votes mentioned in this document follow a [lazy-consensus process](https://medlabboulder.gitlab.io/democraticmediums/mediums/lazy_consensus/) with a default time-period of 2 weeks unless they are mentioned to be unanimous in which case they require unanimous consensus from all binding voters.

## Roles and Membership

The current members are defined in [MEMBERS.md](MEMBERS.md)

### Technical Oversight Committee (TOC)

Hera TOC members are maintainers who have made substantial contributions to the project. The Hera TOC is modeled on the CNCF TOC as a technical governing body. It oversees all aspects of the project and has a mandate to drive consensus for:

- Defining and maintaining the technical vision for the project
- Fostering a healthy and welcoming community, including by defining and enforcing our Code of Conduct
- Defining the governance structure of the project
- Appointing maintainers and leads
- Defining the [HEP](proposals/README.md) process through which cross-cutting changes are proposed and approved
- Defining the annual roadmap
- Responsible for handling security reports and incidents
- Anything else that falls through the cracks

#### Nomination Process

For a new TOC member to be appointed they must:

- Be a seasoned maintainer of Hera
- Have driven multiple HEPs to implementation
- Be nominated by an existing TOC member
- Be unanimously elected by the TOC

#### Privileges

TOC members will have the following permissions:
- Admin permissions on the Hera Github repository
- Ability to approve releases to PyPI
- Binding votes on [HEPs](proposals/README.md)
- Binding votes on Governance changes
- Added to hera-security-reports@googlegroups.com

### Maintainers

Maintainers are in charge of the day to day maintenance of the project including:

- Ensuring contributions align with project goals and meet the project's quality standards
- Reviewing, approving, and merging PRs
- Planning release milestones, and releasing components under the team's area of responsibility
- Representing the work of the team to the community
- Supporting contributors
- Growing the team by mentoring aspiring contributors and maintainers

#### Nomination Process

For a new maintainer to be appointed they must:

- Be an approver to Hera for at least 2 months
- Reviewer for or author of at least 10 substantial PRs to the codebase, with the definition of substantial subject to the TOC's discretion (e.g. refactors, enhancements rather than grammar correction or one-line pulls).
- Exhibiting sound technical judgment through PR contributions
- Exhibiting sound technical judgment through PR reviews
- Be nominated by an existing maintainer/TOC member and be voted in by remaining maintainers/TOC members (via a lazy-consensus vote lasting 2 weeks)

#### Privileges

Maintainers will have the following permissions:
- ["Maintain" permissions](https://docs.github.com/en/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/repository-roles-for-an-organization#permissions-for-each-role) on the Hera Github repository
- Ability to merge PRs to protected branches
- Cutting releases (PyPI publish will still require approval from a TOC member)

### Approvers

Approvers are seasoned contributors who are responsible for:

- Ensuring contributions align with project goals and meet the project's quality standards
- Reviewing and approving PRs (but not merging to protected branches)
- Supporting contributors

#### Nomination Process

For a new approver to be appointed they must:

- Be an author or reviewer of multiple feature or bug-fix PRs
- Exhibiting sound technical judgment through PR contributions
- Exhibiting sound technical judgment through PR reviews
- Be nominated by an existing approver (or above) or self-nominate
- Be sponsored by a maintainer/TOC member

#### Privileges

Maintainers will have the following permissions:
- Push permissions on the Hera Github repository
- Ability to approve PRs to protected branches

### Member

Project members are contributors to the project.

#### Nomination Process

For a new member to be appointed they must:

- Be a Hera user
- Exhibit interest and time to help out the project
- Be sponsored by an existing approver or above

#### Privileges

Members will have the following permissions:
- Triage permissions on the Hera Github repository
- Ability to triage issues, PRs
- Ability to assign issues
3 changes: 0 additions & 3 deletions MAINTAINERS.md

This file was deleted.

19 changes: 19 additions & 0 deletions MEMBERS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Hera Project Members

## TOC

- Flaviu Vadan <flaviuvadan@gmail.com>
- Sambhav Kothari <sambhavs.email@gmail.com>
- Elliot Gunton <elliotgunton@gmail.com>

## Maintainers

...

## Approvers

...

## Members

...
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ codegen: models services examples init-files
check-codegen: ## Check if the code is up to date
check-codegen:
@$(MAKE) codegen
git diff --exit-code || "Code is not up-to-date. Please run 'make codegen'"
@git diff --exit-code || echo "Code is not up-to-date. Please run 'make codegen'"

.PHONY: format
format: ## Format and sort imports for source, tests, examples, etc.
Expand Down Expand Up @@ -122,7 +122,7 @@ examples: ## Generate documentation files for examples

.PHONY: regenerate-example
regenerate-example: ## Regenerates the yaml for a single example, using EXAMPLE_FILENAME envvar
regenerate-example: install-3.8
regenerate-example: install
@HERA_REGENERATE=1 poetry run python -m pytest -k $(EXAMPLE_FILENAME)

.PHONY: regenerate-test-data
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ time to react, analyze and develop a fix to mitigate the found security vulnerab

Please report vulnerabilities by e-mail to the following address:

* flaviu.vadan@dynotx.com
* hera-security-reports@googlegroups.com

All vulnerabilities and associated information will be treated with full confidentiality.

Expand Down
133 changes: 133 additions & 0 deletions docs/examples/workflows/experimental/new_dag_decorator_artifacts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
# New Dag Decorator Artifacts






=== "Hera"

```python linenums="1"
from typing_extensions import Annotated

from hera.shared import global_config
from hera.workflows import Artifact, Input, Output, Workflow

global_config.experimental_features["script_annotations"] = True
global_config.experimental_features["script_pydantic_io"] = True
global_config.experimental_features["decorator_syntax"] = True


w = Workflow(generate_name="my-workflow-")


class ArtifactOutput(Output):
an_artifact: Annotated[str, Artifact(name="an-artifact")]


class ConcatInput(Input):
word_a: Annotated[str, Artifact(name="word_a")]
word_b: Annotated[str, Artifact(name="word_b")]


@w.script()
def concat(concat_input: ConcatInput) -> ArtifactOutput:
return ArtifactOutput(an_artifact=f"{concat_input.word_a} {concat_input.word_b}")


class WorkerInput(Input):
artifact_a: Annotated[str, Artifact(name="artifact_a")]
artifact_b: Annotated[str, Artifact(name="artifact_b")]


@w.set_entrypoint
@w.dag()
def worker(worker_input: WorkerInput) -> ArtifactOutput:
concat_1 = concat(
ConcatInput(
word_a=worker_input.artifact_a,
word_b=worker_input.artifact_b,
)
)

concat_2 = concat(
ConcatInput(
word_a=concat_1.an_artifact,
word_b=concat_1.an_artifact,
),
name="concat-2-custom-name",
)

return ArtifactOutput(an_artifact=concat_2.an_artifact)
```

=== "YAML"

```yaml linenums="1"
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
generateName: my-workflow-
spec:
entrypoint: worker
templates:
- inputs:
artifacts:
- name: word_a
path: /tmp/hera-inputs/artifacts/word_a
- name: word_b
path: /tmp/hera-inputs/artifacts/word_b
name: concat
outputs:
artifacts:
- name: an-artifact
path: /tmp/hera-outputs/artifacts/an-artifact
script:
args:
- -m
- hera.workflows.runner
- -e
- examples.workflows.experimental.new_dag_decorator_artifacts:concat
command:
- python
env:
- name: hera__script_annotations
value: ''
- name: hera__outputs_directory
value: /tmp/hera-outputs
- name: hera__script_pydantic_io
value: ''
image: python:3.8
source: '{{inputs.parameters}}'
- dag:
tasks:
- arguments:
artifacts:
- from: '{{inputs.artifacts.artifact_a}}'
name: word_a
- from: '{{inputs.artifacts.artifact_b}}'
name: word_b
name: concat_1
template: concat
- arguments:
artifacts:
- from: '{{tasks.concat_1.outputs.artifacts.an-artifact}}'
name: word_a
- from: '{{tasks.concat_1.outputs.artifacts.an-artifact}}'
name: word_b
depends: concat_1
name: concat-2-custom-name
template: concat
inputs:
artifacts:
- name: artifact_a
path: /tmp/hera-inputs/artifacts/artifact_a
- name: artifact_b
path: /tmp/hera-inputs/artifacts/artifact_b
name: worker
outputs:
artifacts:
- from: '{{tasks.concat-2-custom-name.outputs.artifacts.an-artifact}}'
name: an-artifact
```

Loading

0 comments on commit a28ecd4

Please sign in to comment.