Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hipercow Linux Support #168

Open
wants to merge 26 commits into
base: main
Choose a base branch
from
Open

Hipercow Linux Support #168

wants to merge 26 commits into from

Conversation

weshinsley
Copy link
Contributor

No description provided.

Copy link

codecov bot commented Feb 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (bf31760) to head (666d9ce).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #168   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           27        27           
  Lines         2480      2481    +1     
=========================================
+ Hits          2480      2481    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@weshinsley weshinsley changed the title hipercow_hello works Hipercow Linux Support Feb 22, 2025
@weshinsley weshinsley requested a review from richfitz February 26, 2025 15:40
@weshinsley weshinsley marked this pull request as ready for review February 26, 2025 15:40
Copy link
Member

@richfitz richfitz left a comment

Choose a reason for hiding this comment

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

The biggest concern I have is that the linux platform support is still to obviously done by difference to the windows one. Other small comments throughout

Comment on lines +4 to +6
template_file <- if (run_on_linux) "task_run.sh" else "task_run.bat"
out_script <- if (run_on_linux) SH_RUN else BATCH_RUN
write_os_lines <- if (run_on_linux) write_linux_lines else writeLines
Copy link
Member

Choose a reason for hiding this comment

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

This might be easier to read in one if/else

if (run_on_linux) {
  template_file <- ...
  out_script <- ...
} else {
}

etc

Comment on lines +14 to +19
path_dat <- prepare_path(path, config$shares)
linux_path <- path_on_linux(path_dat)
wrap_path <- path_to_task_file(path_root, task_id, SH_WRAP_RUN)
write_linux_lines(
sprintf("python -u /opt/hpcnodemanager/kwrap.py %s", linux_path),
wrap_path)
Copy link
Member

Choose a reason for hiding this comment

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

Can you add a comment explaining what any of this does please?

path
}


write_batch_provision_script <- function(id, config, path_root) {
run_on_linux <- config$platform == "linux"
template_file <- if (run_on_linux) "provision.sh" else "provision.bat"
Copy link
Member

Choose a reason for hiding this comment

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

The other way of doing this is you have a list

details <- list(
  linux = list(template_file = "provision.sh", write_lines = write_linux_lines),
  windows = list(template_file = "provision.bat", write_lines = writeLines)

and then you do

template_file <- details[[config$platform]][["template_file"]]

or similar. But I think the version above is probably easiest tbh

x <- prepare_path(x, shares)
file.path(x$drive_remote, x$rel)
if (run_on_linux) {
path_on_linux(x)
Copy link
Member

Choose a reason for hiding this comment

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

this name I think is insufficiently clear as to what sort of changes are going on here, and in particular I think that this is really "path on the dide network as seen from a linux machine", as opposed to some sort of windows/linux slash normalisation that one might expect

@@ -36,10 +36,10 @@ web_client <- R6::R6Class(
},

submit = function(path, name, resources, cluster = NULL,
depends_on = NULL) {
depends_on = NULL, workdir = "") {
Copy link
Member

Choose a reason for hiding this comment

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

What is going on with workdir here? I'm not thrilled that we need to set it on linux but not windows and that is has a default -- which presumably won't work on linux

client_parse_cluster_resources(httr_text(r))
cluster_resources = function() {
r_windows <- private$client$GET(
"/api/v1/cluster_info/wpia-hn/hipercow.windows/", public = TRUE)
Copy link
Member

Choose a reason for hiding this comment

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

These names are immediately out of date as they look like package names (we had hipercow.windows but now we are working towards hipercow.dide. I know that the portal will be replaced by a new API soon but we might want to not bake in these names all the same

module load hiredis
module load libsodium

echo working directory: $(pwd)
Copy link
Member

Choose a reason for hiding this comment

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

in the windows version the first bit of the script moves to the working directory. Is there some reason this won't work in linux? If not then we probably should move that bit of control into the same place on windows too


module load R/{{r_version}}
module load hiredis
module load libsodium
Copy link
Member

Choose a reason for hiding this comment

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

what ends up needing libsodium?

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