Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pypelines
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HaissLab
Data Management
Pypelines
Commits
77af8432
Commit
77af8432
authored
1 year ago
by
Timothe Jost
Browse files
Options
Downloads
Patches
Plain Diff
fixing some errors
parent
b4510e62
No related branches found
No related tags found
No related merge requests found
Pipeline
#127820
passed
1 year ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/pypelines/__init__.py
+1
-1
1 addition, 1 deletion
src/pypelines/__init__.py
src/pypelines/celery_tasks.py
+17
-4
17 additions, 4 deletions
src/pypelines/celery_tasks.py
with
18 additions
and
5 deletions
src/pypelines/__init__.py
+
1
−
1
View file @
77af8432
__version__
=
"
0.0.5
0
"
__version__
=
"
0.0.5
1
"
from
.
import
loggs
from
.
import
loggs
from
.pipes
import
*
from
.pipes
import
*
...
...
This diff is collapsed.
Click to expand it.
src/pypelines/celery_tasks.py
+
17
−
4
View file @
77af8432
...
@@ -443,10 +443,13 @@ def create_celery_app(conf_path, app_name="pypelines", v_host=None) -> "Celery |
...
@@ -443,10 +443,13 @@ def create_celery_app(conf_path, app_name="pypelines", v_host=None) -> "Celery |
registered_tasks
=
self
.
control
.
inspect
().
registered_tasks
()
registered_tasks
=
self
.
control
.
inspect
().
registered_tasks
()
workers
=
[]
workers
=
[]
task_names
=
[]
task_names
=
[]
for
worker
,
tasks
in
registered_tasks
.
items
():
if
registered_tasks
:
workers
.
append
(
worker
)
for
worker
,
tasks
in
registered_tasks
.
items
():
for
task
in
tasks
:
workers
.
append
(
worker
)
task_names
.
append
(
task
)
for
task
in
tasks
:
task_names
.
append
(
task
)
return
{
"
workers
"
:
workers
,
"
task_names
"
:
task_names
}
def
get_celery_app_tasks
(
self
,
refresh
=
False
):
def
get_celery_app_tasks
(
self
,
refresh
=
False
):
...
@@ -503,6 +506,15 @@ def create_celery_app(conf_path, app_name="pypelines", v_host=None) -> "Celery |
...
@@ -503,6 +506,15 @@ def create_celery_app(conf_path, app_name="pypelines", v_host=None) -> "Celery |
)
)
return
task_record
return
task_record
def
is_hand_shaken
(
self
):
try
:
result
=
self
.
tasks
[
f
"
{
app_name
}
.handshake
"
].
delay
(
app_name
).
get
(
timeout
=
1
)
logger
.
warning
(
f
"
Handshake result :
{
result
}
"
)
return
True
except
ValueError
:
logger
.
error
(
"
No handshake result. All workers are busy ?
"
)
return
False
settings_files
=
get_setting_files_path
(
conf_path
)
settings_files
=
get_setting_files_path
(
conf_path
)
if
len
(
settings_files
)
==
0
:
if
len
(
settings_files
)
==
0
:
...
@@ -563,6 +575,7 @@ def create_celery_app(conf_path, app_name="pypelines", v_host=None) -> "Celery |
...
@@ -563,6 +575,7 @@ def create_celery_app(conf_path, app_name="pypelines", v_host=None) -> "Celery |
app
.
get_remote_tasks
=
MethodType
(
get_remote_tasks
,
app
)
# type: ignore
app
.
get_remote_tasks
=
MethodType
(
get_remote_tasks
,
app
)
# type: ignore
app
.
get_celery_app_tasks
=
MethodType
(
get_celery_app_tasks
,
app
)
# type: ignore
app
.
get_celery_app_tasks
=
MethodType
(
get_celery_app_tasks
,
app
)
# type: ignore
app
.
launch_named_task_remotely
=
MethodType
(
launch_named_task_remotely
,
app
)
# type: ignore
app
.
launch_named_task_remotely
=
MethodType
(
launch_named_task_remotely
,
app
)
# type: ignore
app
.
is_hand_shaken
=
MethodType
(
is_hand_shaken
,
app
)
# type: ignore
logger
.
info
(
f
"
The celery app
{
app_name
}
was created successfully.
"
)
logger
.
info
(
f
"
The celery app
{
app_name
}
was created successfully.
"
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment