Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'adopt'
java-version: '17'
java-version: '25'
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Spring Boot 4 requires 17, but it wasn't compiling for me. I moved to 25, new LTS version of Java. That brings getFirst(), Java records, and hopefully a bit of performance improvement? I can try again with JVM 17 if it's a blocker.


- name: Set up Ruby
uses: ruby/setup-ruby@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
uses: actions/setup-java@v5
with:
distribution: 'adopt'
java-version: '17'
java-version: '25'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM docker.io/library/maven:3-eclipse-temurin-17-alpine AS build-licensee
FROM docker.io/library/maven:3-eclipse-temurin-25-alpine AS build-licensee

RUN apk add --update \
alpine-sdk \
Expand All @@ -10,7 +10,7 @@ RUN apk add --update \
RUN gem install licensee


FROM docker.io/library/maven:3-eclipse-temurin-17-alpine
FROM docker.io/library/maven:3-eclipse-temurin-25-alpine
MAINTAINER Stian Soiland-Reyes <stain@apache.org>

# Build-time metadata as defined at https://github.com/opencontainers/image-spec/blob/main/annotations.md
Expand Down
25 changes: 17 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# CWL Viewer

This is a [Spring Boot](http://projects.spring.io/spring-boot/) MVC application which fetches [Common Workflow Language](http://www.commonwl.org/) files from a Github repository and creates a page for it detailing the main workflow and its inputs, outputs and steps.
This is a [Spring Boot](http://projects.spring.io/spring-boot/) MVC application which fetches [Common Workflow Language](http://www.commonwl.org/) files
from a GitHub repository and creates a page for it detailing the main workflow and its inputs, outputs and steps.

[![Build Status](https://github.com/common-workflow-language/cwlviewer/workflows/CWL%20Viewer%20Build/badge.svg?branch=main)](https://github.com/common-workflow-language/cwlviewer/actions?query=workflow%3A%22CWL%20Viewer%20Build%22) [![Coverage Status](https://coveralls.io/repos/github/common-workflow-language/cwlviewer/badge.svg)](https://coveralls.io/github/common-workflow-language/cwlviewer) [![Gitter](https://img.shields.io/gitter/room/gitterHQ/gitter.svg)](https://gitter.im/common-workflow-language/cwlviewer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![](https://images.microbadger.com/badges/image/commonworkflowlanguage/cwlviewer.svg)](https://microbadger.com/images/commonworkflowlanguage/cwlviewer "MicroBadger commonworkflowlanguage/cwlviewer") [![Docker image commonworkflowlanguage/cwlviewer](https://images.microbadger.com/badges/version/commonworkflowlanguage/cwlviewer.svg)](https://hub.docker.com/r/commonworkflowlanguage/cwlviewer/ "Docker Hub commonworkflowlanguage/cwlviewer")
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.823534.svg)](https://doi.org/10.5281/zenodo.823534)

# Using CWL Viewer

You are recommended to use the **production instance** of CWL Viewer at https://view.commonwl.org/ which runs the latest [release](https://github.com/common-workflow-language/cwlviewer/releases). Any downtime should be reported on the [gitter chat for cwlviewer](https://gitter.im/common-workflow-language/cwlviewer).
You are recommended to use the **production instance** of CWL Viewer at https://view.commonwl.org/ which runs
the latest [release](https://github.com/common-workflow-language/cwlviewer/releases). Any downtime should be reported on the [gitter chat for cwlviewer](https://gitter.im/common-workflow-language/cwlviewer).

<!--- I don't think this is a thing any more.
The **dev instance** at http://view.commonwl.org:8082/ corresponds to the current `master` branch, and is updated every 6 minutes to run the latest [commonworkflowlanguage/cwlviewer docker image](https://hub.docker.com/r/commonworkflowlanguage/cwlviewer/builds/). Note that this instance is NOT secured and might break at any time.
<!--- I don't think this is a thing anymore.
The **dev instance** at http://view.commonwl.org:8082/ corresponds to the current `master` branch,
and is updated every 6 minutes to run the latest
[commonworkflowlanguage/cwlviewer docker image](https://hub.docker.com/r/commonworkflowlanguage/cwlviewer/builds/).
Note that this instance is NOT secured and might break at any time.
-->

# Running
Expand All @@ -19,7 +24,8 @@ If you are a developer, or you want to use the CWL Viewer in a closed environmen

## Recommended - Running with Docker

This application can be started with [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/install/) and Docker Compose is the recommended method of running or developing this codebase.
This application can be started with [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/install/) and Docker Compose is the recommended
method of running or developing this codebase.

Then run the following commands to clone the project in your local system.

Expand Down Expand Up @@ -134,7 +140,8 @@ To compile you will need [Java 17](https://www.oracle.com/java/technologies/down
(e.g. [Eclipse Adoptium](https://projects.eclipse.org/projects/adoptium)) and version, as well as
[Apache Maven 3](https://maven.apache.org/download.cgi) (`apt install maven`).

Spring Boot uses an embedded HTTP server. The Spring Boot Maven plugin includes a run goal which can be used to quickly compile and run it:
Spring Boot uses an embedded HTTP server. The Spring Boot Maven plugin includes a run goal which can be used to
quickly compile and run it:

```
$ mvn spring-boot:run
Expand Down Expand Up @@ -166,9 +173,11 @@ Now check out http://localhost:8080/ to access CWL Viewer.

## Configuration

There are a variety of configuration options detailed in the [application configuration file](https://github.com/common-workflow-language/cwlviewer/blob/master/src/main/resources/application.properties) which can be adjusted.
There are a variety of configuration options detailed in the [application configuration file](https://github.com/common-workflow-language/cwlviewer/blob/master/src/main/resources/application.properties) which can
be adjusted.

When deploying with docker, these can be overridden externally by creating/modifying `docker-compose.override.yml` as follows:
When deploying with docker, these can be overridden externally by creating/modifying `docker-compose.override.yml`
as follows:

```yaml
version: '3.9'
Expand Down
36 changes: 5 additions & 31 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,17 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.1.4</version>
<version>4.1.0-RC1</version>
<relativePath/>
</parent>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>17</java.version>
<java.version>25</java.version>
<jena.version>6.1.0</jena.version>
<!-- BEGIN should correspond to https://repo1.maven.org/maven2/org/apache/jena/jena/3.9.0/jena-3.9.0.pom -->
<ver.jsonldjava>0.13.6</ver.jsonldjava>
<ver.jackson>2.21.3</ver.jackson>
<!-- END -->
<log4j2.version>2.17.0</log4j2.version>
</properties>
Expand Down Expand Up @@ -65,24 +64,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-commons</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>io.hypersistence</groupId>
<artifactId>hypersistence-utils-hibernate-62</artifactId>
<version>3.9.4</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.module</groupId>
<artifactId>jackson-module-jakarta-xmlbind-annotations</artifactId>
<version>2.21.3</version>
</dependency>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These were causing conflicts with new dependencies in Spring Boot & Spring Data.

<!-- Liquibase; note that Flyway, while probably having more documentation and users,
changed its license model. Similarly to mongo, we prefer an open license that
won't lock users or developers from updating or modifying the code if necessary.
Expand Down Expand Up @@ -124,12 +105,6 @@
</exclusion>
</exclusions>
</dependency>
<!-- JSON parsing -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${ver.jackson}</version>
</dependency>
<!-- Jena, turtle -->
<dependency>
<groupId>org.apache.jena</groupId>
Expand Down Expand Up @@ -184,14 +159,13 @@
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
<artifactId>postgresql</artifactId>
<version>1.21.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>postgresql</artifactId>
<version>1.21.4</version>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa-test</artifactId>
<scope>test</scope>
</dependency>
<!-- We use mockito-inline as it supports mocking static methods -->
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/commonwl/view/CwlViewerApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@EnableTransactionManagement
public class CwlViewerApplication {

public static void main(String[] args) {
static void main(String[] args) {
SpringApplication.run(CwlViewerApplication.class, args);
}
}
42 changes: 30 additions & 12 deletions src/main/java/org/commonwl/view/Scheduler.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/

package org.commonwl.view;

import java.io.File;
Expand Down Expand Up @@ -63,14 +82,13 @@ public void removeOldQueuedWorkflowEntries() {
calendar.add(Calendar.HOUR, -QUEUED_WORKFLOW_AGE_LIMIT_HOURS);
Date removeTime = calendar.getTime();

logger.info("The time is " + now);
logger.info(
"Delete time interval is : OLDER THAN " + QUEUED_WORKFLOW_AGE_LIMIT_HOURS + " HOURS");
logger.info("Deleting queued workflows older than or equal to " + removeTime);
logger.info("The time is {}", now);
logger.info("Delete time interval is : OLDER THAN {} HOURS", QUEUED_WORKFLOW_AGE_LIMIT_HOURS);
logger.info("Deleting queued workflows older than or equal to {}", removeTime);

logger.info(
queuedWorkflowRepository.deleteByTempRepresentation_RetrievedOnLessThanEqual(removeTime)
+ " Old queued workflows removed");
"{} Old queued workflows removed",
queuedWorkflowRepository.deleteByTempRepresentation_RetrievedOnLessThanEqual(removeTime));
}

/**
Expand All @@ -79,9 +97,9 @@ public void removeOldQueuedWorkflowEntries() {
* <p>Will scan each temporary directory (graphviz, RO, git), searching for files exceeding a
* specified threshold.
*
* <p>It scans the first level directories, i.e. it does not recursively scans directories. So it
* <p>It scans the first level directories, i.e. it does not recursively scan directories. So it
* will delete any RO or Git repository directories that exceed the threshold. Similarly, it will
* delete any graph (svg, png, etc) that also exceed it.
* delete any graph (svg, png, etc.) that also exceeds it.
*
* <p>Errors logged through Logger. Settings in Spring application properties file.
*
Expand Down Expand Up @@ -110,7 +128,7 @@ private void clearDirectory(String temporaryDirectory) {
File temporaryDirectoryFile = new File(temporaryDirectory);
String[] files = temporaryDirectoryFile.list(new AgeFileFilter(Date.from(cutoff)));

if (files != null && files.length > 0) {
if (files != null) {
for (String fileName : files) {
File fileToDelete = new File(temporaryDirectoryFile, fileName);
try {
Expand All @@ -122,9 +140,9 @@ private void clearDirectory(String temporaryDirectory) {
// expected and
// must be treated as errors.
logger.error(
String.format(
"Failed to delete old temporary file or directory [%s]: %s",
fileToDelete.getAbsolutePath(), e.getMessage()),
"Failed to delete old temporary file or directory [{}]: {}",
fileToDelete.getAbsolutePath(),
e.getMessage(),
e);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/commonwl/view/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class WebConfig implements WebMvcConfigurer {
* @see Workflow#getPermalink(Format)
* @see WorkflowPermalinkController
*/
public static enum Format {
public enum Format {
// Browser
html(MediaType.TEXT_HTML),
// API
Expand Down
9 changes: 4 additions & 5 deletions src/main/java/org/commonwl/view/cwl/CWLElement.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,22 @@
package org.commonwl.view.cwl;

import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/** Represents the input/output of a workflow/tool */
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class CWLElement {
public class CWLElement implements Serializable {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

hypersistence-utils-hibernate library was handling the transformation from CWLElement and others like CWLStep into JSON. Now Jackson + Hibernate can handle this, but we need to make it Serializable or write a converter.


private String label;
private String doc;
private String type;
private String format;
private List<String> sourceID;
private final List<String> sourceID = new ArrayList<>();
private String defaultVal;

public CWLElement() {
this.sourceID = new ArrayList<>();
}
public CWLElement() {}

public String getLabel() {
return label;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
package org.commonwl.view.cwl;

/** Exception thrown when the provided CWL document is not a Workflow. */
@SuppressWarnings("unused")
public class CWLNotAWorkflowException extends CWLValidationException {

public CWLNotAWorkflowException(String message) {
Expand Down
Loading
Loading