Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
job_controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
videoag
job_controller
Commits
aeefd324
Verified
Commit
aeefd324
authored
8 months ago
by
Dorian Koch
Browse files
Options
Downloads
Patches
Plain Diff
Use more resources for CutAndTranscode
parent
2118d34a
No related branches found
No related tags found
No related merge requests found
Pipeline
#6481
passed
8 months ago
Stage: deploy
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/jobs/cut_and_transcode.py
+1
-0
1 addition, 0 deletions
src/jobs/cut_and_transcode.py
src/jobs/wrapped_job.py
+9
-0
9 additions, 0 deletions
src/jobs/wrapped_job.py
src/kubernetes_api.py
+9
-10
9 additions, 10 deletions
src/kubernetes_api.py
with
19 additions
and
10 deletions
src/jobs/cut_and_transcode.py
+
1
−
0
View file @
aeefd324
...
@@ -43,6 +43,7 @@ class CutAndTranscode(WrappedJob):
...
@@ -43,6 +43,7 @@ class CutAndTranscode(WrappedJob):
def
config
(
self
)
->
ContainerConfig
:
def
config
(
self
)
->
ContainerConfig
:
cfg
=
ContainerConfig
(
image
=
"
registry.git.fsmpi.rwth-aachen.de/videoag_infra/production/dominic_render_video:latest
"
,
args
=
[
"
-C
"
,
self
.
in_dir
])
cfg
=
ContainerConfig
(
image
=
"
registry.git.fsmpi.rwth-aachen.de/videoag_infra/production/dominic_render_video:latest
"
,
args
=
[
"
-C
"
,
self
.
in_dir
])
cfg
.
mount_video_fs
(
"
/mnt/video_data
"
)
cfg
.
mount_video_fs
(
"
/mnt/video_data
"
)
cfg
.
resources
(
"
8
"
,
"
12Gi
"
)
return
cfg
return
cfg
def
prepare
(
self
,
cstate
:
"
ControllerState
"
):
def
prepare
(
self
,
cstate
:
"
ControllerState
"
):
...
...
This diff is collapsed.
Click to expand it.
src/jobs/wrapped_job.py
+
9
−
0
View file @
aeefd324
...
@@ -10,10 +10,19 @@ class ContainerConfig:
...
@@ -10,10 +10,19 @@ class ContainerConfig:
self
.
command
=
command
self
.
command
=
command
self
.
args
=
args
self
.
args
=
args
self
.
mount_video_fs_path
:
str
|
None
=
None
self
.
mount_video_fs_path
:
str
|
None
=
None
self
.
resources_dict
:
dict
|
None
=
None
def
mount_video_fs
(
self
,
mount_path
:
str
):
def
mount_video_fs
(
self
,
mount_path
:
str
):
self
.
mount_video_fs_path
=
mount_path
self
.
mount_video_fs_path
=
mount_path
def
resources
(
self
,
cpu
:
str
,
memory
:
str
):
self
.
resources_dict
=
{
"
limits
"
:
{
"
cpu
"
:
cpu
,
"
memory
"
:
memory
}
}
class
WrappedJob
(
Event
):
class
WrappedJob
(
Event
):
...
...
This diff is collapsed.
Click to expand it.
src/kubernetes_api.py
+
9
−
10
View file @
aeefd324
...
@@ -34,15 +34,7 @@ class K8sApi():
...
@@ -34,15 +34,7 @@ class K8sApi():
def
list_worker_jobs
(
self
)
->
V1JobList
:
def
list_worker_jobs
(
self
)
->
V1JobList
:
return
self
.
batch_v1
.
list_namespaced_job
(
NAMESPACE
,
label_selector
=
f
"
app=
{
WORKER_LABEL
}
"
)
return
self
.
batch_v1
.
list_namespaced_job
(
NAMESPACE
,
label_selector
=
f
"
app=
{
WORKER_LABEL
}
"
)
def
create_job
(
self
,
job
:
WrappedJob
,
resources
=
{}):
def
create_job
(
self
,
job
:
WrappedJob
):
default_res
=
{
"
limits
"
:
{
"
cpu
"
:
"
1
"
,
"
memory
"
:
"
1Gi
"
}
}
resources
=
{
**
default_res
,
**
resources
}
cfg
=
job
.
config
()
cfg
=
job
.
config
()
job_manifest
=
{
job_manifest
=
{
...
@@ -76,7 +68,12 @@ class K8sApi():
...
@@ -76,7 +68,12 @@ class K8sApi():
"
image
"
:
cfg
.
image
,
"
image
"
:
cfg
.
image
,
"
args
"
:
cfg
.
args
,
"
args
"
:
cfg
.
args
,
"
command
"
:
cfg
.
command
,
"
command
"
:
cfg
.
command
,
"
resources
"
:
resources
"
resources
"
:
{
"
limits
"
:
{
"
cpu
"
:
"
1
"
,
"
memory
"
:
"
1Gi
"
}
}
}
}
],
],
"
priorityClassName
"
:
"
videoag-worker-priority
"
,
"
priorityClassName
"
:
"
videoag-worker-priority
"
,
...
@@ -118,6 +115,8 @@ class K8sApi():
...
@@ -118,6 +115,8 @@ class K8sApi():
}
}
}
}
]
]
if
cfg
.
resources_dict
is
not
None
:
job_manifest
[
"
spec
"
][
"
template
"
][
"
spec
"
][
"
containers
"
][
0
][
"
resources
"
]
=
cfg
.
resources_dict
# print(f"Creating job with manifest: {json.dumps(job_manifest)}")
# print(f"Creating job with manifest: {json.dumps(job_manifest)}")
return
self
.
batch_v1
.
create_namespaced_job
(
NAMESPACE
,
job_manifest
)
return
self
.
batch_v1
.
create_namespaced_job
(
NAMESPACE
,
job_manifest
)
...
...
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