Skip to content

Commit

Permalink
Merge pull request #67 from xenon-middleware/xenonmiddleware-docker
Browse files Browse the repository at this point in the history
Upgraded to Xenon 3.0.1 + Replace Docker images from `nlesc/xenon-*` …
  • Loading branch information
sverhoeven authored Aug 1, 2019
2 parents 10bf6f9 + 3360e59 commit c109a89
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 29 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
# Change Log

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

### Changed

* Upgraded to Xenon 3.0.1
* Test against xenonmiddleware Docker images ([#42](https://github.com/xenon-middleware/xenon-docker-images/issues/42))

## [3.0.0] - 2019-06-14

### Added
Expand All @@ -28,7 +34,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Fixed

* s3 adaptor gives wrong error due to gson conflict
* s3 adaptor gives wrong error due to gson conflict

## [2.4.0] - 2018-03-14

Expand Down
39 changes: 24 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@

Command line interface which uses the [Xenon library](https://xenon-middleware.github.io/xenon) to perform job and file operations.

# Install
## Install

Goto https://github.com/xenon-middleware/xenon-cli/releases and download a tarball (or zipfile).
Goto [releases](https://github.com/xenon-middleware/xenon-cli/releases) and download a tarball (or zipfile).
The tarball can be installed with:

```bash
tar -xf build/distributions/xenon*.tar
xenon*/bin/xenon --help
```

Add `xenon*/bin` to your PATH environment variable for easy usage.

# Usage
## Usage

```bash
# List files on local filesystem
Expand All @@ -40,30 +42,33 @@ The above commands use your current username and keys from ~/.ssh.

To keep password or passphrase invisible in process list put the password in a text file (eg. 'password.txt') and then use '@password.txt' as argument.
For example:
```

```sh
xenon filesystem sftp --location localhost --username $USER --password @password.txt list $PWD/src
```

# Build
## Build

```
```sh
./gradlew build
```

Generates application tar/zip in `build/distributions/` directory.

# Tests
## Tests

Requirements for the integration tests:

* [docker](https://docs.docker.com/engine/installation/), v1.13 or greater
* [docker-compose](https://docs.docker.com/compose/), v1.10 or greater

The unit and integration tests can be run with:
```

```sh
./gradlew check
```

# Release
## Release

1. Bump version in `build.gradle`, `conda/xenon-cli/meta.yaml` files, add version to `CHANGELOG.md` and commit/push
2. Run `./gradlew build` to build distributions
Expand All @@ -78,29 +83,33 @@ The unit and integration tests can be run with:
Run Xenon CLI as a Docker container.

The Docker image can be build with
```

```sh
./gradlew docker
```

Generates a `nlesc/xenon-cli` Docker image.
Generates a `xenonmiddleware/xenon-cli` Docker image.

To use local files use volume mounting (watch out as the path should be relative to mount point):
```
docker run -ti --rm nlesc/xenon-cli --user $USER -v $PWD:/work --adaptor ssh upload --source /work/somefile.txt --location localhost --path /tmp/copy-of-somefile.txt

```sh
docker run -ti --rm xenonmiddleware/xenon-cli --user $USER -v $PWD:/work --adaptor ssh upload --source /work/somefile.txt --location localhost --path /tmp/copy-of-somefile.txt
```

## Common Workflow Language

Run Xenon CLI using a cwl-runner or as a tool in a [Common Workflow Language](http://www.commonwl.org/) workflow.

Requires `nlesc/xenon-cli` Docker image to be available locally.
Requires `xenonmiddleware/xenon-cli` Docker image to be available locally.

Example to list contents of `/etc` directory via a ssh to localhost connection with cwl-runner:
```

```sh
./xenon-ls.cwl --adaptor sftp --location $USER@172.17.0.1 --certfile ~/.ssh/id_rsa --path /etc
# Copy file from localhost to working directory inside Docker container
./xenon-upload.cwl --adaptor sftp --certfile ~/.ssh/id_rsa --location $USER@172.17.0.1 --source $PWD/README.md --target /tmp/copy-of-README.md
# Copy file inside Docker container to localhost
./xenon-download.cwl --adaptor sftp --certfile ~/.ssh/id_rsa --location $USER@172.17.0.1 --source /etc/passwd --target $PWD/copy-of-passwd
```

(Replace `<user>@<host>` with actual username and hostname + expects docker with default network range)
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ plugins {
}

description = 'Perform files and jobs operations with Xenon library from command line'
version = '3.0.0'
version = '3.0.1'
group = 'nl.esciencecenter.xenon.cli'
mainClassName = 'nl.esciencecenter.xenon.cli.Main'
applicationName = 'xenon'
Expand All @@ -36,7 +36,7 @@ testSets {
integrationTest
}

ext.xenonLibVersion = '3.0.0'
ext.xenonLibVersion = '3.0.1'
ext.xenonCloudLibVersion = '3.0.1'

dependencies {
Expand All @@ -62,7 +62,7 @@ dependencies {
}

docker {
name 'nlesc/xenon-cli'
name 'xenonmiddleware/xenon-cli'
dependsOn tasks.installShadowDist
files tasks.installShadowDist.outputs
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class SftpTest {
private static final int PORT = 22;

@ClassRule
public static final GenericContainer server = new GenericContainer("nlesc/xenon-ssh").withExposedPorts(PORT);
public static final GenericContainer server = new GenericContainer("xenonmiddleware/ssh").withExposedPorts(PORT);


@Rule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class SlurmTest {
private static final int PORT = 22;

@ClassRule
public static final GenericContainer server = new GenericContainer("nlesc/xenon-slurm").withExposedPorts(PORT);
public static final GenericContainer server = new GenericContainer("xenonmiddleware/slurm").withExposedPorts(PORT);

private static String getLocation() {
return "ssh://" + server.getContainerIpAddress() + ":" + server.getMappedPort(PORT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class SshTest {
private static final int PORT = 22;

@ClassRule
public static final GenericContainer server = new GenericContainer("nlesc/xenon-ssh").withExposedPorts(PORT);
public static final GenericContainer server = new GenericContainer("xenonmiddleware/ssh").withExposedPorts(PORT);

@Rule
public final ExpectedSystemExit exit = ExpectedSystemExit.none();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class CopyInputTest {
private static final int PORT = 22;

@ClassRule
public static final GenericContainer server = new GenericContainer("nlesc/xenon-ssh").withExposedPorts(PORT);
public static final GenericContainer server = new GenericContainer("xenonmiddleware/ssh").withExposedPorts(PORT);

private static String getLocation() {
return server.getContainerIpAddress() + ":" + server.getMappedPort(PORT);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ public class SftpCopyTest {
private static final int PORT = 22;

@ClassRule
public static final GenericContainer serverA = new GenericContainer("nlesc/xenon-ssh").withExposedPorts(PORT);
public static final GenericContainer serverA = new GenericContainer("xenonmiddleware/ssh").withExposedPorts(PORT);
@ClassRule
public static final GenericContainer serverB = new GenericContainer("nlesc/xenon-ssh").withExposedPorts(PORT);
public static final GenericContainer serverB = new GenericContainer("xenonmiddleware/ssh").withExposedPorts(PORT);

private static String getLocationA() {
return serverA.getContainerIpAddress() + ":" + serverA.getMappedPort(PORT);
Expand Down
2 changes: 1 addition & 1 deletion src/integrationTest/resources/slurm-docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
version: '3'
services:
slurm:
image: nlesc/xenon-slurm
image: xenonmiddleware/slurm
ports:
- 22 # ssh
2 changes: 1 addition & 1 deletion xenon-download.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ doc: Download file from remote storage
hints:
- class: DockerRequirement
# xenon-cli Docker container needs to be manually build before
dockerImageId: nlesc/xenon-cli
dockerImageId: xenonmiddleware/xenon-cli
baseCommand:
- xenon
- '--json'
Expand Down
2 changes: 1 addition & 1 deletion xenon-ls.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ doc: List objects on remote storage
hints:
- class: DockerRequirement
# xenon-cli Docker container needs to be manually build before
dockerImageId: nlesc/xenon-cli
dockerImageId: xenonmiddleware/xenon-cli
baseCommand:
- xenon
- '--json'
Expand Down
2 changes: 1 addition & 1 deletion xenon-upload.cwl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ doc: Upload file to remote storage
hints:
- class: DockerRequirement
# xenon-cli Docker container needs to be manually build before
dockerImageId: nlesc/xenon-cli
dockerImageId: xenonmiddleware/xenon-cli
baseCommand:
- xenon
- '--json'
Expand Down

0 comments on commit c109a89

Please sign in to comment.