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

Commit

Permalink
Merge 5505c1c into 745413a
Browse files Browse the repository at this point in the history
  • Loading branch information
Diego committed Oct 8, 2019
2 parents 745413a + 5505c1c commit e43da6e
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 8 deletions.
21 changes: 17 additions & 4 deletions reana_cluster/backends/kubernetes/k8s.py
Expand Up @@ -52,6 +52,8 @@ def __init__(self,
cephfs=False,
cephfs_volume_size=None,
cephfs_storageclass=None,
cephfs_os_share_id=None,
cephfs_os_share_access_id=None,
cvmfs=False,
debug=False,
url=None,
Expand All @@ -78,6 +80,8 @@ def __init__(self,
:param cephfs_volume_size: Int number which represents cephfs volume
size (GB)
:param cephfs_storageclass: Name of an existing cephfs storageclass.
:param cephfs_os_share_id: TODO
:param cephfs_os_share_access_id: TODO
: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 @@ -117,6 +121,8 @@ def __init__(self,
cephfs=cephfs,
cephfs_volume_size=cephfs_volume_size,
cephfs_storageclass=cephfs_storageclass,
cephfs_os_share_id=cephfs_os_share_id,
cephfs_os_share_access_id=cephfs_os_share_access_id,
debug=debug,
url=url,
ui=ui)
Expand Down Expand Up @@ -151,10 +157,13 @@ def current_kubeconfig(self):
return self.kubeconfig

@classmethod
def generate_configuration(cls, cluster_spec, cvmfs=False, cephfs=False,
cephfs_volume_size=None,
cephfs_storageclass=None,
debug=False, url=None, ui=None):
def generate_configuration(
cls, cluster_spec, cvmfs=False, cephfs=False,
cephfs_volume_size=None,
cephfs_storageclass=None,
cephfs_os_share_id=None,
cephfs_os_share_access_id=None,
debug=False, url=None, ui=None):
"""Generate Kubernetes manifest files used to init REANA cluster.
:param cluster_spec: Dictionary representing complete REANA
Expand All @@ -163,6 +172,8 @@ def generate_configuration(cls, cluster_spec, cvmfs=False, cephfs=False,
deployed with CEPH or not.
:param cephfs_volume_size: Int to set CEPH volume size in GB.
:param cephfs_storageclass: Name of an existing cephfs storageclass.
:param cephfs_os_share_id: TODO
:param cephfs_os_share_access_id: TODO
:param cvmfs: Boolean which represents whether REANA is
deployed with CVMFS or not.
:param debug: Boolean which represents whether REANA is
Expand Down Expand Up @@ -263,6 +274,8 @@ def generate_configuration(cls, cluster_spec, cvmfs=False, cephfs=False,
CEPHFS_VOLUME_SIZE=cephfs_volume_size or 1,
CEPHFS_STORAGECLASS=cephfs_storageclass or
'geneva-cephfs-testing',
CEPHFS_OS_SHARE_ID=cephfs_os_share_id,
CEPHFS_OS_SHARE_ACCESS_ID=cephfs_os_share_access_id,
SERVER_IMAGE=rs_img,
WORKFLOW_CONTROLLER_IMAGE=rwfc_img,
MESSAGE_BROKER_IMAGE=rmb_img,
Expand Down
Expand Up @@ -10,5 +10,3 @@ spec:
requests:
storage: {{CEPHFS_VOLUME_SIZE}}G
storageClassName: {{CEPHFS_STORAGECLASS}}
mountOptions:
- nonempty
Expand Up @@ -18,3 +18,7 @@ parameters:
protocol: CEPHFS
backend: csi-cephfs
csi-driver: csi-cephfsplugin
{% if CEPHFS_OS_SHARE_ID and CEPHFS_OS_SHARE_ACCESS_ID %}
osShareID: {{CEPHFS_OS_SHARE_ID}}
osShareAccessID: {{CEPHFS_OS_SHARE_ACCESS_ID}}
{% endif %}
15 changes: 13 additions & 2 deletions reana_cluster/cli/__init__.py
Expand Up @@ -61,6 +61,12 @@ def __init__(self):
@click.option(
'--cephfs-storageclass',
help='A preset cephfs storageclass.')
@click.option(
'--cephfs-os-share-id',
help='Manila share id.')
@click.option(
'--cephfs-os-share-access-id',
help='Manila share access id.')
@click.option(
'--debug', is_flag=True,
help='If set, deploy REANA in debug mode.')
Expand All @@ -73,7 +79,8 @@ def __init__(self):
help='Deploy the REANA-UI inside the REANA Cluster.')
@click.pass_context
def cli(ctx, loglevel, skip_validation, file,
cephfs, cephfs_volume_size, cephfs_storageclass, debug, url, ui):
cephfs, cephfs_volume_size, cephfs_storageclass, cephfs_os_share_id,
cephfs_os_share_access_id, debug, url, ui):
"""Command line application for managing a REANA cluster."""
logging.basicConfig(
format=DEBUG_LOG_FORMAT if loglevel == 'debug' else LOG_FORMAT,
Expand All @@ -83,7 +90,9 @@ def cli(ctx, loglevel, skip_validation, file,
try:
cluster_spec = load_spec_file(click.format_filename(file),
skip_validation)
if (cephfs_volume_size or cephfs_storageclass) and not cephfs:
cephfs_options = [cephfs_volume_size, cephfs_storageclass,
cephfs_os_share_id, cephfs_os_share_access_id]
if any(cephfs_options) and not cephfs:
cephfs_volume_size = None
cephfs_storageclass = None
click.echo(click.style('CEPHFS configuration not taken into '
Expand All @@ -101,6 +110,8 @@ def cli(ctx, loglevel, skip_validation, file,
cephfs=cephfs,
cephfs_volume_size=cephfs_volume_size,
cephfs_storageclass=cephfs_storageclass,
cephfs_os_share_id=cephfs_os_share_id,
cephfs_os_share_access_id=cephfs_os_share_access_id,
debug=debug,
url=url,
ui=ui)
Expand Down

0 comments on commit e43da6e

Please sign in to comment.