Skip to content

Commit

Permalink
feat: alle jobber bruker litt disk
Browse files Browse the repository at this point in the history
100mb dekker 50%
  • Loading branch information
Kyrremann committed Feb 27, 2024
1 parent fd50ac6 commit e724c10
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dataverk_airflow/kubernetes_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def kubernetes_operator(
:param extra_envs: dict: dict with environment variables example: {"key": "value", "key2": "value2"}
:param allowlist: list: list of hosts and port the task needs to reach on the format host:port
:param requirements_path: bool: Path (including filename) to your requirements.txt
:param resources: dict: Specify cpu and memory resource usage (dict: request/limit: {"memory": "", "cpu": "", "ephemeral-storage": ""}), default None
:param resources: dict: Specify cpu and memory resource usage (dict: request/limit: {"memory": "", "cpu": "", "ephemeral-storage": ""}), default ephemeral-storage: 100Mi
:param startup_timeout_seconds: int: pod startup timeout
:param retries: int: Number of retries for task before DAG fails, default 3
:param delete_on_finish: bool: Whether to delete pod on completion
Expand Down Expand Up @@ -135,6 +135,11 @@ def on_failure(context):
allowlist.append("files.pythonhosted.org")
allowlist.append("pypi.python.org")

if resources is None or resources.ephemeral_storage is None:
resources = client.V1ResourceRequirements(
ephemeral_storage="100Mi"
)

return KubernetesPodOperator(
dag=dag,
on_failure_callback=on_failure,
Expand Down

0 comments on commit e724c10

Please sign in to comment.