tutorial

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2025 License: BSD-2-Clause, Unlicense Imports: 17 Imported by: 0

README

Tutorial Instructions

NOTE: These are rough for now and not yet ready for others. No harm in giving it a shot, I just may not be able to support.

Requirements

  • Docker Desktop (or Docker engine)
  • Go (go.dev/dl)
  • core tool (make install in repo root directory)
  • Conda, Micromamba or similar with installed and active

While agent visibility is coming online, tools like Docker Desktop, btop and htop can be invaluable in checking for whether or not the core operations are busy.

Fetch or build the latest container image

make image
docker pull hoffmanxlab/core:latest

Run the tutorial container

mkdir container-out
docker run -it --rm  -p 8080-8082:8080-8082 -v ./container-out:/tmp/ hoffmanxlab/core core tutorial --skip-intro

Dispatch a lungmask agent into the container

cd cmd/client-apis/python/agents
core control createagent --context lungmask/ --entrypoint "micromamba install -n base -f env.yaml && python lungmask_agent.py" --addr localhost:8080

Upload a dicom series

You will need to provide your own lung CT series

cd cmd/client-apis/python/agents/uploader/
python upload_agent.py ~/data/series-000001 dicom-series,lung

Documentation

Overview

Copyright © 2024 NAME HERE <EMAIL ADDRESS>

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadScript

func LoadScript(filename string) string

func NewTextAnimator

func NewTextAnimator(input io.Reader, output io.Writer) *textAnimator

Types

type TutorialAgent

type TutorialAgent struct {
	*TutorialState
	client.CoreAgent
	*sync.WaitGroup
	// contains filtered or unexported fields
}

func NewTutorialAgent

func NewTutorialAgent(bb_addr string) *TutorialAgent

func (*TutorialAgent) BlackboardHandler

func (wa *TutorialAgent) BlackboardHandler(w http.ResponseWriter, r *http.Request)

func (*TutorialAgent) IndexHandler

func (wa *TutorialAgent) IndexHandler(w http.ResponseWriter, r *http.Request)

func (*TutorialAgent) JSHandler

func (wa *TutorialAgent) JSHandler(w http.ResponseWriter, r *http.Request)

func (*TutorialAgent) ListenAndServe

func (wa *TutorialAgent) ListenAndServe(addr string) error

func (*TutorialAgent) Log

func (wa *TutorialAgent) Log(sev core.Log_Severity, msg string) error

func (*TutorialAgent) LoggingMiddleware

func (wa *TutorialAgent) LoggingMiddleware(next http.Handler) http.HandlerFunc

This page functions more like a web app using JS to interact with the new blackboard that is created when visiting this page.

Thought: agent design should almost always be "fire and forget". Transactional agents are ineffective and slow. Streaming agents utilize the system to the fullest effect. Get the middle-agent out of the way.

The web interface

func (*TutorialAgent) Loop

func (wa *TutorialAgent) Loop(ctx context.Context) (bool, error)

func (*TutorialAgent) Setup

func (wa *TutorialAgent) Setup() error

Fulfill the managed interface Always serve the tutorial on localhost? Blackboard does not necessarily have to be on localhost

type TutorialState

type TutorialState struct {
	States       []WebState
	CurrentState int
}

func NewTutorialState

func NewTutorialState() *TutorialState

func (*TutorialState) DoItForMe

func (t *TutorialState) DoItForMe() error

func (*TutorialState) MarshalJSON

func (t *TutorialState) MarshalJSON() ([]byte, error)

func (*TutorialState) Next

func (t *TutorialState) Next() error

func (*TutorialState) Prev

func (t *TutorialState) Prev() error

type WebState

type WebState struct {
	DoItForMe      func() error `json:"-"`
	TextBlock      string
	AllowNext      bool
	AllowPrev      bool
	AllowDoItForMe bool
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳