Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Java edits for kb-sdk 1.3 #350

Merged
merged 9 commits into from
Jun 19, 2020
136 changes: 136 additions & 0 deletions .github/workflows/kb_sdk-actions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
name: Basic kb-sdk tests
ialarmedalien marked this conversation as resolved.
Show resolved Hide resolved

on:
[push, pull_request]

jobs:

test_kb-sdk_builds:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04]
ialarmedalien marked this conversation as resolved.
Show resolved Hide resolved
ialarmedalien marked this conversation as resolved.
Show resolved Hide resolved
language: [perl, python, java]
test_type: [base, example]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Build with Ant
run: |
make

- name: Add bin to $PATH
run: |
echo "::add-path::$GITHUB_WORKSPACE/bin"

- name: checking kb-sdk functions
env:
KBASE_TEST_TOKEN: ${{ secrets.KBASE_TEST_TOKEN }}
LANGUAGE_TOKEN: ${{ matrix.language }}
run: |
env
kb-sdk help
kb-sdk version

- name: init base repo
if: matrix.test_type == 'base'
env:
LANGUAGE_TOKEN: ${{ matrix.language }}
run: |
kb-sdk init -l $LANGUAGE_TOKEN -u user SampleApp

- name: init example repo
if: matrix.test_type == 'example'
env:
LANGUAGE_TOKEN: ${{ matrix.language }}
run: |
kb-sdk init -l $LANGUAGE_TOKEN -u user --example SampleApp

- name: test ${{ matrix.test_type }} repo
env:
KBASE_TEST_TOKEN: ${{ secrets.KBASE_TEST_TOKEN }}
LANGUAGE_TOKEN: ${{ matrix.language }}
run: |
cd SampleApp
kb-sdk test || true
sed -i "s/test_token=/test_token=$KBASE_TEST_TOKEN/" test_local/test.cfg
kb-sdk test

- name: make resulting app available as artefact in case of failure
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: kbaseapp-${{ matrix.language }}-${{ matrix.test_type }}-${{ matrix.os }}
ialarmedalien marked this conversation as resolved.
Show resolved Hide resolved
path: SampleApp


test_existing_repos:
if: "!contains(github.event.head_commit.message, 'skip ci')"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-16.04, ubuntu-18.04, ubuntu-20.04]
app: [WsLargeDataIO, KBaseReport]
Copy link
Member

Choose a reason for hiding this comment

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

Hmm... this means if those repos break then kb-sdk test also breaks. I understand why you're doing this but making the sdk build depend on outside repos building and testing correctly seems overly fragile.

Copy link
Member

Choose a reason for hiding this comment

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

Also, neither of these repos test callback server functionality

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

What would you suggest here? The tests are kind of moot anyway because the app base images may have a different version of kb-sdk on them, so the build/compile step won't really be testing the revised kb-sdk. There should be something to test that the changes aren't going to break existing repos.

Copy link
Member

Choose a reason for hiding this comment

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

Well personally, I wouldn't test against outside repos and I would depend on a good suite of regression tests and quality PR reviews to ensure that changes don't break repos. So let's just make that happen yeah

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hah! I have some ideas for setting up some better regression tests but I didn't want to put too much into this PR, especially since I am working around the knowledge that kb-sdk v1.1.0 to 1.2.0 introduces breaking changes in the python code which have been masked because the sdkbase repo has not been updated. 🤦

I really wish that the old testing mechanisms had not been disabled!

Copy link
Member

Choose a reason for hiding this comment

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

Were they actually disabled? I just thought that no one could get them to run except me. I'm not even sure if I can get them to run at this point, so I wouldn't be surprised if bitrot had set in.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I tried to get them going a while back, but they ran on a VM which has now disappeared, and the config/set up files were removed from the repo.

Copy link
Member

Choose a reason for hiding this comment

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

the config/set up files were removed from the repo

That's just... wow.


steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8

- name: Build with Ant
run: |
make

- name: Add bin to $PATH
run: |
echo "::add-path::$GITHUB_WORKSPACE/bin"

- name: checking basic kb-sdk functions
run: |
env
kb-sdk help
kb-sdk version

- name: Checkout existing kbase module ${{ matrix.app }}
uses: actions/checkout@v2
with:
repository: kbaseapps/${{ matrix.app }}
path: kbase_app

- name: prep for repo tests
run: |
cd kbase_app
kb-sdk test || true

- name: edit test.cfg
env:
KBASE_TEST_TOKEN: ${{ secrets.KBASE_TEST_TOKEN }}
run: |
cd kbase_app
sed -i "s/test_token=/test_token=$KBASE_TEST_TOKEN/" test_local/test.cfg

- name: run test
run: |
cd kbase_app
kb-sdk test

- name: make resulting app available as artefact in case of failure
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: kbaseapp-${{ matrix.app }}-${{ matrix.os }}
ialarmedalien marked this conversation as resolved.
Show resolved Hide resolved
path: kbase_app
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,3 @@ script:
- cd MyContigFilter
- make
- kb-sdk validate


2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ bin: jars-submodule-init
echo '#!/bin/bash' > bin/kb-sdk
echo 'DIR=$(DIR)' >> bin/kb-sdk
echo 'KBASE_JARS_DIR=$$DIR/submodules/jars/lib/jars' >> bin/kb-sdk
@# Next command processes links in JAR_DEPS_BIN file and has 5 parts (one on each line):
@# Next command processes links in JAR_DEPS_BIN file and has 5 parts (one on each line):
@# (1) removing comments
@# (2) trimming each line (picking first word actually)
@# (3) skipping empty lines
Expand Down
20 changes: 15 additions & 5 deletions RELEASE_NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
OVERVIEW
-----------------------------------------
The KBase SDK is a set of tools for developing new modules
that can be dynamically registered and run on the KBase
platform. Modules include all code, specification files, and
documentation needed to define and run a set of methods
The KBase SDK is a set of tools for developing new modules
that can be dynamically registered and run on the KBase
platform. Modules include all code, specification files, and
documentation needed to define and run a set of methods
in the KBase Narrative interface.

VERSION: 1.2.2 (Released 06/xx/2020)
------------------------------------
NEW FEATURES:
- kb-sdk version reports the build time and date of the instance
- kb-sdk can use the environment variable KBASE_TEST_TOKEN if a test token is not present in the test.cfg file
- GitHub Actions now used to run basic tests on initialising and testing new base and sample repos.

BUG FIXES:
- Corrected a class name in the generated tests for the Java SDK module.

VERSION: 1.2.0 (Released 11/14/2018)
------------------------------------
NEW FEATURES:
Expand Down Expand Up @@ -74,7 +84,7 @@ VERSION: 1.0.0 (Released 11/19/2015)
------------------------------------------
NEW FEATURES:
- R language is now supported for generation of clients and server stubs.
- Test sub-command is fully implemented for all 4 languages (perl,
- Test sub-command is fully implemented for all 4 languages (perl,
python, java and R).
- Version sub-command was added

Expand Down
9 changes: 5 additions & 4 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</condition>
<!-- Properties in ant are immutable, so the following assignment will only take place if jardir was not set above. -->
<property name="jardir" location="${env.JENKINS_JARS_MODULE_PATH}/lib/jars"/>

<!-- KBASE_COMMON_JAR should come from Makefile because of "make bin" mode support -->
<condition property="commonjar" value="${KBASE_COMMON_JAR}">
<and>
Expand Down Expand Up @@ -102,7 +102,7 @@
</target>



<tstamp/>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Timestamp

<target name="compile" depends="init" description="compile the source">
<fail message="KBase common jar is not set">
<condition>
Expand All @@ -116,7 +116,8 @@
<echo file="${src}/us/kbase/mobu/git.properties">### PLEASE DO NOT CHANGE THIS FILE MANUALLY! ###
giturl=${git.url}
branch=${git.branch}
commit=${git.commit}</echo>
commit=${git.commit}
build_timestamp=${DSTAMP}-${TSTAMP}</echo>
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

add date and time to the git.properties file

<echo>Compiling with jar directory: ${jardir}</echo>
<javac destdir="${classes}" srcdir="${src}" includeantruntime="false" debug="true" classpathref="compile.classpath" target="1.7" source="1.7" />
<!-- Copy resource files-->
Expand Down Expand Up @@ -205,7 +206,7 @@ echo $pid > $DIR/pid.txt
</echo>
<chmod file="${ee.dir}/${ee.start.script}" perm="a+x"/>
<echo>Successfully built: ${ee.dir}/${ee.start.script}</echo>

<echo file="${ee.dir}/${ee.stop.script}">#!/bin/bash
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" &amp;&amp; pwd )
kill $(&lt;"$DIR/pid.txt")
Expand Down
Loading