Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,18 @@ on:

jobs:
build:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
java: ['11', '16', '17' ]

name: Java ${{ matrix.java }} Build and Test
steps:
- name: Set up java
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
java-version: 11.0.2
java-package: jdk
architecture: x64
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Set up python
uses: actions/setup-python@v2
with:
Expand All @@ -39,7 +41,7 @@ jobs:
- name: Build with Gradle
run: ./gradlew build -x test
- name: Test
run: ./gradlew check
run: ./gradlew --info check
- name: Publish Unit Test Results
uses: EnricoMi/[email protected]
if: always()
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/cwl_compliance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ jobs:

steps:
- name: Set up java
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
java-version: 11.0.2
java-package: jdk
architecture: x64
distribution: 'temurin'
java-version: '17'
- name: Set up python
uses: actions/setup-python@v2
with:
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ build/
.settings
*.iws
.DS_Store
.vscode

# Ignore yarn
src/main/frontend/yarn-v1.22.0/

# Xenonflow logs
log/
db/
xenon-flow.log
Expand Down
31 changes: 17 additions & 14 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
id 'idea'
id 'eclipse'
id 'application'
id 'org.springframework.boot' version '2.2.4.RELEASE'
id 'org.springframework.boot' version '2.3.12.RELEASE'
id 'io.spring.dependency-management' version '1.0.7.RELEASE'
id 'jacoco'
id "com.github.node-gradle.node" version "2.2.2"
Expand All @@ -15,7 +15,7 @@ sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11

application {
mainClassName = 'nl.esciencecenter.computeservice.rest.Application'
mainClass = 'nl.esciencecenter.computeservice.rest.Application'
}


Expand Down Expand Up @@ -43,26 +43,27 @@ dependencies {
implementation group: 'nl.esciencecenter.xenon.adaptors', name: 'xenon-adaptors-cloud', version: '3.0.2'

//Spring(boot)
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.2.4.RELEASE'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter', version: '2.2.4.RELEASE'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: '2.2.4.RELEASE'
implementation group: 'org.springframework.boot', name: 'spring-boot-devtools', version: '2.2.4.RELEASE'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.3.12.RELEASE'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter', version: '2.3.12.RELEASE'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: '2.3.12.RELEASE'
implementation group: 'org.springframework.boot', name: 'spring-boot-devtools', version: '2.3.12.RELEASE'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation', version: '2.3.12.RELEASE'
implementation group: 'io.springfox', name: 'springfox-boot-starter', version: '3.0.0'

//Jackson, match version used in Spring
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.8'
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.9.8'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.9.8'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.11.4'
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.11.4'
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.11.4'

//compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310'
implementation group: 'javax.validation', name: 'validation-api', version: '2.0.1.Final'

//JPA, hibernate and h2 database persistance libraries
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: '2.2.4.RELEASE'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-jpa', version: '2.3.12.RELEASE'
runtimeOnly group: 'com.h2database', name: 'h2', version: '1.4.199'

// Security
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-security', version: '2.2.4.RELEASE'
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-security', version: '2.3.12.RELEASE'

// Admin Interface

Expand All @@ -75,18 +76,20 @@ dependencies {
testImplementation group: 'org.hamcrest', name:'hamcrest', version:'2.2'
testImplementation group: 'org.hamcrest', name:'hamcrest-library', version:'2.2'
testImplementation group: 'junit', name:'junit', version:'4.13'
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '2.2.4.RELEASE'
testImplementation group: 'org.springframework.boot', name: 'spring-boot-starter-test', version: '2.3.12.RELEASE'

runtimeOnly group: 'org.springframework.boot', name: 'spring-boot-properties-migrator', version: '2.3.12.RELEASE'
}

bootJar {
baseName = 'xenonflow'
baseName = 'xenonflow'
}

// Include some more files in the distribution zip
// Don't use include an extra directory in the dist zip.
distributions {
boot {
baseName = 'xenonflow'
distributionBaseName = 'xenonflow'
contents {
from(['config/config.yml', 'config/application.properties']) {
into '/config'
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.commonwl.cwl.Parameter;

public class BaseStagingObject implements StagingObject {
public abstract class BaseStagingObject implements StagingObject {

protected long bytesCopied = 0;
protected String copyId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
package nl.esciencecenter.computeservice.service.staging;

import org.commonwl.cwl.Parameter;
import java.util.Set;

import org.slf4j.Logger;

import nl.esciencecenter.xenon.XenonException;
import nl.esciencecenter.xenon.filesystems.FileSystem;
import nl.esciencecenter.xenon.filesystems.Path;
import nl.esciencecenter.xenon.filesystems.PosixFilePermission;

public class CommandScriptStagingObject extends StringToFileStagingObject {

public CommandScriptStagingObject(String source, Path targetPath, Parameter parameter) {
super(source, targetPath, parameter);
public CommandScriptStagingObject(String source, Path targetPath) {
super(source, targetPath, null);
}

public String stage(Logger jobLogger, FileSystem sourceFileSystem, FileSystem targetFileSystem,
Path sourceDirectory, Path targetDirectory) throws XenonException {
String id = super.stage(jobLogger, sourceFileSystem, targetFileSystem, sourceDirectory, targetDirectory);

Path targetPath = targetDirectory.resolve(getTargetPath());

Set<PosixFilePermission> permissions = targetFileSystem.getAttributes(targetPath).getPermissions();
permissions.add(PosixFilePermission.OWNER_EXECUTE);
permissions.add(PosixFilePermission.GROUP_EXECUTE);
permissions.add(PosixFilePermission.OTHERS_EXECUTE);
targetFileSystem.setPosixFilePermissions(targetPath, permissions);

return id;
}
}
Original file line number Diff line number Diff line change
@@ -1,38 +1,27 @@
package nl.esciencecenter.computeservice.service.staging;

import org.commonwl.cwl.Parameter;
import org.slf4j.Logger;

import nl.esciencecenter.xenon.XenonException;
import nl.esciencecenter.xenon.filesystems.FileSystem;
import nl.esciencecenter.xenon.filesystems.Path;

public class CwlFileStagingObject extends BaseStagingObject {
private Path sourcePath;
private Path targetPath;
public class CwlFileStagingObject extends FileStagingObject {
protected FileSystem cwlFileSystem;

public CwlFileStagingObject(Path sourcePath, Path targetPath, Parameter parameter) {
super(parameter);
this.sourcePath = sourcePath;
this.targetPath = targetPath;
}

public Path getSourcePath() {
return sourcePath;
}

public void setSourcePath(Path sourcePath) {
this.sourcePath = sourcePath;
}

public Path getTargetPath() {
return targetPath;
}

public void setTargetPath(Path targetPath) {
this.targetPath = targetPath;
public CwlFileStagingObject(Path sourcePath, Path targetPath, FileSystem cwlFileSystem) {
super(sourcePath, targetPath, null);
this.cwlFileSystem = cwlFileSystem;
}

@Override
public String toString() {
return "CwlFileStagingObject [sourcePath=" + sourcePath + ", targetPath=" + targetPath
+ ", parameter=" + parameter + "]";
}

public String stage(Logger jobLogger, FileSystem sourceFileSystem, FileSystem targetFileSystem,
Path sourceDirectory, Path targetDirectory) throws XenonException {
return super.stage(jobLogger, cwlFileSystem, targetFileSystem, sourceDirectory, targetDirectory);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
package nl.esciencecenter.computeservice.service.staging;

import org.commonwl.cwl.Parameter;
import org.slf4j.Logger;

import nl.esciencecenter.xenon.XenonException;
import nl.esciencecenter.xenon.filesystems.CopyMode;
import nl.esciencecenter.xenon.filesystems.FileSystem;
import nl.esciencecenter.xenon.filesystems.Path;

public class DirectoryStagingObject extends BaseStagingObject implements FileOrDirectoryStagingObject {
Expand Down Expand Up @@ -35,4 +39,24 @@ public String toString() {
return "DirectoryStagingObject [sourcePath=" + sourcePath + ", targetPath=" + targetPath
+ ", parameter=" + parameter + "]";
}

public String stage(Logger jobLogger, FileSystem sourceFileSystem, FileSystem targetFileSystem,
Path sourceDirectory, Path targetDirectory) throws XenonException {
Path sourcePath = getSourcePath();
if (!sourcePath.isAbsolute()) {
sourcePath = sourceDirectory.resolve(getSourcePath()).toAbsolutePath();
}
Path targetPath = targetDirectory.resolve(getTargetPath());
Path targetDir = targetPath.getParent();
if (!targetFileSystem.exists(targetDir)) {
targetFileSystem.createDirectories(targetDir);
}

jobLogger.info("Copying from " + sourcePath + " to " + targetPath);
String copyId = sourceFileSystem.copy(sourcePath, targetFileSystem, targetPath, CopyMode.REPLACE,
true);

setCopyId(copyId);
return copyId;
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
package nl.esciencecenter.computeservice.service.staging;

import org.commonwl.cwl.Parameter;
import org.slf4j.Logger;

import nl.esciencecenter.xenon.XenonException;
import nl.esciencecenter.xenon.filesystems.CopyMode;
import nl.esciencecenter.xenon.filesystems.FileSystem;
import nl.esciencecenter.xenon.filesystems.Path;

public class FileStagingObject extends BaseStagingObject implements FileOrDirectoryStagingObject {
private Path sourcePath;
private Path targetPath;
protected Path sourcePath;
protected Path targetPath;

public FileStagingObject(Path sourcePath, Path targetPath, Parameter parameter) {
super(parameter);
Expand Down Expand Up @@ -35,4 +39,24 @@ public String toString() {
return "FileStagingObject [sourcePath=" + sourcePath + ", targetPath=" + targetPath
+ ", parameter=" + parameter + "]";
}

public String stage(Logger jobLogger, FileSystem sourceFileSystem, FileSystem targetFileSystem,
Path sourceDirectory, Path targetDirectory) throws XenonException {
Path sourcePath = getSourcePath();
if (!sourcePath.isAbsolute()) {
sourcePath = sourceDirectory.resolve(getSourcePath()).toAbsolutePath();
}
Path targetPath = targetDirectory.resolve(getTargetPath());
Path targetDir = targetPath.getParent();
if (!targetFileSystem.exists(targetDir)) {
targetFileSystem.createDirectories(targetDir);
}

jobLogger.info("Copying from " + sourcePath + " to " + targetPath);
String copyId = sourceFileSystem.copy(sourcePath, targetFileSystem, targetPath, CopyMode.REPLACE,
false);

setCopyId(copyId);
return copyId;
}
}

This file was deleted.

Loading