ort-operator-api

command module
v0.0.0-...-c4a6719 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 18, 2023 License: GPL-3.0 Imports: 23 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

ORT Operator API

This repository contains a HTTP/JSON API, a Matrix chatbot and a (currently broken) Slack chatbot for the ORT Kubernetes Operator. The bots should probably live in separate repos.

HTTP Endpoints

GET /runs - Returns a list of all OrtRun resources

Response:

{
  "runs": [
    {
      "name": "<name>",
      "repoUrl": "<repoUrl>",
      "status": {
        "analyzer": "[Pending|Running|Succeeded|Failed|Aborted]",
        "scanner": "[Pending|Running|Succeeded|Failed|Aborted]",
        "reporter": "[Pending|Running|Succeeded|Failed|Aborted]"
      }
    }
  ]
}
GET /runs/<name> - Return the OrtRun resources with the given name

Response:

{
  "name": "<name>",
  "repoUrl": "<repoUrl>",
  "status": {
    "analyzer": "[Pending|Running|Succeeded|Failed|Aborted]",
    "scanner": "[Pending|Running|Succeeded|Failed|Aborted]",
    "reporter": "[Pending|Running|Succeeded|Failed|Aborted]"
  },
  "kubernetesResource": "<yaml>"
}
POST /runs - Create a new OrtRun resources

Payload:

{
    "repoUrl": "https://github.com/haikoschol/cats-of-asia.git"
}

Response:

{
  "name": "<name>",
  "repoUrl": "<repoUrl>",
  "status": {
    "analyzer": "[Pending|Running|Succeeded|Failed|Aborted]",
    "scanner": "[Pending|Running|Succeeded|Failed|Aborted]",
    "reporter": "[Pending|Running|Succeeded|Failed|Aborted]"
  },
  "kubernetesResource": "<yaml>"
}
GET /logs/<name>/[analyzer|scanner|reporter] - Fetch the logs from the analyzer, scanner or reporter of an ORT run

Response:

{
  "name": "<name>",
  "stage": "[analyzer|scanner|reporter]",
  "podLogs": [
    {
      "podName": "<name>",
      "podLogs": "<log>"
    }
  ]
}

Configuration

To talk to Kubernetes, the API process first tries InClusterConfig and if that fails looks for a kubeconfig in $HOME/.kube/config.

if MATRIX_SERVER is set, MATRIX_USER and MATRIX_ACCESS_TOKEN are assumed to be set as well and an instance of the Matrix bot is created and run.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址