workflow.core 1.12.0__tar.gz → 1.12.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. {workflow_core-1.12.0 → workflow_core-1.12.2}/PKG-INFO +3 -3
  2. {workflow_core-1.12.0 → workflow_core-1.12.2}/README.md +1 -1
  3. {workflow_core-1.12.0 → workflow_core-1.12.2}/pyproject.toml +6 -8
  4. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/cli/run.py +15 -25
  5. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/lifecycle/configure.py +8 -2
  6. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/workspaces/chimefrb.yml +2 -1
  7. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/__init__.py +0 -0
  8. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/cli/__init__.py +0 -0
  9. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/cli/buckets.py +0 -0
  10. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/cli/configs.py +0 -0
  11. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/cli/main.py +0 -0
  12. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/cli/pipelines.py +0 -0
  13. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/cli/results.py +0 -0
  14. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/cli/schedules.py +0 -0
  15. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/cli/workspace.py +0 -0
  16. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/daemons/__init__.py +0 -0
  17. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/daemons/audit.py +0 -0
  18. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/daemons/transfer.py +0 -0
  19. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/definitions/__init__.py +0 -0
  20. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/definitions/config.py +0 -0
  21. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/definitions/jsonschema.md +0 -0
  22. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/definitions/notify.py +0 -0
  23. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/definitions/work.py +0 -0
  24. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/definitions/workspace.py +0 -0
  25. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/examples/autocomplete.py +0 -0
  26. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/examples/function.py +0 -0
  27. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/examples/sample.svg +0 -0
  28. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/examples/sample.workflow.yml +0 -0
  29. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/exceptions.py +0 -0
  30. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/helpers/__init__.py +0 -0
  31. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/helpers/date.py +0 -0
  32. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/http/__init__.py +0 -0
  33. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/http/buckets.py +0 -0
  34. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/http/client.py +0 -0
  35. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/http/configs.py +0 -0
  36. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/http/context.py +0 -0
  37. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/http/pipelines.py +0 -0
  38. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/http/results.py +0 -0
  39. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/http/schedules.py +0 -0
  40. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/lifecycle/__init__.py +0 -0
  41. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/lifecycle/archive/__init__.py +0 -0
  42. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/lifecycle/archive/http.py +0 -0
  43. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/lifecycle/archive/posix.py +0 -0
  44. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/lifecycle/archive/s3.py +0 -0
  45. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/lifecycle/attempt.py +0 -0
  46. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/lifecycle/execute.py +0 -0
  47. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/utils/__init__.py +0 -0
  48. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/utils/decorators.py +0 -0
  49. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/utils/format.py +0 -0
  50. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/utils/logger.py +0 -0
  51. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/utils/prompt.py +0 -0
  52. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/utils/read.py +0 -0
  53. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/utils/renderers.py +0 -0
  54. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/utils/tmate.sh +0 -0
  55. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/utils/validate.py +0 -0
  56. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/utils/variables.py +0 -0
  57. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/utils/write.py +0 -0
  58. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/workspaces/__init__.py +0 -0
  59. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/workspaces/development.yml +0 -0
  60. {workflow_core-1.12.0 → workflow_core-1.12.2}/workflow/workspaces/site-dev.yml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: workflow.core
3
- Version: 1.12.0
3
+ Version: 1.12.2
4
4
  Summary: Workflow Core
5
5
  License: MIT
6
6
  Author: Shiny Brar
@@ -20,11 +20,11 @@ Requires-Dist: docker (>=6.1)
20
20
  Requires-Dist: minio (>=7.2,<8.0)
21
21
  Requires-Dist: pydantic (>=2.0,<3.0)
22
22
  Requires-Dist: pydantic-settings (>=2.0,<3.0)
23
- Requires-Dist: python-logging-loki (>=0.3,<0.4)
24
23
  Requires-Dist: pyyaml (>=6.0,<7.0)
25
24
  Requires-Dist: requests (>=2.31,<3.0)
26
25
  Requires-Dist: rich (>=13.4,<14.0)
27
26
  Requires-Dist: tenacity (>=8.2,<9.0)
27
+ Requires-Dist: tjzegmott-python-logging-loki (>=0.0.1,<0.0.2)
28
28
  Requires-Dist: toml (>=0.10,<0.11)
29
29
  Project-URL: Documentation, https://chimefrb.github.io/workflow-docs/
30
30
  Project-URL: Repository, https://github.com/chimefrb/workflow
@@ -57,7 +57,7 @@ pip install git+https://github.com/chimefrb/workflow.git
57
57
  Alternatively, you can add the Workflow project as a dependency to your own project using Poetry:
58
58
 
59
59
  ```bash
60
- poetry add git+https://github.chime/chimefrb/workflow.git
60
+ poetry add git+https://github.com/chimefrb/workflow.git
61
61
  ```
62
62
 
63
63
  ## Contributing
@@ -25,7 +25,7 @@ pip install git+https://github.com/chimefrb/workflow.git
25
25
  Alternatively, you can add the Workflow project as a dependency to your own project using Poetry:
26
26
 
27
27
  ```bash
28
- poetry add git+https://github.chime/chimefrb/workflow.git
28
+ poetry add git+https://github.com/chimefrb/workflow.git
29
29
  ```
30
30
 
31
31
  ## Contributing
@@ -1,15 +1,13 @@
1
1
  [tool.poetry]
2
2
  name = "workflow.core"
3
- version = "1.12.0"
3
+ version = "1.12.2"
4
4
  description = "Workflow Core"
5
5
  authors = ["Shiny Brar <charanjotbrar@gmail.com>"]
6
6
  license = "MIT"
7
7
  readme = "README.md"
8
8
  repository = "https://github.com/chimefrb/workflow"
9
9
  documentation = "https://chimefrb.github.io/workflow-docs/"
10
- packages = [
11
- { include = "workflow", from = "." }
12
- ]
10
+ packages = [{ include = "workflow", from = "." }]
13
11
 
14
12
  [tool.poetry.dependencies]
15
13
  python = ">=3.8.1,<4.0"
@@ -22,9 +20,9 @@ toml = "^0.10"
22
20
  rich = "^13.4"
23
21
  minio = "^7.2"
24
22
  pydantic-settings = "^2.0"
25
- python-logging-loki = "^0.3"
26
23
  click-params = "^0.5"
27
24
  docker = ">=6.1"
25
+ tjzegmott-python-logging-loki = "^0.0.1"
28
26
 
29
27
  [tool.poetry.group.dev.dependencies]
30
28
  mypy = "*"
@@ -50,7 +48,7 @@ build-backend = "poetry.core.masonry.api"
50
48
  # Pytest Environment Variables
51
49
  [tool.pytest.ini_options]
52
50
  env = [
53
- "WORKFLOW_S3_ENDPOINT=play.min.io",
54
- "WORKFLOW_S3_ACCESS_KEY=Q3AM3UQ867SPQQA43P2F",
55
- "WORKFLOW_S3_SECRET_KEY=zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"
51
+ "WORKFLOW_S3_ENDPOINT=play.min.io",
52
+ "WORKFLOW_S3_ACCESS_KEY=Q3AM3UQ867SPQQA43P2F",
53
+ "WORKFLOW_S3_SECRET_KEY=zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",
56
54
  ]
@@ -196,31 +196,21 @@ def run(
196
196
  "[bold red]Backend Checks [/bold red]",
197
197
  extra=dict(markup=True, color="green"),
198
198
  )
199
- # Add pipeline and site to loki tags
200
- if config.get("logging", {}).get("loki", {}).get("tags", {}):
201
- # Loki tags exist, add pipeline and site
202
- config["logging"]["loki"]["tags"].update(
203
- {
204
- # Assumes that there is only one bucket
205
- "pipeline": buckets[0],
206
- "site": site,
207
- }
208
- )
209
- else:
210
- # Missing Logging config in Workspace
211
- config.update(
212
- {
213
- "logging": {
214
- "loki": {
215
- "tags": {
216
- # Assumes that there is only one bucket
217
- "pipeline": buckets[0],
218
- "site": site,
219
- }
220
- }
221
- }
222
- }
223
- )
199
+ # Add pipeline and site to loki tags, without clobbering the rest of the
200
+ # logging config in the workspace (e.g. loki headers).
201
+ logging_config: Dict[str, Any] = config.get("logging") or {}
202
+ loki_config: Dict[str, Any] = logging_config.get("loki") or {}
203
+ loki_tags: Dict[str, Any] = loki_config.get("tags") or {}
204
+ loki_tags.update(
205
+ {
206
+ # Assumes that there is only one bucket
207
+ "pipeline": buckets[0],
208
+ "site": site,
209
+ }
210
+ )
211
+ loki_config["tags"] = loki_tags
212
+ logging_config["loki"] = loki_config
213
+ config["logging"] = logging_config
224
214
  loki_status: bool = configure.loki(logger=logger, config=config)
225
215
  logger.info(f"Loki Logs: {'✅' if loki_status else '❌'}")
226
216
  http: HTTPContext = HTTPContext(backends=["buckets"])
@@ -61,6 +61,9 @@ def loki(logger: Logger, config: Dict[str, Any]) -> bool:
61
61
  urls: List[str] = []
62
62
  loki_urls: Optional[Any] = config.get("http", {}).get("baseurls", {}).get("loki")
63
63
  loki_tags: Optional[Any] = config.get("logging", {}).get("loki", {}).get("tags", {})
64
+ loki_headers: Optional[Any] = (
65
+ config.get("logging", {}).get("loki", {}).get("headers", {})
66
+ )
64
67
  if not loki_urls:
65
68
  return status
66
69
  elif isinstance(loki_urls, str):
@@ -74,10 +77,13 @@ def loki(logger: Logger, config: Dict[str, Any]) -> bool:
74
77
  for url in urls:
75
78
  try:
76
79
  status_code: int = requests.get(
77
- url.replace("loki/api/v1/push", "ready"), timeout=1
80
+ url.replace("loki/api/v1/push", "loki/api/v1/status/buildinfo"),
81
+ timeout=1,
78
82
  ).status_code
79
83
  if status_code == 200:
80
- loki_handler = LokiHandler(url=url, tags=loki_tags, version="1")
84
+ loki_handler = LokiHandler(
85
+ url=url, tags=loki_tags, headers=loki_headers, version="1"
86
+ )
81
87
  loki_handler.setFormatter(
82
88
  Formatter("%(levelname)s %(tag)s %(name)s %(message)s")
83
89
  )
@@ -28,7 +28,7 @@ http:
28
28
  schedules:
29
29
  - http://frb-vsop.chime:8007/v2
30
30
  - https://frb.chimenet.ca/workflow/pipelines/v2
31
- loki: https://frb.chimenet.ca/loki/loki/api/v1/push
31
+ loki: https://loki.chimefrb.xyz/loki/api/v1/push
32
32
  # This is the prefix url to make a output data plot or product accessible to the user
33
33
  products: https://frb.chimenet.ca/frb-master/v1/events/query-file?filename=
34
34
 
@@ -107,3 +107,4 @@ deployers:
107
107
  logging:
108
108
  loki:
109
109
  tags: {}
110
+ headers: { X-Scope-OrgID: chime }