Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ml_solar_plates
modern_pipeline
Modern Pipeline
Commits
79c89650
Commit
79c89650
authored
Oct 22, 2021
by
Yori Fournier
Browse files
started the generation of manifest for steps
parent
6d30dcb1
Changes
3
Hide whitespace changes
Inline
Side-by-side
manifests-template/multi-manifest.yaml
0 → 100644
View file @
79c89650
apiVersion
:
v1
kind
:
PersistentVolumeClaim
metadata
:
name
:
{{
project_name
}}
-artifacts-pv-claim
spec
:
storageClassName
:
manual
accessModes
:
-
ReadWriteOnce
resources
:
requests
:
storage
:
{{
artifacts_volume.storage_size
}}
---
apiVersion
:
v1
kind
:
PersistentVolumeClaim
metadata
:
name
:
{{
project_name
}}
-archives-pv-claim
spec
:
storageClassName
:
manual
accessModes
:
-
ReadWriteOnce
resources
:
requests
:
storage
:
{{
archives_volume.storage_size
}}
---
apiVersion
:
batch/v1
kind
:
Job
metadata
:
name
:
{{
job.step_name
}}
spec
:
template
:
spec
:
volumes
:
-
name
:
artifacts
persistentVolumeClaim
:
claimName
:
{{
project_name
}}
-artifacts-pv-claim
-
name
:
archives
persistentVolumeClaim
:
claimName
:
{{
project_name
}}
-archives-pv-claim
containers
:
-
name
:
{{
job.container.name
}}
image
:
{{
job.container.image
}}
imagePullPolicy
:
Never
volumeMounts
:
-
mountPath
:
{{
job.container.artifact_volume.mount_path
}}
name
:
artifacts
subPath
:
{{
job.container.artifact_volume.sub_path
}}
{
%
for n in range(job.container.deps_volume | length) -%
}
-
mountPath
:
{{
job.container.deps_volume
[
n
]
.mount_path
}}
name
:
artifacts
subPath
:
{{
job.container.deps_volume
[
n
]
.sub_path
}}
{
%
endfor %
}
{
%
- for n in range(job.container.archives_volume | length) -%
}
-
mountPath
:
{{
job.container.archives_volume
[
n
]
.mount_path
}}
name
:
archives
subPath
:
{{
job.container.archives_volume
[
n
]
.sub_path
}}
{
%
- endfor %
}
restartPolicy
:
Never
backoffLimit
:
1
\ No newline at end of file
manifests-template/populate_template.py
0 → 100644
View file @
79c89650
from
jinja2
import
Template
import
toml
with
open
(
'multi-manifest.yaml'
,
'r'
)
as
fd
:
template
=
Template
(
fd
.
read
())
with
open
(
'step_config.toml'
,
'r'
)
as
fd
:
config
=
toml
.
load
(
fd
)
#print(config)
rendered
=
template
.
render
(
**
config
)
print
(
rendered
)
# sources:
# https://stackoverflow.com/a/50557523
# https://stackoverflow.com/a/50333856
manifests-template/step_config.toml
0 → 100644
View file @
79c89650
project_name
=
"ml-solar-plates"
[artifacts_volume]
storage_size
=
"1Gi"
[archives_volume]
storage_size
=
"1Gi"
[job]
step_name
=
"select-features"
[job.artifacts_volume]
name
=
"artifacts"
[job.archives_volume]
name
=
"archives"
[job.container]
name
=
"select-features"
image
=
"select-features:latest"
[job.container.artifact_volume]
mount_path
=
"home/fournier/artifact/"
sub_path
=
"select-features-ghjdhsgd-ghsteydjs-hdjsksush"
[[job.container.deps_volume]]
mount_path
=
"home/fournier/extract-features/"
sub_path
=
"extract-features-ghjdhsgd-ghsteydjs-hdjsksush"
[[job.container.deps_volume]]
mount_path
=
"home/fournier/label-features/"
sub_path
=
"label-features-ghjdhsgd-ghsteydjs-hdjsksush"
[[job.container.archives_volume]]
mount_path
=
"home/fournier/archives/ml_solar_plates"
sub_path
=
"ml_solar_plates"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment