profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/the-maldridge/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Michael Aldridge the-maldridge Dallas, Texas http://www.michaelwashere.net Hostmaster of the Clan of Iron Bones

resinstack/resinstack 23

The HashiStack, but cast in resin for optimal immutability.

pikhq/musl-nscd 22

Musl-nscd is an implementation of the NSCD protocol, suitable for use with musl and with standard NSS modules

texasdiaz/FLLTS2013 4

FIRST LEGO League Tournament Software

SimpleGateway/sg-base 3

Complete Open BSD gateway managed with Ansible

resinstack/dtn 2

Deploy to Nomad, a simple way to keep bumping versions in Nomad from CI

resinstack/emissary 2

A fairly simplistic one-shot tool to write out secrets from secure storage.

lkolbly/blindnxt 1

Blind NXT

resinstack/spotwatch 1

Daemon that drains AWS Spot instances as they are warned for termination.

the-maldridge/bob 1

Bob is a build service based on docker containers and minimal shell scripts.

created tagresinstack/nomad

tagv1.2.0b1r0

A container with Nomad inside!

created time in 16 hours

delete tag resinstack/nomad

delete tag : v1.2.0b1r1

delete time in 16 hours

created tagresinstack/nomad

tagv1.2.0b1r1

A container with Nomad inside!

created time in 16 hours

delete tag resinstack/nomad

delete tag : 1.2.0b1r1

delete time in 16 hours

created tagresinstack/nomad

tag1.2.0b1r1

A container with Nomad inside!

created time in 17 hours

push eventresinstack/nomad

Michael Aldridge

commit sha de8375fba9f4093e8a3862e0c243bf1eb86ee25d

Build for 1.2.0-beta1 -- NOT FOR PRODUCTION USE

view details

push time in 17 hours

push eventthe-maldridge/nbuild

fosslinux

commit sha 05c60205ada05632f322834d5e27bca3eddeca9f

pkg/graph: add basic client API (to the graph HTTP API)

view details

fosslinux

commit sha 7b09104e152eadb72792e5c926526f9c29104914

pkg/scheduler: add a scheduler. Along with this add a example local CapacityProvider.

view details

fosslinux

commit sha d6332ec18b91e47f9a6a0037268f075fc4515c4b

pkg/source: change logging levels of a few messages. Closes: #6 [via git-merge-pr]

view details

push time in 21 hours

PR closed the-maldridge/nbuild

Scheduler
+418 -8

0 comment

11 changed files

fosslinux

pr closed time in 21 hours

push eventvoid-linux/void-packages

Michael Aldridge

commit sha fb1c4acedadd86588651c3717ce049c0ff656ec5

void-release-keys: Import 20210930 minisign key

view details

push time in a day

created tagresinstack/terraform-linuxkit-resinstack

tagv0.0.11

Terraform module for building a complete ResinStack image set.

created time in a day

push eventvoid-linux/void-linux.github.io

Érico Nogueira

commit sha 3bd707cd133f22c5f2e50bc97bbc147dd95ee5fd

download: fix text about graphical images. We don't make releases, these are purely snapshots of the current state.

view details

Érico Nogueira

commit sha 89da0ccb32f52d8162298444fc14099d508ea217

download: add links for checksum and signature files.

view details

push time in a day

Pull request review commentthe-maldridge/nbuild

Scheduler

+package scheduler++import (+	"errors"+	"os"+	"os/exec"+	"path/filepath"++	"github.com/hashicorp/go-hclog"++	"github.com/the-maldridge/nbuild/pkg/source"+)++func NewLocalCapacityProvider(l hclog.Logger, path string) *LocalCapacityProvider {+	absPath, err := filepath.Abs(path)+	if err != nil {+		absPath = path+	}+	x := LocalCapacityProvider{+		l:       l.Named("capacityProvider"),+		path:    absPath,+		ongoing: nil,+	}+	return &x+}++// Wrapper function for pkgCmd.Run()+func (c *LocalCapacityProvider) pkgRun(cmd *exec.Cmd) {+	output, err := cmd.CombinedOutput()+	c.ongoing = nil+	if err != nil {+		c.l.Warn("Error building pkg", "err", err)+	}+	c.l.Trace("Building package output", "output", string(output))+}++// Builds a package.+func (c *LocalCapacityProvider) DispatchBuild(b Build) error {+	if c.ongoing != nil {+		return errors.New("no capacity")

This should be a typed error. You can either create a new type which implements the Error interface or you can make this a package variable and return it from there. (hint: the package variable needs to be from the scheduler since all capacity providers may wish to signal they have insufficient capacity to complete the request.

fosslinux

comment created time in 2 days

Pull request review commentthe-maldridge/nbuild

Scheduler

+package scheduler++import (+	"sync"+	"time"++	"github.com/hashicorp/go-hclog"++	"github.com/the-maldridge/nbuild/pkg/graph"+	"github.com/the-maldridge/nbuild/pkg/types"+)++func NewScheduler(l hclog.Logger, c CapacityProvider, url string) *Scheduler {+	x := Scheduler{+		l:                l.Named("scheduler"),+		capacityProvider: c,+		apiClient:        graph.NewAPIClient(l),+		queue:            make([]Build, 0),+		queueMutex:       new(sync.Mutex),+		tuples:           make([]types.SpecTuple, 0),

ditto.

fosslinux

comment created time in 2 days

Pull request review commentthe-maldridge/nbuild

Scheduler

+package scheduler++import (+	"sync"++	"github.com/hashicorp/go-hclog"++	"github.com/the-maldridge/nbuild/pkg/graph"+	"github.com/the-maldridge/nbuild/pkg/types"+)++// A Build is all the information required for a build+type Build struct {+	Spec types.SpecTuple+	Pkg  string+	Rev  string+}++// CapacityProviders are a way for packages to be built.+type CapacityProvider interface {+	DispatchBuild(Build) error+	ListBuilds() ([]Build, error)+}++// Scheduler makes builds ready + dispatches them using a CapacityProvider.+type Scheduler struct {+	l hclog.Logger++	queue      []Build+	queueMutex *sync.Mutex+	tuples     []types.SpecTuple++	apiClient        *graph.APIClient+	capacityProvider CapacityProvider+}++// LocalCapacityProvider is a capacity provider that builds one build at a time locally.

This type, and the provider attached to it, should move to pkg/scheduler/local

fosslinux

comment created time in 2 days

Pull request review commentthe-maldridge/nbuild

Scheduler

+package scheduler++import (+	"sync"+	"time"++	"github.com/hashicorp/go-hclog"++	"github.com/the-maldridge/nbuild/pkg/graph"+	"github.com/the-maldridge/nbuild/pkg/types"+)++func NewScheduler(l hclog.Logger, c CapacityProvider, url string) *Scheduler {+	x := Scheduler{+		l:                l.Named("scheduler"),+		capacityProvider: c,+		apiClient:        graph.NewAPIClient(l),+		queue:            make([]Build, 0),+		queueMutex:       new(sync.Mutex),+		tuples:           make([]types.SpecTuple, 0),+	}+	x.apiClient.Url = url++	return &x+}++// Pops a build off the queue and hands it off to the CapacityProvider.+func (s *Scheduler) send() bool {

This function should probably return an Error rather than a bool, looking at how you are logging messages based on error return status.

fosslinux

comment created time in 2 days

Pull request review commentthe-maldridge/nbuild

Scheduler

+package scheduler++import (+	"sync"++	"github.com/hashicorp/go-hclog"++	"github.com/the-maldridge/nbuild/pkg/graph"+	"github.com/the-maldridge/nbuild/pkg/types"+)++// A Build is all the information required for a build+type Build struct {+	Spec types.SpecTuple+	Pkg  string+	Rev  string+}++// CapacityProviders are a way for packages to be built.+type CapacityProvider interface {

Consider dropping Build from the signatures here. Its known that all of these deal with Builds based on the type.

fosslinux

comment created time in 2 days

Pull request review commentthe-maldridge/nbuild

Scheduler

+package scheduler++import (+	"sync"+	"time"++	"github.com/hashicorp/go-hclog"++	"github.com/the-maldridge/nbuild/pkg/graph"+	"github.com/the-maldridge/nbuild/pkg/types"+)++func NewScheduler(l hclog.Logger, c CapacityProvider, url string) *Scheduler {+	x := Scheduler{+		l:                l.Named("scheduler"),+		capacityProvider: c,+		apiClient:        graph.NewAPIClient(l),+		queue:            make([]Build, 0),

If you're explicitly creating this with no capacity, there's no need for this make() you can just omit it from the instatiation of this variable.

fosslinux

comment created time in 2 days

Pull request review commentthe-maldridge/nbuild

Scheduler

+package scheduler++import (+	"net/http"++	"github.com/go-chi/chi/v5"+)++// HTTPEntry provides the mountpoint for this service into the shared+// webserver routing tree.+func (s *Scheduler) HTTPEntry() chi.Router {+	r := chi.NewRouter()++	r.Get("/done", s.httpDone)+	return r+}++func (s *Scheduler) httpDone(w http.ResponseWriter, r *http.Request) {+	ok := s.Reconstruct()+	if !ok {+		w.WriteHeader(http.StatusInternalServerError)+		return+	}++	w.WriteHeader(http.StatusOK)

Since you're returning no bytes in the body, the appropriate message here would be http.StatusNoContent for HTTP 204.

fosslinux

comment created time in 2 days

Pull request review commentthe-maldridge/nbuild

Scheduler

+package scheduler++import (+	"sync"+	"time"++	"github.com/hashicorp/go-hclog"++	"github.com/the-maldridge/nbuild/pkg/graph"+	"github.com/the-maldridge/nbuild/pkg/types"+)++func NewScheduler(l hclog.Logger, c CapacityProvider, url string) *Scheduler {+	x := Scheduler{+		l:                l.Named("scheduler"),+		capacityProvider: c,+		apiClient:        graph.NewAPIClient(l),+		queue:            make([]Build, 0),+		queueMutex:       new(sync.Mutex),+		tuples:           make([]types.SpecTuple, 0),+	}+	x.apiClient.Url = url++	return &x+}++// Pops a build off the queue and hands it off to the CapacityProvider.+func (s *Scheduler) send() bool {+	s.queueMutex.Lock()+	defer s.queueMutex.Unlock()++	if len(s.queue) == 0 {+		return false+	}+	err := s.capacityProvider.DispatchBuild(s.queue[0])+	if err != nil {+		s.l.Trace("Unable to dispatch right now", "build", s.queue[0], "err", err)+		return false+	}+	s.l.Trace("Dispatching", "build", s.queue[0])+	s.queue = s.queue[1:]+	return true+}++// Reconstructs the queue from dispatchable.+func (s *Scheduler) Reconstruct() bool {+	dispatchable, ok := s.apiClient.GetDispatchable()+	if !ok {+		return false+	}++	s.queueMutex.Lock()+	defer s.queueMutex.Unlock()+	s.queue = make([]Build, 0)++	current, err := s.capacityProvider.ListBuilds()+	if err != nil {+		return false+	}+convert:+	for tuple, pkgs := range dispatchable.Pkgs {+		for _, pkg := range pkgs {+			b := Build{+				Spec: tuple,+				Pkg:  pkg,+				Rev:  dispatchable.Rev,+			}+			for _, curBuild := range current {+				if b.Equal(&curBuild) {+					break convert

This is a code smell, lets try to find a way to refactor this so that it doesn't require the double level break.

fosslinux

comment created time in 2 days

Pull request review commentthe-maldridge/nbuild

Scheduler

+package graph++import (+	"bytes"+	"encoding/json"+	"io/ioutil"+	"net/http"+	"strings"+	"time"++	"github.com/hashicorp/go-hclog"++	"github.com/the-maldridge/nbuild/pkg/types"+)++// NewAPIClient creates a new API client.+func NewAPIClient(l hclog.Logger) *APIClient {+	x := APIClient{+		l: l.Named("client"),

This client needs to have its own http.Client which has a timeout set. Otherwise its possible for this to just hang forever.

fosslinux

comment created time in 2 days

Pull request review commentthe-maldridge/nbuild

Scheduler

+package scheduler++import (+	"sync"+	"time"++	"github.com/hashicorp/go-hclog"++	"github.com/the-maldridge/nbuild/pkg/graph"+	"github.com/the-maldridge/nbuild/pkg/types"+)++func NewScheduler(l hclog.Logger, c CapacityProvider, url string) *Scheduler {+	x := Scheduler{+		l:                l.Named("scheduler"),+		capacityProvider: c,+		apiClient:        graph.NewAPIClient(l),+		queue:            make([]Build, 0),+		queueMutex:       new(sync.Mutex),+		tuples:           make([]types.SpecTuple, 0),+	}+	x.apiClient.Url = url++	return &x+}++// Pops a build off the queue and hands it off to the CapacityProvider.+func (s *Scheduler) send() bool {+	s.queueMutex.Lock()+	defer s.queueMutex.Unlock()++	if len(s.queue) == 0 {+		return false+	}+	err := s.capacityProvider.DispatchBuild(s.queue[0])

This line and the below if statement should be combined if err := s.capacityProvider.DispatchBuild(...); err != nil {

fosslinux

comment created time in 2 days

Pull request review commentthe-maldridge/nbuild

Scheduler

 func main() { 	mgr.Bootstrap() 	mgr.SetIndexURLs(cfg.RepoDataURLs) +	capacityProvider := scheduler.NewLocalCapacityProvider(appLogger, "build-packages")

Hmm. This can stay for now, but we should really come up with a better way to configure the scheduler.

fosslinux

comment created time in 2 days

Pull request review commentthe-maldridge/nbuild

Scheduler

+package scheduler++import (+	"errors"+	"os"+	"os/exec"+	"path/filepath"++	"github.com/hashicorp/go-hclog"++	"github.com/the-maldridge/nbuild/pkg/source"+)++func NewLocalCapacityProvider(l hclog.Logger, path string) *LocalCapacityProvider {+	absPath, err := filepath.Abs(path)+	if err != nil {+		absPath = path+	}+	x := LocalCapacityProvider{+		l:       l.Named("capacityProvider"),+		path:    absPath,+		ongoing: nil,+	}+	return &x+}++// Wrapper function for pkgCmd.Run()+func (c *LocalCapacityProvider) pkgRun(cmd *exec.Cmd) {+	output, err := cmd.CombinedOutput()+	c.ongoing = nil+	if err != nil {+		c.l.Warn("Error building pkg", "err", err)+	}+	c.l.Trace("Building package output", "output", string(output))+}++// Builds a package.+func (c *LocalCapacityProvider) DispatchBuild(b Build) error {+	if c.ongoing != nil {+		return errors.New("no capacity")+	}+	c.ongoing = &b++	// Git checkout+	repo := source.New(c.l)+	repo.SetBasepath(c.path)+	err := repo.Bootstrap()+	if err != nil {+		return err+	}+	_, err = repo.Checkout(b.Rev)+	if err != nil {+		return err+	}++	os.Chdir(c.path)+	c.l.Info("Binary-bootstrapping", "path", c.path, "spec", b.Spec)+	bootstrapCmd := exec.Command("./xbps-src", "binary-bootstrap", b.Spec.Host)+	bootstrapCmd.Dir = c.path+	err = bootstrapCmd.Run()+	if err != nil {+		c.l.Warn("Error running binary-bootstrap", "err", err)+		return err+	}++	c.l.Debug("Building package", "build", b, "path", c.path)+	args := []string{"pkg", b.Pkg}+	if !b.Spec.Native() {+		args = append(args, "-a", b.Spec.Target)+	}+	pkgCmd := exec.Command("./xbps-src", args...)+	pkgCmd.Dir = c.path+	go c.pkgRun(pkgCmd)+	os.Chdir("..")++	return nil+}++// Lists the ongoing build, if there is one.+func (c *LocalCapacityProvider) ListBuilds() ([]Build, error) {+	if c.ongoing == nil {+		return make([]Build, 0), nil

You can just return nil here to avoid this allocation.

fosslinux

comment created time in 2 days

PullRequestReviewEvent
PullRequestReviewEvent

push eventthe-maldridge/nbuild

Michael Aldridge

commit sha 83be0e21101b526c967ec9b6fa45efa36b885f98

policy: Remove obsolete policy directory

view details

Michael Aldridge

commit sha 1567d7e2db086fe4add9e94c5d1f1b80f8cbb64f

nomad: Rename jobs to nomad

view details

Michael Aldridge

commit sha fb2ac3e36500ec9f4ab9a1e1612faccec4d51839

nomad: Clean up xbps-src job

view details

push time in 2 days

push eventvoid-linux/void-linux.github.io

Abigail G

commit sha ba0543f3644d474eca1487d70cf047be9d44bb5c

add opengraph meta tags for rich url embeds on social sites

view details

push time in 2 days

PR merged void-linux/void-linux.github.io

add opengraph meta tags for rich url embeds on social sites

opengraph is a standard for social websites (and other services) to display more info about a url's destination, based on a set of <meta> tags. In this PR, I implemented opengraph for voidlinux.org.

Here's how they currently render in discord: image

I'm open to suggestions for the exact content of the embed; most of the pages are currently fairly simplistic, except for news posts, which have an excerpt of the post.

+22 -1

1 comment

2 changed files

classabbyamp

pr closed time in 2 days

push eventvoid-linux/void-linux.github.io

Andrew J. Hesford

commit sha 465940c0ee4076f99904ade0dce3795bba946b03

acknowledgments: note emeritus status for pullmoll Closes: #150 [via git-merge-pr]

view details

push time in 2 days