Skip to content

OpsLevel Runner is the Kubernetes based job processor for OpsLevel

License

Notifications You must be signed in to change notification settings

OpsLevel/opslevel-runner

Repository files navigation

License Go Report Card Release Stability: Experimental Contributors Activity Downloads

Overall

opslevel-runner

OpsLevel Runner is the Kubernetes based job processor for OpsLevel

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

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

# 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 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 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 <PATH> to put the file in a target location of your choice.

cd src
go build

About

OpsLevel Runner is the Kubernetes based job processor for OpsLevel

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages