Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
workspaces
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
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ssa
workspaces
Merge requests
!518
back out almapipe changes
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
back out almapipe changes
relocatable_workflows
into
main
Overview
0
Commits
2
Pipelines
1
Changes
1
Merged
Charlotte Hausman
requested to merge
relocatable_workflows
into
main
3 years ago
Overview
0
Commits
2
Pipelines
1
Changes
1
Expand
0
0
Merge request reports
Viewing commit
162a0993
Prev
Next
Show latest version
1 file
+
19
−
15
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
162a0993
fix submit user for processing directory
· 162a0993
Charlotte Hausman
authored
3 years ago
shared/workspaces/workspaces/workflow/services/workflow_service.py
+
19
−
15
Options
@@ -281,12 +281,15 @@ class WorkflowService(WorkflowServiceIF):
:return: path to tmp folder
"""
vlapipe_id
=
6000
if
"
remote-cv
"
in
request
.
argument
:
user_id
=
9233
else
:
user_id
=
6000
temp_folder_path
=
self
.
processing_settings
.
rootDirectory
if
not
os
.
path
.
isdir
(
temp_folder_path
):
os
.
mkdir
(
temp_folder_path
)
temp_folder
=
Path
(
mkdtemp
(
dir
=
temp_folder_path
))
os
.
chown
(
temp_folder
,
vlapipe_id
,
vlapipe
_id
)
os
.
chown
(
temp_folder
,
user_id
,
user
_id
)
logger
.
info
(
"
Settled on temp folder %s
"
,
temp_folder
)
# set new directory as result_dir
request
.
results_dir
=
temp_folder
.
__str__
()
@@ -485,20 +488,21 @@ class WorkflowService(WorkflowServiceIF):
sets gid and uid of subprocess to those of the submituser so that jobs can be
properly submitted
"""
if
run_cv
:
# run as almapipe
submituser_gid
=
9233
submituser_uid
=
9233
os
.
setgid
(
submituser_gid
)
os
.
setuid
(
submituser_uid
)
else
:
# run as vlapipe
submituser_gid
=
6000
submituser_uid
=
6000
os
.
setgid
(
submituser_gid
)
os
.
setuid
(
submituser_uid
)
# if run_cv:
# run as almapipe
# submituser_gid = 9233
# submituser_uid = 9233
#
# os.setgid(submituser_gid)
# os.setuid(submituser_uid)
# else:
# run as vlapipe
submituser_gid
=
6000
submituser_uid
=
6000
os
.
setgid
(
submituser_gid
)
os
.
setuid
(
submituser_uid
)
@staticmethod
def
_get_job_logfile_name
(
jobfile_name
:
Path
)
->
Path
:
Loading