Skip to content

Draft PR - Kubernetes based interactive tools integration in openVRE - #59

Open
yasirmaqsood wants to merge 17 commits into
inab:devfrom
yasirmaqsood:kubernetes-interactive-with-guacamole
Open

yasirmaqsood wants to merge 17 commits into
inab:devfrom
yasirmaqsood:kubernetes-interactive-with-guacamole

Conversation

@yasirmaqsood

Copy link
Copy Markdown
Collaborator

This is the draft PR to review changes made in openVRE to embed changes for interactive tools to be run on kubernetes setup. The code was updated to handle interactive tools of both types i.e web apps and desktop apps (handled by guacamole).

@nicodr97
nicodr97 marked this pull request as ready for review November 9, 2026 10:14

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is not used anywhere

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not having the intermediate page as the rest of the interactive tools and dealing with the exact URL redirection at front_end/openVRE/public/phplib/interactive_tools.inc.php?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplify functions using auxiliar functions if needed and split file to avoid having more than ~200 lines, 400 max.

}


protected function enqueueInteractiveK8s($tool, $cpus, $memory)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$cpus and $memory are not used

$dataDir = $user['id'] . "/" . $user['activeProject'];
$dataDirP = $GLOBALS['dataDir'] . "/" . $dataDir;

foreach ($tool['infrastructure']['volumes'] as $hostDir => $containerDir) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$containerDir is not used. Should it be part of the volume map as it is for Docker?

}

if (is_null($launcherType) && is_numeric($pid)) {
if (strpos((string)$pid, "openvre-ix-") === 0) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not checking only $launcherType == "kubernetes_interactive"?

throw new NotFoundException("Job ID not provided.");
}

if (strpos((string)$pid, "openvre-ix-") === 0) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not checking only $launcherType == "kubernetes_interactive"?

mkdir("$dataDirP/repository", 0775);
}

// RStudio workspace .

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this. Interactive tool folder is created at registerToolVolumeDirs

? $userInfo['roles']
: explode(',', (string)$userInfo['roles']);
} else {
$user['roles'] = $user['roles'] ?? [];

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User roles should come from the OIDC token. If no roles are present we should not keep the old ones.

$user['lastLogin'] = moment();
$user['secretsId'] = $userInfo['sub'];
$user['roles'] = explode(',', $userInfo['roles']);
$user['secretsId'] = $userInfo['sub'] ?? ($user['secretsId'] ?? '');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sub attribute in OIDC token should always be present

$projects = getProjects_byOwner();
syncProjectFiles($projects);

// Sync rstudio_data files from disk into Mongo.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this. It is done before an interactive tool is run

Comment thread front_end/Dockerfile.k8s

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this Dockerfile is almost identical to the one of front_end service, keep one Dockerfile and use some ARG that reads from the env file for steps that differ. Remember to do the check in setup.sh also.

Comment thread front_end/setup-k8s.sh

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread scheduler/app.py

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simplify functions using auxiliar functions if needed and split file to avoid having more than ~200 lines, 400 max.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants