Skip to content
This repository has been archived by the owner on Mar 27, 2024. It is now read-only.

Commit

Permalink
Merge pull request #421 from osbornjd/jay/MarkIII
Browse files Browse the repository at this point in the history
Mina Dependency
  • Loading branch information
osbornjd committed Feb 24, 2020
2 parents 618b457 + 613607c commit b6f767e
Show file tree
Hide file tree
Showing 56 changed files with 1,583 additions and 899 deletions.
10 changes: 7 additions & 3 deletions org.eclipse.ice.commands/README.md
@@ -1,6 +1,6 @@
# Commands Package

This README serves as an overview of the commands package, which is a standalone maven package that can be used within or outside of ICE. The package provides the necessary API to set up and run jobs on either one's local computer or a remote host. Additionally, the API includes file transfer and file system browsing capabilities, with the option to move or copy files on the local host or remote host. It is suggested that users encode their file processing logic into a bash/python/powershell script to be run locally/remotely.
This README serves as an overview of the commands package, which is a standalone maven package that can be used within or outside of ICE. The package provides the necessary API to set up and run jobs on either one's local computer or a remote host. Additionally, the API includes file transfer and file system browsing capabilities, with the option to move or copy files on the local host or remote host. It is suggested that users encode their file processing logic into a bash/python/powershell script to be run locally/remotely. For example, a remote job on a remote host B could be run from commands on local host A which executes a remote job on remote host C, assuming the script contains the necessary logic to connect remote host B to remote host C.

Examples can be found in either the `src/test/java/org/eclipse/ice/tests/commands` directory or in the standalone package within ICE `org/eclipse/ice/demo/commands/`.

Expand Down Expand Up @@ -34,7 +34,9 @@ hostname

Windows users need to put their ssh credentials into the file located at `C:\Users\Adminstrator\ice-remote-creds.txt` in order for the tests to properly function.

The automated tests will then grab the necessary credentials from this file to run the tests. Any valid ssh connection will work. If you still find that the tests fail, ensure that the ssh connection you are using has been logged into before from your host computer such that there is a key fingerprint associated to that host in your `~/.ssh/known_hosts` file. The Commands package requires that this key exists in order for authentication to proceed, no matter what form of authentication you use. Alternatively, you can set `StrictHostKeyChecking` to false in the `ConnectionManager`, which is not advised as it is inherently unsecure. To do this for the static `ConnectionManager`, just write:
The automated tests will then grab the necessary credentials from this file to run. Any valid ssh connection will work. If you still find that the tests fail, ensure that the ssh connection you are using has been logged into before from your host computer such that there is a key fingerprint associated to that host in your `~/.ssh/known_hosts` file. The Commands package requires that this key exists in order for authentication to proceed, no matter what form of authentication you use. In the event that tests fail on a host that already exists in `known_hosts` (e.g. with the error message `server key did not validate`, try deleting your `known_hosts` file (or the entries in your `known_hosts` that correspond to the host you are trying to run the tests on), logging in again to re-establish a fingerprint, and running the tests again.

Alternatively, you can set `StrictHostKeyChecking` to false in the `ConnectionManager`, which is in general not advised as it is inherently unsecure. To do this for the static `ConnectionManager`, just write:

```java
ConnectionManagerFactory.getConnectionManager().setRequireStrictHostKeyChecking(false);
Expand All @@ -46,13 +48,15 @@ Note that this is also a way through which ssh validation can be performed in th

#### KeyGen Tests and Connections

Connections may be established via a public/private key pair that is generated between the local and remote host. The JSch API only works with RSA keys - Commands can also function with ECDSA, but it is advised to use RSA. You should be sure to generate a key similarly to the following snip of shell code:
Connections may be established via a public/private key pair that is generated between the local and remote host. Commands can function with ECDSA or RSA type keys. To generate an RSA key, for example, use:

```bash
$ ssh-keygen -t rsa -m PEM
$ ssh-copy-id -i ~/.ssh/keyname.pub username@hostname
```

Then you should be able to remotely login via `ssh -i /path/to/key username@hostname` without a password requirement.

For the keygen connection tests to pass, you should also create a key to a remote host that the tests expect to find. This can be done with any arbitrary remote server that you have credential access to; however, the key must be named dummyhostkey and must exist in your home `.ssh` directory. In other words, the key must be here:

```
Expand Down
15 changes: 10 additions & 5 deletions org.eclipse.ice.commands/pom.xml
Expand Up @@ -25,10 +25,15 @@
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
<dependency>
<groupId>com.jcraft</groupId>
<artifactId>jsch</artifactId>
<version>0.1.55</version>
<dependency>
<groupId>org.apache.sshd</groupId>
<artifactId>sshd-core</artifactId>
<version>2.3.0</version>
</dependency>
<dependency>
<groupId>org.apache.sshd</groupId>
<artifactId>sshd-sftp</artifactId>
<version>2.3.0</version>
</dependency>
</dependencies>
</dependencies>
</project>
Expand Up @@ -161,7 +161,7 @@ public CommandStatus cancel() {
* This function is intended to clean up any (possible) remaining loose ends
* after the job is finished processing.
*
* @return
* @return CommandStatus - indicating that the configuration completed clean up
*/
protected CommandStatus cleanUp() {

Expand All @@ -182,7 +182,7 @@ protected CommandStatus cleanUp() {
* log/error information.
*
* @return - CommandStatus indicating that configuration completed and job can
* start running
* start running
*/
protected CommandStatus setConfiguration() {

Expand Down Expand Up @@ -330,7 +330,7 @@ protected boolean logOutput(final InputStream output, final InputStream errors)
* This function is a simple helper function to check and make sure that the
* command status is not set to a flagged error, e.g. failed.
*
* @param current_status
* @param current_status to be checked
* @return boolean indicating whether or not status is good to continue (true)
* or whether or not job has failed (returns false)
*/
Expand Down Expand Up @@ -371,7 +371,7 @@ public void setStatus(CommandStatus status) {
* This function returns to the user the configuration that was used to create a
* particular command.
*
* @return - the particular configuration for this command
* @return - the particular CommandConfiguration for this command
*/
public CommandConfiguration getCommandConfiguration() {
return commandConfig;
Expand All @@ -380,7 +380,7 @@ public CommandConfiguration getCommandConfiguration() {
/**
* This function sets the command configuration for a particular command
*
* @param config
* @param commandConfig - CommandConfiguration to be set
*/
public void setCommandConfiguration(CommandConfiguration commandConfig) {
this.commandConfig = commandConfig;
Expand All @@ -400,7 +400,7 @@ public ConnectionConfiguration getConnectionConfiguration() {
* This function sets the configuration that is to be used to set up a
* particular connection.
*
* @param connect
* @param connectionConfig - ConnectionConfiguration to be set
*/
public void setConnectionConfiguration(ConnectionConfiguration connectionConfig) {
this.connectionConfig = connectionConfig;
Expand Down

0 comments on commit b6f767e

Please sign in to comment.