Skip to content

Commit

Permalink
EBR-58: refactor code after pyunicore upgrade version
Browse files Browse the repository at this point in the history
  • Loading branch information
915-Misan-Teodora committed Sep 11, 2024
1 parent 9247195 commit 840232d
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 149 deletions.
167 changes: 31 additions & 136 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 7 additions & 8 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,12 @@ const xircuits: JupyterFrontEndPlugin<void> = {

try {
let command_str = cfg['command'] + " " + path + " " + cfg['run_config_name']
+ " " + "'" + cfg['project'] + "'"
+ " " + cfg['project']
+ " " + cfg['stage-out']
+ " " + "'" + cfg['filesystem'] + "'"
+ " " + "'" + cfg['python'] + "'"
+ " " + "'" + cfg['modules'] + "'"
+ " " + "'" + cfg['libraries'] + "'" ;
+ " " + cfg['filesystem']
+ " " + cfg['python']
+ " " + cfg['modules']
+ " " + cfg['libraries'];
let code_str = "\nfrom subprocess import Popen, PIPE\n\n";

code_str += `command_str= "${command_str}"\n`;
Expand Down Expand Up @@ -300,15 +300,14 @@ const xircuits: JupyterFrontEndPlugin<void> = {
await createPanel();
}

// Convert the model_path to be bash aware
model_path = `"${model_path}"`

outputPanel.session.ready.then(async () => {
let code = startRunOutputStr();
if (runType == 'remote-run') {
// Run subprocess when run type is Remote Run
code += doRemoteRun(model_path, config);
} else {
// Convert the model_path to be bash aware
model_path = `"${model_path}"`
code += `%run ${model_path} ${message} ${debug_mode}`
}

Expand Down
6 changes: 3 additions & 3 deletions tvbextxircuits/hpc_config/pyunicore_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
from urllib.error import HTTPError
import pyunicore.client as unicore_client
import requests
from pyunicore.helpers.jobs import Status as unicore_status
from pyunicore.credentials import AuthenticationFailedException
from pyunicore.client import JobStatus as unicore_status
from pyunicore.credentials import AuthenticationFailedException, OIDCToken
from tvb_ext_bucket.ebrains_drive_wrapper import BucketWrapper
from tvb_ext_bucket.exceptions import CollabAccessError
from tvbwidgets.core.auth import get_current_token
Expand Down Expand Up @@ -74,7 +74,7 @@ def _install_dependencies_command(self):

def connect_client(self):
LOGGER.info(f"Connecting to {self.site}...")
token = get_current_token()
token = OIDCToken(get_current_token())
transport = unicore_client.Transport(token)
registry = unicore_client.Registry(transport, unicore_client._HBP_REGISTRY_URL)

Expand Down
Loading

0 comments on commit 840232d

Please sign in to comment.