Giter VIP home page Giter VIP logo

algorithmia-ci-action's Introduction

algorithmia ci/cd action

An algorithmia github Action to test and deploy github backed Algorithmia.com algorithms. When attached as a workflow for an Algorithmia algorithm, can automatically deploy new versions when provided tests pass.

For this action to function, the github action actions/checkout must be called before this action, as we search for key files in your algorithm repository for simplicity. An example workflow is below -- or you can take a look at a full algorithm example or this step-by-step tutorial.

Action Input

inputs:
  api_key:
    description: 'Your algorithm management capable Algorithmia API key'
    required: true
  api_address:
    description: 'The API address for the Algorithmia Cluster you wish to connect to'
    required: false
    default: 'https://api.algorithmia.com'
  version_schema:
    description: 'identifier to describe how to promote this release'
    required: false
    default: "minor"
  path:
    description: 'directory name for the local project stored in /github/workspace due to an "actions/checkout" command'
    required: true
  api_key - (required) - An Algorithmia api key that has execute access for the algorithm you wish to test, has full access for algorithms. read more about that [here](https://algorithmia.com/developers/platform/customizing-api-keys)
  api_address - (optional) - The Algorithmia API cluster address you wish to connect to, if using a private cluster; please provide the correct path to your environment.
  version_schema - (optional) - The [semantic version](https://semver.org/) parameter that will get incremented whenever this action gets triggered. May be "Major", "Minor", or "Revision"
  path - (required) - The workspace path variable provided to the actions/checkout@v2 of the current job

Important Files

Your Algorithm naturally contains a algorithmia.conf file which we parse to gather the algorithm name from, however a new file called TEST_CASES.json is required. The required schema of this json file is shown below:

Case Schema

Your test cases should follow the following json schema

[
 { 
    "case_name": String,
    "input": Any,
    "expected_output": Any,
    "type": String,
    "tree": List
  },
  ...
]
  • input (required) - the raw input that will be passed into the algorithm. Typically this will be a json dictionary, json list, or a primitive type (like a string).
  • expected_output (required) - What we are comparing against the result of your algorithm, which can be scoped in conjunction with setting tree. For types GREATER_OR_EQUAL and LESS_OR_EQUAL this must be a number value. For types NO_EXCEPTION and EXCEPTION this field is optional.
  • type (optional) - defines the type of matching that can be done, options include EXACT_MATCH, GREATER_OR_EQUAL, LESS_OR_EQUAL, NO_EXCEPTION and EXCEPTION. Defaults to EXACT_MATCH
  • tree (optional) - A list defining the json keys we should traverse in order to find the value you wish to compare against with expected_output.

Example Case

[
    {
      "case_name": "image_classifier_accuracy",
      "input": {"image_data":  [...]},
      "expected_output": 0.7,
      "type": "GREATER_OR_EQUAL",
      "tree": ["accuracy"],
    }
]

Example workflow

Below is the standard algorithm CI workflow we recommend you use to take advantage of our CI/CD system. If you have any questions or comments please feel free to create an issue.

# This is an example using the Algorithmia CI action

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# In this instance we're triggering this workflow whenever a push to master is performed.
on:
  push:
    branches: [master]

jobs:
  # This workflow only contains a single job, however if you'd like you can split this processing across multiple jobs.
  algorithmia-ci:
    runs-on: ubuntu-latest

    steps:
    - name: Checkout
      uses: actions/[email protected]
      with:
        ref: ${{github.sha}}
        path: algorithm
    - name: Algorithmia CI
      uses: algorithmiaio/[email protected]
      with:
        # Your master Algorithmia API key
        api_key: ${{ secrets.mgmt_api_key }}
        # The API address for the Algorithmia Cluster you wish to connect to
        api_address: https://api.algorithmia.com
        # identifier to describe how to promote this release ('major', 'minor', 'revision')
        version_schema: revision
        # the path variable you defined in the actions/checkout action triggered before this one.
        path: algorithm

algorithmia-ci-action's People

Contributors

peckjon avatar zeryx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

jbrache

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.