https://github.com/opslevel/opslevel-runner
OpsLevel Runner is the Kubernetes based job processor for OpsLevel
https://github.com/opslevel/opslevel-runner
Last synced: about 2 months ago
JSON representation
OpsLevel Runner is the Kubernetes based job processor for OpsLevel
- Host: GitHub
- URL: https://github.com/opslevel/opslevel-runner
- Owner: OpsLevel
- License: mit
- Created: 2022-03-10T13:57:18.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-17T17:14:06.000Z (over 1 year ago)
- Last Synced: 2025-02-17T18:23:44.315Z (over 1 year ago)
- Language: Go
- Size: 546 KB
- Stars: 0
- Watchers: 10
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://app.opslevel.com/services/opslevel_runner/maturity-report)
# opslevel-runner
OpsLevel Runner is the Kubernetes based job processor for [OpsLevel](https://www.opslevel.com/)
### Metrics
| Name | Type | Description |
|---------------------------------|-------------|---------------------------------------------------------------|
| opslevel_runner_jobs_duration | `histogram` | The duration of jobs in seconds. |
| opslevel_runner_jobs_finished | `counter` | The count of jobs that finished processing by outcome status. |
| opslevel_runner_jobs_processing | `gauge` | The current number of active jobs being processed. |
| opslevel_runner_jobs_started | `counter` | The count of jobs that started processing. |
### Commands
Testing a job
```sh
OPSLEVEL_API_TOKEN=XXXXX go run main.go test -f job.yaml
cat << EOF | OPSLEVEL_API_TOKEN=XXXXX go run main.go test -f -
id: "1"
image: alpine/curl
commands:
- export TEST=100
- echo "::set-outcome-var hello-world=42"
- sleep 2
- echo $TEST
- echo $Secret
- echo $NotSecret
- /opslevel/check.sh
variables:
- key: Secret
value: "World!"
sensitive: true
- key: NotSecret
value: "World!"
sensitive: false
files:
- name: check.sh
contents: |
#! /bin/bash
echo "Hello from inside the script!"
echo "Secrets are still ${Secret}"
sleep 2
EOF
```
Running
```sh
# Production
OPSLEVEL_API_TOKEN=XXXXX go run main.go run
# Staging
OPSLEVEL_API_TOKEN=XXXXX go run main.go run --api-url=https://api.opslevel-staging.com/graphql --app-url=https://app.opslevel-staging.com
```
## Running
Download the latest release from the [Releases](https://github.com/OpsLevel/opslevel-runner/releases/) page for your architecture.
Extract it to a directory of your choice, mark it as executable and move it to something on your path
```
chmod +x ./opslevel-runner
mv ./opslevel-runner /usr/local/bin/opslevel-runner
```
For OSX you'll probably need to remove the quarantine bit:
```
sudo xattr -r -d com.apple.quarantine /usr/local/bin/opslevel-runner
```
At this point you can run the OpsLevel Runner with OpsLevel by following the [instructions](https://gitlab.com/jklabsinc/OpsLevel/-/blob/master/CONTRIBUTING.md#OpsLevel-Runner) in that repository.
## Developing
To build, ensure you have go installed
```
brew install go
```
Then init and update the submodules (if you clone with `--recurse-submodules` you can skip this step)
```
git submodule init && git submodule update
```
Then run `go build` in `src` to build in the local directory, you can also use `-o ` to put the file in a target location of your choice.
```
cd src
go build
```