Skip to content

Commit

Permalink
feat: add hooks to have consistent styles for non py files and other …
Browse files Browse the repository at this point in the history
…neccessary hooks.
  • Loading branch information
JaeAeich committed May 24, 2024
1 parent 22d2571 commit c97fc1a
Show file tree
Hide file tree
Showing 37 changed files with 652 additions and 362 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
# Scripts and tools
./scripts
Makefile
PULL_REQUEST_TEMPLATE.md
PULL_REQUEST_TEMPLATE.md
32 changes: 23 additions & 9 deletions .github/ISSUE_TEMPLATE/general-purpose.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,47 @@
Your issue may already be reported!
Please search on the [issue tracker](https://github.com/elixir-cloud-aai/TESK/issues) before creating one.
Your issue may already be reported! Please search on the
[issue tracker](https://github.com/elixir-cloud-aai/TESK/issues) before creating
one.

## Expected Behavior

<!--- If you're describing a bug, tell us what should happen -->

<!--- If you're suggesting a change/improvement, tell us how it should work -->

## Current Behavior

<!--- If describing a bug, tell us what happens instead of the expected behavior -->

<!--- If suggesting a change/improvement, explain the difference from current behavior -->

## Possible Solution

<!--- Not obligatory, but suggest a fix/reason for the bug, -->

<!--- or ideas how to implement the addition or change -->

## Steps to Reproduce (for bugs)

<!--- Provide a link to a live example, or an unambiguous set of steps to -->

<!--- reproduce this bug. Include code to reproduce, if relevant -->

1.
1.
1.
1.
2.
3.
4.

## Context

<!--- How has this issue affected you? What are you trying to accomplish? -->

<!--- Providing context helps us come up with a solution that is most useful in the real world -->

## Your Environment

<!--- Include as many relevant details about the environment you experienced the bug in -->
* Version used:
* Browser Name and version:
* Operating System and version (desktop or mobile):
* Link to your project:

- Version used:
- Browser Name and version:
- Operating System and version (desktop or mobile):
- Link to your project:
8 changes: 4 additions & 4 deletions .github/workflows/build_and_publish_charts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Create k3s Cluster
uses: debianmaster/[email protected]
with:
version: 'latest'

- name: Create namespace
run: kubectl create ns tesk

Expand Down Expand Up @@ -67,12 +67,12 @@ jobs:
uses: actions/[email protected]
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Run chart-releaser
uses: helm/[email protected]
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/build_and_publish_filer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
images: |
elixircloud/${{ github.workflow }}
- name: Build and push Docker images
uses: docker/build-push-action@v3
with:
Expand All @@ -47,4 +47,3 @@ jobs:
file: ./deployment/containers/filer.Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

3 changes: 1 addition & 2 deletions .github/workflows/build_and_publish_taskmaster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
with:
images: |
elixircloud/${{ github.workflow }}
- name: Build and push Docker images
uses: docker/build-push-action@v3
with:
Expand All @@ -46,4 +46,3 @@ jobs:
file: ./deployment/containers/taskmaster.Dockerfile
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

2 changes: 1 addition & 1 deletion .github/workflows/code_quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,4 @@ jobs:
run: poetry install --only=lint --no-interaction --no-root

- name: Check spellings
run: poetry run typos .
run: poetry run typos .
2 changes: 1 addition & 1 deletion .github/workflows/validation_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches: ['main']

jobs:
semantic_pr:
semantic_pr:
name: Semantic PR title
runs-on: ubuntu-latest
if: ${{ github.event.action != 'edited' || github.event.changes.title != null }}
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,4 @@ poetry.toml
# LSP config files
pyrightconfig.json

# End of https://www.toptal.com/developers/gitignore/api/python
# End of https://www.toptal.com/developers/gitignore/api/python
58 changes: 49 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,61 @@
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
# Common commands:
# pre-commit install
# pre-commit autoupdate
# pre-commit run --all-files --hook-stage commit
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-builtin-literals
- repo: https://github.com/pre-commit/mirrors-mypy
rev: '' # Use the sha / tag you want to point at
hooks:
- id: mypy
- id: check-added-large-files
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-vcs-permalinks
- id: debug-statements
- id: destroyed-symlinks
- id: detect-private-key
exclude: |
(?x)^(
deployment/charts/tesk/templates/.*\.yaml|deployment/charts/tesk/tls_secret_name\.yml-TEMPLATE
)$
- id: double-quote-string-fixer
- id: end-of-file-fixer
- id: fix-byte-order-marker
- id: fix-encoding-pragma
args: [--remove]
- id: mixed-line-ending
args: [--fix=auto]
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.4.5
hooks:
- id: ruff
- id: ruff-format
args: [ --check ]
args: [--check]
- repo: https://github.com/executablebooks/mdformat
rev: 0.7.17
hooks:
- id: mdformat
additional_dependencies:
- mdformat-config
- mdformat-black
- mdformat-frontmatter
args: [--wrap=80]
# exclude: _.+\.md|CHANGELOG\.md # Add when changelog is implemented
# - repo: https://github.com/adrienverge/yamllint.git # nice to have, but it's will change alot of files.
# rev: v1.35.1
# hooks:
# - id: yamllint
# ignore: deployment/charts
- repo: https://github.com/pappasam/toml-sort
rev: v0.23.1
hooks:
- id: toml-sort-fix
args: [--in-place, --all, --trailing-comma-inline-array]
exclude: poetry\.lock
1 change: 0 additions & 1 deletion .safety-policy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,3 @@ security-updates:
dependency-vulnerabilities:
auto-security-updates-limit:
- patch

2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ run-service:
exit 1; \
fi

.PHONY: clean-service-image
.PHONY: clean-service-image
clean-service-image:
@if [ -x "$(BUILDAH_CMD)" ]; then \
if $(BUILDAH_CMD) inspect $(ELIXIR_CLOUD_REGISTRY)/tesk-core-$(IMAGE):$(TAG) > /dev/null 2>&1; then \
Expand Down
39 changes: 25 additions & 14 deletions PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
## Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.
Please include a summary of the change and which issue is fixed. Please also
include relevant motivation and context. List any dependencies that are required
for this change.

Fixes # (issue)

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
- \[ \] Bug fix (non-breaking change which fixes an issue)
- \[ \] New feature (non-breaking change which adds functionality)
- \[ \] Breaking change (fix or feature that would cause existing functionality
to not work as expected)
- \[ \] Documentation update

## Checklist:

- [ ] My code follows the [style guidelines](https://github.com/elixir-cloud-aai/elixir-cloud-aai/blob/dev/resources/contributing_guidelines.md#language-specific-guidelines) of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] I have not reduced the existing code coverage
- [ ] I have added docstrings following the [Python style guidelines](https://github.com/elixir-cloud-aai/elixir-cloud-aai/blob/dev/resources/python.md) of this project to all new modules, classes, methods and functions are documented with docstrings following; I have updated any previously existing docstrings, if applicable
- [ ] I have updated any sections of the app's documentation that are affected by the proposed changes, if applicable
- \[ \] My code follows the
[style guidelines](https://github.com/elixir-cloud-aai/elixir-cloud-aai/blob/dev/resources/contributing_guidelines.md#language-specific-guidelines)
of this project
- \[ \] I have performed a self-review of my own code
- \[ \] I have commented my code, particularly in hard-to-understand areas
- \[ \] My changes generate no new warnings
- \[ \] I have added tests that prove my fix is effective or that my feature
works
- \[ \] New and existing unit tests pass locally with my changes
- \[ \] I have not reduced the existing code coverage
- \[ \] I have added docstrings following the
[Python style guidelines](https://github.com/elixir-cloud-aai/elixir-cloud-aai/blob/dev/resources/python.md)
of this project to all new modules, classes, methods and functions are
documented with docstrings following; I have updated any previously existing
docstrings, if applicable
- \[ \] I have updated any sections of the app's documentation that are affected
by the proposed changes, if applicable
50 changes: 38 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,59 @@

<img src="images/TESKlogowfont.png" height="200">

An implementation of a task execution engine based on the [TES standard](https://github.com/ga4gh/task-execution-schemas) running on `Kubernetes`. For more details on `TES`, see the (very) brief [introduction to TES](docs/tesintro.md).
An implementation of a task execution engine based on the
[TES standard](https://github.com/ga4gh/task-execution-schemas) running on
`Kubernetes`. For more details on `TES`, see the (very) brief
[introduction to TES](docs/tesintro.md).

For organisational reasons, this project is split into 3 repositories:

- This one, which contains documentation and deployment files
- [tesk-api](https://github.com/elixir-cloud-aai/tesk-api): Contains the service that implements the TES API and translates tasks into kubernetes batch calls
- [tesk-core](https://github.com/elixir-cloud-aai/tesk-core): Contains the code that is launched as images into the kubernetes cluster by tesk-api.
- [tesk-api](https://github.com/elixir-cloud-aai/tesk-api): Contains the service
that implements the TES API and translates tasks into kubernetes batch calls
- [tesk-core](https://github.com/elixir-cloud-aai/tesk-core): Contains the code
that is launched as images into the kubernetes cluster by tesk-api.

If the API is running on your cluster it will pull the images from our `docker.io` repository automatically.
If the API is running on your cluster it will pull the images from our
`docker.io` repository automatically.

`TESK` is designed with the goal to support any `Kubernetes` cluster, for its deployment please refer to the [deployment](deployment/documentation/deployment.md) page.
`TESK` is designed with the goal to support any `Kubernetes` cluster, for its
deployment please refer to the
[deployment](deployment/documentation/deployment.md) page.

The technical documentation is available in the [documentation](deployment/documentation) folder.
The technical documentation is available in the
[documentation](deployment/documentation) folder.

## Architecture

<!-- TODO: Change the image remove tomcat, change naming etc -->

**Description**: The first pod in the task lifecycle is the API pod, a pod which runs a web server (`Tomcat`) and exposes the `TES` specified endpoints. It consumes `TES` requests, validates them and translates them to `Kubernetes` jobs. The API pod then creates a `task controller` pod, or `taskmaster`.
**Description**: The first pod in the task lifecycle is the API pod, a pod which
runs a web server (`Tomcat`) and exposes the `TES` specified endpoints. It
consumes `TES` requests, validates them and translates them to `Kubernetes`
jobs. The API pod then creates a `task controller` pod, or `taskmaster`.

The `taskmaster` consumes the executor jobs, inputs and outputs. It first creates `filer` pod, which creates a persistent volume claim (PVC) to mount as scratch space. All mounts are initialized and all files are downloaded into the locations specified in the TES request; the populated PVC can then be used by each executor pod one after the other. After the `filer` has finished, the taskmaster goes through the executors and executes them as pods one by one. **Note**: Each TES task has a separate taskmaster, PVC and executor pods belonging to it; the only 'singleton' pod across tasks is the API pod.
The `taskmaster` consumes the executor jobs, inputs and outputs. It first
creates `filer` pod, which creates a persistent volume claim (PVC) to mount as
scratch space. All mounts are initialized and all files are downloaded into the
locations specified in the TES request; the populated PVC can then be used by
each executor pod one after the other. After the `filer` has finished, the
taskmaster goes through the executors and executes them as pods one by one.
**Note**: Each TES task has a separate taskmaster, PVC and executor pods
belonging to it; the only 'singleton' pod across tasks is the API pod.

After the last executor, the `filer` is called once more to process the outputs and push them to remote locations from the PVC. The PVC is the scrubbed, deleted and the taskmaster ends, completing the task.
After the last executor, the `filer` is called once more to process the outputs
and push them to remote locations from the PVC. The PVC is the scrubbed, deleted
and the taskmaster ends, completing the task.

## Requirements

- A working [Kubernetes](https://kubernetes.io/) cluster version 1.9 and later.
- If you want TESK to handle tasks with I/O (and you probably want), you additionally need:
- A default storage class, which TESK will use to create temporary PVCs. It is enough that the storage class supports the RWO mode.
- And, if you want TESK to integrate with workflow managers, you additionally need either an FTP account or a PVC that can be accessed from within or from outside of the cluster by the workflow manager (more in the [deployment](deployment/documentation/deployment.md) page).
- If you want TESK to handle tasks with I/O (and you probably want), you
additionally need:
- A default storage class, which TESK will use to create temporary PVCs. It is
enough that the storage class supports the RWO mode.
- And, if you want TESK to integrate with workflow managers, you additionally
need either an FTP account or a PVC that can be accessed from within or from
outside of the cluster by the workflow manager (more in the
[deployment](deployment/documentation/deployment.md) page).
1 change: 0 additions & 1 deletion deployment/charts/tesk/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,3 @@
.idea/
*.tmproj
.vscode/

Loading

0 comments on commit c97fc1a

Please sign in to comment.