matttproud
Repos
95
Followers
357
Following
3

Events

issue comment
^c kill, but doesn't exit?

On the road at the moment. Won’t have time to look for a few days.

Created at 2 days ago
issue comment
^c kill, but doesn't exit?

I wonder if we need to more closely look at root context cancellation. Just a guess.

Created at 2 days ago
issue comment
Orient Documentation toward Simpler Example

Why not? It's the tenth birthday: https://promlabs.com/blog/2022/11/24/prometheus-turns-10!

Message ID: @.***>

Created at 4 days ago
opened issue
Orient Documentation toward Simpler Example

The README for the project orients itself around a hypothetical Grafana setup. For the purposes of easy setup, demonstration, and even testing, I would like to propose amending the README toward a different example, something that can be installed from the base package repository for a given Linux distribution (e.g., Debian). Grafana's setup on Debian requires adding a separate repository and keychain entry, which is a little annoying. I am at a loss of an immediate suggestion and want to see what you think, @miekg.

Created at 4 days ago

main: gracefully drain SSH, tests, and refactoring.

This commit extracts HTTP and SSH interface setup and running from the runner routine, because the code becomes unwieldy when graceful draining is bolted on. Meanwhile tests are added for the HTTP interface.

Created at 4 days ago

services: refactor slightly (#33)

pull out the check if the service is for this host and target, should save a few lines.

Signed-off-by: Miek Gieben miek@science.ru.nl

Signed-off-by: Miek Gieben miek@science.ru.nl Co-authored-by: Miek Gieben miek@science.ru.nl

main: gracefully cease HTTP serving on shutdown. (#34)

When the controller context is cancelled and the worker goroutines have ceased serving, the HTTP serving interface should attempt a graceful shutdown, but not before. This pattern sets the stage for probable application of the same to the SSH interface.

There are a few potential avenues for additional cleanups around monitoring interface setup and context plumbing that should be explored independently. I wanted to keep the code delta as small as possible in case I made any mistakes.

main: gracefully drain SSH, tests, and refactoring.

This commit extracts HTTP and SSH interface setup and running from the runner routine, because the code becomes unwieldly when graceful draining is bolted on. Meanwhile tests are added for the HTTP interface.

Created at 4 days ago
pull request opened
refactor/graceful http shutdown
  • main: gracefully cease HTTP serving on shutdown.
  • main: gracefully drain SSH, tests, and refactoring.
Created at 4 days ago

main: gracefully drain SSH, tests, and refactoring.

This commit extracts HTTP and SSH interface setup and running from the runner routine, because the code becomes unwieldly when graceful draining is bolted on. Meanwhile tests are added for the HTTP interface.

Created at 4 days ago
pull request opened
main: gracefully cease HTTP serving on shutdown.

When the controller context is cancelled and the worker goroutines have ceased serving, the HTTP serving interface should attempt a graceful shutdown, but not before. This pattern sets the stage for probable application of the same to the SSH interface.

There are a few potential avenues for additional cleanups around monitoring interface setup and context plumbing that should be explored independently. I wanted to keep the code delta as small as possible in case I made any mistakes.

Created at 5 days ago
pull request closed
main: gracefully cease HTTP serving on shutdown.

When the controller context is cancelled and the worker goroutines have ceased serving, the HTTP serving interface should attempt a graceful shutdown, but not before. This pattern sets the stage for probable application of the same to the SSH interface.

There are a few potential avenues for additional cleanups around monitoring interface setup and context plumbing that should be explored independently. I wanted to keep the code delta as small as possible in case I made any mistakes.

Created at 5 days ago
pull request opened
main: gracefully cease HTTP serving on shutdown.

When the controller context is cancelled and the worker goroutines have ceased serving, the HTTP serving interface should attempt a graceful shutdown, but not before. This pattern sets the stage for probable application of the same to the SSH interface.

There are a few potential avenues for additional cleanups around monitoring interface setup and context plumbing that should be explored independently. I wanted to keep the code delta as small as possible in case I made any mistakes.

Created at 5 days ago
pull request closed
main: gracefully cease HTTP serving on shutdown.
  • Various cleanups
  • Detect config file changes
  • Factor hostname stuff into osutil - as used multiple times (#12)
  • Add bootstrapping (#13)
  • polish docs a bit (#14)
  • ospkg: add tooling to install package (#15)
  • Implement auth by moving the remote interface to SSH (#17)
  • Add -P flag to force newest repo when bootstrapping (#18)
  • main: refactor entrypoint to support testing. (#21)
  • server: chown entire path (#22)
  • add test (#23)
  • server: redo metrics (#24)
  • fix docs too (#25)
  • Add -m flag to expose the json directly (#27)
  • main, config: Make adding keys easier (#28)
  • Add SetBoot (#30)
  • updates (#31)
  • readme: Small updates/polish (#32)
  • main: gracefully cease HTTP serving on shutdown.
Created at 5 days ago
create branch
matttproud create branch refactor/graceful-http-shutdown
Created at 5 days ago
pull request opened
main: gracefully cease HTTP serving on shutdown.
  • Various cleanups
  • Detect config file changes
  • Factor hostname stuff into osutil - as used multiple times (#12)
  • Add bootstrapping (#13)
  • polish docs a bit (#14)
  • ospkg: add tooling to install package (#15)
  • Implement auth by moving the remote interface to SSH (#17)
  • Add -P flag to force newest repo when bootstrapping (#18)
  • main: refactor entrypoint to support testing. (#21)
  • server: chown entire path (#22)
  • add test (#23)
  • server: redo metrics (#24)
  • fix docs too (#25)
  • Add -m flag to expose the json directly (#27)
  • main, config: Make adding keys easier (#28)
  • Add SetBoot (#30)
  • updates (#31)
  • readme: Small updates/polish (#32)
  • main: gracefully cease HTTP serving on shutdown.
Created at 5 days ago
issue comment
running tests as root fails

That is a good question:

How many things require root: systemd interactions and bind mounting and privilege setting with subcommands?

Do you think it would be easy to ensure that the context in which they run with the actions workflow can be made to execute as root? I was thinking about creating interfaces and test doubles for the things I mentioned (as a part of ExecContext) that could be used for local automated testing.

Message ID: @.***>

Created at 6 days ago
pull request opened
main: refactor entrypoint to support testing.

In order to test on my local machine, I need to swap out some of the binary's dependencies with test doubles. I've started by making the basic inputs into the binary the flags something contained in a struct whose values can be dereferenced and explicitly passed.

Created at 6 days ago
create branch
matttproud create branch refactor/testing
Created at 6 days ago

main: populate hosts flag from using OS first.

When prototyping the tool in my local sandbox, I discovered that a minimal Debian host did not default to having a HOSTNAME environment set by default, so I decided to rejigger the logic to query the operating system first and then fall back to the environment variable if needed.

Created at 1 week ago
pull request opened
main: populate hosts flag from using OS first.

When prototyping the tool in my local sandbox, I discovered that a minimal Debian host did not default to having a HOSTNAME environment set by default, so I decided to rejigger the logic to query the operating system first and then fall back to the environment variable if needed.

Created at 1 week ago

Merge pull request #1 from matttproud/main

main: make context-controlled and interruptible.

Fix specific branch pulling

Signed-off-by: Miek Gieben miek@miek.nl

Merge pull request #2 from miekg/fix-main-branch

Fix specific branch pulling

Test git checkout

Add setup_test.go that has a git checkout test to see if that is working. Put parseConfig in config.go so we can also test it easier later.

Signed-off-by: Miek Gieben miek@miek.nl

Merge pull request #3 from miekg/gittest

Test git checkout

Add actual member to machine output

As machine can have multiple names (-h flag) it's probably handy to see the real machine name in the output when queried by gitopperctl.

Some tweaks to the README.

Signed-off-by: Miek Gieben miek@miek.nl

Merge pull request #4 from miekg/machine-output

Add actual member to machine output

tagline

Signed-off-by: Miek Gieben miek@miek.nl

Fix various TODO items

  • Add config tests, and enable strict toml parsing
  • Start webserver first and then checkout all repos
  • On SIGHUP exit with status code 2

Signed-off-by: Miek Gieben miek@miek.nl

Merge pull request #5 from miekg/restart-on-change

restart on change

typos

Signed-off-by: Miek Gieben miek@miek.nl

Merge pull request #6 from miekg/bla2

typos

Restart services when new bind mounts are made

Check number of bindmounts done and restart service when > 0. Also clear logging when running tests, so go test -v looks clean.

Signed-off-by: Miek Gieben miek@miek.nl

Merge pull request #7 from miekg/restart-on-bindmount

Restart services when new bind mounts are made

main: populate hosts flag from using OS first.

When prototyping the tool in my local sandbox, I discovered that a minimal Debian host did not default to having a HOSTNAME environment set by default, so I decided to rejigger the logic to query the operating system first and then fall back to the environment variable if needed.

Created at 1 week ago

main: make context-controlled and interruptible.

This commit adapts the main entrypoint and control loops it starts to be context interruptible due to an open TODO. There is more that can be done.

Created at 1 week ago
pull request opened
main: make context-controlled and interruptible.

This commit adapts the main entrypoint and control loops it starts to be context interruptible due to an open TODO. There is more that can be done.

Created at 1 week ago

main: make context-controlled and interruptible.

This commit adapts the main entrypoint and control loops it starts to be context interruptible due to an open TODO. There is more that can be done.

Created at 1 week ago
Created at 1 week ago
matttproud create tag v2.0.0
Created at 1 month ago

pbutil: publish major version 2 of this module.

This commit provides a touch-up of v1.0.3. Since it introduces a new major version, several steps to upgrade will need to be followed as described in the CHANGELOG.md file. Users of major version 1 can continue using that version until they are ready to transition.

Created at 1 month ago
Breaking change

After the release of v1.0.3 this library is no longer backwards compatible with the old proto.Message interface

V1 Message Interface

type MessageV1 interface {
	Reset()
	String() [string](https://pkg.go.dev/builtin#string)
	ProtoMessage()
}

After the import of new protobuf package from google.golang.org/protobuf/proto proto.Message is https://pkg.go.dev/google.golang.org/protobuf@v1.28.1/reflect/protoreflect#ProtoMessage

type ProtoMessage interface{ 
   ProtoReflect() Message 
}

This currently breaks https://github.com/prometheus/common/blob/main/expfmt/decode.go

go/pkg/mod/github.com/prometheus/common@v0.37.0/expfmt/decode.go:89:38: cannot use v (variable of type *io_prometheus_client.MetricFamily) as type protoreflect.ProtoMessage in argument to pbutil.ReadDelimited:
        *io_prometheus_client.MetricFamily does not implement protoreflect.ProtoMessage (missing ProtoReflect method)

go/pkg/mod/github.com/prometheus/common@v0.37.0/expfmt/encode.go:120:40: cannot use v (variable of type *io_prometheus_client.MetricFamily) as type protoreflect.ProtoMessage in argument to pbutil.WriteDelimited:
        *io_prometheus_client.MetricFamily does not implement protoreflect.ProtoMessage (missing ProtoReflect method)

Could you please remove this release and tag it with v2.0.0 or something?

Created at 1 month ago
Breaking change

Thanks for bearing with me on this. I apologize for any inconvenience this caused. I was on the other side of Alps from my computer by the time the first defect report arose, which was why I couldn't immediately rectify this.

I have pushed a new tag v1.0.4, which is pinned to the v1.0.2 code. For now, the behavior of v1.0.4 and similar now lives in a legacy v1 branch. I expect that branch to go dormant long-term with a subsequent update that provides deprecation notices on the old APIs advising users to migrate to a new major version 2.

Going forward, the master branch will take the code of v1.0.3 and track what is today's current Protocol Buffer implementation and generated code API. This will become major version 2. Users should adapt to this where possible, though there is no need to worry that v1 will go away. Migrating to version 2 will require updating both the version of the Protocol Buffer library you use as well as any generated Protocol Buffer message file assets. For small and medium projects, this should be a simple affair. I will cut a version 2 release soon hereafter.

My instinct told me before cutting v1.0.3 I should have made a new major version instead, but I was not 100% certain due to these reasons. And then there is some extra ceremony involved with creating new module major versions.

Created at 1 month ago
matttproud create tag v1.0.4
Created at 1 month ago