Skip to content

Commit 9b89d22

Browse files
Merge pull request #7 from ftschirpke/wow_as_fs
Support for WOW scheduler
2 parents f31bfb9 + 9e26f2f commit 9b89d22

40 files changed

+2956
-437
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ jobs:
2929
fetch-depth: 1
3030
submodules: true
3131

32+
- name: Install dependencies for C (cross-)compilation
33+
run: |
34+
sudo apt-get update
35+
sudo apt-get install -y clang lld gcc-aarch64-linux-gnu libc6-dev-arm64-cross
36+
37+
- name: Compile C script using make
38+
run: make c_scripts
39+
3240
- name: Setup Java ${{ matrix.java_version }}
3341
uses: actions/setup-java@v3
3442
with:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ out
1010
/gradle.properties
1111
/logs.tmp
1212
*.jar
13+
/plugins/nf-cws/src/resources/nf-cws/getStatsAndResolveSymlinks_*

Makefile

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,52 @@ else
77
mm =
88
endif
99

10+
C_SCRIPT_SRC = plugins/nf-cws/src/resources/nf-cws/getStatsAndResolveSymlinks.c
11+
C_SCRIPT_AARCH64 = plugins/nf-cws/src/resources/nf-cws/getStatsAndResolveSymlinks_linux_aarch64
12+
C_SCRIPT_X86_64 = plugins/nf-cws/src/resources/nf-cws/getStatsAndResolveSymlinks_linux_x86_64
13+
C_SCRIPT_ALL_TARGETS = $(C_SCRIPT_X86_64) $(C_SCRIPT_AARCH64)
14+
15+
arch:=$(shell uname -m)
16+
17+
ifneq ($(arch),x86_64)
18+
$(info ====================================================================================)
19+
$(info This Makefile assumes to be run on an x86_64 build system. Found: $(arch))
20+
$(info As an alternative you can adjust the Makefile or build $(C_SCRIPT_SRC) yourself for the following targets:)
21+
$(info - target aarch64-linux-gnu: saved to $(C_SCRIPT_AARCH64))
22+
$(info - target x86_64-linux-gnu: saved to $(C_SCRIPT_X86_64))
23+
$(error Aborting)
24+
endif
25+
26+
c_scripts: $(C_SCRIPT_ALL_TARGETS)
27+
28+
$(C_SCRIPT_AARCH64): $(C_SRIPT_SRC)
29+
clang -static \
30+
-target aarch64-linux-gnu \
31+
--sysroot=/usr/aarch64-linux-gnu \
32+
plugins/nf-cws/src/resources/nf-cws/getStatsAndResolveSymlinks.c \
33+
-fuse-ld=lld \
34+
-o $@
35+
36+
37+
$(C_SCRIPT_X86_64): $(C_SCRIPT_SRC)
38+
clang -static \
39+
-target x86_64-linux-gnu \
40+
plugins/nf-cws/src/resources/nf-cws/getStatsAndResolveSymlinks.c \
41+
-fuse-ld=lld \
42+
-o $@
43+
1044
clean:
1145
rm -rf .nextflow*
1246
rm -rf work
1347
rm -rf build
1448
rm -rf plugins/*/build
49+
rm -f $(C_SCRIPT_ALL_TARGETS)
1550
./gradlew clean
1651

1752
compile:
1853
./gradlew :nextflow:exportClasspath compileGroovy
1954
@echo "DONE `date`"
2055

21-
2256
check:
2357
./gradlew check
2458

@@ -55,7 +89,7 @@ assemble:
5589
# generate build zips under build/plugins
5690
# you can install the plugin copying manually these files to $HOME/.nextflow/plugins
5791
#
58-
buildPlugins:
92+
buildPlugins: $(C_SCRIPT_ALL_TARGETS)
5993
./gradlew copyPluginZip
6094

6195
#
@@ -69,4 +103,4 @@ upload-plugins:
69103
./gradlew plugins:upload
70104

71105
publish-index:
72-
./gradlew plugins:publishIndex
106+
./gradlew plugins:publishIndex

README.md

Lines changed: 195 additions & 108 deletions
Large diffs are not rendered by default.

buildSrc/src/main/groovy/io.nextflow.groovy-common-conventions.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ java {
1717
toolchain {
1818
languageVersion = JavaLanguageVersion.of(21)
1919
}
20+
2021
sourceCompatibility = 17
2122
targetCompatibility = 17
2223
}

plugins/nf-cws/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ sourceSets {
3434
}
3535

3636
ext{
37-
nextflowVersion = '24.11.0-edge'
37+
nextflowVersion = '25.01.0-edge'
3838
}
3939

4040
dependencies {

plugins/nf-cws/src/main/nextflow/cws/CWSConfig.groovy

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ class CWSConfig {
1616

1717
String getStrategy() { target.strategy as String ?: 'FIFO' }
1818

19+
boolean strategyIsLocationAware() {
20+
switch(target.strategy) {
21+
case "wow": return true
22+
default:
23+
return false
24+
}
25+
}
26+
1927
String getCostFunction() { target.costFunction as String }
2028

2129
String getMemoryPredictor() { target.memoryPredictor as String }
@@ -30,6 +38,10 @@ class CWSConfig {
3038
return s ? new MemoryUnit(s) : null
3139
}
3240

41+
Integer getMaxCopyTasksPerNode() { target.maxCopyTasksPerNode as Integer }
42+
43+
Integer getMaxWaitingCopyTasksPerNode() { target.maxWaitingCopyTasksPerNode as Integer }
44+
3345
int getBatchSize() {
3446
String s = target.batchSize as String
3547
//Default: 1 -> No batching

plugins/nf-cws/src/main/nextflow/cws/CWSPlugin.groovy

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
package nextflow.cws
22

33
import groovy.transform.CompileStatic
4+
import nextflow.cws.wow.file.LocalPath
5+
import nextflow.cws.wow.file.OfflineLocalPath
6+
import nextflow.cws.wow.file.WorkdirPath
7+
import nextflow.cws.wow.filesystem.WOWFileSystemProvider
8+
import nextflow.cws.wow.serializer.LocalPathSerializer
9+
import nextflow.file.FileHelper
410
import nextflow.plugin.BasePlugin
511
import nextflow.trace.TraceRecord
12+
import nextflow.util.KryoHelper
613
import org.pf4j.PluginWrapper
714

815
@CompileStatic
@@ -14,6 +21,10 @@ class CWSPlugin extends BasePlugin {
1421

1522
private static void registerTraceFields() {
1623
TraceRecord.FIELDS.putAll( [
24+
infiles_time: 'num',
25+
outfiles_time: 'num',
26+
create_bash_wrapper_time: 'num',
27+
create_request_time: 'num',
1728
submit_to_scheduler_time: 'num',
1829
submit_to_k8s_time: 'num',
1930
scheduler_time_in_queue: 'num',
@@ -33,13 +44,29 @@ class CWSPlugin extends BasePlugin {
3344
scheduler_delta_submitted_batch_end: 'num',
3445
memory_adapted: 'mem',
3546
input_size: 'num',
47+
scheduler_files_bytes: 'num',
48+
scheduler_files_node_bytes: 'num',
49+
scheduler_files_node_other_task_bytes: 'num',
50+
scheduler_files: 'num',
51+
scheduler_files_node: 'num',
52+
scheduler_files_node_other_task: 'num',
53+
scheduler_depending_task: 'num',
54+
scheduler_location_count: 'num',
55+
scheduler_nodes_to_copy_from: 'num',
56+
scheduler_no_alignment_found: 'num',
57+
scheduler_time_delta_phase_three: 'str',
58+
scheduler_copy_tasks: 'num',
3659
] )
3760
}
3861

3962
@Override
4063
void start() {
4164
super.start()
4265
registerTraceFields()
66+
KryoHelper.register( LocalPath, LocalPathSerializer )
67+
KryoHelper.register( OfflineLocalPath, LocalPathSerializer )
68+
KryoHelper.register( WorkdirPath, LocalPathSerializer )
69+
FileHelper.getOrInstallProvider(WOWFileSystemProvider)
4370
}
4471

4572
}

plugins/nf-cws/src/main/nextflow/cws/CWSSchedulerBatch.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
package nextflow.cws
22

3+
import groovy.transform.CompileStatic
34
import nextflow.cws.processor.SchedulerBatch
45

6+
@CompileStatic
57
class CWSSchedulerBatch extends SchedulerBatch {
68

79
private SchedulerClient schedulerClient

plugins/nf-cws/src/main/nextflow/cws/CWSSession.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
package nextflow.cws
22

3+
import groovy.transform.CompileStatic
4+
35
/**
46
* Central, global instance to manage all generated Executor instances
57
*/
8+
@CompileStatic
69
class CWSSession {
710

811
static final CWSSession INSTANCE = new CWSSession()

0 commit comments

Comments
 (0)