Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
jass
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor 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
Statistical-Genetics
jass
Commits
1d64718b
Commit
1d64718b
authored
2 years ago
by
Bryan BRANCOTTE
Browse files
Options
Downloads
Patches
Plain Diff
dump metadata in a celery task, backend serve the content of the metadata file
parent
cb1e05e5
No related branches found
No related tags found
1 merge request
!71
dump metadata in a celery task, backend serve the content of the metadata file
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
client/pages/projects/_id.vue
+1
-1
1 addition, 1 deletion
client/pages/projects/_id.vue
jass/models/project.py
+17
-0
17 additions, 0 deletions
jass/models/project.py
jass/server.py
+1
-1
1 addition, 1 deletion
jass/server.py
jass/tasks.py
+9
-0
9 additions, 0 deletions
jass/tasks.py
with
28 additions
and
2 deletions
client/pages/projects/_id.vue
+
1
−
1
View file @
1d64718b
...
...
@@ -598,7 +598,7 @@ methods:{
this
.
sharedUrl
=
"
http://
"
+
window
.
location
.
host
+
"
/projects/
"
+
this
.
project
.
id
;
console
.
log
(
this
.
project
.
id
);
this
.
status
=
result
.
status
;
if
(
result
.
status
.
worktable
===
"
READY
"
&&
!
this
.
isready
){
if
(
result
.
status
.
metadata
===
"
READY
"
&&
!
this
.
isready
){
await
this
.
$axios
.
$get
(
'
/projects/
'
+
this
.
project
.
id
+
"
/gencov
"
).
then
((
async
function
(
result2
)
{
this
.
gencov
=
result2
;
...
...
This diff is collapsed.
Click to expand it.
jass/models/project.py
+
17
−
0
View file @
1d64718b
...
...
@@ -218,6 +218,12 @@ class Project(BaseModel, abc.ABC):
def
get_project_summary_statistics
(
self
):
return
get_worktable_summary
(
self
.
get_worktable_path
())
def
get_metadata_file_path
(
self
):
"""
Get the path of the metadata json file
"""
return
os
.
path
.
join
(
self
.
get_folder_path
(),
"
metadata.json
"
)
def
get_project_nsnps
(
self
):
return
get_inittable_meta
(
self
.
get_worktable_path
())
...
...
@@ -270,6 +276,11 @@ class Project(BaseModel, abc.ABC):
if
filename
.
endswith
(
"
.png
"
):
os
.
remove
(
os
.
path
.
join
(
self
.
get_folder_path
(),
filename
))
have_removed_file
=
True
try
:
os
.
remove
(
self
.
get_metadata_file_path
())
have_removed_file
=
True
except
FileNotFoundError
:
pass
return
have_removed_file
@call_with_tb
(
'
global_manhattan
'
)
...
...
@@ -296,6 +307,12 @@ class Project(BaseModel, abc.ABC):
def
create_csv_file
(
self
):
return
create_genome_full_csv
(
self
.
get_worktable_path
(),
self
.
get_csv_path
())
@call_with_tb
(
'
metadata
'
)
def
create_project_metadata_file
(
self
):
with
open
(
self
.
get_metadata_file_path
(),
'
w
'
)
as
f
:
f
.
write
(
json
.
dumps
(
self
.
get_project_nsnps
()))
print
(
"
------ metadata -----
"
)
class
GlobalProject
(
Project
):
@call_with_tb
(
'
worktable
'
)
...
...
This diff is collapsed.
Click to expand it.
jass/server.py
+
1
−
1
View file @
1d64718b
...
...
@@ -106,7 +106,7 @@ def project_gencov_view(project_id: str):
@app.get
(
"
/api/projects/{project_id}/metadata
"
)
def
project_metadata
(
project_id
:
str
):
return
load_project
(
project_id
=
project_id
).
get_
project_nsnps
()
return
FileResponse
(
load_project
(
project_id
=
project_id
).
get_
metadata_file_path
()
)
@app.get
(
"
/api/projects/{project_id}/globalmanhattan
"
)
...
...
This diff is collapsed.
Click to expand it.
jass/tasks.py
+
9
−
0
View file @
1d64718b
...
...
@@ -79,6 +79,12 @@ def create_project_csv_file(project_id):
return
project
.
create_csv_file
()
@celery.task
def
create_project_metadata_file
(
project_id
):
project
=
GlobalProject
.
load
(
project_id
)
return
project
.
create_project_metadata_file
()
@celery.task
def
dummy_task
():
print
(
"
This task to nothing, but help the chain to have a valid status
"
)
...
...
@@ -124,6 +130,9 @@ def run_project_analysis_if_needed(project):
if
project
.
get_csv_path
()
and
not
os
.
path
.
exists
(
project
.
get_csv_path
()):
post_worktable_tasks
.
append
(
create_project_csv_file
.
si
(
project
.
id
))
if
project
.
get_metadata_file_path
()
and
not
os
.
path
.
exists
(
project
.
get_metadata_file_path
()):
post_worktable_tasks
.
append
(
create_project_metadata_file
.
si
(
project
.
id
))
if
len
(
tasks
)
+
len
(
post_worktable_tasks
)
==
0
:
return
main_wf
=
chain
(
...
...
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