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

Latest commit

 

History

History
103 lines (72 loc) · 3.06 KB

README.md

File metadata and controls

103 lines (72 loc) · 3.06 KB

example_kb_sdk_app

This repo demonstrates some best practices for writing KBase Apps, as well as providing a simple app that demonstrates uploading data into kbase, using kbase utilities, using an external script, and using biopython to do simple calculations within the app.

Quick start

  1. Make a new project using this repository as a template. NOTE: Do not use example_sdk_app in the name.
  2. Wait for the github action to finish, see details below.
  3. Clone your repository locally. Be sure the name of the local directory is the same as the repository name.
  4. Run kb-sdk test.
  5. Add your token to test.cfg and your repository secrets.
  6. Run kb-sdk test.

Philosophy

We also aim to demonstrate various practicies, such as

Organization

  • Code is organized inside helper classes outside of the impl file. We avoid writing most code in the impl file
  • Dependency injection

Testing

  • Unit tests
  • Tests running in github actions. (See the .github directory)

Logging

  • Use of the logger instead of prints

Experimental Features

  • Usage of KBase Template
  • New Base Image
  • Updated Makefile to enable testing with pytest instead of the deprecated nose

FAQ

How does the github action work?

TODO

  • Non KBase tests with mocks
  • Update UI spec with correct parameters
  • Test optional parameters
  • Refine KBase tests, perhaps with assert statements
  • Add comments to explain what is going on and why things are done this way.
  • See also Chris' code

Running Unit Tests

To run the unit tests for this app ensure the image is built by running kb-sdk test once, then run:

make docker-unit

NOTE: Tests are automatically run via github actions, so you can check to see if your PR passes tests on github

KB SDK

This is a KBase module generated by the KBase Software Development Kit (SDK).

You will need to have the SDK installed to use this module. Learn more about the SDK and how to use it.

You can also learn more about the apps implemented in this module from its catalog page or its spec file.

Setup and test

Add your KBase developer token to test_local/test.cfg and run the following:

$ make
$ kb-sdk test

After making any additional changes to this repo, run kb-sdk test again to verify that everything still works.

Installation from another module

To use this code in another SDK module, call kb-sdk install example_kb_sdk_app in the other module's root directory.

Help

You may find the answers to your questions in our FAQ or Troubleshooting Guide.

example_sdk_app