xenon

A middleware abstraction library that provides a simple programming interface to various compute and storage resources.

https://github.com/xenon-middleware/xenon

Science Score: 67.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 3 DOI reference(s) in README
  • Academic publication links
    Links to: zenodo.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.5%) to scientific vocabulary

Keywords

batch-job java library middleware
Last synced: 4 months ago · JSON representation ·

Repository

A middleware abstraction library that provides a simple programming interface to various compute and storage resources.

Basic Info
Statistics
  • Stars: 35
  • Watchers: 6
  • Forks: 17
  • Open Issues: 32
  • Releases: 25
Topics
batch-job java library middleware
Created over 12 years ago · Last pushed over 1 year ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation Roadmap Zenodo

README.md

Xenon

Unit tests linux Unit tests windows Unit tests macos Integration tests Fixed client tests codecov SonarCloud cffvalidation GitHub license DOI Research Software Directory CII Best Practices fair-software.eu

Copyright 2013-2023 The Netherlands eScience Center

What problem does Xenon solve?

Many applications use remote storage and compute resources. To do so, they need to include code to interact with the scheduling systems and file transfer protocols used on those remote machines.

Unfortunately, many different scheduler systems and file transfer protocols exist, often with completely different programming interfaces. This makes it hard for applications to switch to a different system or support multiple remote systems simultaneously.

Xenon solves this problem by providing a single programming interface to many different types of remote resources, allowing applications to switch without changing a single line of code.

Xenon abstraction

How does Xenon work?

Xenon is an abstraction layer that sits between your application and the (usually remote) resource it uses. Xenon is written in Java, but is also accessible from other languages (e.g. Python) through its gRPC interface and via the command line.

Xenon API

Overview of the Xenon ecosystem of tools

| component | repository | |---|---| | Xenon library | https://github.com/xenon-middleware/Xenon | | Xenon cloud adaptors like s3 | https://github.com/xenon-middleware/xenon-adaptors-cloud | | Xenon grid adaptors like gridftp| https://github.com/xenon-middleware/xenon-adaptors-grid | | Xenon hadoop adaptors like hdfs | https://github.com/xenon-middleware/xenon-adaptors-hadoop | | gRPC extension for Xenon | https://github.com/xenon-middleware/xenon-grpc | | command line interface to Xenon | https://github.com/xenon-middleware/xenon-cli | | Python API for Xenon | https://github.com/xenon-middleware/pyxenon | | Docker images | https://github.com/xenon-middleware/xenon-docker-images |

Supported middleware

Xenon currently supports the following file access mechanisms:

  • file (local file manipulation)
  • ftp
  • sftp
  • webdav
  • s3
  • hdfs

Xenon currently supports the following job submission mechanisms:

  • local
  • ssh
  • at
  • gridengine
  • slurm
  • torque

See the roadmap for the planned extensions.

Adding Xenon as a dependency to your project

Follow the instructions from bintray.com to include Xenon as a dependency for Gradle, Maven, SBT, or Leiningen projects, e.g. Gradle:

gradle allprojects { repositories { ... jcenter() } }

and

```gradle dependencies { compile group: 'nl.esciencecenter.xenon', name: 'xenon', version: '3.2.0' }

```

This will give the core adaptors to get cloud, grid and hadoop adaptors add the following dependencies: gradle compile group: 'nl.esciencecenter.xenon.adaptors', name: 'xenon-adaptors-cloud', version: '3.0.2' compile group: 'nl.esciencecenter.xenon.adaptors', name: 'xenon-adaptors-grid', version: '3.0.0' compile group: 'nl.esciencecenter.xenon.adaptors', name: 'xenon-adaptors-hadoop', version: '3.0.0'

Simple examples

Here are some examples of basic operations you can perform with Xenon:

Copying a file from a local filesystem to a remote filesystem

```java import nl.esciencecenter.xenon.XenonException; import nl.esciencecenter.xenon.credentials.PasswordCredential; import nl.esciencecenter.xenon.filesystems.CopyMode; import nl.esciencecenter.xenon.filesystems.CopyStatus; import nl.esciencecenter.xenon.filesystems.FileSystem; import nl.esciencecenter.xenon.filesystems.Path;

public class CopyFileLocalToSftpAbsolutePaths {

public static void main(String[] args) throws Exception {

    // Use the file system adaptors to create file system representations; the remote file system
    // requires credentials, so we need to create those too.
    //
    // Assume the remote system is actually just a Docker container (e.g.
    // https://hub.docker.com/r/xenonmiddleware/ssh/), accessible via
    // port 10022 on localhost
    String location = "localhost:10022";
    String username = "xenon";
    char[] password = "javagat".toCharArray();
    PasswordCredential credential = new PasswordCredential(username, password);
    FileSystem localFileSystem = FileSystem.create("file");
    FileSystem remoteFileSystem = FileSystem.create("sftp", location, credential);

    // create Paths for the source and destination files, using absolute paths
    Path sourceFile = new Path("/etc/passwd");
    Path destFile = new Path("/tmp/password");

    // create the destination file only if the destination path doesn't exist yet
    CopyMode mode = CopyMode.CREATE;
    boolean recursive = false;

    // perform the copy and wait 1000 ms for the successful or otherwise
    // completion of the operation
    String copyId = localFileSystem.copy(sourceFile, remoteFileSystem, destFile, mode, recursive);
    long timeoutMilliSecs = 1000;
    CopyStatus copyStatus = localFileSystem.waitUntilDone(copyId, timeoutMilliSecs);

    // throw any exceptions
    XenonException copyException = copyStatus.getException();
    if (copyException != null) {
      throw copyException;
    }
}

} ```

Submitting a job

The following code performs a wordcount of a file residing on a remote machine:

```java import nl.esciencecenter.xenon.credentials.PasswordCredential; import nl.esciencecenter.xenon.schedulers.JobDescription; import nl.esciencecenter.xenon.schedulers.JobStatus; import nl.esciencecenter.xenon.schedulers.Scheduler;

public class SlurmSubmitWordCountJob {

public static void main(String[] args) throws Exception {

    // Assume the remote system is actually just a Docker container (e.g.
    // https://hub.docker.com/r/xenonmiddleware/slurm/), accessible to user 'xenon' via
    // port 10022 on localhost, using password 'javagat'
    String location = "localhost:10022";
    String username = "xenon";
    char[] password = "javagat".toCharArray();
    PasswordCredential credential = new PasswordCredential(username, password);

    // create the SLURM scheduler representation
    Scheduler scheduler = Scheduler.create("slurm", location, credential);

    JobDescription description = new JobDescription();
    description.setExecutable("/usr/bin/wc");
    description.setArguments("-l", "/etc/passwd");
    description.setStdout("/tmp/wc.stdout.txt");

    // submit the job
    String jobId = scheduler.submitBatchJob(description);

    long WAIT_INDEFINITELY = 0;
    JobStatus jobStatus = scheduler.waitUntilDone(jobId, WAIT_INDEFINITELY);

    // print any exceptions
    Exception jobException = jobStatus.getException();
    if (jobException != null)  {
      throw jobException;
    }

}

} ```

The output of the job will be written to /tmp/wc.stdout.txt file in the xenonmiddleware/slurm Docker container.

For more examples, see the tutorial at Read The Docs.

Documentation

Xenon's JavaDoc is available online at http://xenon-middleware.github.io/xenon/.

Documentation for maintainers

For developers of Xenon itself

Legal

The Xenon library is copyrighted by the Netherlands eScience Center and released under the Apache License, Version 2.0. A copy of the license may be obtained from http://www.apache.org/licenses/LICENSE-2.0.

Xenon uses several third-party libraries that have their own (permissive, open source) licenses. See the file legal/README.md for an overview.

Owner

  • Name: xenon-middleware
  • Login: xenon-middleware
  • Kind: organization

Citation (CITATION.cff)

--- 
abstract: "Many applications use remote storage and compute resources. To do so, they need to include code to interact with the scheduling systems and file transfer protocols used on those remote machines. Unfortunately, many different scheduler systems and file transfer protocols exist, often with completely different programming interfaces. This makes it hard for applications to switch to a different system or support multiple remote systems simultaneously. Xenon solves this problem by providing a single programming interface to many different types of remote resources, allowing applications to switch without changing a single line of code."
authors: 
  - 
    affiliation: "Netherlands eScience Center"
    family-names: Maassen
    given-names: Jason
    orcid: "https://orcid.org/0000-0002-8172-4865"
  - 
    affiliation: "Netherlands eScience Center"
    family-names: Verhoeven
    given-names: Stefan
    orcid: "https://orcid.org/0000-0002-5821-2060"
  - 
    affiliation: "Netherlands eScience Center"
    family-names: Borgdorff
    given-names: Joris
    orcid: "https://orcid.org/0000-0001-7911-9490"
  - 
    affiliation: "Netherlands eScience Center"
    family-names: Spaaks
    given-names: "Jurriaan H."
    orcid: "https://orcid.org/0000-0002-7064-4069"
  - 
    affiliation: "Netherlands eScience Center"
    family-names: Drost
    given-names: Niels
    orcid: "https://orcid.org/0000-0001-9795-7981"
  - 
    affiliation: "Netherlands eScience Center"
    family-names: Meijer
    given-names: Christiaan
  - 
    affiliation: "Netherlands eScience Center"
    family-names: Ploeg
    given-names: Atze
    name-particle: "van der"
  - 
    affiliation: "Netherlands eScience Center"
    family-names: Boer
    given-names: "Piter T."
    name-particle: de
  - 
    affiliation: "Netherlands eScience Center"
    family-names: Nieuwpoort
    given-names: Rob
    name-particle: van
    orcid: "https://orcid.org/0000-0002-2947-9444"
  - 
    affiliation: "Netherlands eScience Center"
    family-names: Werkhoven
    given-names: Ben
    name-particle: van
    orcid: "https://orcid.org/0000-0002-7508-3272"
  - 
    affiliation: "Netherlands eScience Center"
    family-names: Kuzniar
    given-names: Arnold
    orcid: "https://orcid.org/0000-0003-1711-7961"
cff-version: "1.0.3"
date-released: 2020-03-20
doi: "10.5281/zenodo.597993"
keywords: 
  - Java
  - batch-job
  - middleware
  - library
  - FTP
  - S3
  - SFTP
  - WebDAV
  - HDFS
  - SGE
  - SLURM
  - SSH
  - Torque
  - "distributed computing"
license: Apache-2.0
message: "If you use this software, please cite it using these metadata."
repository-code: "https://github.com/xenon-middleware/xenon"
title: Xenon
version: "3.2.0"

GitHub Events

Total
  • Watch event: 1
  • Fork event: 1
Last Year
  • Watch event: 1
  • Fork event: 1

Issues and Pull Requests

Last synced: over 2 years ago

All Time
  • Total issues: 80
  • Total pull requests: 20
  • Average time to close issues: 10 months
  • Average time to close pull requests: 23 days
  • Total issue authors: 11
  • Total pull request authors: 5
  • Average comments per issue: 2.35
  • Average comments per pull request: 0.85
  • Merged pull requests: 17
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 2
  • Average time to close issues: N/A
  • Average time to close pull requests: about 2 hours
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 1.0
  • Merged pull requests: 2
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • sverhoeven (33)
  • jmaassen (24)
  • nielsdrost (5)
  • jspaaks (5)
  • blootsvoets (4)
  • cwmeijer (2)
  • atzeus (2)
  • arnikz (2)
  • yh882317 (1)
  • LourensVeen (1)
  • acoleman2000 (1)
Pull Request Authors
  • jmaassen (8)
  • sverhoeven (5)
  • arnikz (3)
  • jspaaks (3)
  • onnovalkering (1)
Top Labels
Issue Labels
Bug (16) Enhancement (12) API (9) SSH Adaptor (7) cloud (4) Documentation (4) Testing (4) Utils (3) Slurm Adaptor (3) Build infrastructure (3) Wontfix (3) Question (3) Windows (2) Azure (2) AWS (2) GridEngine Adaptor (2) Torque Adaptor (1) Docker (1) Local Adaptor (1)
Pull Request Labels

Dependencies

.github/workflows/cffconvert.yml actions
  • actions/checkout v2 composite
  • citation-file-format/cffconvert-github-action 2.0.0 composite
.github/workflows/fixedClientTests.yml actions
  • actions/checkout v2 composite
  • actions/setup-java v1 composite
  • codecov/codecov-action v3 composite
.github/workflows/integrationTests.yml actions
  • actions/checkout v2 composite
  • actions/setup-java v1 composite
  • codecov/codecov-action v3 composite
.github/workflows/live-tests-windows.yml actions
  • actions/checkout v2 composite
  • actions/setup-java v1 composite
  • codecov/codecov-action v2 composite
.github/workflows/sonar.yml actions
  • actions/cache v1 composite
  • actions/checkout v2 composite
  • actions/setup-java v1 composite
.github/workflows/tests-macos.yml actions
  • actions/checkout v2 composite
  • actions/setup-java v1 composite
  • codecov/codecov-action v3 composite
.github/workflows/tests-windows.yml actions
  • actions/checkout v2 composite
  • actions/setup-java v1 composite
  • codecov/codecov-action v3 composite
.github/workflows/unitTests.yml actions
  • actions/checkout v2 composite
  • actions/setup-java v1 composite
  • codecov/codecov-action v3 composite
build.gradle maven