Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions app/commands/entry_point.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,17 @@
from .file import file_resume

# Import custom commands
from .hpc import hpc_auth
from .hpc import hpc_get_node
from .hpc import hpc_get_partition
from .hpc import hpc_job_info
from .hpc import hpc_job_submit
from .hpc import hpc_list_nodes
from .hpc import hpc_list_partitions
from .kg_resource import kg_resource
from .project import project_list_all
from .use_config import set_env
from .user import login
from .user import logout

hpc_enabled = os.environ.get('PILOT_CLI_HPC_ENABLED', 'false') == 'true'
kg_enabled = os.environ.get('PILOT_CLI_KG_ENABLED', 'false') == 'true'


def command_groups():
commands = ['file', 'user', 'use_config', 'project', 'dataset', 'container_registry']
if hpc_enabled:
commands.append('hpc')
if kg_enabled:
commands.append('kg_resource')
return commands
Expand Down Expand Up @@ -114,20 +104,6 @@ def cr_group():
config_group.add_command(set_env)

# Custom commands
if hpc_enabled:

@entry_point.group(name='hpc')
def hpc_group():
pass

hpc_group.add_command(hpc_auth)
hpc_group.add_command(hpc_job_submit)
hpc_group.add_command(hpc_job_info)
hpc_group.add_command(hpc_list_nodes)
hpc_group.add_command(hpc_get_node)
hpc_group.add_command(hpc_list_partitions)
hpc_group.add_command(hpc_get_partition)

if kg_enabled:

@entry_point.group(name='kg_resource')
Expand Down
157 changes: 0 additions & 157 deletions app/commands/hpc.py

This file was deleted.

10 changes: 0 additions & 10 deletions app/configs/user_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ def __init__(self, config_path: Union[str, Path, None] = None, config_filename:
'access_token': '',
'refresh_token': '',
'secret': generate_secret(),
'hpc_token': '',
'last_active': int(time.time()),
'session_id': '',
}
Expand Down Expand Up @@ -100,7 +99,6 @@ def clear(self):
'api_key': '',
'access_token': '',
'refresh_token': '',
'hpc_token': '',
'secret': generate_secret(),
'last_active': 0,
'session_id': '',
Expand Down Expand Up @@ -158,14 +156,6 @@ def secret(self):
def secret(self, val):
self.config['USER']['secret'] = val

@property
def hpc_token(self):
return decryption(self.config['USER']['hpc_token'], self.secret)

@hpc_token.setter
def hpc_token(self, val):
self.config['USER']['hpc_token'] = encryption(val, self.secret)

@property
def last_active(self):
return self.config['USER']['last_active']
Expand Down
15 changes: 0 additions & 15 deletions app/models/convert_type.py

This file was deleted.

7 changes: 0 additions & 7 deletions app/models/service_meta_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,3 @@ def __new__(cls, name: str, bases, namespace, **kwargs):
if not name.startswith('Srv'):
raise TypeError('[Fatal] Invalid Service Statement: class name should start with "Srv"', name)
return super().__new__(cls, name, bases, namespace, **kwargs)


class HPCMetaService(type):
def __new__(cls, name: str, bases, namespace, **kwargs):
if not name.startswith('HPC'):
raise TypeError('[Fatal] Invalid Service Statement: class name should start with "Srv"', name)
return super().__new__(cls, name, bases, namespace, **kwargs)
92 changes: 0 additions & 92 deletions app/models/upload_form.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,98 +5,6 @@
from app.services.file_manager.file_upload.models import FileObject


class FileUploadForm:
def __init__(self):
self._attribute_map = {
'resumable_identifier': '',
'resumable_filename': '',
'resumable_chunk_number': -1,
'resumable_total_chunks': -1,
'resumable_total_size': -1,
'resumable_relative_path': '',
'tags': [],
'uploader': '',
'metadatas': None,
'container_id': '',
}

@property
def to_dict(self):
return self._attribute_map

@property
def resumable_identifier(self):
return self._attribute_map['resumable_identifier']

@resumable_identifier.setter
def resumable_identifier(self, resumable_identifier):
self._attribute_map['resumable_identifier'] = resumable_identifier

@property
def resumable_filename(self):
return self._attribute_map['resumable_filename']

@resumable_filename.setter
def resumable_filename(self, resumable_filename):
self._attribute_map['resumable_filename'] = resumable_filename

@property
def resumable_chunk_number(self):
return self._attribute_map['resumable_chunk_number']

@resumable_chunk_number.setter
def resumable_chunk_number(self, resumable_chunk_number):
self._attribute_map['resumable_chunk_number'] = resumable_chunk_number

@property
def resumable_total_chunks(self):
return self._attribute_map['resumable_total_chunks']

@resumable_total_chunks.setter
def resumable_total_chunks(self, resumable_total_chunks):
self._attribute_map['resumable_total_chunks'] = resumable_total_chunks

@property
def resumable_relative_path(self):
return self._attribute_map['resumable_relative_path']

@resumable_relative_path.setter
def resumable_relative_path(self, resumable_relative_path):
self._attribute_map['resumable_relative_path'] = resumable_relative_path.rstrip('/')

@property
def resumable_total_size(self):
return self._attribute_map['resumable_total_size']

@resumable_total_size.setter
def resumable_total_size(self, resumable_total_size):
self._attribute_map['resumable_total_size'] = resumable_total_size

@property
def tags(self):
return self._attribute_map['tags']

@tags.setter
def tags(self, tags):
self._attribute_map['tags'] = tags

@property
def uploader(self):
return self._attribute_map['uploader']

@uploader.setter
def uploader(self, uploader):
self._attribute_map['uploader'] = uploader

@property
def metadatas(self):
return self._attribute_map['metadatas']

@metadatas.setter
def metadatas(self, metadatas):
self._attribute_map['metadatas'] = metadatas


def generate_on_success_form(
project_code: str,
operator: str,
Expand Down
2 changes: 0 additions & 2 deletions app/resources/custom_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ class Error:
'DATASET_PERMISSION': 'You do not have permission to access this dataset',
'USER_DISABLED': 'User may not exist or has been disabled',
'OVER_SIZE': '%s is too large',
'CANNOT_AUTH_HPC': 'Cannot proceed with HPC authorization request',
'CANNOT_PROCESS_HPC_JOB': 'Cannot process with HPC: %s',
'CONTAINER_REGISTRY_HOST_INVALID': "Invalid host URL. Ensure host begins with 'http://' or 'https://'.",
'CONTAINER_REGISTRY_401': 'You lack valid authentication credentials for the requested resource.',
'CONTAINER_REGISTRY_403': 'You do not have permission to access this host or resource.',
Expand Down
13 changes: 0 additions & 13 deletions app/resources/custom_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,6 @@ class HelpPage:
'SET_CONFIG': 'Chose config file and set for cli.',
'CONFIG_DESTINATION': 'The destination the config file goes to, default will be current cli directory.',
},
'hpc': {
'HPC_AUTH': 'Authorize user to HPC with access token.',
'HPC_LOGIN_HOST': 'The host address for login HPC.',
'HPC_LOGIN_USERNAME': 'The username for login HPC.',
'HPC_LOGIN_PASSWORD': 'The password for login HPC.',
'HPC_TOKEN': 'The HPC token',
'HPC_SUBMIT': 'Submit a job to HPC',
'HPC_JOB_INFO': 'Get a job information',
'HPC_NODES': 'Get a list of nodes',
'HPC_GET_NODE': 'Get node information by node name',
'HPC_PARTITIONS': 'Get a list of partitions',
'HPC_GET_PARTITION': 'Get partition information by partition name',
},
'knowledge_graph': {
'KG_IMPORT': 'Import dataset schema into BlueBrainNexus ',
'KG_DATASET_CODE': 'The dataset code',
Expand Down
Loading