-
Notifications
You must be signed in to change notification settings - Fork 31
feat: add k8s client wrapper and constants #201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
40e2136
feat: add k8s client wrapper and needed constants
JaeAeich 3e86549
chore: categorise consts
JaeAeich 6b00c2b
chore: rename consts.
JaeAeich 0d408e4
chore: fix safety error by updating requests, and lock werkeug.
JaeAeich 0ba83b8
chore: remove deps
JaeAeich 292a108
format consts
JaeAeich 48c8cd0
add class config
JaeAeich b611cab
uppercase
JaeAeich d0f2b54
chore: remove datatype from pydocs
JaeAeich 1de65e1
chore: fl and mypy
JaeAeich caf3cdf
Merge branch 'main' into k8s_and_consts
JaeAeich 94891a8
chore: add docs (autogen)
JaeAeich 35e5b94
chore: move k8s package to tesk scope
JaeAeich adda33e
fix: docs
JaeAeich 0e68713
fix: revert deps
JaeAeich 207dcbe
remove requests because vulnerability
JaeAeich d0223cc
minor fix
JaeAeich f44d90c
minor
JaeAeich e3a6584
change name of the package from kubernetes to k8s
JaeAeich 23ac9e8
reamde
JaeAeich dc0ba73
werkzeug updates breaks the server
JaeAeich File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| tesk.api.ga4gh package | ||
| ====================== | ||
|
|
||
| Subpackages | ||
| ----------- | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 4 | ||
|
|
||
| tesk.api.ga4gh.tes | ||
|
|
||
| Module contents | ||
| --------------- | ||
|
|
||
| .. automodule:: tesk.api.ga4gh | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| tesk.api.ga4gh.tes package | ||
| ========================== | ||
|
|
||
| Subpackages | ||
| ----------- | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 4 | ||
|
|
||
| tesk.api.ga4gh.tes.service_info | ||
|
|
||
| Submodules | ||
| ---------- | ||
|
|
||
| tesk.api.ga4gh.tes.controllers module | ||
| ------------------------------------- | ||
|
|
||
| .. automodule:: tesk.api.ga4gh.tes.controllers | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
|
|
||
| tesk.api.ga4gh.tes.models module | ||
| -------------------------------- | ||
|
|
||
| .. automodule:: tesk.api.ga4gh.tes.models | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
|
|
||
| Module contents | ||
| --------------- | ||
|
|
||
| .. automodule:: tesk.api.ga4gh.tes | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: |
21 changes: 21 additions & 0 deletions
21
docs/source/pages/tesk/tesk.api.ga4gh.tes.service_info.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| tesk.api.ga4gh.tes.service\_info package | ||
| ======================================== | ||
|
|
||
| Submodules | ||
| ---------- | ||
|
|
||
| tesk.api.ga4gh.tes.service\_info.service\_info module | ||
| ----------------------------------------------------- | ||
|
|
||
| .. automodule:: tesk.api.ga4gh.tes.service_info.service_info | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
|
|
||
| Module contents | ||
| --------------- | ||
|
|
||
| .. automodule:: tesk.api.ga4gh.tes.service_info | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| tesk.api package | ||
| ================ | ||
|
|
||
| Subpackages | ||
| ----------- | ||
|
|
||
| .. toctree:: | ||
| :maxdepth: 4 | ||
|
|
||
| tesk.api.ga4gh | ||
|
|
||
| Module contents | ||
| --------------- | ||
|
|
||
| .. automodule:: tesk.api | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| tesk.k8s package | ||
| ================ | ||
|
|
||
| Submodules | ||
| ---------- | ||
|
|
||
| tesk.k8s.constants module | ||
| ------------------------- | ||
|
|
||
| .. automodule:: tesk.k8s.constants | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
|
|
||
| tesk.k8s.wrapper module | ||
| ----------------------- | ||
|
|
||
| .. automodule:: tesk.k8s.wrapper | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: | ||
|
|
||
| Module contents | ||
| --------------- | ||
|
|
||
| .. automodule:: tesk.k8s | ||
| :members: | ||
| :undoc-members: | ||
| :show-inheritance: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| """Tesk scoped constants.""" | ||
|
|
||
| import os | ||
|
|
||
| from pydantic import BaseModel | ||
|
|
||
|
|
||
| class TeskConstants(BaseModel): | ||
| """Tesk's K8s scoped constants. | ||
|
|
||
| Attributes: | ||
| FILER_IMAGE_NAME: Name of the filer image | ||
| FILER_IMAGE_VERSION: Version of the filer image | ||
| TASKMASTER_IMAGE_NAME: Name of the taskmaster image | ||
| TASKMASTER_IMAGE_VERSION: Version of the taskmaster image | ||
| TESK_NAMESPACE: Namespace in which api will create K8s resources from TES | ||
| request | ||
| TASKMASTER_SERVICE_ACCOUNT_NAME: Taskmaster service account name | ||
| TASKMASTER_ENVIRONMENT_EXECUTOR_BACKOFF_LIMIT: Backoff limit for taskmaster env | ||
| FILER_BACKOFF_LIMIT: Backoff limit got filer job | ||
| EXECUTOR_BACKOFF_LIMIT: Backoff limit for executor job | ||
|
|
||
| Note: | ||
| Below are the mentioned environment variable with which these constants can be | ||
| configured, otherwise mentioned default will be assigned. | ||
|
|
||
| variable: | ||
| ENV_VARIABLE = default | ||
|
|
||
| FILER_IMAGE_NAME: | ||
| TESK_API_TASKMASTER_FILER_IMAGE_NAME = docker.io/elixircloud/tesk-core-filer | ||
| FILER_IMAGE_VERSION: | ||
| TESK_API_TASKMASTER_FILER_IMAGE_VERSION = latest | ||
| TASKMASTER_IMAGE_NAME: | ||
| TESK_API_TASKMASTER_IMAGE_NAME = docker.io/elixircloud/tesk-core-taskmaster | ||
| TASKMASTER_IMAGE_VERSION: | ||
| TESK_API_TASKMASTER_IMAGE_VERSION = latest | ||
| TESK_NAMESPACE: | ||
| TESK_API_K8S_NAMESPACE = tesk | ||
| TASKMASTER_SERVICE_ACCOUNT_NAME: | ||
| TESK_API_TASKMASTER_SERVICE_ACCOUNT_NAME = taskmaster | ||
| TASKMASTER_ENVIRONMENT_EXECUTOR_BACKOFF_LIMIT: | ||
| ENVIRONMENT_EXECUTOR_BACKOFF_LIMIT = 6 | ||
| FILER_BACKOFF_LIMIT: | ||
| FILER_BACKOFF_LIMIT = 2 | ||
| EXECUTOR_BACKOFF_LIMIT: | ||
| EXECUTOR_BACKOFF_LIMIT = 2 | ||
| """ | ||
|
|
||
| FILER_IMAGE_NAME: str = os.getenv( | ||
| "TESK_API_TASKMASTER_FILER_IMAGE_NAME", "docker.io/elixircloud/tesk-core-filer" | ||
| ) | ||
| FILER_IMAGE_VERSION: str = os.getenv( | ||
| "TESK_API_TASKMASTER_FILER_IMAGE_VERSION", "latest" | ||
| ) | ||
| TASKMASTER_IMAGE_NAME: str = os.getenv( | ||
| "TESK_API_TASKMASTER_IMAGE_NAME", "docker.io/elixircloud/tesk-core-taskmaster" | ||
| ) | ||
| TASKMASTER_IMAGE_VERSION: str = os.getenv( | ||
| "TESK_API_TASKMASTER_IMAGE_VERSION", "latest" | ||
| ) | ||
| TESK_NAMESPACE: str = os.getenv("TESK_API_K8S_NAMESPACE", "tesk") | ||
| TASKMASTER_SERVICE_ACCOUNT_NAME: str = os.getenv( | ||
| "TESK_API_TASKMASTER_SERVICE_ACCOUNT_NAME", "taskmaster" | ||
| ) | ||
| TASKMASTER_ENVIRONMENT_EXECUTOR_BACKOFF_LIMIT: str = os.getenv( | ||
| "ENVIRONMENT_EXECUTOR_BACKOFF_LIMIT", "6" | ||
| ) | ||
| FILER_BACKOFF_LIMIT: str = os.getenv("FILER_BACKOFF_LIMIT", "2") | ||
| EXECUTOR_BACKOFF_LIMIT: str = os.getenv("EXECUTOR_BACKOFF_LIMIT", "2") | ||
|
|
||
| class Config: | ||
| """Configuration for class.""" | ||
|
|
||
| frozen = True | ||
|
|
||
|
|
||
| tesk_constants = TeskConstants() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| """Kubernetes API module for TESK.""" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.