Skip to content

Commit

Permalink
volume_templates: cephfs template pvc
Browse files Browse the repository at this point in the history
Signed-off-by: Dinos Kousidis <dinos.kousidis@cern.ch>
  • Loading branch information
dinosk committed Sep 14, 2018
1 parent 6397ec0 commit 4bf25ff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 23 deletions.
3 changes: 0 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,5 @@ ARG DEBUG=false

RUN if [ "${DEBUG}" = "true" ]; then pip install -r requirements-dev.txt; pip install -e .; else pip install .; fi;

RUN adduser --uid 1000 --disabled-password --gecos '' reanauser && \
chown -R reanauser:reanauser /code
USER reanauser
EXPOSE 5000
CMD ["python", "reana_job_controller/app.py"]
28 changes: 8 additions & 20 deletions reana_job_controller/volume_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,13 @@
'geant4': 'geant4.cern.ch'
}

K8S_CEPHFS_TEMPLATE = Template("""{
"name": "$experiment-shared-volume",
"cephfs": {
"monitors": [
"128.142.36.227:6790",
"128.142.39.77:6790",
"128.142.39.144:6790"
],
"path": "$path",
"user": "k8s",
"secretRef": {
"name": "$secret_name",
"readOnly": false
}
}
}""")
K8S_CEPHFS_TEMPLATE = """{
"name": "reana-shared-volume",
"persistentVolumeClaim": {
"claimName": "manila-cephfs-pvc"
},
"readOnly": "false"
}"""

K8S_CVMFS_TEMPLATE = Template("""{
"name": "cvmfs-$experiment",
Expand Down Expand Up @@ -96,10 +87,7 @@ def get_k8s_cephfs_volume(experiment):
:returns: k8s CephFS volume spec as a dictionary.
"""
return json.loads(
K8S_CEPHFS_TEMPLATE.substitute(
experiment=experiment,
path=SHARED_FS_MAPPING['MOUNT_SOURCE_PATH'],
secret_name=CEPHFS_SECRET_NAME)
K8S_CEPHFS_TEMPLATE
)


Expand Down

0 comments on commit 4bf25ff

Please sign in to comment.