Skip to content
/ petri Public

A framework that abstracts multiple infra providers as one

Notifications You must be signed in to change notification settings

skip-mev/petri

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

petri (alpha) - an abstraction layer for infrastructure providers

how to use

go get github.com/skip-mev/petri

add to your code:

import (
  "github.com/skip-mev/petri/provider/docker"
  "github.com/skip-mev/petri/provider"

  "context"
)

ctx := context.Background()

dockerProvider, err := docker.CreateProvider() // more providers to be added later

if err != nil {
  panic(err)
}

task, err := provider.CreateTask(context.Background(), dockerProvider, provider.TaskDefinition{
  Image: provider.ImageDefinition {
    Name: "nginx:latest",
    UID:  "101",
    GID:  "101",
  },
  Name: "petri-test"
})

if err != nil {
  panic(err)
}

err := task.Start(ctx, false)

if err != nil {
  panic(err)
}