Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
Merge 53bd80b into 7858fea
Browse files Browse the repository at this point in the history
  • Loading branch information
Dinos Kousidis committed Feb 6, 2019
2 parents 7858fea + 53bd80b commit 8520e27
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 103 deletions.
11 changes: 1 addition & 10 deletions reana_cluster/backends/kubernetes/k8s.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ def __init__(self,
kubeconfig=None,
kubeconfig_context=None,
cephfs=False,
cvmfs=False,
debug=False):
"""Initialise Kubernetes specific ReanaBackend-object.
Expand All @@ -69,8 +68,6 @@ def __init__(self,
current_context from config file will be used.
:param cephfs: Boolean flag toggling the usage of a cephfs volume as
storage backend.
:param cvmfs: Boolean flag toggling the mounting of cvmfs volumes in
the cluster pods.
:param debug: Boolean flag setting debug mode.
"""
Expand Down Expand Up @@ -103,7 +100,6 @@ def __init__(self,
self.cluster_spec = cluster_spec
self.cluster_conf = cluster_conf or \
self.generate_configuration(cluster_spec,
cvmfs=cvmfs,
cephfs=cephfs,
debug=debug)

Expand Down Expand Up @@ -137,16 +133,14 @@ def current_kubeconfig(self):
return self.kubeconfig

@classmethod
def generate_configuration(cls, cluster_spec, cvmfs=False,
def generate_configuration(cls, cluster_spec,
cephfs=False, debug=False):
"""Generate Kubernetes manifest files used to init REANA cluster.
:param cluster_spec: Dictionary representing complete REANA
cluster spec file.
:param cephfs: Boolean which represents whether REANA is
deployed with CEPH or not.
:param cvmfs: Boolean which represents whether REANA is
deployed with CVMFS or not.
:param debug: Boolean which represents whether REANA is
deployed in debug mode or not.
Expand All @@ -169,9 +163,6 @@ def generate_configuration(cls, cluster_spec, cvmfs=False,
# Load backend conf params
backend_conf_parameters = yaml.load(f.read())
# change type of deployment (cephfs|cvmfs|hostpath)
if cvmfs or cluster_spec['cluster'].get('cvmfs'):
backend_conf_parameters['CVMFS'] = True

if cephfs or cluster_spec['cluster'].get('cephfs'):
backend_conf_parameters['CEPHFS'] = True

Expand Down
2 changes: 2 additions & 0 deletions reana_cluster/backends/kubernetes/templates/backend_conf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
{% include 'storageclasses/cvmfs-atlas.yaml' %}
{% include 'storageclasses/cvmfs-alice.yaml' %}
{% include 'storageclasses/cvmfs-lhcb.yaml' %}
{% include 'storageclasses/cvmfs-fcc.yaml' %}
{% include 'persistentvolumeclaims/ceph.yaml' %}
{% include 'persistentvolumeclaims/cvmfs-cms.yaml' %}
{% include 'persistentvolumeclaims/cvmfs-atlas.yaml' %}
{% include 'persistentvolumeclaims/cvmfs-lhcb.yaml' %}
{% include 'persistentvolumeclaims/cvmfs-alice.yaml' %}
{% include 'persistentvolumeclaims/cvmfs-fcc.yaml' %}
{%- else %}
{% include 'deployments/wdb-template.yaml' %}
{%- endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@ spec:
mountPath: "/var/run/secrets/kubernetes.io/serviceaccount"
- name: reana-shared-volume
mountPath: {{SHARED_VOLUME_PATH}}
{%- if CVMFS %}
- name: cms-cvmfs-volume
mountPath: /cvmfs/cms.cern.ch
- name: atlas-cvmfs-volume
mountPath: /cvmfs/atlas.cern.ch
- name: alice-cvmfs-volume
mountPath: /cvmfs/alice.cern.ch
- name: lhcb-cvmfs-volume
mountPath: /cvmfs/lhcb.cern.ch
{% endif %}
{% set mountpoints=RJC_MOUNTPOINTS %}
{% for mount in mountpoints %}
- mountPath: {{mount['path'].split(':')[1]}}
Expand Down Expand Up @@ -64,24 +54,6 @@ spec:
hostPath:
path: {{ROOT_PATH}}
{% endif %}
{% if CVMFS %}
- name: cms-cvmfs-volume
persistentVolumeClaim:
claimName: csi-cvmfs-cms-pvc
readOnly: true
- name: atlas-cvmfs-volume
persistentVolumeClaim:
claimName: csi-cvmfs-atlas-pvc
readOnly: true
- name: lhcb-cvmfs-volume
persistentVolumeClaim:
claimName: csi-cvmfs-lhcb-pvc
readOnly: true
- name: alice-cvmfs-volume
persistentVolumeClaim:
claimName: csi-cvmfs-alice-pvc
readOnly: true
{% endif %}
- name: svaccount
secret:
secretName: {{K8S_APISERVER_SECRET}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ spec:
volumeMounts:
- mountPath: {{SHARED_VOLUME_PATH}}
name: reana-shared-volume
{%- if CVMFS %}
- name: cms-cvmfs-volume
mountPath: /cvmfs/cms.cern.ch
- name: atlas-cvmfs-volume
mountPath: /cvmfs/atlas.cern.ch
- name: alice-cvmfs-volume
mountPath: /cvmfs/alice.cern.ch
- name: lhcb-cvmfs-volume
mountPath: /cvmfs/lhcb.cern.ch
{% endif %}
{% set mountpoints=RS_MOUNTPOINTS %}
{% for mount in mountpoints %}
- mountPath: {{mount['path'].split(':')[1]}}
Expand Down Expand Up @@ -79,24 +69,6 @@ spec:
hostPath:
path: {{ROOT_PATH}}
{% endif %}
{% if CVMFS %}
- name: cms-cvmfs-volume
persistentVolumeClaim:
claimName: csi-cvmfs-cms-pvc
readOnly: true
- name: atlas-cvmfs-volume
persistentVolumeClaim:
claimName: csi-cvmfs-atlas-pvc
readOnly: true
- name: lhcb-cvmfs-volume
persistentVolumeClaim:
claimName: csi-cvmfs-lhcb-pvc
readOnly: true
- name: alice-cvmfs-volume
persistentVolumeClaim:
claimName: csi-cvmfs-alice-pvc
readOnly: true
{% endif %}
{% for mount in mountpoints %}
- name: {{mount['name']}}
{{mount['type']}}:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ spec:
env:
- name: REANA_DEPLOYMENT_TYPE
value: {{DEPLOYMENT}}
{% if CVMFS %}
- name: REANA_MOUNT_CVMFS
value: "true"
{% endif %}
{% if CEPHFS %}
- name: REANA_STORAGE_BACKEND
value: "cephfs"
Expand All @@ -58,16 +54,6 @@ spec:
volumeMounts:
- mountPath: {{SHARED_VOLUME_PATH}}
name: reana-shared-volume
{%- if CVMFS %}
- name: cms-cvmfs-volume
mountPath: /cvmfs/cms.cern.ch
- name: atlas-cvmfs-volume
mountPath: /cvmfs/atlas.cern.ch
- name: alice-cvmfs-volume
mountPath: /cvmfs/alice.cern.ch
- name: lhcb-cvmfs-volume
mountPath: /cvmfs/lhcb.cern.ch
{% endif %}
env:
{% set environment=RWFC_ENVIRONMENT %}
{% for envvar in environment %}
Expand All @@ -86,24 +72,6 @@ spec:
hostPath:
path: {{ROOT_PATH}}
{% endif %}
{% if CVMFS %}
- name: cms-cvmfs-volume
persistentVolumeClaim:
claimName: csi-cvmfs-cms-pvc
readOnly: true
- name: atlas-cvmfs-volume
persistentVolumeClaim:
claimName: csi-cvmfs-atlas-pvc
readOnly: true
- name: lhcb-cvmfs-volume
persistentVolumeClaim:
claimName: csi-cvmfs-lhcb-pvc
readOnly: true
- name: alice-cvmfs-volume
persistentVolumeClaim:
claimName: csi-cvmfs-alice-pvc
readOnly: true
{% endif %}
- name: svaccount
secret:
secretName: {{K8S_APISERVER_SECRET}}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: csi-cvmfs-fcc-pvc
spec:
accessModes:
- ReadOnlyMany
resources:
requests:
storage: 1G
storageClassName: csi-cvmfs-fcc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: csi-cvmfs-fcc
provisioner: csi-cvmfsplugin
parameters:
repository: fcc.cern.ch
6 changes: 1 addition & 5 deletions reana_cluster/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,14 @@ def __init__(self):
'--skip-validation', is_flag=True,
help='If set, specifications file is not validated before '
'starting the initialization.')
@click.option(
'--cvmfs', is_flag=True,
help='Specify cvmfs mounts for the pods in the cluster and jobs.')
@click.option(
'--cephfs', is_flag=True,
help='Set cephfs volume for cluster storage.')
@click.option(
'--debug', is_flag=True,
help='If set, deploy REANA in debug mode.')
@click.pass_context
def cli(ctx, loglevel, skip_validation, file, cvmfs, cephfs, debug):
def cli(ctx, loglevel, skip_validation, file, cephfs, debug):
"""Command line application for managing a REANA cluster."""
logging.basicConfig(
format=DEBUG_LOG_FORMAT if loglevel == 'debug' else LOG_FORMAT,
Expand All @@ -82,7 +79,6 @@ def cli(ctx, loglevel, skip_validation, file, cvmfs, cephfs, debug):
"specifications file is '{}'"
.format(cluster_type))
ctx.obj.backend = supported_backends[cluster_type](cluster_spec,
cvmfs=cvmfs,
cephfs=cephfs,
debug=debug)

Expand Down

0 comments on commit 8520e27

Please sign in to comment.