Skip to content

Commit

Permalink
Add project name in the float tags.
Browse files Browse the repository at this point in the history
Add the project name(workflow name) in the float tags so that we
can tell which kind of workflow this job belongs to.

Update the version to 0.4.1.
  • Loading branch information
jealous committed Jan 11, 2024
1 parent ee23466 commit 1f31100
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Just make sure you have proper internet access.

```groovy
plugins {
id 'nf-float@0.4.0'
id 'nf-float@0.4.1'
}
```

Expand All @@ -66,17 +66,17 @@ Go to the folder where you just install the `nextflow` command line.
Let's call this folder the Nextflow home directory.
Create the float plugin folder with:
```bash
mkdir -p .nextflow/plugins/nf-float-0.4.0
mkdir -p .nextflow/plugins/nf-float-0.4.1
```
where `0.4.0` is the version of the float plugin. This version number should
where `0.4.1` is the version of the float plugin. This version number should
align with the version in of your plugin and the property in your configuration
file. (check the configuration section)

Retrieve your plugin zip file and unzip it in this folder.
If everything goes right, you should be able to see two sub-folders:

```bash
$ ll .nextflow/plugins/nf-float-0.4.0/
$ ll .nextflow/plugins/nf-float-0.4.1/
total 48
drwxr-xr-x 4 ec2-user ec2-user 51 Jan 5 07:17 classes
drwxr-xr-x 2 ec2-user ec2-user 25 Jan 5 07:17 META-INF
Expand All @@ -89,7 +89,7 @@ file with the command line option `-c`. Here is a sample of the configuration.

```groovy
plugins {
id 'nf-float@0.4.0'
id 'nf-float@0.4.1'
}
workDir = '/mnt/memverge/shared'
Expand Down Expand Up @@ -171,7 +171,7 @@ Unknown config secret 'MMC_USERNAME'
To enable s3 as work directory, user need to set work directory to a s3 bucket.
```groovy
plugins {
id 'nf-float@0.4.0'
id 'nf-float@0.4.1'
}
workDir = 's3://bucket/path'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class FloatConf {
static final String ADDR_SEP = ","
static final String NF_JOB_ID = "nf-job-id"
static final String NF_PROCESS_NAME = 'nextflow-io-process-name'
static final String NF_PROJECT_NAME = 'nextflow-io-project-name'
static final String NF_RUN_NAME = 'nextflow-io-run-name'
static final String NF_SESSION_ID = 'nextflow-io-session-id'
static final String NF_TASK_NAME = 'nextflow-io-task-name'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,12 @@ class FloatGridExecutor extends AbstractGridExecutor {
result[FloatConf.NF_PROCESS_NAME] = processName
result[FloatConf.FLOAT_JOB_KIND] = getJobKind(processName)
}
if (session.workflowMetadata) {
final projName = session.workflowMetadata.projectName
if (projName) {
result[FloatConf.NF_PROJECT_NAME] = projName
}
}
if (session.runName) {
result[FloatConf.NF_RUN_NAME] = session.runName
}
Expand All @@ -314,7 +320,7 @@ class FloatGridExecutor extends AbstractGridExecutor {
private static String toTag(String value) {
final sizeLimit = 63
value = value.replaceAll("[_\\s]", "-")
value = value.replaceAll("[^a-zA-Z0-9-]", "")
value = value.replaceAll("[^a-zA-Z0-9-]", "-")
if (value.size() > sizeLimit) {
value = value.substring(0, sizeLimit)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class FloatJobs {
// job already finished, no need to update
job = existingJob
} else {
log.info "[float] put job ${job.nfJobID} into map"
nfJobID2job.put(job.nfJobID, job)
}
if (job.finished) {
Expand All @@ -101,7 +102,7 @@ class FloatJobs {
floatJobID2oc.put(job.floatJobID, oc)
updateJob(job)
}
log.debug "[float] update op-center $oc job status"
log.info "[float] update op-center $oc job status"
return nfJobID2FloatJob
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/nf-float/src/resources/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Manifest-Version: 1.0
Plugin-Class: com.memverge.nextflow.FloatPlugin
Plugin-Id: nf-float
Plugin-Version: 0.4.0
Plugin-Version: 0.4.1
Plugin-Provider: MemVerge Corp.
Plugin-Requires: >=23.04.0
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class FloatBaseTest extends BaseTest {
'--job', script,
'--customTag', jobID(taskID),
'--customTag', "${FloatConf.NF_SESSION_ID}:uuid-$uuid",
'--customTag', "${FloatConf.NF_TASK_NAME}:foo-$taskIndex",
'--customTag', "${FloatConf.NF_TASK_NAME}:foo--$taskIndex-",
'--customTag', "${FloatConf.FLOAT_INPUT_SIZE}:0",
'--customTag', "${FloatConf.NF_RUN_NAME}:test-run"]
}
Expand Down

0 comments on commit 1f31100

Please sign in to comment.